Ich habe damit herumgespielt \@outputdblcol
und mir ist Folgendes eingefallen:
\documentclass[twocolumn]{article}
\makeatletter
\def\@outputdblcol{%
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
\else
\global \@firstcolumntrue
\setbox\@outputbox \vbox {%
\hb@xt@\textwidth {%
\hskip\columnwidth
\hfil
{\normalcolor\vrule \@width\columnseprule}%
\hfil
\hb@xt@\columnwidth {%
\box\@outputbox \hss}%
\hskip-\textwidth
\hb@xt@\columnwidth {%
\box\@leftcolumn \hss}%
\hskip\columnwidth \hskip\columnsep
}%
}%
\@combinedblfloats
\@outputpage
\begingroup
\@dblfloatplacement
\@startdblcolumn
\@whilesw\if@fcolmade \fi
{\@outputpage
\@startdblcolumn}%
\endgroup
\fi
}
\makeatother
\pagestyle{headings}
\begin{document}
\tableofcontents
\section{Correct Headings}
Some useless text that we are provingin Some useless text that we are provingin Some useless text that we are provingin Some useless text that we are provingin
\section{Part}
Some useless text that we are provingin
\newpage
\section{Wrong Headings}
Some useless text that we are provingin
\section{Another Part}
Some useless text that we are provingin
\section{LAst Part}
Some useless text that we are provingin
\end{document}
Interessanterweise ist das Inhaltsverzeichnis jedoch nicht in der richtigen Reihenfolge, obwohl die Spalten in der richtigen Reihenfolge sind. Warum passiert das? Und wie kann man das beheben? (Natürlich ohne die Definition in \@outputdblcol
die ursprüngliche Form zu ändern)?
Wenn ich den Vorschlag von David Carlisle verwende, habe ich genau das gleiche Problem:
\documentclass[twocolumn]{article}
\TeXXeTstate=1
\makeatletter
\def\@outputdblcol{%
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
\else
\global \@firstcolumntrue
\setbox\@outputbox \vbox {%
\hb@xt@\textwidth {\beginR%
\hb@xt@\columnwidth {%
\box\@leftcolumn \hss}%
\hfil
{\normalcolor\vrule \@width\columnseprule}%
\hfil
\hb@xt@\columnwidth {%
\box\@outputbox \hss}%
\endR}%
}%
\@combinedblfloats
\@outputpage
\begingroup
\@dblfloatplacement
\@startdblcolumn
\@whilesw\if@fcolmade \fi
{\@outputpage
\@startdblcolumn}%
\endgroup
\fi
}
\makeatother
\pagestyle{headings}
\begin{document}
\tableofcontents
\section{Correct Headings}
Some useless text that we are provingin Some useless text that we are provingin Some useless text that we are provingin Some useless text that we are provingin
\section{Part}
Some useless text that we are provingin
\newpage
\section{Wrong Headings}
Some useless text that we are provingin
\section{Another Part}
Some useless text that we are provingin
\section{LAst Part}
Some useless text that we are provingin
\end{document}
aber das hier funktioniert gut:
\documentclass[twocolumn]{article}
\TeXXeTstate=1
\makeatletter
\def\@outputdblcol{%
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
\else
\global \@firstcolumntrue
\setbox\@outputbox \vbox {%
\hb@xt@\textwidth {%
\hskip\columnwidth
\hfil
{\normalcolor\vrule \@width\columnseprule}%
\hfil
\hb@xt@\columnwidth {%
\box\@leftcolumn \hss}%
\hskip-\textwidth
\hb@xt@\columnwidth {%
\box\@outputbox \hss}%
\hskip\columnwidth\hskip\columnsep }%
}%
\@combinedblfloats
\@outputpage
\begingroup
\@dblfloatplacement
\@startdblcolumn
\@whilesw\if@fcolmade \fi
{\@outputpage
\@startdblcolumn}%
\endgroup
\fi
}
\makeatother
\pagestyle{headings}
\begin{document}
\tableofcontents
\section{Correct Headings}
Some useless text that we are provingin Some useless text that we are provingin Some useless text that we are provingin Some useless text that we are provingin
\section{Part}
Some useless text that we are provingin
\newpage
\section{Wrong Headings}
Some useless text that we are provingin
\section{Another Part}
Some useless text that we are provingin
\section{LAst Part}
Some useless text that we are provingin
\end{document}
Mich interessiert nur, wie das Inhaltsverzeichnis in den ersten beiden Beispielen behoben wird.
Antwort1
\shipout
macht die \write
Schreibknoten in der Reihenfolge, in der sie in der vertikalen Liste erscheinen, nicht in der visuellen Reihenfolge, sodass \hskip-\textwidth
die Schreibreihenfolge nicht geändert wird, obwohl Sie die Spalten visuell vertauscht haben. Können Sie stattdessen die Spalten nicht in natürlicher Reihenfolge ausgeben, sondern mit Anweisungen an xetex (oder ein entsprechendes Luatex), um die RTL-Einstellung zu verwenden?
\hb@xt@\textwidth {\beginR%
..
Ich denke, \beginR
das istRechtsMöglichkeit, dies zu tun (aber es funktioniert nicht), also zurück zum Mischen der Kisten per Hand. Das hier scheint zu funktionieren:
\documentclass[twocolumn]{article}
\setlength\columnseprule{1pt}
\makeatletter
\TeXXeTstate=1
\makeatletter
\def\@outputdblcol{%
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
\else
\global \@firstcolumntrue
\setbox\@outputbox \vbox {%
\hb@xt@\textwidth {%
\kern\textwidth\llap{\hb@xt@\columnwidth {%
\box\@leftcolumn \hss}}%
\kern-\textwidth
\rlap{\hb@xt@\columnwidth {%
\box\@outputbox \hss}}%
\hfil
{\normalcolor\vrule \@width\columnseprule}%
\hfil
}%
}%
\@combinedblfloats
\@outputpage
\begingroup
\@dblfloatplacement
\@startdblcolumn
\@whilesw\if@fcolmade \fi
{\@outputpage
\@startdblcolumn}%
\endgroup
\fi
}
\makeatother
\pagestyle{headings}
\begin{document}
\tableofcontents
\section{Correct Headings}
Some useless text that we are provingin Some useless text that we are provingin Some useless text that we are provingin Some useless text that we are provingin
\section{Part}
Some useless text that we are provingin
\newpage
\section{Wrong Headings}
Some useless text that we are provingin
\section{Another Part}
Some useless text that we are provingin
\section{LAst Part}
Some useless text that we are provingin
\end{document}