
LaTeX 작업 흐름에 대한 스레드를 읽는 동안 다음 댓글을 발견했습니다.https://tex.stackexchange.com/a/22433/32782이는 책 장에 독립 실행형 패키지를 사용할 수 있거나 사용할 수 있는 사람이 두 명 이상 있음을 나타내는 것 같습니다. 일반적으로 사람들은 문서를 여러 tex 파일로 나누고 하나의 tex 파일만 활성화하기 위해 독립 실행형 패키지보다는 독립 실행형 패키지를 사용 \includeonly
하지만 독립 실행형을 사용한다는 아이디어에 흥미를 느꼈고 먼저 섹션이 있는 기사부터 시작하여 시도해 보아야 한다고 생각했습니다. 하지만 내 예는 작동하지 않는 것 같습니다. 내 예는 다음과 같습니다.
기본 tex 파일 flying-animals.tex
:
\documentclass{article}
\usepackage{standalone}
\begin{document}
\input{dragons}
\input{birds}
\input{superman}
\end{document}
그리고 한 섹션에 대한 tex 파일은 다음과 dragons.tex
같습니다.
\documentclass{standalone}
\begin{document}
\section{Theories of dragons}
Being dragons.
\subsection{Theory of angry dragons}
Being angry dragons.
\subsection{Theory of tiny dragons}
Being tiny dragons.
\end{document}
을(를 ) 컴파일할 때 dragons.tex
다음 오류가 발생합니다.
LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.3 \section
{Theories of dragons}
섹션을 사용하여 독립형 작업을 할 수 있나요?
답변1
varwidth
클래스에 옵션으로 추가하면 dragons.tex
정상적으로 작동합니다. 컴파일하면 dragons.tex
하나의 긴 페이지가 생성되므로 이는 이상적이지 않습니다. standalone
주로 TikZ 또는 PSTricks 등에서 만든 그래픽용입니다.
\documentclass[12pt]{article}
\usepackage{standalone}
\usepackage{lipsum}
\usepackage{filecontents}
% writes the following to dragons.tex
\begin{filecontents*}{dragons.tex}
\documentclass[varwidth]{standalone}
\usepackage{lipsum}
\begin{document}
\section{Theories of dragons}
Being dragons.
\lipsum
\subsection{Theory of angry dragons}
Being angry dragons.
\lipsum
\subsection{Theory of tiny dragons}
Being tiny dragons.
\lipsum
\end{document}
\end{filecontents*}
\begin{document}
\input{dragons}
\end{document}