![将页码放在目录中章节名称的旁边](https://linux22.com/image/480367/%E5%B0%86%E9%A1%B5%E7%A0%81%E6%94%BE%E5%9C%A8%E7%9B%AE%E5%BD%95%E4%B8%AD%E7%AB%A0%E8%8A%82%E5%90%8D%E7%A7%B0%E7%9A%84%E6%97%81%E8%BE%B9.png)
在目录中,我想将页码放在章节名称的旁边,如下所示:
/
我最好在章节名称和页码之间添加,如下所示:
1. Intro / 2
我读了一两篇教程,尝试了几种方法,但都无法做到。该怎么做?请注意,我想在不改变课程extbook
和不放弃multitoc
包的情况下做到这一点
\documentclass[a4paper,openany,14pt]{extbook}
\usepackage[titles]{tocloft}
\usepackage[toc]{multitoc}
\renewcommand*{\multicolumntoc}{2}
\setlength{\columnseprule}{0.5pt} % remove vertical column line
% \addtocontents{toc}{\cftpagenumbersoff{chapter}} % remove page no
\renewcommand{\cftdot}{} % remove dots
\begin{document}
\tableofcontents
\pagebreak
\chapter{Intro}
Some text
\pagebreak
\chapter{Unit with more and more text}
Some text
\pagebreak
Some more text
\pagebreak
Some more and more text
\chapter{Termination Unit}
Some text
\pagebreak
\end{document}
答案1
使用包tocloft
你可以使用
\renewcommand{\cftchapleader}{\:/\:}
\renewcommand{\cftchapafterpnum}{\cftparfillskip}
\renewcommand{\cftpnumalign}{l}
例子:
\documentclass[a4paper,openany,14pt]{extbook}
\usepackage[titles]{tocloft}
\usepackage[toc]{multitoc}
\renewcommand*{\multicolumntoc}{2}
\setlength{\columnseprule}{0.5pt}
\renewcommand{\cftchapleader}{\:/\:}
\renewcommand{\cftchapafterpnum}{\cftparfillskip}
\renewcommand{\cftpnumalign}{l}
\begin{document}
\tableofcontents
\chapter{Intro}
Some text
\chapter{Unit with more and more text}
Some text
\clearpage
Some more text
\clearpage
Some more and more text
\chapter{Termination Unit}
Some text
\end{document}