summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/lps/lps.dtx
blob: 0502e5e6044b23883d61d4d932563dd9e1834fa5 (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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
% \iffalse
% 
% file: lps.dtx
% Copyright 2005, 2006, 2007, 2010, 2011 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.7
% 
% 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
%% \usepackage{lipsum}                   % to test this template
%
\begin{document}
%% Article's information:
\title{Title of the article}
%\shorttitle{Optional title to go in the running headings}
%% Author's information:
\author{John First\\Department of Philosophy\\University of Trieste (Italy)\\j.first@mail.it \and%
            James Second\\Department of Philosophy\\University of Trieste (Italy)\\j.second@mail.it}
\shortauthor{John First, James Second}
%% 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.\par
%%
%% \lipsum[1-10]
%%
\begin{thebibliography}{AAA}
\bibitem{mypaper} \textsc{First, J.} and \textsc{Second, J.} (2010), ``An interesting paper'', \emph{A Famous Journal}, 1, pp.~1--11. 
\bibitem{mybook} \textsc{First, J.} and \textsc{Second, J.} (2011), \emph{A great book}, Address: Publisher. 
\end{thebibliography}
\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.7}
% \def\filedate{1 Feb 2011}
%
% \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 Enrico 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 range in title page's header, small layout modifications.}
% \changes{v0.61}{2010/01/21}{Minor modifications (journal web address).}
% \changes{v0.7}{2011/01/01}{Major modifications}
%
% \title{The \pack{lps} class:\\\Large layout for the \emph{Logic \& Philosophy of Science} journal\thanks{\protect\url{http://www2.units.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}}. Suggestions on how to improve the code are welcome.}\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|, |\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 be found at:
% \begin{center}\url{http://www.ctan.org/tex-archive/macros/latex/contrib/lps/}\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 in 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}
% The class requires some standard packages, which should be present in any \LaTeX\ distribution.\footnote{Otherwise, they can be obtained from \url{www.ctan.org}.}\par
% The following package are required:
% \begin{itemize}
% \item \pack{mathptmx}, to use Times New Roman fonts instead of standard Computer Modern fonts;
% \item \pack{geometry}, to customize the page's layout; 
% \item \pack{titlesec} and \pack{titletoc}, to customize the sections' titles and the table of contents.
% \item \pack{lastpage}, to define 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.
% \item \pack{caption}, to customize the captions of figures and tables.
% \end{itemize}
%
% \subsection{Known bugs}
% Known problems include:
% \begin{description}
% \item[Author(s):] in the present version, the author list for running headings must be inserted by hand (|\shortauthor| command). In future versions, both information should be extracted authomatically. Also the information about authors' affiliation and e-mail must be formatted by hand; |\affiliation| and |\email| commands should take care of this in future versions.
% \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. The best way to start using the class is to edit the template file \cod{lps-template.tex} and run it.
% \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{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. % \DescribeMacro{\shorttitle}
%If the title contains any formatting (like emphasis or line breaks), then the |\shorttitle| command must be used to provide a version of the title with no formatting, which will be used in the running headings.
%Multiple authors are inserted separating them with the |\and| command. Note that, for each author, one should specify the corresponding affiliation and e-mail address, separated by a |\\| command. 
% \DescribeMacro{\shortauthor}
% For this reason, the |\shortauthor| command must be used to provide the author list for the running headings. This list contain the complete name of each author, separated by commas. Refer to the template file for an example. Finally, the standard |\maketitle| and |\tableofcontents| are used in this order to produce the first page of the paper.
\par
% \DescribeMacro{abstract}
% Each \landps\ paper has always an abstract, inserted with the standard |abstract| environment. 
% \DescribeMacro{\keywords}
%The abstract also displays a short list of keywords, separated by commas, which are inserted with |\keywords| command.\par
% Note that all 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
% The next group of commands concern the information about the present 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 (or inserted directly by them). 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.
% \DescribeMacro{\Number} The |\Number| command takes as argument the number of the present issue, in arabic digits, e.g. ``1''.
% \DescribeMacro{\Year} The year of publication of the article is then inserted with the |\Year| command.\par
% \DescribeMacro{\FirstPage} The |\FirstPage| command takes as its argument the number of the page of the journal issue where the article actually begins. It set the page counter to that value, by default 101. 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). The value of this counter --- which \emph{must} be an odd number --- will be inserted by the journal editors once the whole issue is complete.\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}[2011/01/01 v0.7%
                    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}
%
% The class requires some standard \LaTeX\ packages:
%    \begin{macrocode}
\RequirePackage{mathptmx}     
\RequirePackage{geometry} 
\RequirePackage[bf,center,tiny,nonindentfirst]{titlesec} 
\RequirePackage{titletoc}
\RequirePackage{lastpage}
\RequirePackage[format=plain,labelsep=colon,%
                   labelfont=small,labelfont=sc,%
                   textfont=it, figurename=Fig.]{caption}
%    \end{macrocode}
%
% We define or re-define some standard commands about article's author and title:
%    \begin{macrocode}
\newcommand{\the@shorttitle}{}
\newcommand{\the@title}%
 {\@latex@warning@no@line{L&PS warning: no \noexpand\Title given}}
\newcommand{\Title}[1]{\renewcommand{\the@title}{#1}%
\renewcommand{\the@shorttitle}{#1}}
\let\title\Title
\newcommand{\shorttitle}[1]{\renewcommand{\the@shorttitle}{#1}}
\newcommand{\the@shortauthor}%
{\@latex@warning@no@line{L&PS warning: no \noexpand\shortauthor given}}
\newcommand{\shortauthor}[1]{\renewcommand{\the@shortauthor}{#1}}
%    \end{macrocode}
% The |\and| command for multiple authors is redefined:
%    \begin{macrocode}
\renewcommand{\and}{%                 
  \end{tabular}%
  \vskip .5em \@plus.17fil%
  \begin{tabular}[t]{c}}%   
%    \end{macrocode}
% The following commands (|\Author|, |\Affiliation| and |\Email|) are defined for compatibility with older versions, but are presently useless:
%    \begin{macrocode}
\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}
% The following four commands take care of the issue's information:
%    \begin{macrocode}
\newcommand{\the@volume}{I}
\newcommand{\Volume}[1]{\renewcommand{\the@volume}{#1}}
\newcommand{\the@number}{1}
\newcommand{\Number}[1]{\renewcommand{\the@number}{#1}}
\newcommand{\the@year}{2222}
\newcommand{\Year}[1]{\renewcommand{\the@year}{#1}}
\newcommand{\first@page}{101}
\newcommand{\FirstPage}[1]{\renewcommand{\first@page}{#1}%
                           \setcounter{page}{\first@page}}
%    \end{macrocode}
% The |\maketitle| command is slightly redefined, mainly with respect vertical spaces:
%    \begin{macrocode}
\renewcommand{\@maketitle}{\newpage\null\vspace{4mm}
  {\centering
  \let\footnote\thanks
  {\LARGE \the@title}\vskip 10mm
  {\normalsize
      \begin{tabular}[t]{c}%
     \@author 
\end{tabular}
    }
    \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@shorttitle\hfil}%
 \renewcommand{\@oddfoot}{\hfil\itshape\thepage\hfil}%
 \renewcommand{\@evenhead}%
  {\hfil\small\scshape\MakeLowercase\the@shortauthor\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://www2.units.it/\~{}episteme/ -- ISSN:\thinspace 1826-1043}\hfil}%
\renewcommand{\@evenhead}{}%
\renewcommand{\@evenfoot}{\hfil\itshape\thepage\hfil}}
%    \end{macrocode}
% Other specifications concern the style of sections' titles and of footnotes:
%    \begin{macrocode}
\titlelabel{\thetitle.\quad}
\titlespacing{\section}{0pt}{2\baselineskip plus .5ex minus .2ex}{1\baselineskip}
\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}
%
% As far as the references list is concerned, its title is typeset in small caps and normal font:
%    \begin{macrocode}
\renewcommand{\refname}%
  {\normalfont\textsc{References}}
%    \end{macrocode}
% Finally, we apply the new page style to the document:
%    \begin{macrocode}
\AtBeginDocument{\pagestyle{lps}}
%    \end{macrocode}
%</class>
%    \PrintChanges
\endinput