
저는 LaTeX를 처음 접했습니다. 논문을 작성 중인데 목차를 편집하려고 합니다. 부품 번호를 매길 때 로마 숫자를 사용합니다.
안타깝게도 목차에서 로마숫자 IV 뒤 마침표 앞의 간격이 너무 큽니다('IV' 및 '.' 다음은 'I' 및 '.' 다음보다 큽니다). 다른 로마 숫자(I, II, III) 앞에도 작게 만들지 않고 더 작게 만드는 방법을 아는 사람이 있나요?
\documentclass[11pt]{book}
\usepackage[]{titletoc}
\usepackage[newparttoc]{titlesec}
\titleformat{\part}[display]{}{\partname\nobreakspace\thepart}{0mm}{}
\titlecontents{part}
[0cm]
{}
{\hfil\normalfont\large\bfseries
\thecontentslabel\mdseries .\bfseries ~\hfil
\normalfont\large\bfseries}
{}
{\normalsize\dotfill\scriptsize\bfseries\thecontentspage}
[]
\begin{document}
\tableofcontents
\part{Part}
\part{Part}
\part{Part}
\part{Part}
\end{document}
답변1
\thecontentslabel
문제는 와 사이의 글꼴 변경 .
으로 인해 커닝이 적용되지 않습니다.
포함된 상자의 너비를 측정 \bfseries\thecontentslabel.
하고 \bfseries\thecontentslabel\kern0pt.
너비의 차이를 사용하여 부품 번호와 마침표 사이를 수동으로 커닝할 수 있는 작업을 수행할 수 있습니다.
답변2
해결책을 찾았습니다. 예쁘지는 않지만 작동합니다.
\documentclass[11pt]{book}
\usepackage[]{titletoc}
\usepackage[newparttoc]{titlesec}
\titleformat{\part}[display]{}{\partname\nobreakspace\thepart}{0mm}{}
\titlecontents{part}
[0cm]
{}
{\hfil\normalfont\large\bfseries
\thecontentslabel\mdseries .\bfseries ~\hfil
\normalfont\large\bfseries}
{}
{\normalsize\dotfill\scriptsize\bfseries\thecontentspage}
[]
\begin{document}
\tableofcontents
\part{Part}
\part{Part}
\part{Part}
\titlecontents{part}
[0cm]
{}
{\hfil\normalfont\large\bfseries
\thecontentslabel\mdseries $\!$.\bfseries ~\hfil
\normalfont\large\bfseries}
{}
{\normalsize\dotfill\scriptsize\bfseries\thecontentspage}
[]
\part{Part}
\part{Part}
\titlecontents{part}
[0cm]
{}
{\hfil\normalfont\large\bfseries
\thecontentslabel\mdseries .\bfseries ~\hfil
\normalfont\large\bfseries}
{}
{\normalsize\dotfill\scriptsize\bfseries\thecontentspage}
[]
\part{Part}
\end{document}