我正在使用\l@chpater
旋转目录\chapter
中的条目,但我需要目录的偶数页上的章节名称位于页面的左侧,而目录的奇数页上的章节名称位于右侧。
\documentclass[openany,12pt]{book}
\usepackage{graphicx}
\def\Rotatebox#1{\rotatebox[origin=lB]{270}{#1}}
\newcounter{linhas}
\def\paginapar{\noindent\hspace*{.7\textwidth}\rlap}
\def\paginaimpar{\noindent\llap}
\makeatletter
\renewcommand\l@chapter[2]{%
\smash{\paginapar{\box{%
\protect\Rotatebox{\protect\parbox{\thelinhas\baselineskip}{\titulo\def\numberline##1{##1 } \centering #1 \vspace*{3pt}\rule{\thelinhas\baselineskip}{1pt}}}}%
\protect}}}
\makeatother
\begin{document}
\addtocontents{toc}{\protect\setcounter{linhas}{4}}
\tableofcontents
\chapter{Foo chapter}
\section{Foo section}
\section{Foo section sdf}
\section{Foo section sdf}
\subsection{Foo subsec}
\subsubsection{Foo subsecsec}
\addtocontents{toc}{\protect\setcounter{linhas}{10}}
\chapter{Foo chapter}
\section{Foo section}
\section{Foo section sdf}
\section{Foo section sdf}
\section{Foo section}
\section{Foo section sdf}
\section{Foo section sdf}
\section{Foo section}
\section{Foo section sdf}
\section{Foo section sdf}
\subsection{Foo subsec}
\subsubsection{Foo subsecsec}
\end{document}
因此,我想\paginapar
通过以下方式进行更改\paginaimpar
,也许间接使用\addtocontents{toc}{\protect\somecommand}