
我有這些行
\documentclass[../main.tex]{subfiles}
\usepackage{float}
\usepackage[font=small,skip=2pt]{caption}
\usepackage{graphicx}
\graphicspath{{Images}{../Images/}}
\input{commands} % global vars and fucntions
\begin{document}
…
當我嘗試使用 MiKTeX Windows 10 用 texmaker 編譯它時,我收到錯誤,第 3、4 和 5 行(帶有 \usepackage 的行)應該位於序言中。不是嗎?這些是專案中唯一的錯誤,我的commands.tex 被很好地識別。
答案1
如果您希望您的檔案能夠編譯,只需從子檔案中刪除前導碼並將其僅放入 main.tex 中(先前導碼將由 main 的所有子檔案共用)。
如果您想解釋為什麼錯誤訊息具有誤導性,我無能為力。