이중 언어 문서의 목차에 키릴 문자로 된 대문자 문자열을 추가할 수 없습니다. 다음은 컴파일 가능한 예입니다.
\documentclass[a4paper,10pt]{extreport}
\usepackage[koi8-r]{inputenc}
\usepackage[english,russian]{babel}
\newif\ifeng
\def\rus{\selectlanguage{russian}\engfalse}
\def\eng{\selectlanguage{english}\engtrue}
\def\UpperCase#1{\ifeng\uppercase{#1}\else\lowercase{#1}\fi}
\def\section#1{\vspace{1cm plus 1cm minus .5cm}\goodbreak
\noindent{\bf\large\UpperCase{#1}}%
\ifeng\addcontentsline{entoc}{section}{\UpperCase{#1}}\else%
\addcontentsline{rutoc}{section}{\UpperCase{#1}}\fi\par\nopagebreak
}
\def\subsection#1{\goodbreak
\noindent{\bf\large #1}%
\ifeng\addcontentsline{entoc}{subsection}{#1}\else%
\addcontentsline{rutoc}{subsection}{#1}\fi\par\nopagebreak}
\makeatletter
\renewcommand\tableofcontents{\pagebreak\selectlanguage{russian}
\noindent{\bf\large СОДЕРЖАНИЕ}\@starttoc{rutoc}
\vspace{2em}\selectlanguage{english}
\noindent{\bf\large CONTENTS}\@starttoc{entoc}}
\makeatother
\begin{document}
\tableofcontents
\rus\section{Русский}
\subsection{Подсекция}
Текст
\eng\section{English}
\subsection{Subsection}
Text
\end{document}
(이상하지만 koi8-r에서 대문자를 만들려면 매크로를 호출해야 \lowercase
하고 그 반대도 마찬가지입니다.)
\rus\section{Русский}
하지만 파일의 명령에 \jobname.rutoc
따르면 \contentsline {section}{\lowercase {\IeC {\CYRR }\IeC {\cyru }\IeC {\cyrs }\IeC {\cyrs }\IeC {\cyrk }\IeC {\cyri }\IeC {\cyrish rt }}}{1}
.
목차에서 올바른 대문자를 얻으려면 어떻게 해야 합니까?
답변1
\MakeUppercase
and not 을 사용해야 하지만 다음 옵션을 사용하여 \uppercase
명시적으로 로드해야 합니다 .fontenc
T2A
\documentclass[a4paper,10pt]{extreport}
\usepackage[T2A]{fontenc}
\usepackage[koi8-r]{inputenc}
\usepackage[english,russian]{babel}
\newif\ifeng
\def\rus{\selectlanguage{russian}\engfalse}
\def\eng{\selectlanguage{english}\engtrue}
\def\section#1{\vspace{1cm plus 1cm minus .5cm}\goodbreak
\noindent{\bf\large\MakeUppercase{#1}}%
\ifeng\addcontentsline{entoc}{section}{\MakeUppercase{#1}}\else%
\addcontentsline{rutoc}{section}{\MakeUppercase{#1}}\fi\par\nopagebreak
}
\def\subsection#1{\goodbreak
\noindent{\bf\large #1}%
\ifeng\addcontentsline{entoc}{subsection}{#1}\else%
\addcontentsline{rutoc}{subsection}{#1}\fi\par\nopagebreak}
\makeatletter
\renewcommand\tableofcontents{\pagebreak\selectlanguage{russian}
\noindent{\bf\large СОДЕРЖАНИЕ}\@starttoc{rutoc}
\vspace{2em}\selectlanguage{english}
\noindent{\bf\large CONTENTS}\@starttoc{entoc}}
\makeatother
\begin{document}
\tableofcontents
\rus\section{Русский}
\subsection{Подсекция}
Текст
\eng\section{English}
\subsection{Subsection}
Text
\end{document}