summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-10-02 21:15:20 +0000
committerKarl Berry <karl@freefriends.org>2019-10-02 21:15:20 +0000
commit190c3d432377809473b658c1dffb592f35160263 (patch)
treeaab819c890b63ef6bfefd0f15437b3aa24eedaa7 /Master/texmf-dist/tex
parentdf3be83c0325f6a35919ff01239baf0bb58f4284 (diff)
asmejour (2oct19)
git-svn-id: svn://tug.org/texlive/trunk@52254 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/asmejour/asmejour.cls128
1 files changed, 103 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/asmejour/asmejour.cls b/Master/texmf-dist/tex/latex/asmejour/asmejour.cls
index 72087ac48de..beb43646347 100644
--- a/Master/texmf-dist/tex/latex/asmejour/asmejour.cls
+++ b/Master/texmf-dist/tex/latex/asmejour/asmejour.cls
@@ -1,12 +1,12 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
-%% This file provides the asmejour class for formatting =papers in a layout similar to
+%% This file provides the asmejour class for formatting papers in a layout similar to
%% ASME Journal papers.
%%
%% The asmejour.cls file should be used with the files asmejour.bst (for citations) and asmejour-template.tex.
%%
%%
-%% This file is version 1.05 dated 2019/08/17.
+%% This file is version 1.06 dated 2019/10/01.
%%
%% Author: John H. Lienhard V
%% Department of Mechanical Engineering
@@ -20,7 +20,7 @@
%% The Times/Helvetica style fonts are from Michael Sharpe's excellent newtxtext and newtxmath packages.
%% This class is not designed for unicode-math or fontspec.
%%
-%% Options for the class are described on lines 63-157.
+%% Options for the class are described on lines 63-173.
%%
%% The class defines an environment for nomenclature. LaTeX must be run twice to align those columns.
%%
@@ -52,7 +52,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{asmejour}[2019/08/17 asmejour paper format]
+\ProvidesClass{asmejour}[2019/10/01 asmejour paper format]
\LoadClass[twoside,9pt,twocolumn]{extarticle}
@@ -66,11 +66,14 @@
\newboolean{lineno}
\setboolean{lineno}{false}
+\newboolean{balance}
+\setboolean{balance}{false}
+
\newboolean{lists}
\setboolean{lists}{true}
\RequirePackage{kvoptions}
-\RequirePackage{kvsetkeys}
+%\RequirePackage{kvsetkeys} %<== this package is called by kvoptions
\SetupKeyvalOptions{
family=asmejour,
prefix=asmejour@,
@@ -98,7 +101,16 @@
\setboolean{lineno}{#1}
}
+%%% set key [balance] to activate final column balancing.
+\define@key{asmejour}{balance}[true]{%
+ \setboolean{balance}{#1}
+}
+
%%% set key [lang,lang-second,lang-third] to pass languages to babel.
+
+%% In case language options are dropped during editing, include this. Subsequent choice of lang= will override it.
+\PassOptionsToPackage{english}{babel}
+
\define@key{asmejour}{lang}[english]{%
\PassOptionsToPackage{#1}{babel}%
}
@@ -197,6 +209,9 @@
\RequirePackage[]{newtxtext}
\RequirePackage[varqu,varl]{inconsolata} % sans typewriter font
\RequirePackage[]{newtxmath}
+
+%% override \textsu if using default superiors
+\ifthenelse{\boolean{DefaultSups}}{\let\textsu\textsuperscript}{\relax}
\RequirePackage[]{mathalfa} % load optional fonts for Calligraphy, Script, etc.
@@ -249,30 +264,53 @@
\providecommand{\keywordname}{Keywords}
-%%%%%%%%%%%%%%%%% LINE AND EQUATION NUMBERING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%% EQUATION AND LINE NUMBERING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% ASME puts equation tags in blue
+\RequirePackage{xpatch}
+\xpatchcmd{\tagform@}{(\ignorespaces#1\unskip\@@italiccorr)}{\color{blue}(\ignorespaces#1\unskip\@@italiccorr)}{}{}
+
+%% Ensure that the current font is used for equation tags, not \normalfont as set by amsmath
+\def\maketag@@@#1{\hbox{\m@th#1}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifthenelse{\boolean{lineno}}{%
- \RequirePackage[switch]{lineno}
+ \RequirePackage[switch,mathlines]{lineno}
\renewcommand{\linenumberfont}{\normalfont\footnotesize\color{red}}
\AtBeginDocument{\linenumbers}
\ClassWarningNoLine{asmejour}{Package lineno loaded, so final column balancing is disabled}
+%%% Allow line numbering in AMS math environments.
+%%% postdisplaypenalty adjusted to avoid extra line number at end, see discussion here: https://tex.stackexchange.com/a/461192/
+%%% multline has some problem that puts an extra line number above it.
+%%% Requires xparse and etoolbox
+\NewDocumentCommand{\losepostpenalty}{}{\patchcmd{\linenomathWithnumbers}{\advance\postdisplaypenalty\linenopenalty}{}{}{}}
+
+\NewDocumentCommand{\FixAMSMath}{m}{%
+ \AtBeginEnvironment{#1}{\losepostpenalty\linenomath}%
+ \AtEndEnvironment{#1}{\endlinenomath}%
+ \AtBeginEnvironment{#1*}{\losepostpenalty\linenomath}%
+ \AtEndEnvironment{#1*}{\endlinenomath}%
+}
+
+\NewDocumentCommand{\FixAll}{>{\SplitList{;}}m}{\ProcessList{#1}{\FixAMSMath}}
+\FixAll{align;alignat;gather;flalign;multline}
+
}{%
- \RequirePackage{flushend} % flushend package is NOT compatible with lineno
+ \ProvideDocumentEnvironment{linenomath}{}{}{}
+ \ifthenelse{\boolean{balance}}{% balancing through flushend can produce weird errors
+ \RequirePackage{flushend} % flushend package is NOT compatible with lineno
\AtEndDocument{\flushcolsend}
+ }{\relax}
}
\providecommand{\@LN@col}[1]{\relax}
\providecommand{\@LN}[2]{\relax}
%% ASME page proofs seem to align the number at top of the line, rather than bottom as done here.
-%% ASME puts equation tags in blue
-\RequirePackage{xpatch}
-\xpatchcmd{\tagform@}{(\ignorespaces#1\unskip\@@italiccorr)}{\color{blue}(\ignorespaces#1\unskip\@@italiccorr)}{}{}
-
-
%%%%%%%%%%%%%%%%% FOOTER SET UP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%% footer text names %%%%%%%%%%
+%%%%%%%%%%% footer text names %%%%%%%%%%%%%%%
\newcommand{\JourName}[1]{\gdef\@JourName{#1}}
\providecommand\@JourName{\hbox{ }}
@@ -340,8 +378,27 @@
\renewcommand\@makefntext[1]{%
\noindent\makebox[4mm][r]{\@makefnmark}\hyphenpenalty=300\exhyphenpenalty=300 #1} %<== suppress hyphenation
-%% Produces an unmarked footnote about the submission date. Insert \reviewfootnote{..} on first page if desired.
-\def\reviewfootnote{\gdef\@thefnmark{}\@footnotetext}
+%% Produces an unmarked footnote about the revision date.
+%% This command is invoked by \date as part of \MakeTitlePage below.
+%% Text can be anything given as the argument to \date{..}.
+\NewDocumentCommand{\revfootnote}{m}{\begin{NoHyper}\gdef\@thefnmark{}\@footnotetext{#1}\end{NoHyper}}
+
+% Previous is modified to eliminate missing anchor warning from hyperref that following would cause
+%\def\revfootnote{\gdef\@thefnmark{}\@footnotetext}
+
+
+%% include a comma for sequential footnotes
+\newcommand\nextToken\relax
+
+\let\oldfootnote\footnote
+\renewcommand\footnote[1]{%
+ \oldfootnote{#1}\futurelet\nextToken\isOtherfnote}
+
+\newcommand\isOtherfnote{%
+ \ifx\footnote\nextToken\textsu{\mdseries,}%
+ \fi%
+}
+
%%%%%%%%% CAPTION RELATED %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -391,7 +448,7 @@
\RequirePackage{enumitem}
\setlist[enumerate,1]{label = (\arabic*), ref = (\arabic*),labelindent=3mm, leftmargin=*,noitemsep}
-%% have no examples of sublists...
+%% I have no examples of sublists...
%%%%%%%%%%%%%%%%% Hyperref %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -601,18 +658,17 @@
}
}
-
\DeclareDocumentCommand\SetAbstract{m}{%
\SetVerticalCoffin{\Abstract}{114mm}{%
\noindent\itshape%
#1
- \@keywords
+ \@keywords\par%
\vspace*{4mm}% <== at bottom of abstract to extend rule
}
}
\DeclareDocumentCommand{\ConstructAuthorBlock}{}{%
-\JoinCoffins\Title[hc,b]\Abstract[hc,t](0pt,-1.5\coffinsep)
+\JoinCoffins\Title[l,b]\Abstract[l,t](0pt,-1.5\coffinsep)
\setlength{\Titleheight}{\CoffinTotalHeight\Title}
\ifdim\Titleheight>\rulecofheight
\setlength{\rulecofheight}{\Titleheight}
@@ -627,10 +683,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Corresponding author gets footnote #1 and subsequent notes are 2, 3, ....
-%%% ASME apparently does not recognize joint first authors...so have not coded that functionality
+%%% ASME apparently does not recognize joint first authors...so I have not coded that functionality
-%%%% Flag for corresponding author (just one expected, although code supports more than one)
-%%%% for more than one, if including email in footnote, place in final command
+%%%% Flag for corresponding author (just one expected, although this code supports more than one)
+%%%% for more than one CA, if including email addresses in the footnote, place them in final the command
\newif\ifCA\CAfalse
\newcommand{\CAemail}[1]{\gdef\@CAemail{#1}}
@@ -666,9 +722,31 @@
\addtocounter{footnote}{1}
\footnotetext{Corresponding author\@CAsep \@CAemail}
\fi
+\ifDate\revfootnote{\@Date} \else\relax \fi
}
-%%%
+%%%%%%%%%%
+
+%% Provide compatibility with titling commands from standard LaTeX article class
+
+\RenewDocumentCommand{\maketitle}{}{\MakeTitlePage}
+\RenewDocumentCommand{\title}{}{\SetTitle}
+
+\RenewDocumentEnvironment{abstract}{+b}{\gdef\tmp{\SetAbstract{#1}}\aftergroup\tmp}{}
+%% Thanks to DPC for the suggestion of \gdef\tmp{...
+
+%% Put date as an unnumbered footnote at bottom of first column
+\newif\ifDate\Datetrue % If true, print a date.
+
+\ExplSyntaxOn
+\RenewDocumentCommand{\date}{m}
+ {%
+ \tl_if_empty:nTF {#1}{\global\Datefalse}{\gdef\@Date{#1}}%
+ }
+\providecommand\@Date{\today}
+\ExplSyntaxOff
+
+\RenewDocumentCommand{\thanks}{m}{\relax} %% disabling this standard command, as it is inconsistent with the format
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%