%20%EB%B0%B0%EC%97%B4(%EB%B3%80%EC%88%98)%20%EB%A7%B5%20%EA%B5%AC%EB%AC%B8%EC%9D%84%20%EC%B0%BE%EA%B3%A0%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
이 내용이 다른 곳에서 논의되었다면 사과드립니다. 하지만 그렇다면 찾을 수 없었습니다.
저는 대학에서 학술 논문 템플릿을 작성했지만 확실히 TeX 전문가는 아닙니다. 이 템플릿에서는 임시(자체) 정의 배열 맵을 사용하는 구성 파일을 광범위하게 사용합니다. 예:
\arraymay{cover}
\cover{phd}={phd_cover_file.pdf}
\cover{msg}={msc_cover_file.pdf}
\arraymap{margin}
\margin{cover,left}={5cm}
\margin{cover,right}={5cm}
\margin{cover,top}={4cm}
\margin{cover,bottom}={4cm}
\margin{main,left}={3cm}
\margin{main,right}={3cm}
\margin{main,top}={2cm}
\margin{main,bottom}={2cm}
키의 쉼표는 시각적 효과를 위해 사용되며 일반 문자로 간주됩니다. 즉, " \margin{cover,bottom}={2cm}
"에서 키는 " cover,bottom
"입니다.
나중에 다음과 같이 값에 액세스할 수 있습니다.
\def\manuscripttype{phd}
The cover file is ``\thecover[\manuscripttype]'' and the margins for the cover are ``\themargin[cover,left], \themargin[cover,right], \themargin[cover,top], and \themargin[cover,bottom].''
생산할 것이다
The cover file is “phd_cover_file.pdf” and the margins for the cover are “3cm, 3cm, 2cm, and 2cm.”
이 기능을 구현하는 다른 (단단한) 패키지가 있습니까? 그렇지 않다면 이를 구현할 수 있는 확실한 방법이 있습니까(KV 패키지 중 하나를 기반으로 할 수도 있음)? 감사해요.
답변1
당신은 그것을 할 수 있습니다 pgfkeys
:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{pgfkeys}
\pgfkeys{
lourenco/.cd,
cover/phd/.initial={},
cover/msc/.initial={},
margin/cover/left/.initial=0pt,
margin/cover/right/.initial=0pt,
margin/cover/top/.initial=0pt,
margin/cover/bottom/.initial=0pt,
margin/main/left/.initial=0pt,
margin/main/right/.initial=0pt,
margin/main/top/.initial=0pt,
margin/main/bottom/.initial=0pt,
}
\newcommand{\setlourenco}[1]{\pgfkeys{lourenco/.cd,#1}}
\newcommand{\thecover}[1]{%
\pgfkeysvalueof{/lourenco/cover/#1}%
}
\newcommand{\themargin}[1]{%
\pgfkeysvalueof{/lourenco/margin/#1}%
}
%% settings
\setlourenco{
cover/phd=phd-cover-file.pdf,
cover/msc=msc-cover-file.pdf,
margin/cover/left=5cm,
margin/cover/right=5cm,
margin/cover/top=4cm,
margin/cover/bottom=4cm,
margin/main/left=3cm,
margin/main/right=3cm,
margin/main/top=2cm,
margin/main/bottom=2cm,
}
\def\manuscripttype{phd}
\begin{document}
The cover file is ``\thecover{\manuscripttype}'' and the margins
for the cover are ``\themargin{cover/left}, \themargin{cover/right},
\themargin{cover/top}, and \themargin{cover/bottom}.''
\end{document}