預處理 LaTeX 文件,相當於 Latex -E

預處理 LaTeX 文件,相當於 Latex -E

可能的重複:
自動將 \input{fileX} 替換為 fileX 的內容

我正在開發一個用於管理 LaTeX 專案依賴項的框架,但我不知道是否有簡單的方法來獲取預處理的 LaTeX 檔案。

例如,如果我的main.tex看起來像:

\documentclass{article}
...
\newcommand{\specialpath}[0]{../foo/}
\input{\specialpath extracommands}
...
\begin{document}
    \input{introduction}
    ...
\end{document}

我希望有:

\documentclass{article}
...
% Content of ../foo/extracommands.tex
\usepackage{minted}
\newcommand{\whatever}
% end
...
\begin{document}
    % Content of introduction.tex
    \section{Introduction}
    \lipsum[1-4] % Or even the developpement of the command
    % end
    ...
\end{document}

換句話說,是否有與 LaTeXgcc標誌等效的東西-E(或能夠做到這一點的實用程式)?

答案1

我想你想用\列表文件

相關內容