tl2017 luatex discretionaries
[latex2e.git] / latex2e-20170101 / doc / ltnews.tex
blobc229842e8c1b4310e555fd54cc1f6559057b7cfc
1 % \iffalse meta-comment
3 % Copyright 2006, 2009, 2011, 2014 Heiko Oberdiek
4 % Copyright 2014 The LaTeX3 Project
5 %
6 % This file is part of the LaTeX base system.
7 % -------------------------------------------
9 % It may be distributed and/or modified under the
10 % conditions of the LaTeX Project Public License, either version 1.3c
11 % of this license or (at your option) any later version.
12 % The latest version of this license is in
13 % http://www.latex-project.org/lppl.txt
14 % and version 1.3c or later is part of all distributions of LaTeX
15 % version 2005/12/01 or later.
17 % This file has the LPPL maintenance status "maintained".
19 % 2006/06/02 v1.0: First version.
20 % 2009/09/25 v1.1: \usepackage disabled.
21 % 2011/07/01 v1.2: Fixes.
22 % 2014/02/30 v1.3:
23 % * Update for LaTeX 2014/05/01.
24 % * Fix for anchor positions of issue titles.
25 % 2014/05/15 v1.4:
26 % * Updates for ltnews21.tex.
27 % 2014/11/14 v1.4a:
28 % * LaTeX Project version
29 % 2015/02/16 v1.4b:
30 % * Fix TOC issue
31 % \fi
33 \NeedsTeXFormat{LaTeX2e}
34 \ProvidesFile{ltnews.tex}%
35 [2015/02/16 v1.4b Master file for ltnews*.tex (LaTeX Project)]
36 \providecommand*{\lastissue}{26}
37 \InputIfFileExists{ltnews-lastissue.cfg}{}{}
39 \RequirePackage{ifpdf}
40 \ifpdf
41 % overwrite nasty stuff of ltnews.cfg
42 % (use of hyperref for this would also support other drivers)
43 \pdfinfo{%
44 /Title(LaTeX News)%
45 /Subject(Issues 1--\lastissue)%
46 /Author(The LaTeX Project)%
47 /Creator(LaTeX)%
49 \newtoks\pdfinfo
50 \else
51 \AtBeginDocument{%
52 \hypersetup{%
53 pdftitle={LaTeX News},%
54 pdfsubject={Issues 1\textendash\lastissue},%
55 pdfauthor={The LaTeX Project},%
56 pdfcreator={LaTeX}%
59 \fi
61 \RequirePackage{lmodern}
62 \RequirePackage[T1]{fontenc}
63 \RequirePackage{hologo}
65 \documentclass{ltnews}
67 \expandafter
68 \DeclareRobustCommand\expandafter*\expandafter\small\expandafter{\small}
70 \RequirePackage{hyperref}
71 \hypersetup{colorlinks}
72 \RequirePackage{bookmark}
74 \makeatletter
76 \newcounter{issue}
77 \renewcommand*{\theissue}{%
78 \ifnum\value{issue}<10 0\fi
79 \number\value{issue}%
82 \newcommand*{\MonthJanuary}{01}
83 \newcommand*{\MonthFebruary}{02}
84 \newcommand*{\MonthMarch}{03}
85 \newcommand*{\MonthApril}{04}
86 \newcommand*{\MonthMay}{05}
87 \newcommand*{\MonthJune}{06}
88 \newcommand*{\MonthJuly}{07}
89 \newcommand*{\MonthAugust}{08}
90 \newcommand*{\MonthSeptember}{09}
91 \newcommand*{\MonthOctober}{10}
92 \newcommand*{\MonthNovember}{11}
93 \newcommand*{\MonthDecember}{12}
94 \newcommand*{\printissue}{%
95 Issue %
96 \texorpdfstring{\number\value{issue}}{\theissue}, %
97 \texorpdfstring{\@month\space\@year}{\@year/\@nameuse{Month\@month}}%
99 \let\l@part\l@section
100 \let\l@section\l@subsection
101 \let\l@subsection\l@subsubsection
102 \let\l@subsubsection\l@paragraph
103 \let\l@paragraph\l@subparagraph
105 \newcommand*{\makefirsttitle}{%
106 \twocolumn[{%
107 \parbox[t][4\baselineskip]{\textwidth}{%
108 \@titlefont\@title, Issues 1--\lastissue
113 % table of contents with underlined links
114 \iffalse % disable if option colorlinks is used
115 \@ifpackagelater{hyperref}{2006/06/01}{%
116 \newcommand*{\saved@tableofcontents}{}%
117 \let\saved@tableofcontents\tableofcontents
118 \renewcommand*{\tableofcontents}{%
119 \begingroup
120 \hypersetup{pdfborderstyle={/S/U/W 1}}%
121 \saved@tableofcontents
122 \endgroup
127 % -- provide command introduced in new release
128 % so this typesets with an old format
129 \DeclareTextCommandDefault\textcommabelow[1]
130 {\hmode@bgroup\ooalign{\null#1\crcr\hidewidth\raise-.31ex
131 \hbox{\check@mathfonts\fontsize\ssf@size\z@
132 \math@fontsfalse\selectfont,}\hidewidth}\egroup}
133 \DeclareTextCommandDefault\textcommaabove[1]{%
134 \hmode@bgroup
135 \ooalign{%
136 \hidewidth
137 \raise.7ex\hbox{%
138 \check@mathfonts\fontsize\ssf@size\z@\math@fontsfalse\selectfont`%
140 \hidewidth\crcr
141 \null#1\crcr
143 \egroup
146 \makeatother
148 \begin{document}
150 %%% Title and Table of Contents
152 \makefirsttitle
153 \pdfbookmark[0]{\contentsname}{toc}
154 \tableofcontents
155 \clearpage
157 %%% Issues
159 \begingroup
160 \makeatletter
161 \renewcommand*{\usepackage}[2][]{%
162 \begingroup
163 \def\x{#1|#2}%
164 \def\y{T1|fontenc}%
165 \ifx\x\y
166 \else
167 \def\y{|lmodern,url}%
168 \ifx\x\y
169 \else
170 \def\y{|lmodern,url,hologo}%
171 \ifx\x\y
172 \else
173 \@latex@error{ltnews.tex: \string\usepackage[#1]{#2} found}\@ehc
177 \endgroup
179 \renewcommand*{\documentclass}[2][]{%
180 \setcounter{footnote}{0}%
181 \gobbleopt
183 \newcommand*{\gobbleopt}[1][]{}%
184 \let\org@twocolumn\twocolumn
185 \renewenvironment{document}{%
186 \clearpage
187 \ifnum\@issue=20 %
188 \addtocontents{toc}{\protect\setcounter{tocdepth}{5}}%
189 \addtocontents{toc}{%
190 \protect\makeatletter
192 \addtocontents{toc}{%
193 \let\protect\saved@l@paragraph\protect\l@paragraph
195 \addtocontents{toc}{%
196 \let\protect\l@paragraph\protect\l@subsection
199 \ifnum\@issue=\lastissue\space
200 \addtocontents{toc}{%
201 \let\protect\l@paragraph\protect\saved@l@paragraph
203 \def\toclevel@subsection{1}%
204 \def\toclevel@subsubsection{2}%
205 \addtocontents{toc}{\protect\setcounter{tocdepth}{4}}%
206 \renewcommand*{\tableofcontents}{%
207 \section*{\contentsname}%
208 \@starttoc{toc\lastissue}%
210 \let\saved@addtocontents\addtocontents
211 \renewcommand*{\addtocontents}[2]{%
212 \saved@addtocontents{##1}{##2}%
213 \def\temp@toc{toc}%
214 \def\temp@param{##1}%
215 \ifx\temp@toc\temp@param
216 \saved@addtocontents{toc\lastissue}{##2}%
219 \let\l@subsubsection\l@subsection
220 \let\l@subsection\l@section
221 \let\l@section\l@part
222 \let\l@part\@gobbletwo
224 \def\twocolumn[{%
225 \let\twocolumn\org@twocolumn
226 \org@twocolumn[%
227 {% because of optional argument of \twocolumn
228 \pdfbookmark[0]{\printissue}{issue\theissue}%
230 \begingroup
231 \let\WriteBookmarks\relax
232 \@firstofone{% inside opt. arg. of \twocolumn: protect "]"
233 \renewcommand*{\Hy@writebookmark}[5]{}%
235 \phantomsection
236 \addcontentsline{toc}{part}{\printissue}%
237 \endgroup
240 \clearpage
242 \makeatother
243 \loop
244 \ifnum\value{issue}<\lastissue
245 \stepcounter{issue}%
246 \input{ltnews\theissue}%
247 \repeat
248 \stepcounter{issue}%
249 \makeatletter
250 \IfFileExists{ltnews\theissue}{%
251 \@latex@error{\jobname.tex is out of date,\MessageBreak
252 there is `ltnews\theissue.tex'%
253 }\@ehc
254 }{}%
255 \makeatother
256 \endgroup
258 \end{document}