\ProvidesPackage{myarticle}[2003/05/13 Customizations for articles] \RequirePackage{mytools} \RequirePackage{roundflt} \RequirePackage{float} \RequirePackage{subfigure} % % BASIC STYLE CONFIGURATION % % DESIGN: % % The idea is that we have three types of text: % % heading: titles, section titles % run-in: run-in titles, figure/table labels % text: everything else % % These three should be independently changeable automatically in groups. % However, each separate component should be able to override and/or augment the % style settings. % % INTERFACE: % % For headings that get their own line, there is \headingstyle to change all of % them. For run-in headings there is \runinstyle. Initially \headingstyle=\relax % and \runinstyle=\headingstyle. % % Then, for each section type, there is the individual section style command. % For \section there is \sectionstyle, for example. % % For each section, first \headingstyle is applied, then \sectionstyle. % \let\headingstyle\@empty \def\runinstyle{\headingstyle} % % Floats style % \def\@fs@cfont#1{\runinstyle{\captionstyle{#1}}} \def\captionstyle{\bfseries} \newcommand\floatc@myruled[2]{{\@fs@cfont{#1}}\quad#2\par} \newcommand\fs@myruled{% \let\@fs@capt\floatc@myruled \def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}% \def\@fs@post{\kern2pt\hrule\relax}% \def\@fs@mid{\kern2pt\hrule\kern2pt}% \let\@fs@iftopcapt\iftrue} \floatstyle{myruled} \restylefloat{table} \restylefloat{figure} % % Subfigure style % \renewcommand\thesubfigure{\textsc{\alph{subfigure}}} \renewcommand\@thesubfigure{{\subcaplabelfont(\thesubfigure)} } % % Titling style % \def\titlestyle{\bfseries\Large}% \def\@titlestyle#1{\headingstyle\titlestyle{#1}} \def\authorstyle{}% \def\@authorstyle#1{\headingstyle\authorstyle{#1}} \def\and{\end{tabular}\hskip 1em\@plus.17fil \begin{tabular}[t]{@{}r@{}}}% \def\@maketitle{% \newpage \null \vskip 1.5\normalbaselineskip \let\footnote\thanks \hb@xt@\textwidth{% \hfil\hsize=\if@twocolumn0.75\else0.9\fi\hsize \titlestyle{\flushvtop[r]{\@title}}% }% \vskip 1em \@minus 0.4em \begin{raggedleft}% \@authorstyle{% \begin{tabular}[t]{@{}r@{}}\@author\end{tabular} %\vskip 1em %\@date %\par }% \par \end{raggedleft}% \vskip 1em\@plus 0.3em \@minus 0.3em } % % Use the full page for twocolumn layout % \if@twocolumn % We don't have the heightrounded option because we only have geometry 2.2! % So do the calculation here. \@tempdima=\paperheight \advance\@tempdima-2in \@roundlen\@tempdima % Copied from fullpage.sty \topmargin \z@ \advance\topmargin-\headheight \advance\topmargin-\headsep \textheight\@tempdima \oddsidemargin \z@ \evensidemargin\oddsidemargin \marginparwidth 0.5in \textwidth 6.5in \fi % I don't like my paragraphs being stretched at _all_ \parskip\z@ % % Section header styles, taken from SOSP, taken from ACM. % % \def\section{% \@startsection{section}{1}{\z@}{10\p@ \@plus 6\p@ \@minus 2\p@}% GM {4\p@ \@plus 1\p@ \@minus 1\p@}{\@sectionstyle}% } \def\@sectionstyle#1{\headingstyle\sectionstyle{#1}} \def\sectionstyle{\bfseries\large\MakeUppercase} \def\subsection{% \@startsection{subsection}{2}{\z@}{6\p@ \@plus 6\p@ \@minus 4\p@} {4\p@ \@plus 1\p@ \@minus 1\p@}{\@subsectionstyle}% } \def\@subsectionstyle#1{\headingstyle\subsectionstyle{#1}} \def\subsectionstyle{\bfseries\large} \def\subsubsection{% \@startsection{subsubsection}{3}{\z@}{5\p@ \@plus 5\p@ \@minus 4\p@}% {4\p@ \@plus 1\p@ \@minus 1\p@}{\@subsubsectionstyle}% } \def\@subsubsectionstyle#1{\headingstyle\subsubsectionstyle{#1}} \def\subsubsectionstyle{\itshape} \def\paragraph{% \@startsection{paragraph}{5}{\z@}{0.5\baselineskip}% {-1em}{\@paragraphstyle}% } \def\@paragraphstyle#1{\runinstyle{\paragraphstyle{#1}}} \def\paragraphstyle{\bfseries} % Use flushpar on the paragraphs. We do that by fudging the \@hangfrom macro. \def\@hangfrom#1{\setbox\@tempboxa\hbox{{#1}}% \hangindent \wd\@tempboxa\noindent \rightskip=\z@\@plus0.5\hsize \parfillskip=\z@\@plus0.5\hsize \box\@tempboxa} % % One-column abstract for two-column article! % \newdimen\abstractwidth \def\abstractstyle{\bfseries} \def\@abstractstyle#1{\headingstyle\abstractstyle{#1}} \if@twocolumn % % TODO: If we don't have an abstract, the title should still round the length. % \abstractwidth=0.7\textwidth % This is mostly copied from the \@topnewpage command. \renewenvironment{abstract}{% \@next\@currbox\@freelist{}{}% % We make a hbox of width textwidth containing a vbox of the abstract. Thus % we open two groups to be closed at endabstract. \global\setbox\@currbox \hb@xt@\textwidth\bgroup\hfil\vbox\bgroup \@twocolumnfalse \@parboxrestore \col@number \@ne % Text parameters \hsize\abstractwidth \small \parindent=\z@ \parskip=0.5\baselineskip % And now the abstract heading {\@abstractstyle{\abstractname}}\par }{% % End the groups \egroup\hfil\egroup % If the total box size is bigger than textheight, make it just textheight \ifdim \ht\@currbox>\textheight \ht\@currbox \textheight \fi % Box may only be placed on top, as this bit vector specifies \global \count\@currbox \tw@ \@tempdima -\ht\@currbox % Now consider the space of the float separator \advance \@tempdima -\dblfloatsep % Decrease the text area height to account for the abstract \global \advance \@colht \@tempdima % Round \@colht to n\baselineskip+\topskip \@tempdima\@colht \@roundlen\@tempdima \advance\@tempdima-\@colht \multiply\@tempdima\m@ne % Now \@tempdima is the extra stretch that the top floating area must express. % If this is too much stretch then subtract a baselineskip. \ifdim\@tempdima>\@dblstretch \advance\@tempdima-\normalbaselineskip \fi \global\advance\@colht-\@tempdima \@cons \@dbltoplist \@currbox \global \@dbltopnum \m@ne \ifdim \@colht<2.5\baselineskip \@latex@warning@no@line {Abstract and title are too tall on page \thepage}% \@emptycol \if@firstcolumn \else \@emptycol \fi \else \global \vsize \@colht \global \@colroom \@colht \@floatplacement \fi % Because the first column inherently does not contain enough stretch and % shrink, especially when the first section's skip is killed, fudge some in. % The parameters below seem to work best for everyone. \vbox{}\kern-\topskip \vskip \z@ \@plus \baselineskip \@minus \baselineskip } \else % One-column abstract \abstractwidth=0.85\textwidth \renewenvironment{abstract}{% \begin{quote} \small \parindent\z@ \parskip\normalbaselineskip\divide\parskip 2 % And now the abstract heading {\@abstractstyle{\abstractname}}\par }{% \par \end{quote} \vskip\normalbaselineskip } \fi % % Tables: I like making "header columns" for tables. Here's a macro to do it % quickly. % \newcommand*\thstyle{\bfseries} \newcommand*\thead{\runinstyle{\relax}\thstyle{\relax}} \newcommand\textth[1]{\runinstyle{\thstyle{#1}}} \endinput