summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tudscr/source/tudscr-twocolfix.dtx
blob: 26e9c62026878f1609e677a034940b54a3bebd79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
% \CheckSum{214}
% \iffalse meta-comment
%
%  TUD-Script -- Corporate Design of Technische Universität Dresden
% ----------------------------------------------------------------------------
%
%  Copyright (C) Falk Hanisch <hanisch.latex@outlook.com>, 2012-2020
%
% ----------------------------------------------------------------------------
%
%  This work may be distributed and/or modified under the conditions of the
%  LaTeX Project Public License, version 1.3c of the license. The latest
%  version of this license is in http://www.latex-project.org/lppl.txt and
%  version 1.3c or later is part of all distributions of LaTeX 2005/12/01
%  or later and of this work. This work has the LPPL maintenance status
%  "author-maintained". The current maintainer and author of this work
%  is Falk Hanisch.
%
% ----------------------------------------------------------------------------
%
%  Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz
%  in der Version 1.3c, verteilt und/oder verändert werden. Die aktuelle
%  Version dieser Lizenz ist http://www.latex-project.org/lppl.txt und
%  Version 1.3c oder später ist Teil aller Verteilungen von LaTeX 2005/12/01
%  oder später und dieses Werks. Dieses Werk hat den LPPL-Verwaltungs-Status
%  "author-maintained", wird somit allein durch den Autor verwaltet. Der
%  aktuelle Verwalter und Autor dieses Werkes ist Falk Hanisch.
%
% ----------------------------------------------------------------------------
%
% \fi
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \iffalse
%%% From File: tudscr-twocolfix.dtx
%<*dtx>
% \fi
%
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\ProvidesFile{tudscr-twocolfix.dtx}[2019/06/28 v2.06 TUD-Script\space%
%
% \iffalse
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{twocolfix}[%
%<*package>
%!TUD@Version
%</package>
%<package>  package
%<*dtx|package>
% \fi
  (twocolumn layout bugfix)%
]
% \iffalse
%</dtx|package>
%<*dtx>
\documentclass[english,ngerman,xindy]{tudscrdoc}
\iftutex
  \usepackage{fontspec}
\else
  \usepackage[T1]{fontenc}
  \usepackage[ngerman=ngerman-x-latest]{hyphsubst}
\fi
\usepackage{babel}
\usepackage{tudscrfonts}
\KOMAoptions{parskip=half-}
\usepackage{bookmark}
\usepackage[babel]{microtype}

\CodelineIndex
\RecordChanges
\GetFileInfo{tudscr-twocolfix.dtx}
\title{\file{\filename}}
\author{Falk Hanisch\qquad\expandafter\mailto\expandafter{\tudscrmail}}
\date{\fileversion\nobreakspace(\filedate)}

\begin{document}
  \maketitle
  \tableofcontents
  \DocInput{\filename}
\end{document}
%</dtx>
% \fi
%
% \selectlanguage{ngerman}
%
% \changes{v2.05}{2016/04/25}{Überprüfen der Definition von \cs{@topnewpage}
%   des \LaTeXe-Kernels}^^A
%
% \section{Das Paket \pkg{twocolfix} -- Bugfix für den zweispaltigen Satz}
%
% Der \LaTeXe-Kernel enthält einen Fehler, der Kapitelüberschriften im
% zweispaltigen Layout höher setzt, als im einspaltigen. Zwar ist der 
% \hrfn{http://latex-project.org/cgi-bin/ltxbugs2html?pr=latex/3126}{Fehler}
% schon länger bekannt, allerdings noch nicht in den \LaTeXe-Kernel übernommen
% worden. Das Paket \pkg{twocolfix} soll das Problem beheben. Eine Integration
% des Bugfixes in \KOMAScript{} wurde bereits bei Markus Kohm angefragt, jedoch
% \hrfn{http://www.komascript.de/node/1681}{von ihm nicht weiter verfolgt}.
%
% \ToDo{Als eingenständiges Paket herauslösen}[v2.??]
% \ToDo{CheckCommand verwenden}[v2.??]
%
% \StopEventually{\PrintIndex\PrintChanges\PrintToDos}
%
% \iffalse
%<*package>
% \fi
%
% Es wird der fehlerhafte Befehl aus dem \LaTeXe-Kernel neu definiert. 
% Allerdings definieren die \KOMAScript-Klassen das Makro \cs{@topnewpage} 
% um und sichern vorher das Original in \cs{scr@topnewpage}. Daher wird der 
% neue Befehl erst temporär definiert. 
%    \begin{macrocode}
\long\def \@tempa [#1]{%
  \@nodocument%
  \@next\@currbox\@freelist{}{}%
  \global \setbox\@currbox%
    \vbox {%
      \break%
      \prevdepth\z@%
      \begingroup%
      \normalcolor%
      \hsize\textwidth%
%    \end{macrocode}
% Damit der Inhalt des optionale Argumentes mit den gleichen Absatzeinstellungen
% gesetzt wird, werden diese nach \cs{@parboxrestore} für \KOMAScript-Klassen
% wiederhergestellt.
%    \begin{macrocode}
      \@parboxrestore%
      \ifcsname KOMAClassName\endcsname%
        \KOMAoptionOf[\KOMAoption{parskip}]{\KOMAClassFileName}{parskip}%
      \fi%
      \col@number \@ne%
      \ignorespaces #1\par%
      \ifdim\parskip>\z@\null\fi%
      \vskip -\dbltextfloatsep%
      \endgroup%
      \ifdim\parskip>\z@\vskip\parskip\else\null\fi%
      \vskip -\topskip%
  }%
  \begingroup%
    \splitmaxdepth\maxdepth \splittopskip\topskip%
    \setbox\@tempboxa \vsplit\@currbox to\z@%
  \endgroup%
  \ifdim \ht\@currbox>\textheight%
    \ht\@currbox \textheight%
  \fi%
  \global \count\@currbox \tw@%
  \@tempdima -\ht\@currbox%
  \advance \@tempdima -\dbltextfloatsep%
  \global \advance \@colht \@tempdima%
  \ifx \@dbltoplist \@empty%
  \else%
    \@latexerr{Float(s) lost}\@ehb%
    \let \@dbltoplist \@empty%
  \fi%
  \@cons \@dbltoplist \@currbox%
  \global \@dbltopnum \m@ne%
  \ifdim \@colht<2.5\baselineskip%
    \@latex@warning@no@line {Optional argument of \noexpand\twocolumn
                too tall on page \thepage}%
    \@emptycol%
    \if@firstcolumn%
    \else%
      \@emptycol%
    \fi%
  \else%
    \global \vsize \@colht%
    \global \@colroom \@colht%
    \@floatplacement%
  \fi%
}
%    \end{macrocode}
% Um eine Änderung am \LaTeXe-Kernel feststellen zu können, wird auf die zum
% Zeitpunkt des Paketes aktuelle Definition von \cs{@topnewpage} geprüft.
%    \begin{macrocode}
\long\def\@tempb[#1]{%
  \@nodocument
  \@next\@currbox\@freelist{}{}%
  \global \setbox\@currbox
    \color@vbox
      \normalcolor
      \vbox {%
        \hsize\textwidth
        \@parboxrestore
        \col@number \@ne
        #1%
        \vskip -\dbltextfloatsep
      }%
    \color@endbox
  \ifdim \ht\@currbox>\textheight
    \ht\@currbox \textheight
  \fi
  \global \count\@currbox \tw@
  \@tempdima -\ht\@currbox
  \advance \@tempdima -\dbltextfloatsep
  \global \advance \@colht \@tempdima
  \ifx \@dbltoplist \@empty
  \else
    \@latexerr{Float(s) lost}\@ehb
    \let \@dbltoplist \@empty
  \fi
  \@cons \@dbltoplist \@currbox
  \global \@dbltopnum \m@ne
  \ifdim \@colht<2.5\baselineskip
    \@latex@warning@no@line {Optional argument of \noexpand\twocolumn
                        too tall on page \thepage}%
    \@emptycol
    \if@firstcolumn
    \else
      \@emptycol
    \fi
  \else
    \global \vsize \@colht
    \global \@colroom \@colht
    \@floatplacement
  \fi
}
%    \end{macrocode}
% \begin{macro}{\@topnewpage}
% \begin{macro}{\scr@topnewpage}
% Nachdem der neue Befehl sowie die Definition aus dem \LaTeXe-Kernel zuerst 
% temporär definiert wurden, wird nun abhängig von der aktiven Klasse der
% notwendige Befehl mit der neuen Definition überschrieben.
%    \begin{macrocode}
\ifx\scr@topnewpage\@undefined
  \@check@eq\@topnewpage\@tempb%
  \let\@topnewpage\@tempa%
\else
  \@check@eq\scr@topnewpage\@tempb%
  \let\scr@topnewpage\@tempa%
\fi
%    \end{macrocode}
% \end{macro}^^A \scr@topnewpage
% \end{macro}^^A \@topnewpage
%
% \iffalse
%</package>
% \fi
%
% \Finale
%
\endinput