xelatex 选项 -output-directory 与 include 命令有关的问题

xelatex 选项 -output-directory 与 include 命令有关的问题

我的设置是 texlive2019 + texstudio,编译器是 xelatex,我在与主 tex 相同的根文件夹中为辅助文件设置了“临时”文件夹,使用此命令

xelatex.exe -output-directory=temp -synctex=1 -interaction=nonstopmode %.tex

将代码编译为 pdf。使用以下 MWE,

\documentclass{book}
\usepackage[nochapter]{vhistory}


\title{ \normalsize \textsc{}
    \\ [2.0cm]
    \HRule{0.5pt} \\
    \LARGE {\uppercase{\bfseries{xx}}
        \HRule{2pt} \\ [0.5cm] \vspace*{2\baselineskip}
        \normalsize  \vspace*{3\baselineskip}}
}

    %\date{}

\author{xx \\ 
    xx }
\date{\today}

\begin{document}
\pdfbookmark[0]{Cover}{title}           % command in hyperref
\maketitle
%\pdfbookmark[0]{Contents}{toc}        % comment this line for have minitoc in each chapter
\dominitoc                              % Pre-do the minitoc
\dominilof                              % Pre-do the minilof
\dominilot                              % Pre-do the minilot
\faketableofcontents                      % hide main toc
\cleardoublepage
%\pdfbookmark[0]{Figure}{lof}          % comment this line for have minitoc in each chapter
\fakelistoffigures                        % hide main lof
\cleardoublepage
%\pdfbookmark[0]{Table}{lot}           % comment this line for have minitoc in each chapter
\fakelistoftables                        % hide main lot
\cleardoublepage
\pdfbookmark[0]{Revision}{Revision}           % command in hyperref
\begin{versionhistory}
    \vhEntry{0.1}{20190529}{xx}{Draft}
\end{versionhistory}


\input{main/ch1/ch1}

\end{document}

如果使用

\input{main/ch1/ch1}

然后构建就通过了,但如果我改为

\include{main/ch1/ch1}

会出现错误

! I can't write on file `main/ch1/ch1.aux'.

我该如何修复这个问题?意思是让 xelatex 找到正确的辅助文件?谢谢。

相关内容