summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/lps/lps.dtx
blob: 7fa242778623e302573b37e2175c21c818516042 (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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
% \iffalse
% 
% file: lps.dtx
% Copyright 2005, 2006, 2007 Gustavo Cevolani
% Gruppo Utilizzatori Italiani di TeX - GuIT - http://www.guit.sssup.it
% 
% This program is provided under the terms of the
% LaTeX Project Public License distributed from CTAN
% archives in directory macros/latex/base/lppl.txt.
% 
% Author: Gustavo Cevolani
%         at g.cevolani@gmail.com
%
% Version: 0.6
% 
% This work has the LPPL maintenance status "author-maintained".
% 
%<*driver>
\documentclass[11pt,a4paper]{ltxdoc}
\usepackage[italian,english]{babel}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[svgnames]{xcolor}
\usepackage{hyperref}
\hypersetup{%
  %pdftex = true,%
  pdfauthor={Gustavo Cevolani},%
  pdftitle={The lps class},%
  pdfsubject={LaTeX},%
  %bookmarks=true,%
  bookmarksnumbered=true,%
  bookmarksopen=true,%
  bookmarksopenlevel=0,%
  urlcolor=NavyBlue,%
  linkcolor=NavyBlue,%
  citecolor=black,%
  colorlinks=true,%
%  backref=true,%
%  hyperindex=true,%
  pdfhighlight=/P,%
  pdfstartview=FitH,%
  plainpages=false,
}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{lps.dtx}
\end{document}
%</driver>
% 
%<*template>
\documentclass{lps}
%%
%% User's packages:
%% \usepackage[italian]{babel}      % for italian language
%% \usepackage[ansinew]{inputenc}   % to insert special symbols on Windows systems
%% \usepackage[T1]{fontenc}         % standard encoding on Windows systems
%
\begin{document}
%% Article's information:
\Title{Title of the article}
\Author{Name Surname}
%% Author's information:
\Affiliation{Department of Philosophy\\ University of Trieste (Italy)}
\Email{n.surname@mail.it}
%% Issue's information:
%%\Volume{}
%%\Number{}
%%\Year{}
%%\FirstPage{}
%%
\maketitle
\tableofcontents
%% Keywords and abstract:
\Keywords{some, crucial, terms.}
\begin{abstract}
Summary of the article.
\end{abstract}
%%
%%%%%%%%%%%%%%%%%%%%%%%% Main text: %%%%%%%%%%%%%%%%%%%%%%%%
\section{First section}
Your article.
%%
\end{document}
%</template>
% \fi
% 
% \CheckSum{337}
% 
% \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         \~}
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% 
% \def\fileversion{0.6}
% \def\filedate{31 Mar 2007}
%
% \newcommand*{\pack}[1]{\textsf{#1}}%
% \newcommand*{\cod}[1]{\texttt{#1}}
% \newcommand{\lps}{\pack{lps}}
% \newcommand{\landps}{\emph{L\&PS}}
% \newcommand{\landpstext}{\emph{Logic \& Philosophy of Science}}
%
% \changes{v0.1}{2005/08/01}{Created \cod{lps.cls}.}
% \changes{v0.2}{2005/09/30}{Minor modifications.}
% \changes{v0.3}{2005/10/17}{First unofficial release (GuIT).}
% \changes{v0.4}{2005/10/18}{Layout modifications, empty fields warning added and minor changes (thanks to Enrigo Gregorio, GuIT).}
% \changes{v0.41}{2006/07/15}{Minor modifications.}
% \changes{v0.5}{2006/09/22}{Layout modifications.}
% \changes{v0.6}{2007/03/31}{Minor modifications. Additions: title page's footer, page rage in title page's header, small layout modifications.}
%
% \title{The \pack{lps} class:\\\Large layout for the \emph{Logic \& Philosophy of Science} journal\thanks{\protect\url{http://www.univ.trieste.it/~episteme/}}}
% \author{Gustavo Cevolani\thanks{Please report any error, comment or incompatibility with other \LaTeX\ packages to \href{mailto:g.cevolani@gmail.com}{\texttt{g.cevolani@gmail.com}}.}\thanks{Gruppo Utilizzatori Italiani di \TeX, \protect\url{http://www.guit.sssup.it}.}}
% \date{version \fileversion\\\filedate}
% 
% \maketitle
%
% \begin{abstract}\small
% The \lps\ class modifies the standard \LaTeX2e \pack{article} class 
% in order to comply with the \landps\ journal style specifications.
% \end{abstract}
%
% \begin{otherlanguage}{italian}
% \begin{abstract}\small
% La classe \lps\ modifica la classe \pack{article} standard e impagina automaticamente il documento secondo le specifiche della rivista \landpstext . \`E  sufficiente richiamare la classe (|\documentclass{lps}|) e specificare alcuni comandi obbligatori (|\Title|, |\Author|, |\Affiliation|, |\Email| e |\Keywords|) per ottenere un articolo nel formato richiesto a partire da qualsiasi sorgente \LaTeX\ standard. Gli altri nuovi comandi introdotti (|\Volume|, |\Number|, |\Year| e |\FirstPage|) si occupano delle informazioni editoriali relative al numero specifico della rivista.
% \end{abstract}
% \end{otherlanguage}
%
% \tableofcontents
%
% \section{Introduction}
%
% The \emph{Logic \& Philosophy of Science} journal (\landps\ for short) is an online academic publication edited at the University of Trieste (Italy).
% The \lps\ class allows \LaTeX\ authors to write their articles conforming to the standards of the journal.
%
% The home address of \landpstext\ is
% \begin{center}\url{http://www.univ.trieste.it/~episteme/}\end{center}
% and the last version of the present files can also be found at:
% \begin{center}\url{http://www.ctan.org/tex-archive/macros/latex/contrib}\end{center}
% or at:
% \begin{center}\url{http://www.univ.trieste.it/~episteme/latex_L&PS.htm}\end{center}
%
% \paragraph{Notice.} Since I am not a \TeX\ hacker, with few exceptions I wrote the class' code (see Section \ref{code}) using high-level \LaTeX\ commands. \href{mailto:g.cevolani@gmail.com}{Suggestions are welcome} on how to improve, simplify or correct the present version of the code.
% \paragraph{Acknowledgements.} The layout of \emph{Logic \& Philosophy of Science} was designed by Luca Tambolo. Thanks are due to the participants to the discussion forum and mailing list of GuIT (Gruppo Utilizzatori Italianti di \TeX), from which I learned much of what I know about \LaTeX. In particular, I am indebted to Enrico Gregorio for the many corrections to earlier versions of the code. I also thank ``B. A.'' for some good advice on the MiKTeX list on SourceForge.net.
%
% \subsection{Description of the class}
% The standard \landps\ page's dimensions are the following. The textblock (including headers and footers) is $155\times 172,795$\thinspace mm. This amounts to 39 lines of text, given the default font dimension and leading, which are 11\thinspace pt and 12.5\thinspace pt, respectively.   
% Since the document is designed for double-printing (twoside), the header is different for odd-numbered and even-numbered pages. Odd-numbered pages contain the author's name, even-numbered pages contain the article's title (possibly shortened). The footer contains the  page number in italics and at center.\par
% The first or title page has different header and footer. The header contains the name of the journal, the volume, number and year of the present issue and the page range of the article. The footer does not contain the page number, but the copyright and journal information.
% The title is similar to standard \LaTeX 's one but also contains author's affiliation (tipically Department, University and country) and electronic (e-mail) address. Finally, the title page also displays a simplified table of contents (without page numbers), the abstract and some kewywords, all centered in a sort of minipage on the title page.\par
% Section titles are centered in a bold face normal size font. At the present moment, the standard article does not consider subsections or lower divisions, which in any case would not enter in the table of contents.\par
% Footnotes' text is separated from the main text by a continuos line of length |\textwidth|. 
% \subsection{Required packages}
% At the present moment, the class requires three other packages, which should be present in any standard \LaTeX\ distribution.\footnote{Otherwise, they can be obtained from \url{www.ctan.org}.}\par
% Required packages are:
% \begin{itemize}
% \item \pack{mathptmx}, which causes \LaTeX\ to use Times New Roman fonts instead of standard Computer Modern fonts;
% \item \pack{geometry}, which allows for a quick and straightforward configuration of the page's layout; and
% \item \pack{titletoc}, which is part of \pack{titlesec} but can be used independently and allows for a complete customization of the table of contents.
% \item \pack{lastpage}, which defines a new label for the last page of the article, which can be then referred to with |\pageref|. This label is used to display the page range in the header of the title page.
% \end{itemize}
% In future versions, the class will maybe no longer use the \pack{geometry} and \pack{titletoc} packages.
%
% \subsection{Known bugs}
% Known problems include:
% \begin{description}
% \item[Title:] formatted titles, such as |\title{My \emph{title}}| cause wrong headers; moreover, there is still no solution for long titles. Both problems will be solved in future version by a |\shorttitle| command.
% \item[Author(s):] there is still no support for multiple authors.
% \end{description}
% Known incompatibilities with other standard packages include:
% \begin{description}
% \item[\pack{PdfDraftCopy}:] the \pack{pdfdraftcopy} package seems to cause problems with the class' layout.
% \end{description}
%
% \section{Usage}
% This section describes the (very intuitive!) use of the class and of its commands. See the template file \cod{lps-template.tex} for a complete sample document.
% \subsection{Installation}
% The class comes in two files, \cod{lps.ins} and \cod{lps.dtx}.
% Run first \LaTeX\ on \cod{lps.ins}: this will create two files, \cod{lps.cls} (the class file) and \cod{lps-template.tex}, a sample file. Then run twice (PDF)\LaTeX\ on \cod{lps.dtx}: this will create the documentation for the class (the file you are reading). To test the installation, run twice (PDF)\LaTeX\ on \cod{lps-template.tex}. 
% \subsection{Loading the class}
% The file \cod{lps.cls} must be in a directory searched by \LaTeX , for instance the same directory containing also the source (\cod{.tex}) file.
%
% Your \cod{.tex} document will then simply begin with |\documentclass{lps}|. Note that the class already sets the right paper and font dimension, so you do not need to specify them here. 
% \subsection{New class commands}
% \DescribeMacro{\Title}
% \DescribeMacro{\Author}
% At the beginning of the document, one should specify the |\title| and |\author| fields as usual; the two capitalized forms |\Title| and |\Author| are also available.\footnote{Note, in fact, that the standard commands have been redefined (section~\ref{code}).} After that, the following commands should be used.\par
% \DescribeMacro{\Affiliation}
% The command |\Affiliation| normally takes as argument the author's Department and University.\par
% \DescribeMacro{\Email} The |\Email| command takes as argument the electronic address of the author, printing it under author's name and affiliation.  \par
% \DescribeMacro{\Keywords} Finally, one should specify a short list of keywords, separated by commas, in the argument of the |\Keywords| command.\par
% Note that the commands described above are mandatory, since they leave an empty space in the final document if not specified. For this reason, a warning will be issued if you don't specify them.\par
% Some other commands and environments have been re-defined: these are |\maketitle|, |\tableofcontents| and |abstract|. Their usage, however, is exactly the standard one.\par
% The following commands regard the information concerning the actual issue of the journal. You don't need to use these commands until the final version of your paper is ready, since this information will be supplied to you by the journal's editors. Each  command has a default value which appears in the draft versions of the article.\par
% \DescribeMacro{\Volume} The volume number, e.g. ``III'', has to be inserted by the user directly \emph{in Roman capital letters}, using the |\Volume| command. \par
% \DescribeMacro{\Number} The |\Number| command takes as argument the number of the present issue, in arabic digits, e.g. ``1''.\par
% \DescribeMacro{\Year} The year of publication of the article is then inserted with the |\Year| command.\par
% \DescribeMacro{\FirstPage} The |\FirstPage| command takes as argument the number of the first actual page of the article --- once this has been inserted in the whole issue --- and set the page counter to that value; by default, its value is 1. The page range of the article will be automatically displayed in the header of the title page (after at least \emph{two} runs of (PDF)\LaTeX).\par
% \StopEventually{}
% 
% \section{The code}\label{code}
% 
% This section describes each line of the \cod{lps.cls} file.\par
% First of all, we declare the class' name and description.
%   \begin{macrocode}
%<*class>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{lps}[2006/09/22 v0.5%
                    LaTeX document class for the L&PS journal]
%    \end{macrocode}
%
% The \lps\ class is derived from the standard \pack{article} class through minor modifications:
%    \begin{macrocode}
\LoadClass[11pt,twoside,onecolumn]{article}                            
%    \end{macrocode}
%
% At the present moment, the class require four standard \LaTeX\ packages:
%    \begin{macrocode}
\RequirePackage{mathptmx}     
\RequirePackage{geometry}  
\RequirePackage{titletoc}
\RequirePackage{lastpage}
%    \end{macrocode}
%
% We define or re-define some standard commands about article's author and title:
%    \begin{macrocode}
\newcommand{\the@title}%
 {\@latex@warning@no@line{LPS warning: no \noexpand\Title given}}
\newcommand{\Title}[1]{\renewcommand{\the@title}{#1}}
\let\title\Title
\newcommand{\the@author}%
{\@latex@warning@no@line{LPS warning: no \noexpand\Author given}}
\newcommand{\Author}[1]{\renewcommand{\the@author}{#1}}
\let\author\Author
\newcommand{\the@affiliation}%
 {\@latex@warning@no@line{No \noexpand\Affiliation given}}
\newcommand{\Affiliation}[1]{\renewcommand{\the@affiliation}{#1}}
\newcommand{\the@email}%
 {\@latex@warning@no@line{No \noexpand\Email given}}
\newcommand{\Email}[1]{\renewcommand{\the@email}{e-mail: #1}}
%    \end{macrocode}
% and about the issue in question:
%    \begin{macrocode}
\newcommand{\the@volume}{III}
\newcommand{\Volume}[1]{\renewcommand{\the@volume}{#1}}
\newcommand{\the@number}{4}
\newcommand{\Number}[1]{\renewcommand{\the@number}{#1}}
\newcommand{\the@year}{2222}
\newcommand{\Year}[1]{\renewcommand{\the@year}{#1}}
\newcommand{\first@page}{1}
\newcommand{\FirstPage}[1]{\renewcommand{\first@page}{#1}%
                           \setcounter{page}{\first@page}}
%    \end{macrocode}
%
% The first group of commands is used on the first page by a re-defined version of the |\maketitle| command:
%    \begin{macrocode}
\renewcommand{\@maketitle}{\newpage\null\vspace{4mm}
  {\centering
  \let\footnote\thanks
  {\LARGE \the@title}\vskip 10mm
  {\normalsize
    \the@author\\\the@affiliation\\\the@email
    }
    \vskip 10mm}}
%    \end{macrocode}
%
% The |\tableofcontents| command is also redefined as follows:
%    \begin{macrocode}
\renewcommand{\tableofcontents}{
  \begin{quotation}\small\noindent
    \@starttoc{toc}
  \end{quotation}}
%    \end{macrocode}
% The appearance of the ToC entries is controlled by the \pack{titletoc} package with the following declaration:
%    \begin{macrocode}
\titlecontents{section}[1.4em]{}%
              {\contentslabel[\bfseries\thecontentslabel ]%
              {1.4em}}{\itshape}{}[]
%    \end{macrocode}
%
% Finally, the \cod{abstract} environment is redefined in order to display a newly defined \cod{keywords} field:
%    \begin{macrocode}
\newcommand{\the@keywords}%
    {\@latex@warning@no@line{No \noexpand\Keywords given}}
\newcommand{\Keywords}[1]{\renewcommand{\the@keywords}{#1}}
\renewenvironment{abstract}%
      {\setlength{\parskip}{0pt}
       \begin{quotation}\noindent\small%
             \textsc{\MakeLowercase\abstractname}.}%
      {\vskip 1\baselineskip \noindent%
       \textsc{keywords}: \the@keywords%
       \end{quotation}\noindent}
%    \end{macrocode}
%
% This completes (apart from the header) the layout of the first page. The rest of the code accomplish other style- and layout-specifications.
%
% The page layout is obtained trough the following \pack{geometry} declarations:
%    \begin{macrocode}
\geometry{paperwidth=155mm,paperheight=230mm}
\geometry{textwidth=122mm,textheight=172.795mm}
\geometry{headsep=10mm,headheight=7mm,footskip=7mm}
\geometry{hcentering,top=33mm}             
%    \end{macrocode}
%
% We define the new page style: 
%    \begin{macrocode}
\newcommand{\ps@lps}{%
 \renewcommand{\@oddhead}%
  {\hfil\small\scshape\MakeLowercase\the@title\hfil}%
 \renewcommand{\@oddfoot}{\hfil\itshape\thepage\hfil}%
 \renewcommand{\@evenhead}%
  {\hfil\small\scshape\MakeLowercase\the@author\hfil}%
 \renewcommand{\@evenfoot}{\hfil\itshape\thepage\hfil}}
%    \end{macrocode}
% and re-define the standard \cod{plain} style for the title page:
%    \begin{macrocode}
\renewcommand{\ps@plain}{%
\renewcommand{\@oddhead}%
 {\hfil\parbox[t]{80mm}{\centering\itshape%
 L\&PS -- Logic \& Philosophy of Science\\%
 Vol. \the@volume, No. \the@number, \the@year, %
 pp. \thepage -\pageref{LastPage}}\hfil}%
\renewcommand{\@oddfoot}{%
 \parbox[t]{80mm}{\footnotesize \copyright\ The Author \the@year\\
 Published by L\&PS -- Logic and Philosophy of Science\\
 http://www.univ.trieste.it/\~{}episteme/ -- ISSN:\thinspace 1826-1043}\hfil}%
\renewcommand{\@evenhead}{}%
\renewcommand{\@evenfoot}{\hfil\itshape\thepage\hfil}}
%     \end{macrocode}
%
% Other specifications regard sections' and footnotes' style:
%    \begin{macrocode}
\renewcommand{\thesection}{\arabic{section}.}
\renewcommand{\section}{\@startsection
    {section}%
    {1}%
    {0mm}%
    {2\baselineskip}%
    {1\baselineskip}%
    {\centering\normalfont\normalsize\bfseries}%
}
\renewcommand{\@makefntext}[1]%
  {\indent\makebox[7mm][r]{\@makefnmark}\hspace{2mm}#1}
\renewcommand{\footnoterule}%
  {\noindent\vspace*{-2pt}\rule{\textwidth}{.4pt}\vspace*{5pt}} 
\setlength{\skip\footins}{6mm}
%    \end{macrocode}
%
% Finally, we apply the new page style to the document:
%    \begin{macrocode}
\AtBeginDocument{\pagestyle{lps}}
%    \end{macrocode}
%</class>
%    \PrintChanges
\endinput