This search tool allows you to search the LaTeX3 project team's database of all bug reports for LaTeX. If you discover what you believe to be a bug with LaTeX, you can search this database to find out if it has already been reported.
Note that you can only search for bugs which were reported after December 1994, when we made the database public.
PR number: latex/2613
Synopsis: wrong headline for twocolumn
Confidential: no
Responsible: The LaTeX Programming Team
State: closed
Arrival date: Mon Sep 22 16:41:09 1997
Daniel Reischert
Mon, 22 Sep 1997 16:28:12 +0200 (MET DST)
Description of bug:
When setting the document in two columns
the headline shows the top mark of the second column,
but it should show the top mark of the first column.
Sample file which indicates the problem:
========================================
\documentclass[twocolumn]{article} % twocolumn
\pagestyle{headings}
\begin{document}
\section{Right headline} % SECTION: Right headline (in left column)
On this page, the first section
of the page should occur in the
headline.
\section{Onesided documents} % another SECTION in the left column
There is no problem
with the headline in onecolumned
documents. But in this
twocolumned document, the headline
is wrong.
\newpage % go to right column
\section{Wrong headline} % SECTION: Wrong headline (in right column)
In this {\LaTeX} version
the first section of the second
column occurs in the headline!
\section{Another section} % another SECTION in the right column
(And you can see that it is not the
last section of the column.)
\section{The Problem is \ldots} % Why the problem occurs:
The problem is that {\LaTeX}
changes the output macro to be
called for each column once.
Therefore both calls set the
values of \verb/\topmark/ and
\verb/\firstmark/ for one column,
and the second values are not
the right ones for the whole page.
I think the first values of
\verb/\topmark/ and \verb/\firstmark/
should be stored during the first
call of \verb/@outputdblcol/
and the macros \verb/\rightmark/
and \verb/\leftmark/ should be
modified appropriately to use
the stored values.
\end{document}
The log file from running LaTeX on the sample:
==============================================
This is TeX, Version 3.14159 (C version 6.1) (format=latex 95.12.6) 22 SEP 1997 16:23
**head
(head.tex
LaTeX2e <1995/06/01> patch level 3
Hyphenation patterns for english, german, loaded.
(/home/xi/local/teTeX/texmf/tex/latex/base/article.cls
Document Class: article 1995/06/26 v1.3g Standard LaTeX document class
(/home/xi/local/teTeX/texmf/tex/latex/base/size10.clo
File: size10.clo 1995/06/26 v1.3g Standard LaTeX file (size option)
)
\c@part=\count82
\c@section=\count83
\c@subsection=\count84
\c@subsubsection=\count85
\c@paragraph=\count86
\c@subparagraph=\count87
\c@figure=\count88
\c@table=\count89
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) (head.aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
Underfull \hbox (badness 7832) in paragraph at lines 9--14
\OT1/cmr/m/n/10 There is no prob-lem with the head-line in
[]
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 16.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 16.
Underfull \hbox (badness 6001) in paragraph at lines 32--40
[]\OT1/cmr/m/n/10 I think the first val-ues of []\OT1/cmtt/m/n/10 \topmark \OT1
/cmr/m/n/10 and
[]
[1
] (head.aux) )
Here is how much of TeX's memory you used:
221 strings out of 10925
2098 string characters out of 72248
46385 words of memory out of 262141
3153 multiletter control sequences out of 9500
4766 words of font info for 18 fonts, out of 150000 for 255
14 hyphenation exceptions out of 607
23i,4n,19p,128b,140s stack positions out of 300i,40n,60p,3000b,4000s
Output written on head.dvi (1 page, 1728 bytes).
============================================================
End of LaTeX2e bug report.
============================================================
LaTeX2e bug report.
Generated by latexbug.tex on 1997/09/22
Reports may be submitted by email to latex-bugs@uni-mainz.de
Please use the subject line:
Subject: wrong headline for twocolumn
============================================================
David Carlisle
Fri, 17 Oct 1997 15:00:08 +0100 (BST)
Daniel,
Thank you for your report. My initial thought is to agree with you
that the output is wrong, and also to agree with your analysis of why
that happens.
As you may guess, changing the mark system would be likely to change
almost all twocolumn documents. Almost certainly not all those changes
would be for the better. (In particular, such a change might badly
affect a package that is being used already to *fix* this problem).
Or perhaps people are using a `two column headline' and really using
the `column' marks for both columns. (In which case they must already
have patched into the output routine to save the first column marks).
A slightly safer alternative may be for the output routine to save the
marks from the first column, as you suggest, but then make them
available via new commands, rather than forcing a resetting \firstmark.
I do not know at present. I think further thought and testing will need
to go into this (and I am not sure that anything will be decided in
time for the December release). We will not close this report until
we have decided what to do. (at which time the database should send
you a message saying the status has changed).
David
From: Piet van Oostrum <piet@cs.ruu.nl>
To: latex-bugs@uni-mainz.de
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Fri, 17 Oct 1997 16:49:54 +0200
>Submitter-Id: net
>Confidential: no
>Priority: medium
>Category: latex
>>>>> David Carlisle <david@dcarlisle.demon.co.uk> (DC) writes:
DC> Piet,
DC> You have probably thought as much as anybody about the interactions
DC> between \mark and latex's page headings.
DC> Have you any thoughts on this pr, which you should find as
DC> http://www.uni-mainz.de/cgi-bin/ltxbugs2html?pr=latex/2613
DC> It looks to me like the report is correct, but I do not know whether
DC> it is safe to risk changing so many documents by changing the mark
DC> system.
DC> Feel free to ignore this if the timing is inconvenient,
DC> but if you do have any thoughts, you could send then to the bug
DC> address (with this subject line) I'd be grateful for any advice:-)
I have always considered this to be a real bug. I think we had some email
exchange about this subject a few years ago (like when fancyheadings came
out). In the fancyhdr package I have a fixmarks.sty that solves the
problem, and it originates from 1993, and was based upon an even earlier
file from Joe Pallas (which wasn't completely correct).
I would vote for correcting this in LaTeX's output routine. I think the
current behaviour is undesirable, and I can't really believe there are any
serious documents that willfully rely on the current behaviour. Making the
marks of the columns known under different names might be a good
alternative for those who want to use them.
--
Piet van Oostrum <piet@cs.ruu.nl>
URL: http://www.cs.ruu.nl/~piet [PGP]
Private email: Piet.van.Oostrum@pi.net
From: David Carlisle <david@dcarlisle.demon.co.uk>
To: daniel@informatik.uni-bonn.de, piet@cs.ruu.nl
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Fri, 17 Oct 1997 17:30:03 +0100 (BST)
Daniel,
I mailed you earlier today to acknowledge that this was a bug and that
we'd look into it. Piet van Oostrum kindly reminded me of a fact that
I think I should have already known, that his fancyhdr package
distribution contains a fixmarks.sty that fixes exactly this problem,
and I can confirm that adding
\usepackage{fixmarks}
to your test document produces the desired headline.
Even with this publicly available `fix' package we will still consider
whether to change the default behaviour, and let you know.
David
From: Frank Mittelbach <Frank.Mittelbach@Uni-Mainz.DE>
To: bugs@goofy.zdv.Uni-Mainz.de
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Sun, 19 Oct 1997 22:21:03 +0100
David Carlisle writes:
> Even with this publicly available `fix' package we will still consider
> whether to change the default behaviour, and let you know.
do you want to comment on this further? ie do you think we should
change this?
frank
From: David Carlisle <david@dcarlisle.demon.co.uk>
To: piet@cs.ruu.nl
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Sun, 19 Oct 1997 23:45:55 +0100 (BST)
Piet,
I suspect I'm going to regret asking, but why in fixmarks do you wait
until the second column, and then rediscover the firstcolumn marks by
vsplit-ing its box? Is it not possible just to remember the marks at
the same time as the first column box is saved, something like this?
David
\def\@outputdblcol{%
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
%%%grab the marks from this column
\toks@\expandafter{\topmark}%
\xdef\firstcolumn@topmark{\the\toks@}%
\toks@\expandafter{\firstmark}%
\xdef\firstcolumn@firstmark{\the\toks@}%
\toks@\expandafter{\botmark}%
\xdef\firstcolumn@botmark{\the\toks@}%
%%%%%%%%%%
\else
\global \@firstcolumntrue
%%%grab the marks from this column
\toks@\expandafter{\topmark}%
\xdef\secondcolumn@topmark{\the\toks@}%
\toks@\expandafter{\firstmark}%
\xdef\secondcolumn@firstmark{\the\toks@}%
\toks@\expandafter{\botmark}%
\xdef\secondcolumn@botmark{\the\toks@}%
%%%%%%%%%%
\setbox\@outputbox \vbox {%
\hb@xt@\textwidth {%
\hb@xt@\columnwidth {%
\box\@leftcolumn \hss}%
\hfil
\vrule \@width\columnseprule
\hfil
\hb@xt@\columnwidth {%
\box\@outputbox \hss}%
}%
}%
\@combinedblfloats
%% set the page marks from the column ones.
\ifx\firstcolumn@firstmark\@empty
\else
\let\topmark\firstcolumn@topmark
\let\firstmark\firstcolumn@firstmark
\fi
%%%%%%%%%%
\@outputpage
\begingroup
\@dblfloatplacement
\@startdblcolumn
\@whilesw\if@fcolmade \fi
{\@outputpage
\@startdblcolumn}%
\endgroup
\fi
}
From: David Carlisle <david@dcarlisle.demon.co.uk>
To: piet@cs.ruu.nl
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Mon, 20 Oct 1997 09:35:23 +0100 (BST)
Answering my own question.
Obviously my \ifx\firstcolumn@firstmark\@empty is silly and only
works for the first page of marks, but I suppose you are right and
that you can not tell if the first column contains marks (if you want
to allow for repeated identical \mark in the document) without
vsplitting the box. The page level marks are always initialised to the
previous botmark, so if they are all the same, and the same as the
previous botmark, chances are that there was no mark in that column
but no doubt there are always going to be times when that fails. (I
see that you more or less explain this in your comments in the
package:-)
Talking of things that are almost safe but not quite:-)
fixmarks'
\expandafter\gdef\expandafter\@firstcoltopmark\expandafter{\topmark}%
isn't quite as safe as
\toks@\expandafter{\topmark}%
\xdef\firstcolumn@topmark{\the\toks@}%
Just in case someone has \def\noexpand\foo#1{..#1...} in a \mark.
So I don't know, if it was `just' a matter of saving the first column
marks, I'd be tempted to do this in the kernel, but vsplitting the box
sounds a larger change to me (even though you do it to a copy of the
box, so it looks pretty safe), and I wonder whether we should leave that
to a package to fix. (I am not sure this distinction is made on any
rational grounds.)
David
From: Piet van Oostrum <piet@cs.ruu.nl>
To: Subject: Re: latex/2613: wrong headline for twocolumn
Date: Mon, 20 Oct 1997 13:33:38 +0200
>>>>> David Carlisle <david@dcarlisle.demon.co.uk> (DC) writes:
DC> Answering my own question.
DC> Obviously my \ifx\firstcolumn@firstmark\@empty is silly and only
DC> works for the first page of marks, but I suppose you are right and
DC> that you can not tell if the first column contains marks (if you want
DC> to allow for repeated identical \mark in the document) without
DC> vsplitting the box. The page level marks are always initialised to the
DC> previous botmark, so if they are all the same, and the same as the
DC> previous botmark, chances are that there was no mark in that column
DC> but no doubt there are always going to be times when that fails. (I
DC> see that you more or less explain this in your comments in the
DC> package:-)
Yes, I had tried several ways to get it correct, and finally decided that
\vsplit was the only really safe thing.
DC> Talking of things that are almost safe but not quite:-)
DC> fixmarks'
DC> \expandafter\gdef\expandafter\@firstcoltopmark\expandafter{\topmark}%
DC> isn't quite as safe as
DC> \toks@\expandafter{\topmark}%
DC> \xdef\firstcolumn@topmark{\the\toks@}%
DC> Just in case someone has \def\noexpand\foo#1{..#1...} in a \mark.
Of course you could argue that \def'ing is a bad thing to do in LaTeX code,
and it could be construed as fragile.
But the \toks method is better anyway, so I think it is good to use that.
DC> So I don't know, if it was `just' a matter of saving the first column
DC> marks, I'd be tempted to do this in the kernel, but vsplitting the box
DC> sounds a larger change to me (even though you do it to a copy of the
DC> box, so it looks pretty safe), and I wonder whether we should leave that
DC> to a package to fix. (I am not sure this distinction is made on any
DC> rational grounds.)
I am opposed to solve bugs with packages. You could load the code only
when the twocolumn option is used, or when the \twocolumn command is used
(although I wonder if it can be done in a timely manner in the latter
case). Anyway, the code must be such that people using the fixmarks package
are not punished.
--
Piet van Oostrum <piet@cs.ruu.nl>
URL: http://www.cs.ruu.nl/~piet [PGP]
Private email: Piet.van.Oostrum@pi.net
From: David Carlisle <david@dcarlisle.demon.co.uk>
To: piet@cs.ruu.nl
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Mon, 20 Oct 1997 16:03:46 +0100 (BST)
> I am opposed to solve bugs with packages.
I have some sympathy with that view, although I have some fear of
changing such a basic function in the kernel. People have the option
of not loading a package, but if a latex update breaks something it is
a lot harder for a normal user to fix the problem.
However the more I think about it, the less I like the current
behaviour. It seems hard to describe it as anything but a bug.
[Comments from the others??]
> Anyway, the code must be such that people using the fixmarks package
> are not punished.
That should be OK. As far as I can see, any fix will only involve a
redefinition of \@outputdblcol so if you load fixmarks onto a `fixed'
kernel you may be replacing one definition by an essentially similar
one, but no harm will come of that.
Do you really think it necessary to preserve the split marks. I can't
see why anybody who knows enough to be using vsplit should be allowing
the output routine to jump in before the marks are used.
David
From: Frank Mittelbach <Frank.Mittelbach@Uni-Mainz.DE>
To: bugs@goofy.zdv.Uni-Mainz.de
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Tue, 21 Oct 1997 08:33:13 +0100
David,
> I have some sympathy with that view, although I have some fear of
> changing such a basic function in the kernel. People have the option
> of not loading a package, but if a latex update breaks something it is
> a lot harder for a normal user to fix the problem.
>
> However the more I think about it, the less I like the current
> behaviour. It seems hard to describe it as anything but a bug.
> [Comments from the others??]
i would consider it a bug as well, but isn't the whole twocolumn a
bug? eg pagewide floats not handled correctly?
that doesn't mean we shouldn't fix it but perhaps if we do modify
anything here we might as well get the float part right at the same
time. i remember dimly that we go some suggested fix for that
(probably somewhere in Chris' pile)
> Do you really think it necessary to preserve the split marks. I can't
> see why anybody who knows enough to be using vsplit should be allowing
> the output routine to jump in before the marks are used.
i can't see either (but we should at least write in a comment in the
source saying that this will part will kill \splitmarks
as for making the intermediate marks available: i think this is a very
good idea but to do this we should step back and think about how to
best make them available. in other words i would like to see a
solution that can be extended to three or more column output routines
logically as well.
summary: i think we should fix it but also look at floats and
extensions to twocolumn
btw, if you are afraid that this might break some documents after all,
what about the following scenario:
- make the whole update available as patch-level 1
- make a comment in ltnews08 that patch-level 1 is in fact
some major surgery which we will officially include with the next release
and if people experience problems they should make a format without this
patch and tell us why and what type of problems they encounter
frank
From: David Carlisle <david@dcarlisle.demon.co.uk>
To: bugs@goofy.zdv.Uni-Mainz.de
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Tue, 21 Oct 1997 16:16:13 +0100 (BST)
> but isn't the whole twocolumn a
> bug? eg pagewide floats not handled correctly?
Oops I see a slippery slope coming up.
You mean the stuff about single/double column floats being out of
sequence?
I think I'd be unhappy to change that in the kernel now. It would make
vast differences to the pagination of old documents. Doing it in a
package (with perhaps a whole new output routine) isn't really any
hardship for people, compared to other package improvements in tools
such as multicol/verbatim/array.
The marks thing is more localised in that it probably only corrects
visibly wrong headlines, it does not re-paginate whole documents.
> as for making the intermediate marks available: i think this is a very
> good idea but to do this we should step back and think about how to
> best make them available. in other words i would like to see a
> solution that can be extended to three or more column output routines
> logically as well.
Good point, so I'd rather any kernel `fix' just didn't make them
available. (Or at least advertise any interface for making them
available)
David
From: David Carlisle <david@dcarlisle.demon.co.uk>
To: bugs@goofy.zdv.Uni-Mainz.de
Subject: Re: latex/2613: wrong headline for twocolumn
Date: Sun, 9 Nov 1997 22:33:55 +0000 (GMT)
Frank (before he became a father-of-three) wrote
i would consider it a bug as well, but isn't the whole twocolumn a
bug? eg pagewide floats not handled correctly?
that doesn't mean we shouldn't fix it but perhaps if we do modify
anything here we might as well get the float part right at the same
time. i remember dimly that we go some suggested fix for that
(probably somewhere in Chris' pile)
Not having access to Chris's pile, here is a suggested fix package for
both these problems. Comments etc welcome:-)
=================================
\input docstrip
\keepsilent
\preamble
\endpreamble
\askforoverwritefalse
\generate{\file{fix2col.sty}{\from{fix2col.dtx}{package}}}
\endbatchfile
=================================
% \iffalse
%% File: fix2col.dtx Copyright 1997 David Carlisle
%
%<*dtx>
\ProvidesFile{fix2col.dtx}
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{fix2col}
%<driver> \ProvidesFile{fix2col.drv}
% \fi
% \ProvidesFile{fix2col.dtx}
[1997/11/07 v0.01 Output Routine fixes for two column mode (DPC)]
%
% \iffalse
%<*driver>
\documentclass{ltxdoc}
\begin{document}
\DocInput{fix2col.dtx}
\end{document}
%</driver>
% \fi
%
% \GetFileInfo{fix2col.dtx}
% \CheckSum{532}
%
% \title{The \textsf{fix2col} package\thanks{This file
% has version number \fileversion, last
% revised \filedate.}}
% \author{David Carlisle\thanks{%^^A
% Part one is essentially a copy of the fixmarks package by
% Piet van Oostrum, itself based on earlier work by Joe Pallas.
% Part two is loosely based on the fixfloats package, originally
% by Ed Sznyter, with some modifications by Bil Kleb.}}
%
% \date{\filedate}
%
% \let\package\textsf
% \let\env\textsf
% \let\url\texttt
%
% \maketitle
%
% \section{Introduction}
% This package makes two independent changes to \LaTeX's two column
% output routine to fix the following two longstanding `features'.
%
% \begin{itemize}
% \item
% If the \TeX\ mark system is used (for example using the
% `headings' page style in the standard \LaTeX\ classes) then any marks
% that originate on the first column are `lost' as \LaTeX\ constructs
% the second column. An example document showing how this can result
% in incorrect page headings may be found in the latex bug database:\\
% \url{http://www.uni-mainz.de/cgi-bin/ltxbugs2html?pr=latex/2613}
%
% \item
% The second feature is documented in the \LaTeX\ book. By default
% \LaTeX\ does not attempt to keep double and single column floats in
% sequence, so if `Figure 1' is a double column float produced with
% |figure*|, then it may float
% after `Figure 2' if that is a single column, |figure|, float.
% Further correspondence about this may also be found in the
% bug database:\\
% \url{http://www.uni-mainz.de/cgi-bin/ltxbugs2html?pr=latex/2346}
% \end{itemize}
%
% \StopEventually{}
%
% \section{Notes on the Implementation Strategies}
%
% \subsection{Preserving Marks}
%
% The standard \LaTeX\ twocolumn system works internally by making
% each column a separate `page' that is passed independently to \TeX's
% pagebreaker. (Unlike say the \package{multicol} package, where all
% columns are gathered together and then split into columns later,
% using |\vsplit|.) This means that the primitive \TeX\ marks that are
% normally used for header information, are globally reset after the
% first column. By default \LaTeX\ does nothing about this.
% A good solution is provided by Piet van Oostrum (building on earlier
% work of Joe Pallas) in his \package{fixmarks} package.
%
% After the first column box has been collected the mark information
% for that box is saved, so that any |\firstmark| can be
% `artificially' used to set the page-level marks after the second
% column has been collected. (The second column |\firstmark| is not
% normally required.) Unfortunately \TeX\ does not provide a direct
% way of knowing if any marks are in the page, |\firstmark| always has a
% value from previous pages, even if there is no mark in this page.
% The solution is to make a copy of the box and then |\vsplit| it
% so that any marks show up as |\splitfirstmark|.
%
% The use of |\vsplit| does mean that the output routine will globally
% change the value of |\splitfirstmark| and
% |\splitbotmark|. The \package{fixmarks} package goes to some trouble
% to save and restore these values so that the output routine does
% \emph{not} change the values. This part of \package{fixmarks} is not
% copied here as it is quite costly (having to be run on every page) and
% there is no reason why anyone writing code using |\vsplit| should
% allow the output routine to be triggered before the split marks have
% been accessed.
%
% \subsection{Preserving Float Order}
%
% The standard output routine maintains two lists of floats that have
% been `deferred' for later consideration. One list for single column
% floats, and one for double column floats (which are always
% immediately put onto their deferred list). This mechanism means
% that \LaTeX\ `knows' which type of float is contained in each box
% by the list that it is processing, but having two lists means
% that there is no mechanism for preserving the order between the
% floats in each list.
%
% The solution to this problem consists of two small changes to
% the output routine.
%
% Firstly, abandon the `double column float list' |\@dbldeferlist|
% and change every command where it is used so that instead the
% same |\@dbldeferlist| is used as for single column floats.
% That one change ensures that double and single column floats
% stay in the same sequence, but as \LaTeX\ no longer `knows'
% whether a float is double or single column, it will happily
% insert a double float into a single column, overprinting the
% other column, or the margin.
%
% The second change is to provide an alternative mechanism for
% recording the two column floats. \LaTeX\ already has a compact
% mechanism for recording float information, an integer count register
% assigned to each float records information about the `type' of float
% `figure', `table' and the position information `htp' etc.
%
% The type information is stored in the `high' bits, one bit position
% (above `32') allocated to each float type. The `low' bits store
% information about the allowed positions, one bit each allocated for
% |h t b p|. In the \LaTeX2.09 system, the bit corresponding to `16'
% formed a `boundary' between these two sets of information, and it
% was never actually used by the system. Ed Sznyter's
% \package{fixfloats} package not unreasonably used this position to
% store the double column information, setting the bit for double
% column floats. Then at each point in the output routine at which a
% float is committed to a certain region, an additional check must be
% made to check that the float is (or is not) double column. If it
% spans the wrong number of columns it is deferred rather than being
% added.
%
% Unfortunately the bit `16' is not available in \LaTeXe. It is used
% to encode the extra float position possibility `|!|' that was added
% in that system. It would be possible to use position `32' and to
% move the flags for `table', `figure',\ldots\ up one position, to
% start at 64, but this would mean that in principle one less float
% type would be supported, and more importantly is likely to break
% any other packages that assume anything about the output routine
% internals. So here I instead use another mechanism for flagging
% double column floats: By default all floats have depth 0pt.
% This package arranges that double column ones have depth 1sp.
% This information may then be used in the same manner as in
% the \package{fixfloats} package, to defer any floats that are not of
% the correct column spanning type.
%
%
% \section{Implementation}
% \begin{macrocode}
%<*package>
% \end{macrocode}
%
% \subsection{Preserving Marks}
%
% This is just a change to the single command |\@outputdblcol|
% so that it saves mark information for the first column and restores
% it in the second column.
% \begin{macrocode}
\def\@outputdblcol{%
\if@firstcolumn
\global\@firstcolumnfalse
% \end{macrocode}
% Save the left column
% \begin{macrocode}
\global\setbox\@leftcolumn\copy\@outputbox
% \end{macrocode}
%
% Remember the marks from the first column
% \begin{macrocode}
\splitmaxdepth\maxdimen
\vbadness\maxdimen
\setbox\@outputbox\vsplit\@outputbox to\maxdimen
% \end{macrocode}
%
% One minor difference from the current \package{fixmarks}, pass the
% marks through a token register to stop any |#| tokens causing an
% error in a |\def|.
% \begin{macrocode}
\toks@\expandafter{\topmark}%
\xdef\@firstcoltopmark{\the\toks@}%
\toks@\expandafter{\splitfirstmark}%
\xdef\@firstcolfirstmark{\the\toks@}%
% \end{macrocode}
%
% This test does not work if truly empty marks have been inserted, but
% \LaTeX\ marks should always have (at least) two brace groups.
% \begin{macrocode}
\ifx\@firstcolfirstmark\@empty
\global\let\@setmarks\relax
\else
\gdef\@setmarks{%
\let\firstmark\@firstcolfirstmark
\let\topmark\@firstcoltopmark}%
\fi
% \end{macrocode}
%
% End of change
% \begin{macrocode}
\else
\global\@firstcolumntrue
\setbox\@outputbox\vbox{%
\hb@xt@\textwidth{%
\hb@xt@\columnwidth{\box\@leftcolumn \hss}%
\hfil
\vrule \@width\columnseprule
\hfil
\hb@xt@\columnwidth{\box\@outputbox \hss}}}%
\@combinedblfloats
% \end{macrocode}
% Override current first and top with those of first column if necessary
% \begin{macrocode}
\@setmarks
% \end{macrocode}
% End of change
% \begin{macrocode}
\@outputpage
\begingroup
\@dblfloatplacement
\@startdblcolumn
\@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}%
\endgroup
\fi}
% \end{macrocode}
%
% \subsection{Preserving Float Order}
%
% Changes |\@dbldeferlist| to |\@deferlist| are not explicitly noted
% but are flagged by blank comment lines around the changed line.
%
%
% \begin{macrocode}
\def\end@dblfloat{%
\if@twocolumn
\@endfloatbox
\ifnum\@floatpenalty <\z@
\@largefloatcheck
% \end{macrocode}
%
% Force the depth of two column float boxes.
% \begin{macrocode}
\global\dp\@currbox1sp %
% \end{macrocode}
%
% \begin{macrocode}
\@cons\@deferlist\@currbox
% \end{macrocode}
%
% \begin{macrocode}
\fi
\ifnum \@floatpenalty =-\@Mii \@Esphack\fi
\else
\end@float
\fi
}
% \end{macrocode}
%
% Test if the float box has the wrong width. (Actually as noted above
% the test is for a conventional depth setting rather than for the
% width of the float).
% \begin{macrocode}
\def\@testwrongwidth #1{%
\ifdim\dp#1=\f@depth
\else
\global\@testtrue
\fi}
% \end{macrocode}
%
% Normally looking for single column floats, which have zero depth.
% \begin{macrocode}
\let\f@depth\z@
% \end{macrocode}
%
% but when making two column float area, look for floats with 1sp
% depth.
% \begin{macrocode}
\def\@dblfloatplacement{\global\@dbltopnum\c@dbltopnumber
\global\@dbltoproom \dbltopfraction\@colht
\@textmin \@colht
\advance \@textmin -\@dbltoproom
\@fpmin \dblfloatpagefraction\textheight
\@fptop \@dblfptop
\@fpsep \@dblfpsep
\@fpbot \@dblfpbot
% \end{macrocode}
%
% \begin{macrocode}
\def\f@depth{1sp}}
% \end{macrocode}
%
% All the remaining changes are replacing the double column defer list
% or insering the extra test |\@testwrongwidth|\marg{box} at suitable
% places. That is at plces where a box is taken off the deferlist.
% \begin{macrocode}
\def \@doclearpage {%
\ifvoid\footins
\setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
\setbox\@tempboxa\box\@cclv
\xdef\@deferlist{\@toplist\@botlist\@deferlist}%
\global \let \@toplist \@empty
\global \let \@botlist \@empty
\global \@colroom \@colht
\ifx \@currlist\@empty
\else
\@latexerr{Float(s) lost}\@ehb
\global \let \@currlist \@empty
\fi
\@makefcolumn\@deferlist
\@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
\if@twocolumn
\if@firstcolumn
% \end{macrocode}
%
% \begin{macrocode}
\xdef\@deferlist{\@dbltoplist\@deferlist}%
% \end{macrocode}
%
% \begin{macrocode}
\global \let \@dbltoplist \@empty
\global \@colht \textheight
\begingroup
\@dblfloatplacement
% \end{macrocode}
%
% \begin{macrocode}
\@makefcolumn\@deferlist
\@whilesw\if@fcolmade \fi{\@outputpage
\@makefcolumn\@deferlist}%
% \end{macrocode}
%
% \begin{macrocode}
\endgroup
\else
\vbox{}\clearpage
\fi
\fi
\else
\setbox\@cclv\vbox{\box\@cclv\vfil}%
\@makecol\@opcol
\clearpage
\fi
}
% \end{macrocode}
%
% \begin{macrocode}
\def \@startdblcolumn {%
\@tryfcolumn \@deferlist
\if@fcolmade
\else
\begingroup
\let \reserved@b \@deferlist
\global \let \@deferlist \@empty
\let \@elt \@sdblcolelt
\reserved@b
\endgroup
\fi
}
% \end{macrocode}
%
% \begin{macrocode}
\def\@addtonextcol{%
\begingroup
\@insertfalse
\@setfloattypecounts
\ifnum \@fpstype=8
\else
\ifnum \@fpstype=24
\else
\@flsettextmin
\@reqcolroom \ht\@currbox
\advance \@reqcolroom \@textmin
\ifdim \@colroom>\@reqcolroom
\@flsetnum \@colnum
\ifnum\@colnum>\z@
\@bitor\@currtype\@deferlist
\@testwrongwidth\@currbox
\if@test
\else
\@addtotoporbot
\fi
\fi
\fi
\fi
\fi
\if@insert
\else
\@cons\@deferlist\@currbox
\fi
\endgroup
}
% \end{macrocode}
%
% \begin{macrocode}
\def\@addtodblcol{%
\begingroup
\@insertfalse
\@setfloattypecounts
\@getfpsbit \tw@
\ifodd\@tempcnta
\@flsetnum \@dbltopnum
\ifnum \@dbltopnum>\z@
\@tempswafalse
\ifdim \@dbltoproom>\ht\@currbox
\@tempswatrue
\else
\ifnum \@fpstype<\sixt@@n
\advance \@dbltoproom \@textmin
\ifdim \@dbltoproom>\ht\@currbox
\@tempswatrue
\fi
\advance \@dbltoproom -\@textmin
\fi
\fi
\if@tempswa
\@bitor \@currtype \@deferlist
% \end{macrocode}
%
% not in fixfloats?
% \begin{macrocode}
\@testwrongwidth\@currbox
% \end{macrocode}
%
% \begin{macrocode}
\if@test
\else
\@tempdima -\ht\@currbox
\advance\@tempdima
-\ifx \@dbltoplist\@empty \dbltextfloatsep \else
\dblfloatsep \fi
\global \advance \@dbltoproom \@tempdima
\global \advance \@colht \@tempdima
\global \advance \@dbltopnum \m@ne
\@cons \@dbltoplist \@currbox
\@inserttrue
\fi
\fi
\fi
\fi
\if@insert
\else
\@cons\@deferlist\@currbox
\fi
\endgroup
}
% \end{macrocode}
%
% \begin{macrocode}
\def \@addtocurcol {%
\@insertfalse
\@setfloattypecounts
\ifnum \@fpstype=8
\else
\ifnum \@fpstype=24
\else
\@flsettextmin
\advance \@textmin \@textfloatsheight
\@reqcolroom \@pageht
\ifdim \@textmin>\@reqcolroom
\@reqcolroom \@textmin
\fi
\advance \@reqcolroom \ht\@currbox
\ifdim \@colroom>\@reqcolroom
\@flsetnum \@colnum
\ifnum \@colnum>\z@
\@bitor\@currtype\@deferlist
\if@test
\else
\@bitor\@currtype\@botlist
% \end{macrocode}
%
% \begin{macrocode}
\@testwrongwidth\@currbox
% \end{macrocode}
%
% \begin{macrocode}
\if@test
\@addtobot
\else
\ifodd \count\@currbox
\advance \@reqcolroom \intextsep
\ifdim \@colroom>\@reqcolroom
\global \advance \@colnum \m@ne
\global \advance \@textfloatsheight \ht\@currbox
\global \advance \@textfloatsheight 2\intextsep
\@cons \@midlist \@currbox
\if@nobreak
\nobreak
\@nobreakfalse
\everypar{}%
\else
\addpenalty \interlinepenalty
\fi
\vskip \intextsep
\box\@currbox
\penalty\interlinepenalty
\vskip\intextsep
\ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi
\outputpenalty \z@
\@inserttrue
\fi
\fi
\if@insert
\else
\@addtotoporbot
\fi
\fi
\fi
\fi
\fi
\fi
\fi
\if@insert
\else
\@resethfps
\@cons\@deferlist\@currbox
\fi
}
% \end{macrocode}
%
% \begin{macrocode}
\def\@xtryfc #1{%
\@next\reserved@a\@trylist{}{}%
\@currtype \count #1%
\divide\@currtype\@xxxii
\multiply\@currtype\@xxxii
\@bitor \@currtype \@failedlist
\@testfp #1%
% \end{macrocode}
%
% \begin{macrocode}
\@testwrongwidth #1%
% \end{macrocode}
%
% \begin{macrocode}
\ifdim \ht #1>\@colht
\@testtrue
\fi
\if@test
\@cons\@failedlist #1%
\else
\@ytryfc #1%
\fi}
% \end{macrocode}
%
% \begin{macrocode}
%</package>
% \end{macrocode}
%
% \Finale
%
State-Changed-From-To: open-suspended
State-Changed-By: rowley
State-Changed-When: Thu May 28 16:24:10 1998
State-Changed-Why:
We are sorry but have No time to work on this at present: the fixmarks
package does some of this.
State-Changed-From-To: suspended-closed
State-Changed-By: schoepf
State-Changed-When: Fri Sep 24 09:53:13 1999
State-Changed-Why:
fix added to fixltx2e package to be released 99/12
>Unformatted:
LaTeX2e bug report.
Generated by latexbug.tex on 1997/09/22
Reports may be submitted by email to latex-bugs@uni-mainz.de
Please use the subject line:
Subject: wrong headline for twocolumn
============================================================
Address information Copyright 1994 -- 2006 the LaTeX3 project and Alan Jeffrey.
The LaTeX home page