파일 이름에 인수를 전달하여 .tex 파일을 빠르게 전환하는 방법은 무엇입니까?

파일 이름에 인수를 전달하여 .tex 파일을 빠르게 전환하는 방법은 무엇입니까?

예를 들어

비슷한 파일 이름 구조를 가진 두 개의 TeX 프로젝트가 있습니다.

여기에 이미지 설명을 입력하세요

master.tex는 다음과 같은 구조를 가지고 있습니다:

\input{preamble.tex} % <- \bibliography{Projekt_A_Literature} in preamble

% ...

\begin{document}

% ...

    \include{chapter/Projekt_A_cp1.tex}
    \include{chapter/Projket_A_cp2.tex}
    \include{chapter/Projekt_A_cp3.tex}

% ...

\end{document}

목적은 입력할 챕터의 파일 그룹을 쉽고 빠르게 변경할 수 있다는 것입니다.

\include{chpater/Project_A_cp1.tex}        \include{chpater/Project_B_cp1.tex}
\include{chpater/Project_A_cp2.tex}  ==>   \include{chpater/Project_B_cp2.tex} 
\include{chapter/Project_A_cp3.tex}        \include{chpater/Project_B_cp3.tex}

간단하지만 우아하지 않은 접근 방식은 다음과 같습니다.

\newcommand{\prjindex}{A} $ or \def\prjindex{A}
%...
\begin{document}
  \include{chpater/Project_\prjindex_cp1.tex}
  \include{chpater/Project_\prjindex_cp2.tex}
  \include{chpater/Project_\prjindex_cp3.tex}    
\end{document}

이 솔루션의 문제는 마스터 TeX 파일이 아닌 컴파일을 하면 다음과 같은 오류가 발생한다는 것입니다.

정의되지 않은 제어 시퀀스 ....{Project_\prjindex_Literature.tex}.

그래서 저는 좀 더 우아한 해결책을 찾기 위해 여기에 왔습니다.

답변1

"직접" \prjindex정의가 제공되지 않는 상황에서 자동 감지를 위한 "메커니즘"이 필요한 것 같습니다 .\prjindex


사전 설명:

대개기본 요소의 확장은 \jobname컴파일을 시작하는 데 사용된 해당 파일의 이름(확장자 없음)을 형성합니다.

testfile.tex예를 들어, 메인 파일이 명령줄을 통해 있는 프로젝트를 컴파일하는 경우
latex testfile.tex
기본 요소는 \jobname구문으로 확장됩니다 testfile.
에 의해 전달된 문구의 문자 토큰은 \jobname항상 범주 코드 12(기타)이고 공백은 항상 범주 코드 10(공백)입니다.

testfile확장에서 나오는 문구는 \jobname다음과 같은 용도로 사용됩니다.

  • .log 파일 생성: .log 파일의 이름은 testfile.log.
  • 기본 .aux 파일 생성: 이름이 testfile.aux.
  • 목차에 대한 데이터를 보유하는 .toc 파일 생성: 이름이 testfile.toc.
  • 그림 목록에 대한 데이터를 보유하는 .lof 파일 생성: 이름이 testfile.lof.
  • 테이블 목록에 대한 데이터를 보유하는 .lot 파일 생성: 이름이 testfile.lot.
  • 등.

그러나 요즘 대부분의 TeX 배포판에서는 (La)TeX를 사용할 수 있습니다.평소의 일 처리 방식에서 벗어나다:

요즘 대부분의 TeX 배포판에서는 명령줄에서 전달할 ‑‑jobname문구를 변경할 수 있는 명령줄 옵션(-옵션) 을 제공할 수 있습니다.\jobname

testfile.tex예를 들어, 메인 파일이 명령줄을 통해 있는 프로젝트를 컴파일하는 경우
latex --jobname=foobar testfile.tex
기본 요소는 \jobname구문으로 확장됩니다 foobar.

foobar이 경우 확장에서 나오는 문구가 \jobname사용됩니다.

  • .log 파일 생성: .log 파일의 이름은 foobar.log.
  • 기본 .aux 파일 생성: 이름이 foobar.aux.
  • 목차에 대한 데이터를 보유하는 .toc 파일 생성: 이름이 foobar.toc.
  • 그림 목록에 대한 데이터를 보유하는 .lof 파일 생성: 이름이 foobar.lof.
  • 테이블 목록에 대한 데이터를 보유하는 .lot 파일 생성: 이름이 foobar.lot.
  • 등.

아래 제안에 따르면 LaTeX가 작업을 처리해야 합니다.에서평소대로, 즉, 항목이 컴파일되어야 합니다.없이일부 제공‑‑jobname-옵션.

따라서 아래 제안은 -옵션을 사용하도록 내부적으로 구성된 (온라인) LaTeX 플랫폼/TeX 편집기/사용자 인터페이스를 사용하는 사람들에게는 적합하지 않습니다 ‑‑jobname.


경우에

  1. 컴파일하는 동안 정의가 \prjindex"자동 감지"되는 모든 파일의 이름("손으로" 정의되지 않으므로)은 패턴을 따릅니다 . 둘 다 프로젝트를 나타내고 비어 있지 않고 밑줄( )을 포함하지 않습니다.Projekt_⟨#1⟩_⟨#2⟩.tex⟨#1⟩_
, 그리고

  1. 컴파일하는 동안 정의가 \prjindex항상 "자동 감지"되는 "독립 실행형 컴파일" 파일에 대해 라텍스를 호출합니다.없이-옵션 호출 ‑‑jobname(이것은 -primitive의 확장이 \jobname컴파일을 시작하는 데 사용된 해당 파일의 이름(확장자 없음)을 형성함을 의미함)
\GetPrjindexFromJobnameIfUndefined, 다음과 같이 작동하는 매크로를 제공할 수 있습니다 .

매크로가 \prjindex이미 정의된 경우에는 아무 작업도 수행되지 않습니다.

매크로가 정의되지 않은 경우 -primitive \prjindex의 확장이 \jobname패턴인지 확인합니다 . 해당 패턴이 아닌 경우 오류 메시지가 표시됩니다. 해당 패턴이면 비어 있는지 여부를 검사합니다 . 이 경우 오류 메시지가 트리거됩니다. 그렇지 않은 경우 매크로는 로 확장되도록 정의됩니다 .Projekt_⟨#1⟩_⟨#2⟩⟨#1⟩\prjindex⟨#1⟩

단일 파일을 "독립형" 으로 컴파일할 수 있도록 하는 프로젝트의 파일 구조 부분이 어떻게 구성되어 있는지 너무 자세히 공개하지 않았기 때문에 해당 루틴이 당신에게 유용한지 여부를 결정할 수 없습니다. 또는 를 통해 마스터 tex 파일에서 호출될 때 .Projekt_⟨#1⟩_⟨#2⟩.tex\input\include

모든 프로젝트 파일이 어떻게든 동일한 프리앰블을 공유하는 경우 해당 프리앰블을 통해 모든 프로젝트 파일에서 이 루틴을 사용할 수 있도록 할 수 있습니다.

아마도 해당 루틴(및 이에 대한 호출)을 해당 루틴에 포함시킬 수 있습니다. preamble.tex.해당 루틴은 이미 정의된 경우에는 아무 작업도 수행하지 않습니다 \prjindex.
그러므로

  • 당신 안에서 master.tex정의할 수 있습니다\prjindex ~ 전에입력 중 preamble.tex.
  • -files 중 하나를 독립 실행형으로 컴파일하는 시나리오는 아직 정의되지 않은 동안 입력으로 이어지며 , 이는 차례로 확장 결과를 검사하여 "자동 감지" 및 정의 루틴으로 이어집니다 .Projekt_⟨#1⟩_⟨#2⟩.tex\preamble.tex\prjindex\GetPrjindexFromJobnameIfUndefined\prjindex\jobname

\documentclass{article}

%%========Code for \GetPrjindexFromJobnameIfUndefined=========
\begingroup
\makeatletter
\def\prjprephrase{Projekt_}%
\def\prjpostphrase{_}%
% \jobname delivers everything but the space (which will be of catcode 10) 
% with catcode 12(other). Therefore "sanitizing" is needed for turning
% everything but the space into catcode 12(other):
\@onelevel@sanitize\prjprephrase
\@onelevel@sanitize\prjpostphrase
\newcommand\GetPrjindexFromJobnameIfUndefined[2]{%
  \endgroup
  \newcommand\GetPrjindexFromJobnameIfUndefined{%
    \@ifundefined{prjindex}{%
      \expandafter\GetPrjindexCheckPattern\jobname$#1#2$&%
    }{}%
  }%
  \@ifdefinable\GetPrjindexCheckPattern{%
    \def\GetPrjindexCheckPattern##1#1##2#2##3$##4&{%
      \GetPrjindexPatternfork
      &##4&{\expandafter\GetPrjindexExtractfrompattern\jobname$}%
      &#1#2$&{%
        \GenericError{(\string\prjindex)\space}{%
          Error on input line \the \inputlineno:\MessageBreak
          \string\GetPrjindexFromJobnameIfUndefined\space cannot extract the\MessageBreak
          \string\prjindex\space from \string\jobname's expansion.\MessageBreak
          (\string\GetPrjindexFromJobnameIfUndefined\space is defined\MessageBreak
           \space somewhere in this document.)\@gobble
        }{Have a look at the comments in this document.}%
        {%
          \string\GetPrjindexFromJobnameIfUndefined\space can extract the \string\prjindex\MessageBreak
          from \string\jobname's expansion only in case \string\jobname's expansion is\MessageBreak
          of pattern\MessageBreak
          \@spaces #1\string####1#2\string####2\MessageBreak
          while \string####1 is not empty.\MessageBreak
          If this is the case, the expansion of \string\prjindex\space will be \string####1.\MessageBreak
          \string####1 will not contain underscores (\string_).\MessageBreak
          \string####2 can contain underscores.\MessageBreak
        }%
      }%
      &&&&%
    }%
  }%
  \@ifdefinable\GetPrjindexPatternfork{%
    \def\GetPrjindexPatternfork##1&#1#2$&##2##3&&&&{##2}%
  }%
  \@ifdefinable\GetPrjindexExtractfrompattern{%
    \def\GetPrjindexExtractfrompattern#1##1#2##2${%
      \ifx\relax##1\relax
        \expandafter\@firstoftwo
      \else
        \expandafter\@secondoftwo
      \fi
      {%
        \GenericError{(\string\prjindex)\space}{%
          Error on input line \the \inputlineno:\MessageBreak
          \string\prjindex\space is empty.\MessageBreak
          (\string\GetPrjindexFromJobnameIfUndefined\space is defined\MessageBreak
           \space somewhere in this document.)\@gobble
        }{Have a look at the comments in this document.}%
        {%
          \string\GetPrjindexFromJobnameIfUndefined\space can extract the \string\prjindex\MessageBreak
          from \string\jobname's expansion only in case \string\jobname's expansion is\MessageBreak
          of pattern\MessageBreak
          \@spaces #1\string####1#2\string####2\MessageBreak
          while \string####1 is not empty.\MessageBreak
          If this is the case, the expansion of \string\prjindex\space will be \string####1.\MessageBreak
          \string####1 will not contain underscores (\string_).\MessageBreak
          \string####2 can contain underscores.\MessageBreak
        }%
      }%
      {\newcommand*\prjindex{##1}}%
    }%
  }%
}%
\expandafter\expandafter\expandafter\GetPrjindexFromJobnameIfUndefined
\expandafter\expandafter\expandafter{\expandafter\prjprephrase\expandafter}%
\expandafter{\prjpostphrase}%
%%=====End of code for \GetPrjindexFromJobnameIfUndefined=====

\GetPrjindexFromJobnameIfUndefined

\show\prjindex

\begin{document}
Some document
\end{document}

그건 그렇고: 루틴을 테스트하기 위해 위의 예제를 다른 값으로 저장 test.tex하고 컴파일하여 -옵션을 호출했습니다 .‑‑jobname

latex test.tex예상대로 산출된 명령을 통해 컴파일하면 다음과 같습니다 .

! Error on input line 80:
(\prjindex) \GetPrjindexFromJobnameIfUndefined cannot extract the
(\prjindex) \prjindex from \jobname's expansion.
(\prjindex) (\GetPrjindexFromJobnameIfUndefined is defined
(\prjindex)  somewhere in this document.)

Have a look at the comments in this document.
Type  H <return>  for immediate help.
 ...                                              

l.80 \GetPrjindexFromJobnameIfUndefined

? 
> \prjindex=undefined.
l.82 \show\prjindex

이 경우는 패턴이 아닌 \jobname확장 으로 예상되었습니다 .test
Projekt_⟨#1⟩_⟨#2⟩

latex ‑‑jobname=Projekt_A_4  test.tex예상대로 산출된 명령을 통해 컴파일하면 다음과 같습니다 .

\prjindex=macro:
->A.
l.82 \show\prjindex

(예제를 로 저장하고 Projekt_A_4.tex명령을 통해 컴파일 하면 동일한 결과를 얻을 수 있습니다 latex Projekt_A_4.tex.)

latex ‑‑jobname=Projekt_B_4 test.tex예상대로 산출된 명령을 통해 컴파일하면 다음과 같습니다 .

\prjindex=macro:
->B.
l.82 \show\prjindex

(예제를 로 저장하고 Projekt_B_4.tex명령을 통해 컴파일 하면 동일한 결과를 얻을 수 있습니다 latex Projekt_B_4.tex.)

latex ‑‑jobname=Projekt_JohannGambolputty_12345 test.tex예상대로 산출된 명령을 통해 컴파일하면 다음과 같습니다 .

\prjindex=macro:
->JohannGambolputty.
l.82 \show\prjindex

(예제를 로 저장하고 Projekt_JohannGambolputty_12345.tex명령을 통해 컴파일 하면 동일한 결과를 얻을 수 있습니다 latex Projekt_JohannGambolputty_12345.tex.)

그런데:

때로는 프로젝트 파일을 다음과 같이 구성합니다.

전문.tex

% Check whether the \documentclass-command was already invoked.
% If so, increment \inputlevel and stop inputting.
% If not so, don't stop imputting and thus do all the
% preamble-stuff, inclusive defining \inputlevel:
\expandafter\ifx\csname @twoclasseserror\endcsname\documentclass
  \xdef\inputlevel{\number\numexpr\inputlevel+1\relax}%
  \expandafter\endinput
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\documentclass{article}%
% 
\newcommand*\inputlevel{1}%
\global\let\inputlevel=\inputlevel
%
% Whatsoever preamble-commands, etc.
%
% Here you can also place the code for defining \GetPrjindexFromJobnameIfUndefined
% and then invoke it for defining \prjindex:
%
%%========Code for \GetPrjindexFromJobnameIfUndefined=========
\begingroup
\makeatletter
\def\prjprephrase{Projekt_}%
\def\prjpostphrase{_}%
% \jobname delivers everything but the space (which will be of catcode 10) 
% with catcode 12(other). Therefore "sanitizing" is needed for turning
% everything but the space into catcode 12(other):
\@onelevel@sanitize\prjprephrase
\@onelevel@sanitize\prjpostphrase
\newcommand\GetPrjindexFromJobnameIfUndefined[2]{%
  \endgroup
  \newcommand\GetPrjindexFromJobnameIfUndefined{%
    \@ifundefined{prjindex}{%
      \expandafter\GetPrjindexCheckPattern\jobname$#1#2$&%
    }{}%
  }%
  \@ifdefinable\GetPrjindexCheckPattern{%
    \def\GetPrjindexCheckPattern##1#1##2#2##3$##4&{%
      \GetPrjindexPatternfork
      &##4&{\expandafter\GetPrjindexExtractfrompattern\jobname$}%
      &#1#2$&{%
        \GenericError{(\string\prjindex)\space}{%
          Error on input line \the \inputlineno:\MessageBreak
          \string\GetPrjindexFromJobnameIfUndefined\space cannot extract the\MessageBreak
          \string\prjindex\space from \string\jobname's expansion.\MessageBreak
          (\string\GetPrjindexFromJobnameIfUndefined\space is defined\MessageBreak
           \space somewhere in this document.)\@gobble
        }{Have a look at the comments in this document.}%
        {%
          \string\GetPrjindexFromJobnameIfUndefined\space can extract the \string\prjindex\MessageBreak
          from \string\jobname's expansion only in case \string\jobname's expansion is\MessageBreak
          of pattern\MessageBreak
          \@spaces #1\string####1#2\string####2\MessageBreak
          while \string####1 is not empty.\MessageBreak
          If this is the case, the expansion of \string\prjindex\space will be \string####1.\MessageBreak
          \string####1 will not contain underscores (\string_).\MessageBreak
          \string####2 can contain underscores.\MessageBreak
        }%
      }%
      &&&&%
    }%
  }%
  \@ifdefinable\GetPrjindexPatternfork{%
    \def\GetPrjindexPatternfork##1&#1#2$&##2##3&&&&{##2}%
  }%
  \@ifdefinable\GetPrjindexExtractfrompattern{%
    \def\GetPrjindexExtractfrompattern#1##1#2##2${%
      \ifx\relax##1\relax
        \expandafter\@firstoftwo
      \else
        \expandafter\@secondoftwo
      \fi
      {%
        \GenericError{(\string\prjindex)\space}{%
          Error on input line \the \inputlineno:\MessageBreak
          \string\prjindex\space is empty.\MessageBreak
          (\string\GetPrjindexFromJobnameIfUndefined\space is defined\MessageBreak
           \space somewhere in this document.)\@gobble
        }{Have a look at the comments in this document.}%
        {%
          \string\GetPrjindexFromJobnameIfUndefined\space can extract the \string\prjindex\MessageBreak
          from \string\jobname's expansion only in case \string\jobname's expansion is\MessageBreak
          of pattern\MessageBreak
          \@spaces #1\string####1#2\string####2\MessageBreak
          while \string####1 is not empty.\MessageBreak
          If this is the case, the expansion of \string\prjindex\space will be \string####1.\MessageBreak
          \string####1 will not contain underscores (\string_).\MessageBreak
          \string####2 can contain underscores.\MessageBreak
        }%
      }%
      {\newcommand*\prjindex{##1}}%
    }%
  }%
}%
\expandafter\expandafter\expandafter\GetPrjindexFromJobnameIfUndefined
\expandafter\expandafter\expandafter{\expandafter\prjprephrase\expandafter}%
\expandafter{\prjpostphrase}%
%%=====End of code for \GetPrjindexFromJobnameIfUndefined=====
% 
% This will define \prjindex depending on the expansion of \jobname
% while \jobname usually represents the name of the file used for
% initiating compilation:
%
% !!! I don't know whether, e.g., online-latex-plattforms like overleaf
% !!! invoke latex using the -jobname-option, which would lead to
% !!! the expansion of \jobname deviating from the name of the file
% !!! used for initiating compilation.
%
\GetPrjindexFromJobnameIfUndefined
%
% With subsequent preamble-commands you can, if you wish, fork depending on
% the expansion of \prjindex. But be aware that like \jobname \prjindex also
% holds only characters of catcode 12(other) and spaces of catcode 10(space).
% Therefore when storing a string in a temporary macro (this should, like
% \prjindex not be defined in terms of \long, which is the case with
% \def or \newcommand*) and \ifx-comparing that temporary macro to \prjindex,
% make sure that the definition of that temporary macro is "sanitized" by
% means of \@onelevel@sanitize before doing the \ifx-comparison.
%
%  \usepackage...
%  \usepackage...
%
\begin{document}%
\endinput
|
| Place whatsoever comments remarks and explanations and manuals you wish to place 
| here. They won't be processed because LaTeX ceases reading and processing this
| file when encountering \endinput.

Postamble.tex

\csname @\ifnum\inputlevel>1 second\else first\fi oftwo\endcsname
{%
  \end{document}%
}{%
  \xdef\inputlevel{\number\numexpr\inputlevel-1\relax}%
}%

프로젝트_A_cp1.tex

%----------------------
\input{Preamble.tex}%
%----------------------
This is file \texttt{Projekt\string_A\string_cp1.tex}\par
This is the text in file \texttt{Projekt\string_\prjindex\string_cp1.tex}.\par
The file \texttt{Projekt\string_\prjindex\string_cp1.tex} invokes the file \texttt{Projekt\string_\prjindex\string_cp2.tex}:\par
\input{Projekt_\prjindex_cp2.tex}%
%----------------------
\input{Postamble.tex}%
%----------------------

프로젝트_A_cp2.tex

%----------------------
\input{Preamble.tex}%
%----------------------
This is file \texttt{Projekt\string_A\string_cp2.tex}\par
This is the text in file \texttt{Projekt\string_\prjindex\string_cp2.tex}.\par
The file \texttt{Projekt\string_\prjindex\string_cp2.tex} invokes the file \texttt{Projekt\string_\prjindex\string_cp3.tex}:\par
\input{Projekt_\prjindex_cp3.tex}%
%----------------------
\input{Postamble.tex}%
%----------------------

프로젝트_A_cp3.tex

%----------------------
\input{Preamble.tex}%
%----------------------
This is file \texttt{Projekt\string_A\string_cp3.tex}\par
This is the text in file \texttt{Projekt\string_\prjindex\string_cp3.tex}.\par
%----------------------
\input{Postamble.tex}%
%----------------------

프로젝트_B_cp1.tex

%----------------------
\input{Preamble.tex}%
%----------------------
This is file \texttt{Projekt\string_B\string_cp1.tex}\par
This is the text in file \texttt{Projekt\string_\prjindex\string_cp1.tex}.\par
The file \texttt{Projekt\string_\prjindex\string_cp1.tex} invokes the file \texttt{Projekt\string_\prjindex\string_cp2.tex}:\par
\input{Projekt_\prjindex_cp2.tex}%
%----------------------
\input{Postamble.tex}%
%----------------------

프로젝트_B_cp2.tex

%----------------------
\input{Preamble.tex}%
%----------------------
This is file \texttt{Projekt\string_B\string_cp2.tex}\par
This is the text in file \texttt{Projekt\string_\prjindex\string_cp2.tex}.\par
The file \texttt{Projekt\string_\prjindex\string_cp2.tex} invokes the file \texttt{Projekt\string_\prjindex\string_cp3.tex}:\par
\input{Projekt_\prjindex_cp3.tex}%
%----------------------
\input{Postamble.tex}%
%----------------------

Project_B_cp3.tex

%----------------------
\input{Preamble.tex}%
%----------------------
This is file \texttt{Projekt\string_B\string_cp3.tex}\par
This is the text in file \texttt{Projekt\string_\prjindex\string_cp3.tex}.\par
%----------------------
\input{Postamble.tex}%
%----------------------

이런 방식으로 각 파일 Projekt_A_cp1.tex, 각각의 파일 , 은(는) Projekt_A_cp2.tex" 독립형 " 컴파일과 동일한 프로젝트의 다른 파일을 통해 호출되는 데 모두 사용될 수 있습니다 .Projekt_A_cp3.texProjekt_B_cp1.texProjekt_B_cp2.texProjekt_B_cp3.tex\input\include

Preamble.tex의 의미에 따라 분기가 발생하는 코드를 포함할 수 있으므로 \prjindex동일한 프리앰블 파일 내의 프로젝트마다 다르게 처리될 수 있습니다.

답변2

문제가 무엇인지 잘 모르겠지만 확실히 코드를 변경해야 합니다 \include.~ 아니다확장자를 가지고 있습니다 .tex.

\documentclass{book}

% why shouldn't this be elegant
\newcommand{\projectindex}{B}

\begin{document}

\include{chapter/Project_\projectindex_cp1}
\include{chapter/Project_\projectindex_cp2}
\include{chapter/Project_\projectindex_cp3}

\end{document}

이 코드를 컴파일할 때의 터미널 출력은 다음과 같습니다.

pdflatex sun
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./sun.tex
LaTeX2e <2019-10-01> patch level 3
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/book.cls
Document Class: book 2019/10/25 v1.4k Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/bk10.clo)) (./sun.aux
(./chapter/Project_B_cp1.aux) (./chapter/Project_B_cp2.aux)
(./chapter/Project_B_cp3.aux)) (./chapter/Project_B_cp1.tex
Chapter 1.
) [1{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./chapter/Project_B_cp2.tex [2]
Chapter 2.
) [3] (./chapter/Project_B_cp3.tex [4]
Chapter 3.
) [5] (./sun.aux (./chapter/Project_B_cp1.aux) (./chapter/Project_B_cp2.aux)
(./chapter/Project_B_cp3.aux)) )</usr/local/texlive/2019/texmf-dist/fonts/type1
/public/amsfonts/cm/cmbx12.pfb></usr/local/texlive/2019/texmf-dist/fonts/type1/
public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2019/texmf-dist/fonts/type1/pu
blic/amsfonts/cm/cmsl10.pfb>
Output written on sun.pdf (5 pages, 30009 bytes).

로 변경하면 \newcommand{\projectindex}{A}LaTeX를 두 번 실행한 후에 다음과 같은 결과가 나타납니다.

pdflatex sun
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./sun.tex
LaTeX2e <2019-10-01> patch level 3
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/book.cls
Document Class: book 2019/10/25 v1.4k Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/bk10.clo)) (./sun.aux
(./chapter/Project_A_cp1.aux) (./chapter/Project_A_cp2.aux)
(./chapter/Project_A_cp3.aux)) (./chapter/Project_A_cp1.tex
Chapter 1.
) [1{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./chapter/Project_A_cp2.tex [2]
Chapter 2.
) [3] (./chapter/Project_A_cp3.tex [4]
Chapter 3.
) [5] (./sun.aux (./chapter/Project_A_cp1.aux) (./chapter/Project_A_cp2.aux)
(./chapter/Project_A_cp3.aux)) )</usr/local/texlive/2019/texmf-dist/fonts/type1
/public/amsfonts/cm/cmbx12.pfb></usr/local/texlive/2019/texmf-dist/fonts/type1/
public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2019/texmf-dist/fonts/type1/pu
blic/amsfonts/cm/cmsl10.pfb>
Output written on sun.pdf (5 pages, 29893 bytes).
Transcript written on sun.log.

보시다시피 예상되는 파일이 포함되어 있습니다.

관련 정보