summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/base/ltnews.tex
blob: 9bb2a8da5679b8fd24f7ecbd2ccacf0dc9d5b499 (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
% \iffalse meta-comment
%
% Copyright 2006, 2009, 2011, 2014 Heiko Oberdiek
% Copyright 2014 The LaTeX3 Project
% 
% This file is part of the LaTeX base system.
% -------------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% 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
% version 2005/12/01 or later.
%
% This file has the LPPL maintenance status "maintained".
%
% 2006/06/02 v1.0: First version.
% 2009/09/25 v1.1: \usepackage disabled.
% 2011/07/01 v1.2: Fixes.
% 2014/02/30 v1.3:
%  * Update for LaTeX 2014/05/01.
%  * Fix for anchor positions of issue titles.
% 2014/05/15 v1.4:
%  * Updates for ltnews21.tex.
% 2014/11/14 v1.4a:
%  * LaTeX Project version
% 2015/02/16 v1.4b:
%  * Fix TOC issue
% \fi

\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{ltnews.tex}%
  [2015/02/16 v1.4b Master file for ltnews*.tex (LaTeX Project)]
\providecommand*{\lastissue}{24}
\InputIfFileExists{ltnews-lastissue.cfg}{}{}

\RequirePackage{ifpdf}
\ifpdf
  % overwrite nasty stuff of ltnews.cfg
  % (use of hyperref for this would also support other drivers)
  \pdfinfo{%
    /Title(LaTeX News)%
    /Subject(Issues 1--\lastissue)%
    /Author(The LaTeX Project)%
    /Creator(LaTeX)%
  }
  \newtoks\pdfinfo
\else
  \AtBeginDocument{%
    \hypersetup{%
      pdftitle={LaTeX News},%
      pdfsubject={Issues 1\textendash\lastissue},%
      pdfauthor={The LaTeX Project},%
      pdfcreator={LaTeX}%
    }%
  }%
\fi

\RequirePackage{lmodern}
\RequirePackage[T1]{fontenc}
\RequirePackage{hologo}

\documentclass{ltnews}

\expandafter
\DeclareRobustCommand\expandafter*\expandafter\small\expandafter{\small}

\RequirePackage{hyperref}
\hypersetup{colorlinks}
\RequirePackage{bookmark}

\makeatletter

\newcounter{issue}
\renewcommand*{\theissue}{%
  \ifnum\value{issue}<10 0\fi
  \number\value{issue}%
}

\newcommand*{\MonthJanuary}{01}
\newcommand*{\MonthFebruary}{02}
\newcommand*{\MonthMarch}{03}
\newcommand*{\MonthApril}{04}
\newcommand*{\MonthMay}{05}
\newcommand*{\MonthJune}{06}
\newcommand*{\MonthJuly}{07}
\newcommand*{\MonthAugust}{08}
\newcommand*{\MonthSeptember}{09}
\newcommand*{\MonthOctober}{10}
\newcommand*{\MonthNovember}{11}
\newcommand*{\MonthDecember}{12}
\newcommand*{\printissue}{%
  Issue %
  \texorpdfstring{\number\value{issue}}{\theissue}, %
  \texorpdfstring{\@month\space\@year}{\@year/\@nameuse{Month\@month}}%
}
\let\l@part\l@section
\let\l@section\l@subsection
\let\l@subsection\l@subsubsection
\let\l@subsubsection\l@paragraph
\let\l@paragraph\l@subparagraph

\newcommand*{\makefirsttitle}{%
  \twocolumn[{%
    \parbox[t][4\baselineskip]{\textwidth}{%
      \@titlefont\@title, Issues 1--\lastissue
    }%
  }]%
}

% table of contents with underlined links
\iffalse % disable if option colorlinks is used
\@ifpackagelater{hyperref}{2006/06/01}{%
  \newcommand*{\saved@tableofcontents}{}%
  \let\saved@tableofcontents\tableofcontents
  \renewcommand*{\tableofcontents}{%
    \begingroup
      \hypersetup{pdfborderstyle={/S/U/W 1}}%
      \saved@tableofcontents
    \endgroup
  }%
}{}
\fi

% -- provide command introduced in new release
%    so this typesets with an old format
\DeclareTextCommandDefault\textcommabelow[1]
  {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\raise-.31ex
   \hbox{\check@mathfonts\fontsize\ssf@size\z@
   \math@fontsfalse\selectfont,}\hidewidth}\egroup}
\DeclareTextCommandDefault\textcommaabove[1]{%
    \hmode@bgroup
    \ooalign{%
      \hidewidth
      \raise.7ex\hbox{%
        \check@mathfonts\fontsize\ssf@size\z@\math@fontsfalse\selectfont`%
      }%
     \hidewidth\crcr
     \null#1\crcr
    }%
    \egroup
  }

\makeatother

\begin{document}

%%% Title and Table of Contents

\makefirsttitle
\pdfbookmark[0]{\contentsname}{toc}
\tableofcontents
\clearpage

%%% Issues

\begingroup
  \makeatletter
  \renewcommand*{\usepackage}[2][]{%
    \begingroup
      \def\x{#1|#2}%
      \def\y{T1|fontenc}%
      \ifx\x\y
      \else
        \def\y{|lmodern,url}%
        \ifx\x\y
        \else
          \def\y{|lmodern,url,hologo}%
          \ifx\x\y
          \else
            \@latex@error{ltnews.tex: \string\usepackage[#1]{#2} found}\@ehc
          \fi
        \fi
      \fi
    \endgroup
  }%
  \renewcommand*{\documentclass}[2][]{%
    \setcounter{footnote}{0}%
    \gobbleopt
  }%
  \newcommand*{\gobbleopt}[1][]{}%
  \let\org@twocolumn\twocolumn
  \renewenvironment{document}{%
    \clearpage
    \ifnum\@issue=20 %
      \addtocontents{toc}{\protect\setcounter{tocdepth}{5}}%
      \addtocontents{toc}{%
        \protect\makeatletter
       }%
       \addtocontents{toc}{%
         \let\protect\saved@l@paragraph\protect\l@paragraph
       }%
       \addtocontents{toc}{%
         \let\protect\l@paragraph\protect\l@subsection
       }%
    \fi
    \ifnum\@issue=\lastissue\space
      \addtocontents{toc}{%
        \let\protect\l@paragraph\protect\saved@l@paragraph
      }%
      \def\toclevel@subsection{1}%
      \def\toclevel@subsubsection{2}%
      \addtocontents{toc}{\protect\setcounter{tocdepth}{4}}%
      \renewcommand*{\tableofcontents}{%
        \section*{\contentsname}%
        \@starttoc{toc\lastissue}%
      }%
      \let\saved@addtocontents\addtocontents
      \renewcommand*{\addtocontents}[2]{%
        \saved@addtocontents{##1}{##2}%
        \def\temp@toc{toc}%
        \def\temp@param{##1}%
        \ifx\temp@toc\temp@param
          \saved@addtocontents{toc\lastissue}{##2}%
        \fi
      }%
      \let\l@subsubsection\l@subsection
      \let\l@subsection\l@section
      \let\l@section\l@part
      \let\l@part\@gobbletwo
    \fi
    \def\twocolumn[{%
      \let\twocolumn\org@twocolumn
      \org@twocolumn[%
      {% because of optional argument of \twocolumn
        \pdfbookmark[0]{\printissue}{issue\theissue}%
      }%
      \begingroup
        \let\WriteBookmarks\relax
        \@firstofone{% inside opt. arg. of \twocolumn: protect "]"
          \renewcommand*{\Hy@writebookmark}[5]{}%
        }%
        \phantomsection
        \addcontentsline{toc}{part}{\printissue}%
      \endgroup
    }%
  }{%
    \clearpage
  }%
  \makeatother
  \loop
  \ifnum\value{issue}<\lastissue
    \stepcounter{issue}%
    \input{ltnews\theissue}%
  \repeat
  \stepcounter{issue}%
  \makeatletter
  \IfFileExists{ltnews\theissue}{%
    \@latex@error{\jobname.tex is out of date,\MessageBreak
      there is `ltnews\theissue.tex'%
    }\@ehc
  }{}%
  \makeatother
\endgroup

\end{document}