
texlive
데비안 Jessie에서 사용하기
저는 지원서를 작성 중인데 독일어와 영어로 된 내용 버전을 포함하고 싶습니다.
ToC
내 응용 프로그램 표지 바로 뒤에 두 개의 가 나란히 있지만 각각 지정된 언어로만 표시되는 페이지를 갖고 싶습니다 .
지금까지 다음과 같이 두 개를 추가하는 방법을 알아냈습니다 ToC
.
\usepackage{parcolumns}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\pc@placeboxes}{\vrule}{{\VRULE}}{}{}
\makeatother
\newcommand\VRULE{\color{SOME_COLOR}\vrule width 0.2mm}
\usepackage{shorttoc}
...
\begin{parcolumns}[nofirstindent,rulebetween=true]{2}
\colchunk{
\selectlanguage{german}
\shorttableofcontents{\contentsname}{1}
}
\colchunk{
\selectlanguage{english}
\tableofcontents
}
\end{parcolumns}
\pagebreak
그러면 다음이 생성됩니다.
보시다시피 일이 끝나려면 아직 멀었습니다. 나는 LaTeX 특수 효과에 그다지 관심이 없기 때문에 내가 요청하려는 것이 가능한지 전혀 모릅니다.
첫 번째 질문은 다음과 같습니다.특정 조건을 충족하는 항목만 표시하도록 ToC를 사용자 정의할 수 있습니까?내 경우 조건은 다음과 같습니다: 섹션 이름이 독일어로 되어 있습니까, 아니면 영어로 되어 있습니까? 독일어인 경우 왼쪽 ToC에만 표시하고, 영어인 경우 오른쪽 ToC에만 표시합니다. 또한 항목이 두 조건을 모두 충족하여 두 ToC에 모두 표시될 수 있다면 정말 좋을 것입니다(예를 들어 번역이 없고 단지 재미를 위해 두 번 추가할 필요가 없는 인증서). 위의 모든 내용이 일종의 작업을 수행 if
하고 독일어 및 영어 섹션에 대한 일종의 값을 추가한 다음 확인되고 이를 기반으로 ToC가 그에 따라 채워질 것이라고 상상합니다.
이런 생각을 계속해서 두 언어에 모두 익숙하다면 위 이미지에서 항목이1과 2항목뿐만 아니라 동일한(그러나 다른 언어로) 의미3과 4.
이는 두 번째 질문, 즉 다음과 같은 질문으로 이어집니다.두 섹션이 동일한 번호를 갖도록 허용하는 일종의 조건을 사용할 수 있습니까?
결국 페이지는 다음과 같이 보여야 합니다.
편집하다:놀라운 @ChristianHupfer 덕분에 작업이 거의 완료되었습니다! 마지막 문제 중 하나는 toc
항목 X, Y 및 Z가 없지만 항목이 있는 빈 항목을 제거하는 것입니다 ftoc
.
위 이미지는 아래 코드에 해당합니다.
\section{Lebenslauf}
\pagebreak
\section{Lebenslauf}[CV]*
\pagebreak
\section{Bachelor Urkunde}
\pagebreak
\section{Bachelor Urkunde}[Bachelor Diploma]*
\pagebreak
\section{Lalalala}[Lalalala]
\pagebreak
\section{Wichtige Informationen}
\pagebreak
\section{Wichtige Informationen}[Important information]*
\pagebreak
\section{Andere Informationen}
\pagebreak
\section{Noch mehr wichtige Informationen}
\pagebreak
\section{Noch mehr wichtige Informationen}[Even more important information]*
\pagebreak
\section{Blabla}[Only in English Foo]*
\pagebreak
\section{Zusammengef\"uhrt}[Recombined]
제가 내용을 충분히 설명하지 못한 것 같은 느낌이 듭니다(죄송합니다!). 다른 언어로 된 섹션은 실제로 별도의 섹션으로 나타나야 합니다. 따라서 위의 코드는 두 toc
항목 모두에 빈 항목이 남아 있다는 작은 시각적 성가심으로 인해 내 요구 사항에 가장 적합합니다. 이것들을 제거하는 것이 가능합니까? 그다지 큰 문제는 아니지만 특히 두 toc
항목 중 하나에 여러 항목이 나타날 수 있는 더 큰 문서에 제공된 솔루션을 사용하려는 이 전체 주제의 다른 독자에게는 상황이 훨씬 더 좋아 보일 것이라고 믿습니다. 다른 쪽에는 공백이 있습니다 toc
.
답변1
\section
다음은 목차 섹션 이름의 영어 버전을 보유하는 추가 선택적 인수가 있는 버전입니다 . 를 생략하면 (의미 ) [...]
에는 아무것도 입력되지 않습니다 .ftoc
foreign toc
\tableofcontents
전통적인 동작과 \tableofcontents[ftoc]
다른 언어에 사용합니다 . 언어 설정은 실제로 parcolumns
내부 \tableofcontents
가 아닌 환경에서 수행됩니다.
\documentclass{article}
\usepackage[english,ngerman]{babel}
\usepackage{xpatch}
\usepackage{xparse}
\usepackage{parcolumns}
\makeatletter
\patchcmd{\pc@placeboxes}{\vrule}{{\VRULE}}{}{}
\newcommand\VRULE{\color{SOME_COLOR}\vrule width 0.2mm}
\let\latex@@section\section
\RenewDocumentCommand{\section}{somo}{%
\IfBooleanTF{#1}{%
\latex@@section*{#3}%
}{%
\IfValueTF{#2}{%
\latex@@section[#2]{#3}%
}{%
\latex@@section{#3}%
}%
\IfValueT{#4}{%
\addcontentsline{ftoc}{section}{\protect\numberline{\csname thesection\endcsname}#4}
}%
}%
}
\renewcommand\tableofcontents[1][toc]{%
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{#1}%
}
\makeatother
\begin{document}
\begin{parcolumns}[nofirstindent,rulebetween=true]{2}
\colchunk{
\selectlanguage{ngerman}
\tableofcontents
%\shorttableofcontents{\contentsname}{1}
}
\colchunk{
\selectlanguage{english}
\tableofcontents[ftoc]
}
\end{parcolumns}
\pagebreak
\section{Lebenslauf}[CV]
\section{Bachelor Urkunde}[Bachelor Diploma]
\section{Wichtige Informationen}[Important information]
\end{document}
업데이트
\documentclass{article}
\usepackage[english,ngerman]{babel}
\usepackage{xpatch}
\usepackage{xparse}
\usepackage{parcolumns}
\makeatletter
\patchcmd{\pc@placeboxes}{\vrule}{{\VRULE}}{}{}
\newcommand\VRULE{\color{SOME_COLOR}\vrule width 0.2mm}
\newcounter{storetocdepth}
\let\latex@@section\section
\RenewDocumentCommand{\section}{somos}{%
\IfBooleanTF{#1}{%
\latex@@section*{#3}%
}{%
\IfBooleanTF{#5}{%
\setcounter{storetocdepth}{\value{tocdepth}}
\addtocontents{toc}{\protect\setcounter{tocdepth}{-4}}
% The #2 is of no use here, except of page headings /section mark
\IfValueTF{#2}{%
\latex@@section[#2]{#3}%
}{%
\latex@@section{#3}%
}%
\addtocontents{toc}{\protect\setcounter{tocdepth}{\number\value{storetocdepth}}}
\addtocontents{toc}{\protect\contentsline{section}{\protect\phantom{#3}}{}}% Provide an empty fake entry
}{%
\IfValueTF{#2}{%
\latex@@section[#2]{#3}%
}{%
\latex@@section{#3}%
}%
}%
\IfValueTF{#4}{%
\addcontentsline{ftoc}{section}{\protect\numberline{\csname thesection\endcsname}#4}
}{%
\addtocontents{ftoc}{\protect\contentsline{section}{\protect\phantom{#2}}{}}% Provide an empty fake entry
}%
}%
}
\renewcommand\tableofcontents[1][toc]{%
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{#1}%
}
\makeatother
\begin{document}
\begin{parcolumns}[nofirstindent,rulebetween=true]{2}
\colchunk{
\selectlanguage{ngerman}
\tableofcontents
%\shorttableofcontents{\contentsname}{1}
}
\colchunk{
\selectlanguage{english}
\tableofcontents[ftoc]
}
\end{parcolumns}
\pagebreak
\section{Lebenslauf}[CV]
\section{Bachelor Urkunde}[Bachelor Diploma]
\section{Wichtige Informationen}[Important information]
\section{Andere Informationen}
\section{Noch mehr wichtige Informationen}[Even more important information]
\section{Blabla}[Only in English Foo]*
\section{Zusammengef\"uhrt}[Recombined]
\end{document}