TOC 페이지 번호 매기기를 위한 소문자/소문자

TOC 페이지 번호 매기기를 위한 소문자/소문자

내 문서에서는 아랍어(1, 2, ...)와 로마자 페이지 번호 매기기(I, II, ...)를 모두 사용합니다. 그러나 일반적인 로마 숫자는 목차에서 너무 지배적으로 보입니다(예: XXVIII). 소문자 로마 숫자도 나에게는 좋지 않습니다(xxviii).

나는 다음을 달성하고 싶습니다 :

  • 각 페이지 하단의 로마자 페이지 번호는 표준 크기의 대문자여야 합니다.
  • 각 페이지 하단의 아랍어 페이지 번호는 표준 크기의 숫자여야 합니다.
  • 목차의 로마자 페이지 번호는 표준 크기의 작은 대문자 또는 더 작은 대문자여야 합니다. (정기적으로 넓게 실행되어서는 안됩니다)
  • 목차의 아랍어 페이지 번호 매기기는 표준 크기의 숫자여야 합니다.

다음은 현재 내가 가지고 있는 것을 보여주는 MWE입니다.

\documentclass{scrartcl}
\begin{document}
    \pagenumbering{Roman}
    \setcounter{page}{27}
    \tableofcontents
    \newpage
    \section{Section}
    \newpage
    \pagenumbering{arabic}
    \section{Section}
\end{document}

보시다시피 저는 KOMA-Script를 사용합니다. 나는 다음의 기능을 사용하는 데 개방적입니다.tocstyle 나는 이미 이 패키지를 사용하고 있으므로KOMA-Script: 로마 숫자 정렬이 잘못되었습니다.).


참고:이 질문은 처음에 tocloft. 이것이 그것을 사용하여 몇 가지 답변이 있는 이유입니다.

답변1

와 더불어다가오는 KOMA-Script 버전 3.20 tocstyle필요하지 않습니다. 이미사전 출시KOMA-Script 웹사이트에서.

\documentclass{scrartcl}[2016/10/23]
\newcommand\pagenumbertocfont[1]{\ifisinteger{#1}{#1}{\tiny #1}}
\RedeclareSectionCommands[
    tocdynnumwidth,
    tocpagenumberbox=\hbox,
    tocpagenumberformat=\pagenumbertocfont
]{part,section,subsection,subsubsection,paragraph}
\RedeclareSectionCommands[
    tocpagenumberformat=\usekomafont{disposition}\pagenumbertocfont
]{part,section}


\usepackage{blindtext}

\begin{document}
    \pagenumbering{Roman}
    \setcounter{page}{27}
    \tableofcontents
    \clearpage
    \part{Part}
    \blinddocument

    \cleardoubleoddpage
    \pagenumbering{arabic}
    \blinddocument
\end{document}

결과:

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


와 더불어현재 버전 3.19apagenumberhook패키지에서 사용할 수 있습니다 tocstyle.

\documentclass{scrartcl}

\usepackage[tocindentauto]{tocstyle}
\usetocstyle{KOMAlike}
\settocfeature{pagenumberbox}{\hbox}

\newcommand\pagenumbertocfont[1]{\ifisinteger{#1}{#1}{\tiny #1}}
\settocstylefeature{pagenumberhook}{\pagenumbertocfont}
\settocstylefeature[-1]{pagenumberhook}{\pagenumbertocfont}
\settocstylefeature[1]{pagenumberhook}{\pagenumbertocfont}

\usepackage{blindtext}

\begin{document}
    \pagenumbering{Roman}
    \setcounter{page}{27}
    \tableofcontents
    \clearpage
    \part{Part}
    \blinddocument

    \cleardoubleoddpage
    \pagenumbering{arabic}
    \blinddocument

\end{document}

이는 표준 클래스에서도 작동합니다 article. 하지만 추가로 패키지를 로드해야 합니다 scrextend.

\documentclass{article}
\usepackage{scrextend}
\usepackage{tocstyle}
\usetocstyle{standard}
\settocfeature{pagenumberbox}{\hbox}

\newcommand\pagenumbertocfont[1]{\ifisinteger{#1}{#1}{\tiny #1}}
\settocstylefeature{pagenumberhook}{\pagenumbertocfont}
\settocstylefeature[-1]{pagenumberhook}{\pagenumbertocfont}
\settocstylefeature[1]{pagenumberhook}{\pagenumbertocfont}

\usepackage{blindtext}

\begin{document}
    \pagenumbering{Roman}
    \setcounter{page}{27}
    \tableofcontents
    \clearpage
    \part{Part}
    \blinddocument

    \cleardoubleoddpage
    \pagenumbering{arabic}
    \blinddocument
\end{document}

답변2

아마도 가장 쉬운 방법은 패키지를 사용하여 tocloft목차의 모양을 설정하는 것입니다.

\documentclass{scrartcl}
\usepackage{tocloft}
\renewcommand\cftsecfont{\bfseries\sffamily}
\renewcommand\cftsecpagefont{\bfseries\small\sffamily}
\begin{document}
    \pagenumbering{Roman}
    \setcounter{page}{27}
    \tableofcontents
    \newpage
    \section{Section}
    \newpage
    \pagenumbering{arabic}
    \section{Section}
\end{document}

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

비교를 위해 설정이 없습니다 tocloft.

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

답변3

태그를 설정했으므로 tocloft패키지를 사용하여 목차의 모양을 수정하는 데 관심이 있다고 가정합니다. 다음 코드는 이 작업을 수행하는 방법을 보여줍니다. 페이지 번호를 위해 확보된 공간을 늘리려면 \cftsetrmarg및 를 사용하십시오 \cftsetpnumwidth. 로마 숫자는 아라비아 숫자보다 훨씬 더 많은 공간을 차지하는 경향이 있습니다.

Computer Modern 글꼴 계열은 산세리프/작은 대문자/굵게 글꼴 속성 조합을 제공하지 않습니다. 따라서 아래 코드는 ToC에 serif/굵게 표시되지 않은 작은 대문자 페이지 번호를 생성합니다.

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

\documentclass{scrartcl}

\usepackage{tocloft}
\cftsetrmarg{4em} % set aside more space for roman numerals
\cftsetpnumwidth{3.5em}  
\renewcommand\cftsecfont{\bfseries\sffamily}
\renewcommand\cftsubsecfont{\bfseries\sffamily}
\renewcommand\cftsubsubsecfont{\bfseries\sffamily}
\renewcommand\cftsecpagefont{\scshape}

\begin{document}
    %%\pagenumbering{roman} 
    \renewcommand\thepage{\scshape\roman{page}} % <- new
    \setcounter{page}{37}
    \tableofcontents
    \newpage
    \section{Section}
    \subsection{Subsection}
    \subsubsection{A very very very very very  very very very very very very very very very very very very very very very very very very very very long subsubsection header}
    \newpage
    \pagenumbering{arabic}
    \section{Section}
\end{document}

관련 정보