summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/papertex/papertex.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/papertex/papertex.dtx')
-rw-r--r--Master/texmf-dist/source/latex/papertex/papertex.dtx98
1 files changed, 80 insertions, 18 deletions
diff --git a/Master/texmf-dist/source/latex/papertex/papertex.dtx b/Master/texmf-dist/source/latex/papertex/papertex.dtx
index f9505158291..f589dae7ac9 100644
--- a/Master/texmf-dist/source/latex/papertex/papertex.dtx
+++ b/Master/texmf-dist/source/latex/papertex/papertex.dtx
@@ -22,7 +22,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{papertex}
%<*class>
- [2007/01/18 v1.1b paperTeX class]
+ [2007/02/27 v1.2a paperTeX class]
%</class>
%
%<*driver>
@@ -59,6 +59,9 @@
% \changes{v1.1}{2007/01/10}{Some minor changes}
% \changes{v1.1a}{2007/01/15}{Changes in documentation}
% \changes{v1.1b}{2007/01/18}{Short news have label. They could not be referenced before. Phantomsections added.}
+% \changes{v1.1c}{2007/01/20}{Makeindex removed.}
+% \changes{v1.2}{2007/01/25}{New counter minraggedcols and raggedFormat command. They allow users to have ragged texts in news.}
+% \changes{v1.2a}{2007/02/27}{Anysize package replaced by geometry. Option `12pt' is now sent to standard article class. Authorandplace aligns on the left now. Bugs in documentation. New `a3paper' option.}
%
% \GetFileInfo{papertex.dtx}
%
@@ -69,6 +72,10 @@
% \newcommand{\papertex}[0]{paper\TeX{}}
%
%
+% \newcommand*{\NEWfeature}[1]{%
+% \hskip 1sp \marginpar{\small\sffamily\raggedright
+% New feature\\#1}}
+%
% \title{\papertex{} class: creating newspapers using \LaTeX{}}
%
% \author{Ignacio Llopis \\ \texttt{lloptor@gmail.com}\\{\large Polytechnic University of Valencia}}
@@ -89,7 +96,7 @@
%
% This manual is typeset according to the conventions of the \LaTeX{} \textsc{docstrip} utility which enables the automatic extraction of the \LaTeX{} macro source files.
%
-% Section~\ref{sec:usage} describes the usage of the package.
+% Section~\ref{sec:usage} describes the usage of the class.
%
%
%
@@ -277,6 +284,17 @@
% Most of the newspaper in my country (Spain) finish the news text with a black square (\blackbox{}). As I wanted to create a highly customizable \LaTeX{} class I added the macro |\innerTextFinalMark| to change this black square. This item will appear always following the last character of the text with the $\sim$ character.
%
%
+% \DescribeMacro{\minraggedcols} \DescribeMacro{\raggedFormat}
+% \NEWfeature{v1.2}
+% The |\minraggedcols| counter is used to tell \papertex{} when news text should be ragged instead of justified.
+% The counter represents the minimum number of columns that are needed in order to use ragged texts. For example,
+%if |\minraggedcols| is set to $3$, all news with $3$ columns or more will be ragged.
+% News with $1$, $2$ columns will have justified text.
+% By default, |\minraggedcols| is set to $4$.
+%
+% The |\raggedFormat| macro can be redefined to fit user ragged style. Default value is |\RaggedRight|.
+%
+%
% \DescribeMacro{\heading} \DescribeMacro{\foot}
% \papertex{} includes package \texttt{fancyhdr} for changing headings and footers. Although it is possible to use its own commands to modify \papertex{} style, there are two commands to change headings and foot appearance. Place them in the preamble of your \papertex{} document.
% \begin{quote}
@@ -291,11 +309,12 @@
%
% \section{Class options} \label{sec:options}
%
-% The \papertex{} class is in itself an alteration of the standard \texttt{article} class, thus it inherits most of its class options but |twoside|, |twocolumn| and |notitlepage|. If you find problems when loading other \texttt{article} features, please let me know to fix it.
-%
-% There are also four own options that \papertex{} implements.\\
+% The \papertex{} class is in itself an alteration of the standard \texttt{article} class, thus it inherits most of its class options but |twoside|, |twocolumn|, |notitlepage| and |a4paper|. If you find problems when loading other \texttt{article} features, please let me know to fix it.
%
+% There are also five own options that \papertex{} implements.\\
+% \NEWfeature{v1.2a}
% \begin{description}
+% \item[a3paper] (\textit{false}) This option makes \papertex{} $297mm$ width by $420mm$ height. This option is implemented because the standard \texttt{article} class does not allow this document size.
% \item[9pt] (\textit{false}) Allows the $9pt$ font size that \texttt{article} class does not include (default is $10pt$).
% \item[hyphenatedtitles] (\textit{false}) Forces heading titles to be hyphenated. This feature is off by default because most of newspapers prefer not to hyphenate them.
% \item[columnlines] (\textit{false}) Adds lines between columns in the entire \papertex{}. The default line width is $0.1pt$ but it is possible to change this by setting length |\columnlines| in the preamble.
@@ -351,6 +370,8 @@
\setboolean{papertex@ninepoints}{false}
\newboolean{papertex@showgrid}
\setboolean{papertex@showgrid}{false}
+\newboolean{papertex@a3paper}
+\setboolean{papertex@a3paper}{false}
% \end{macrocode}
%
% Some booleans to keep track of where we are.
@@ -372,11 +393,21 @@
\papertex@gridcolumns=50
% \end{macrocode}
%
+% \NEWfeature{v1.2}
+% The following count defines when \papertex{} should use ragged text instead
+% of justified text. It represents the maximum number of columns not ragged.
+% Default value is $5$.
+% \begin{macrocode}
+\newcount\minraggedcols
+\minraggedcols=5
+% \end{macrocode}
+%
% Now, we declare the class options.
-% First, options \papertex{} inherit from ``article.cls''.
+% First, all the options which \papertex{} inherits from ``article.cls'' standard class.
% \begin{macrocode}
\DeclareOption{10pt}{\PassOptionsToClass{10pt}{article}}
\DeclareOption{11pt}{\PassOptionsToClass{11pt}{article}}
+\DeclareOption{12pt}{\PassOptionsToClass{12pt}{article}}
% \end{macrocode}
%
% Second, options \papertex{} does not inherit from ``article.cls''.
@@ -395,13 +426,14 @@
\DeclareOption{hyphenatedtitles}{\setboolean{papertex@hyphenatedtitles}{false}}
\DeclareOption{columnlines}{\setlength{\columnlines}{0.1 pt}}
\DeclareOption{showgrid}{\setboolean{papertex@showgrid}{true}}
+\DeclareOption{a3paper}{\setboolean{papertex@a3paper}{true}}
% \end{macrocode}
%
% As \papertex{} is based in the \LaTeX{} ``article'' class,
% we load this class with default \papertex{} options.
% \begin{macrocode}
-\ProcessOptions
-\LoadClass[10pt, onecolumn, titlepage]{article}
+\ProcessOptions\relax
+\LoadClass[10pt, onecolumn, titlepage, a4paper]{article}
% \end{macrocode}
%
% From this point, \papertex{} requires all packages needed.
@@ -412,12 +444,16 @@
\RequirePackage{multicol}
\RequirePackage{fancyhdr}
\RequirePackage{fancybox}
-\RequirePackage{anysize}
% \end{macrocode}
%
-% Define margins to get as much as possible from the page layout.
+% \NEWfeature{v1.2a}
+% Define margins using \texttt{geometry} package to get as much as possible from the page layout. It is also time to check if ``a3paper'' option is requested.
% \begin{macrocode}
-\marginsize{1.5cm}{1.5cm}{0.5cm}{0.5cm}
+\ifthenelse{\boolean{papertex@a3paper}}{%
+ \RequirePackage[a3paper,headsep=0.5cm,vmargin={2cm,2cm},hmargin={1.5cm,1.5cm}]{geometry}
+}{
+ \RequirePackage[headsep=0.5cm,vmargin={2cm,2cm},hmargin={1.5cm,1.5cm}]{geometry}
+}
% \end{macrocode}
%
% Some requirements whether we compile using PDF\LaTeX{} or just \LaTeX{}.
@@ -441,14 +477,28 @@
\RequirePackage{setspace} % set space between lines
% \end{macrocode}
%
-% When the whole class is loaded, draw the front page grid. Draw lines if requested by using \textbf{showgrid} option.
+% \NEWfeature{2007/01/25}
+% We, now, load \texttt{ragged2e} package in order to provide \papertex{} with
+% nicely ragged texts. A new command called |\raggedFormat| is defined to control
+% which kind of ragged format should be used.
+% \begin{macrocode}
+\RequirePackage{ragged2e}
+\newcommand{\raggedFormat}{\RaggedRight}
+% \end{macrocode}
+%
+% When the whole class is loaded, draw the front page grid. Draw lines if requested by using \textbf{showgrid} option.
+% There is also a substraction from |\minraggedcols| counter by one in order to match is definition.
% \begin{macrocode}
\AtEndOfClass{\papertexInit}
\ifthenelse{\boolean{papertex@showgrid}}{%
- \AtBeginDocument{\grid[show]{\papertex@gridrows}{\papertex@gridcolumns}}
-}{%
- \AtBeginDocument{\grid[]{\papertex@gridrows}{\papertex@gridcolumns}}
-}
+ \AtBeginDocument{
+ \grid[show]{\papertex@gridrows}{\papertex@gridcolumns}}
+ \advance\minraggedcols by -1
+ }{%
+ \AtBeginDocument{
+ \grid[]{\papertex@gridrows}{\papertex@gridcolumns}}
+ \advance\minraggedcols by -1
+ }
% \end{macrocode}
%
% Definition of \textbf{ninepoints} class option.
@@ -931,7 +981,6 @@
\setlength{\columnseprule}{\columnlines}
\setlength{\fboxrule}{0.1 pt}
- \makeindex
}
% \end{macrocode}
%
@@ -1368,6 +1417,9 @@
\end{center}
\begin{multicols}{\papertex@ncolumns{}}
+ \ifnum \papertex@ncolumns > \minraggedcols
+ \raggedFormat
+ \fi
}
% \end{macrocode}
%
@@ -1435,7 +1487,7 @@
% The next macro types out the author and the place of the news. It is just a format command.
% \begin{macrocode}
\newcommand{\authorandplace}[2]{%
- \rightline{%
+ \leftline{%
{\innerAuthorFormat #1},\space{}{\innerPlaceFormat #2}%
}%
\par %
@@ -1474,6 +1526,9 @@
\phantomsection
\pdfbookmark[1]{#2}{\thepage}
\label{#5}
+ \ifnum #1 > \minraggedcols
+ \raggedFormat
+ \fi
}
{~\innerTextFinalMark{}
\end{multicols}
@@ -1538,6 +1593,9 @@
\phantomsection
\pdfbookmark[1]{#2}{\thepage}
\label{#4}
+\ifnum #1 > \minraggedcols
+\raggedFormat
+\fi
}
{
\end{multicols}
@@ -1572,6 +1630,9 @@
\pdfbookmark[1]{#2}{\thepage}
\label{#4}
\par %
+ \ifnum #1 > \minraggedcols
+ \raggedFormat
+ \fi
}
{
\end{multicols}
@@ -1583,6 +1644,7 @@
% \begin{macrocode}
\newcommand{\shortnewsitem}[2]{
\goodbreak
+ \vspace{5pt plus 3pt minus 3pt}
{\vbox{\noindent\papertex@shortnewsItemTitle{#1}}}
\vspace{5pt plus 3pt minus 3pt}
{\noindent #2}\\