Inhaltsverzeichnis in zweispaltigen Dokumenten nicht in der richtigen Reihenfolge

Inhaltsverzeichnis in zweispaltigen Dokumenten nicht in der richtigen Reihenfolge

Ich habe damit herumgespielt \@outputdblcolund 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 \@outputdblcoldie 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

\shipoutmacht die \writeSchreibknoten in der Reihenfolge, in der sie in der vertikalen Liste erscheinen, nicht in der visuellen Reihenfolge, sodass \hskip-\textwidthdie 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, \beginRdas istRechtsMöglichkeit, dies zu tun (aber es funktioniert nicht), also zurück zum Mischen der Kisten per Hand. Das hier scheint zu funktionieren:

Bildbeschreibung hier eingeben

\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}

verwandte Informationen