summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/latex-tds/tex/ltnews.tex
blob: 2cdacedff2aad435834b7df533d1dea47936f9df (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{ltnews.tex}%
  [2006/06/02 v1.0 Master file for ltnews*.tex (HO)]
%
% Copyright 2006 Heiko Oberdiek
%
% This file is part of project `latex-tds'.
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% 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 work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Heiko Oberdiek.
%
% See `readme.txt' for a list of all files belonging to the
% project `latex-tds' and additional information.
%
\providecommand*{\lastissue}{17}

\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

\documentclass{ltnews}

\RequirePackage{hyperref}
\hypersetup{colorlinks}

\makeatletter

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

\newcommand*{\MonthJune}{06}
\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
\makeatother

\begin{document}

%%% Title and Table of Contents

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

%%% Issues

\begingroup
  \renewcommand*{\documentclass}[2][]{%
    \setcounter{footnote}{0}%
    \gobbleopt
  }%
  \newcommand*{\gobbleopt}[1][]{}%
  \renewenvironment{document}{%
    \clearpage
    \pdfbookmark[0]{\printissue}{issue\theissue}%
    \begingroup
      \let\WriteBookmarks\relax
      \phantomsection
      \addcontentsline{toc}{part}{\printissue}%
    \endgroup
  }{%
    \clearpage
  }%
  \loop
  \ifnum\value{issue}<\lastissue
    \stepcounter{issue}%
    \input{ltnews\theissue}%
  \repeat
\endgroup

\end{document}