diff options
author | Karl Berry <karl@freefriends.org> | 2012-08-08 17:56:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-08-08 17:56:22 +0000 |
commit | dad94a4dcb71392996b045db358e9b09affeef74 (patch) | |
tree | 3e6bb4bc7dd773003f6ec21e736c8d8662cdd541 | |
parent | cdb33d59d9cec048bac89cb1c4bc3aa2cfa9b19b (diff) |
new old latex package tamefloats
git-svn-id: svn://tug.org/texlive/trunk@27345 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/tamefloats/README.txt | 25 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tamefloats/deml3541.tex | 37 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tamefloats/fltfltdk.tex | 34 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tamefloats/newbug.tex | 47 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tamefloats/tameflts.sty | 208 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 4 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 6 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/tamefloats.tlpsrc | 0 |
9 files changed, 359 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/latex/tamefloats/README.txt b/Master/texmf-dist/doc/latex/tamefloats/README.txt new file mode 100644 index 00000000000..cc67fb8fb11 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tamefloats/README.txt @@ -0,0 +1,25 @@ +README for tameflts.sty, 2004/04/21, +Uwe Lueck http://contact-ednotes.sty.de.vu . + +The files address the problem that LaTeX floats and \marginpar +may cause misplacement of footnotes or footnote splits. (The +LaTeX code makes me also expect problems with \enlargethispage). + +tameflts.sty provides + * a simple, experimental fix, maybe just as a + contribution to discussion and as a summary of + what other authors have contributed; + * many explanations -- so go on reading there. + +deml3541.tex demonstrates the fix and adds a few explanations. + +newbug.tex demonstrates a weakness of tameflts, or that such a + simple approach does not perfectly suffice, rather + LaTeX needs an essentially new mechanism for + handling floats indeed. + +fltfltdk.tex varies deml3541.tex to test interaction with Mats + Dahlgren's package floatflt. + +(The package was called `noreins.sty' earlier, in folder +`noreinserts'. Added infos on compatibility 2005/04/21.) diff --git a/Master/texmf-dist/doc/latex/tamefloats/deml3541.tex b/Master/texmf-dist/doc/latex/tamefloats/deml3541.tex new file mode 100644 index 00000000000..da68ebef425 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tamefloats/deml3541.tex @@ -0,0 +1,37 @@ +%% deml3451.tex 2005/04/17 +% Basically David Kastrup's test code from latex/3541, +% edited by Uwe Lueck, http://contact-ednotes.sty.de.vu. +% Demonstrates bug and its fix by tameflts.sty. +% Run this and watch the order of the numbers in the +% footnote, and where it has its footnote mark; then +% remove the next `%' for the fix. + +\documentclass[12pt]{article} + +% \usepackage{tameflts} + +\newcounter{xxx} +\usepackage{ifthen} +\nofiles +\begin{document} +Test a footnote\footnote{% + \whiledo{\value{xxx}<69}{% + \stepcounter{xxx} + This is just test line \thexxx. \par + }% +} and then a marginal note:\marginpar{\sffamily Look!} +\end{document} + +REMARKs: +* It is essential that \marginpar comes after \footnote. This + indicates how to avoid the problem in many situations without + changing the output routine. Marginal notes are often used + only at the beginning of a paragraph; then it is good to start + with the \marginpar's, making sure that they appear in + horizontal mode. +* The editing of the example from latex/3541 consisted in + structuring and replacing TeX commands by LaTeX commands. The + essence is, like in latex/3719 a very long footnote, with a + \marginpar shortly following. +-- U.L. + diff --git a/Master/texmf-dist/doc/latex/tamefloats/fltfltdk.tex b/Master/texmf-dist/doc/latex/tamefloats/fltfltdk.tex new file mode 100644 index 00000000000..c1c104fb079 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tamefloats/fltfltdk.tex @@ -0,0 +1,34 @@ +%% fltfltdk.tex 2005/04/17 +% like deml3541.tex, but tests usage of tameflts.sty with +% Mats Dahlgren's floatflt.sty which is available from +% tex-archive/macros/latex/contrib/floatflt (through +% .dtx and .ins). + +\documentclass[12pt]{article} +\usepackage{floatflt} + +% \usepackage{tameflts} + +\newcounter{xxx} +\usepackage{ifthen} +\nofiles +\begin{document} +Test a footnote\footnote{% + \whiledo{\value{xxx}<46}{% + \stepcounter{xxx} + This is just test line \thexxx. \par + }% +} and then a ``floating figure'': +\begin{floatingfigure}{.4\linewidth} +\vspace*{3\baselineskip} +\textsf{Space for notes} +\end{floatingfigure} +\setcounter{xxx}{0}% +\whiledo{\value{xxx}<39}{% + \stepcounter{xxx} + Testtext. +}% + +\end{document} + + diff --git a/Master/texmf-dist/doc/latex/tamefloats/newbug.tex b/Master/texmf-dist/doc/latex/tamefloats/newbug.tex new file mode 100644 index 00000000000..0b479f20bfe --- /dev/null +++ b/Master/texmf-dist/doc/latex/tamefloats/newbug.tex @@ -0,0 +1,47 @@ +%% newbug.tex 2005/04/17 demonstrates tameflts.sty bug. +%% (C) 2005 Uwe Lueck http://contact-ednotes.sty.de.vu +%% +%% RIGHTS: LaTeX Project Public License (LPPL) v1.3 +%% -- author-maintained. +% +% Remove the next `%' to see the bug (bug? see bottom): + +\documentclass[12pt]{article} + +% \usepackage{tameflts} + +\nofiles +\begin{document} + +\newcommand{\footnobreakpar}{Test.\footnote{A note.}\par\nobreak} +\footnobreakpar \footnobreakpar \footnobreakpar \footnobreakpar +\footnobreakpar \footnobreakpar \footnobreakpar \footnobreakpar +\footnobreakpar \footnobreakpar \footnobreakpar \footnobreakpar +\footnobreakpar \footnobreakpar \footnobreakpar \footnobreakpar +\footnobreakpar \footnobreakpar \footnobreakpar +Test.\footnote{A note.} +\begin{figure} +\begin{center} +\leavevmode\vrule height 10em +\end{center} +\caption{An upright stroke.} +\end{figure} + +\newcommand{\testpar}{Test.\par} +\testpar \testpar \testpar \testpar \testpar \testpar +\testpar \testpar \testpar \testpar \testpar \testpar +\testpar \testpar \testpar \testpar \testpar + +\enddocument + +REMARKS: +* Bug? This may be a matter of taste. However, I expect + agreement here that it is better to use two pages instead of + three (unless the user explicitly demands that the figure goes + to its own page). +* I think the present example is rather artificial. +* `License' may be funny with a demo file. Yet the part of LPPL + on changing/redistributing is useful here especially with the + \usepackage line, which should remain commented out for + distribution. + diff --git a/Master/texmf-dist/tex/latex/tamefloats/tameflts.sty b/Master/texmf-dist/tex/latex/tamefloats/tameflts.sty new file mode 100644 index 00000000000..2b2e7a1f336 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tamefloats/tameflts.sty @@ -0,0 +1,208 @@ +%% tameflts.sty -- experimental fix of bug(s) +%% latex/3208, 3370, 3541, and 3719, +%% using \holdinginserts. +%% (C) 2005 Uwe Lueck http://contact-ednotes.sty.de.vu +%% Adapted from lineno.sty, due to Stephan I. Boettcher, with an +%% improvement by David Kastrup. +\def\filedate{2005/04/27} \def\fileversion{v0.42} +%% RIGHTS: LaTeX Project Public License (LPPL) v1.3a +%% -- author-maintained. +%% +%% PURPOSE, USAGE, WARNINGs etc.: see below \endinput. + +\ProvidesPackage{tameflts}[\filedate\space\fileversion\space + do without \string\@reinserts] +% \let\@reinserts\relax % TODO!? another package might use it. +\mathchardef\@UAR@Mv=10005 % v0.3, for floatflt. + % "Universally Avoid \@reinserts". +\newif\if@UAR@goodoutput % lineno.sty has used \if@tempswa. +\chardef\@UAR@vl=45 +% <- Latin `vl' is written `ul' in critical editions. +\global\holdinginserts\@UAR@vl % TODO!? +\let\@tempa\output % giving up reference to previous \output . +\newtoks\output +\output\expandafter{\the\@tempa} +\let\@UAR@output\output +\@tempa{% + \@UAR@goodoutputtrue + \ifnum\holdinginserts=\@UAR@vl + \ifnum\outputpenalty>-\@Mii + \@UAR@goodoutputfalse + \else + \ifnum\outputpenalty<-\@UAR@Mv % was \@Miv % \@Miii breaks. + \@UAR@goodoutputfalse + \fi + \fi + \fi + \if@UAR@goodoutput + \the\@UAR@output + \ifnum\holdinginserts=-\@UAR@vl + \global\holdinginserts\@UAR@vl + \fi + \else + \unvbox\@cclv + \global\holdinginserts-\@UAR@vl + \ifnum\outputpenalty=\@M \else + \penalty\outputpenalty + \fi + \fi +} +% v0.3, user switch: +\newcommand\releasefloats{% + \ifnum\holdinginserts=\@UAR@vl + \global\holdinginserts\z@ \fi} +\newcommand\tamefloats{\global\holdinginserts\@UAR@vl} +\endinput + +* INTRODUCTION: * + +PURPOSE/WARNING: +Experts know well that \@reinserts in LaTeX's \@specialoutput -- +which handles floats (figures, tables) and \marginpar's -- may +cause wrong order of footnote splits or output of footnotes on +unnecessarily late pages. Disabling \@reinserts or dropping it, +as David Kastrup recommends in latex/3541, would require +additional efforts. TeX3 was equipped with \holdinginserts to +deal with problems of this kind. Yet LaTeX has still not made use +of it, since it seems that this would still require redesigning +LaTeX's output routine entirely. Here is an experimental, simple +fix (!?). It replaces the problem by another one, yet the new +one might show up more rarely or might easier be dealt with by +non-expert users -- I would like to know. (I have made a file +newbug.tex to demonstrate a possible effect of the problem, yet +it is not very unrealistic). + +The new problem will not occur with single-line \marginpar's +(in different lines -- paragraph numbers, e.g.) -- for such +purposes the package may be valuable indeed. + +Note that this package doesn't help you if you neither use +\marginpar nor figures nor tables. The bug shows up in very +special situations only -- e.g., many footnotes, or large ones. +It may often be avoidable by moving the \marginpar or figure +or table in the code a little across the suffering \footnote. +The present package may rather be considered a contribution to +discussion on the problem. +(I have accidentally learnt about the problem with critical +editions, where there are many footnotes per page, and with an +implementation that used a modified \marginpar mechanism two +times for each note.) + +The package may be incompatible with other packages doing the +same thing -- if you need the other one, I suppose you don't +need the present one. I am just working at making lineno.sty +compatible with the present package. + +Note for non-wizards: `latex/3208', `latex/3370', `latex/3541', +and `latex/3719' refer to relevant bug reports on the LaTeX Bugs +Data Base, + + http://www.latex-project.org/cgi-bin/ltxbugs2html . + +USAGE: +Just load the package. You can use \releasefloats anywhere in your +files for (kind of) reinstalling the situation without +tameflts.sty (for a passage where it works badly); after this you +can reinstall the tamefltos.sty function by \tamefloats. Both +commands act globally. + +MORE INFORMATIONS: +In the recent days, there was an intense discussion of the +matter on the LaTeX-L e-mail list. + +WELCOME: +Suggestions on almost everything, especially implementation, +different algorithms, different names; demo files; where, how, +whether to present these experiments. + + +* ACKNOWLEDGEMENTs / PRESENT IMPLEMENTATION: * + +The basic idea is, like in latex/3719, to have \holdinginserts>0 +unless we are sure that footnotes actually are output, i.e., the +output routine will empty the \footins box (and \@kludgeins, for +\enlargethispage). The problem stems from LaTeX's \@reinserts +which in effect moves \footins and \@kludgeins inserts down the +main vertical list. + +The implementation is a variant of how lineno.sty, say v3.02ff., +using \holdinginserts, due to Stephan I. Boettcher. +Particular purposes are here: As compared with the proposal +in latex/3719, the implementation is intended to work relatively +independently of other changes of the output routine, maybe due +to different LaTeX versions or due to packages like longtable. +It is even intended that it doesn't conflict with uses of +\holdinginserts by other packages or a future LaTeX version, but +it is not clear to me how probably this works. %% TODO +With version v0.3 I'm neither sure about \releasefloats and +\tamefloats. %% TODO + +The problem that the implementation introduces is the following. +The float mechanism measures the \footins box to decide about +placement of floats. Now, with \holdinginserts>0 the \footins box +is "spuriously" empty. Floats may thus come too early in the sense +that one would have preferred that footnotes had been printed. +I have made a file newbug.tex to demonstrate an effect of this. + +One further difference to the proposal in latex/3719 is that +\holdinginserts is decreased for \clearpage here. + +A problem discussed on LaTeX-L is whether/how +\penalty\outputpenalty should be used. The present proposal is +just what lineno.sty has done when I found it. + +\@reinserts is neither defined away nor circumvented, it will +just find that there is nothing to reinsert. + +You see from the code that the package doesn't hold back +insertions with output penalties -10002 and -10003 only, where +\@reinserts is met. It would not work this way (the page builder +stops working), and David Kastrup seems to address the reason in +latex/3541, which I don't exactly know. So insertions are held +back with any fake \output call, so also with +\outputpenalty=-10004 and -- v0.3, for Mats Dahlgren's floatftl +-- \outputpenalty=-10005, where \@reinserts does not occur. The +floatftl documentation mentions that floatftl also had problems +with footnotes. The demo file fltfltdk.tex indicates that the +package solves the problem, although I don't exactly know why. + +v0.2 improves interaction with other packages that change the +output routine, due to David Kastrup (LaTeX-L list). Unlike in +lineno.sty, the number of the token register allocated by +\newtoks\output is stored by a control sequence. The output +(sub-)routine defined here uses the latter instead of \output. +Otherwise, a package loaded later may try the same trick, to the +effect that it puts a (would-be) output routine into a token +register that will never be read, while \the\output still +contains what the present package found in \output, although +\output will refer to another register than at the end of the +present package. +(The routine may be a subroutine, the package may be loaded +after another one using the same trick, then the present one +does not change the content of the token parameter which "naked" +TeX calls `\output'.) +The previous \output is now (v0.2) referred to by just \@tempa. +Maintaining the possibility of referring to TeX's built-in token +parameter (when another package uses the trick) would need an +agreement and additional effort. To do so, I would suggest: + \@ifundefined{@@output}{\let\@@output\output}{} . + + +* HISTORY of VERSIONS: * +v0.1 2005/04/01 Sent to LaTeX-L. +v0.2 2005/04/04 Mentions of existing demo files; several + changes of wordings; one \vl -> \@vl; + one = to \ifnum; \@tempa and \@UAR@output for + \output trick; extended explanations of + implementation. Mentioning Frank Mittelbach + was erroneous, corrected. Sent to LaTeX-L and + CTAN. +v0.3 2005/04/08 \@UAR@Mv, \@vl -> \@UAR@vl, \doreinserts. + Sent to CTAN and Mats Dahlgren. +v0.4 2005/04/17 Renamed noreins -> tameflts, \doreinserts + -> \releasefloats, \noreinserts -> + \tamefloats, changed explanations on + implementation. +v0.41 2005/04/21 Additional remarks on compatibility and the + bug introduced. +v0.42 2005/04/26 Adjustment of documentation to lineno.sty. diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 8c37d9dbf05..2a3de4432fa 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -388,7 +388,7 @@ my @TLP_working = qw( tabfigures tableaux tablefootnote tablists tablor tabls tabto-generic tabto-ltx tabu tabularborder tabularcalc tabularew - tabulars-e tabulary tabvar tagging talk + tabulars-e tabulary tabvar tagging talk tamefloats tamethebeast tapir tcldoc tcolorbox tdclock tdsfrmath technics ted templates-fenn templates-sommer tengwarscript tensor termcal termlist teubner @@ -438,7 +438,7 @@ my @TLP_working = qw( velthuis venn venturisadf verbasef verbatimbox verbatimcopy verbdef verbments verse version versions vertbars vhistory visualfaq vmargin vntex vocaltract volumes vpe vruler vwcol - wadalab wallpaper warning warpcol was webguide widetable williams + wadalab wallpaper warning warpcol was wasysym webguide widetable williams wnri wnri-latex wordlike wrapfig wsuipa xargs xcite xcolor xcomment xdoc diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 6407da1924d..76ab67b62d7 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -238,6 +238,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'computer-typesetting-using-latex', "die 'skipping, nosource'", 'concmath-fonts', "&MAKEflatten", 'concmath', "&MAKEnosymlinks", + 'conferences', "die 'skipping, container directory'", 'context', "&MAKEcontext", 'context-algorithmic', "&MAKEcopy", 'context-account', "&MAKEcopy", @@ -856,6 +857,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'skak', "&MAKEflatten", 'slashbox', "die 'skipping, noinfo license, c.1993'", 'slidenotes', "die 'skipping, nonfree'", + 'smallcap', "die 'skipping, questionable license, 1996'", 'smflatex', "die 'skipping, nosource'", 'softmaker-freefonts', "die 'skipping, requires nonfree fonts'", 'songs', "die 'skipping, requires binary'", @@ -955,6 +957,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'upmethodology',"&MAKEflatten", 'varioref', "die 'skipping, use latex[-tds]'", 'vector', "die 'skipping, noinfo license, 1994'", + 'vdm', "die 'skipping, noinfo license, 1994, '", 'velthuis', "&MAKEcopy", 'venturisadf', "&MAKEcopy", 'verdana', "die 'skipping, support for nonfree font'", @@ -962,6 +965,7 @@ chomp ($Build = `cd $Master/../Build/source && pwd`); 'vhistory', "&MAKEflatten", 'vicentino', "die 'skipping, nonfree license'", 'view_print_ps_pdf', "die 'skipping, three-char cmd name for ruby script?'", + 'viiptar', "die 'skipping, 1998, await request'", 'vita', "die 'skipping, nonfree license'", 'voss-de', "&MAKEvossde", 'vpp', "die 'skipping, not self-locating, three-char name for ruby script?'", @@ -5028,7 +5032,7 @@ sub POSTzhspacing { # sub readconfig { - my ($base,$dir,$ext) = fileparse ($0,'\.pl'); + my ($base,$dir,$ext) = fileparse ($0, '\.pl'); my $configFileName = "$dir/$base-config.pl"; $configFileName = $ENV{"CTAN2TDS_CONFIG"} || $configFileName; diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index feb5bc98839..28fa0129276 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -737,6 +737,7 @@ depend tabularew depend tabulary depend tagging depend talk +depend tamefloats depend tcldoc depend tcolorbox depend tdclock diff --git a/Master/tlpkg/tlpsrc/tamefloats.tlpsrc b/Master/tlpkg/tlpsrc/tamefloats.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/tamefloats.tlpsrc |