summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/prtec/prtec.cls
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/prtec/prtec.cls')
-rw-r--r--macros/latex/contrib/prtec/prtec.cls204
1 files changed, 85 insertions, 119 deletions
diff --git a/macros/latex/contrib/prtec/prtec.cls b/macros/latex/contrib/prtec/prtec.cls
index 9bd3af2237..9bd46e5ba1 100644
--- a/macros/latex/contrib/prtec/prtec.cls
+++ b/macros/latex/contrib/prtec/prtec.cls
@@ -1,12 +1,14 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% This file provides the prtec class for formatting conference papers according to
-%% the Pacific Rim Thermal Engineering Conference (PRTEC) requirements as of April 2019.
+%% the Pacific Rim Thermal Engineering Conference (PRTEC) requirements as of July 2024.
%%
%% The prtec.cls file should be used with the files prtec.bst (for citations) and prtec-template.tex.
%%
%%
-%% This file is version 1.06 dated 2019/08/20.
+%% This file is version and date:
+ \def\versionno{1.07}
+ \def\versiondate{2024/07/07\space}
%%
%% Author: John H. Lienhard V
%% Department of Mechanical Engineering
@@ -34,7 +36,7 @@
%%
%% LICENSE:
%%
-%% Copyright (c) 2019 John H. Lienhard
+%% Copyright (c) 2024 John H. Lienhard
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
%% associated documentation files (the "Software"), to deal in the Software without restriction,
@@ -54,33 +56,14 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{prtec}[2019/08/20 PRTEC paper format]
+\ProvidesClass{prtec}[\versiondate\ PRTEC paper format]
-\LoadClass[twoside,11pt]{article}
-% Two-sided layout not used in PRTEC's specs, but is included anyway.
+\LoadClass[11pt]{article}
%%%%%%%%%%%%%% Options for the class %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{ifthen}
-\newboolean{DefaultSups}
-\setboolean{DefaultSups}{true}
-
-\RequirePackage{kvoptions}
-\RequirePackage{kvsetkeys}
-\SetupKeyvalOptions{
- family=prtec,
- prefix=prtec@,
- setkeys=\kvsetkeys,
-}
-
-%%% set key nodefaultsups to obtain newtx superiors font for footnotes.
-\define@key{prtec}{nodefaultsups}[false]{%
- \setboolean{DefaultSups}{#1}
-}
-
-\ProcessKeyvalOptions*
-
%% option to omit PRTEC footer and header
\DeclareOption{nofoot}{%
@@ -96,13 +79,10 @@
%% Access many options from newtxmath
%% See newtxmath documentation for details
-\DeclareOption{upint,smallerops,varvw,varg,slantedGreek,frenchmath,varbb,cmbraces}{\PassOptionsToPackage{}{newtxmath}}
+\DeclareOption{upint,smallerops,varvw,varg,slantedGreek,frenchmath,varbb,cmbraces,subscriptcorrection}{\PassOptionsToPackage{}{newtxmath}}
%% Option for slightly larger small capitals font
-\DeclareOption{largesc}{\PassOptionsToPackage{}{newtxtext}}
-
-%% Option not to use latex default superscripts, instead using the newtxtext superiors font [nodefaultsups]
-\ifthenelse{\boolean{DefaultSups}}{\PassOptionsToPackage{defaultsups}{newtxtext}}{\relax}
+\DeclareOption{largesc}{\PassOptionsToPackage{largesc=true}{newtxtext}}
%% Suppress warnings about any omitted keys as unused global options
\DeclareOption*{}
@@ -112,8 +92,8 @@
%%%%%%%%%%%%% end options %%%%%%%%%%%%%%%%%%%
-\RequirePackage[a4paper, left=20mm, right=20mm, top=20mm, bottom = 20mm, footskip=10mm, includefoot, headsep=2mm]{geometry}
-% conforms to PRTEC 19 required margins
+\RequirePackage[a4paper, left=20mm, right=20mm, top=20mm, bottom=20mm, headsep=3mm, includefoot ]{geometry}
+% conforms to PRTEC24 required margins
\RequirePackage{parskip}
@@ -122,8 +102,9 @@
\renewcommand*{\bibfont}{\footnotesize}
\RequirePackage{graphicx}
-\RequirePackage[hyperref,fixpdftex,dvipsnames,svgnames,x11names]{xcolor}
-\RequirePackage{xparse}
+\RequirePackage[dvipsnames,svgnames,x11names]{xcolor}
+
+\ifdefined\NewDocumentCommand\else\RequirePackage{xparse}\fi
%%%%%%%%%%%%%%%%%%%%%%%%
@@ -136,14 +117,10 @@
%%%% FONT related %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{mathtools} % extends amsmath
-\RequirePackage[utf8]{inputenc}
\RequirePackage[]{newtxtext}
\RequirePackage[]{newtxmath}
% See package documentation
-%% override \textsu if using default superiors
-\ifthenelse{\boolean{DefaultSups}}{\let\textsu\textsuperscript}{\relax}
-
\RequirePackage{bm} % load after all other math packages, to give greater access to bold math
@@ -163,19 +140,19 @@
\RequirePackage{fancyhdr}
\pagestyle{fancy}
-\setlength{\headheight}{22.53pt}
+\setlength{\headheight}{24pt}
\fancyfoot{}
-\fancyfoot[CE,CO]{\thepage}
-\fancyfoot[RO,LE]{}
+\fancyfoot[C,C]{\thepage}
+\fancyfoot[R,L]{}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{title}{%
\fancyhf{} % clear all header and footer fields
-\fancyfoot[LO,RE]{Copyright~\textcopyright~\the\year\ The Author(s). Distributed by JSME, KSME, and ASTFE with permission.}
-\fancyfoot[LE,RO]{\thepage}
-\fancyhead[LE,RO]{\bfseries\sffamily \HeaderConfName}
+\fancyfoot[L]{Copyright~\textcopyright~\the\year\ The Author(s). Distributed by JSME, KSME, and ASTFE with permission.}
+\fancyfoot[R]{\thepage}
+\fancyhead[R]{\bfseries\sffamily \HeaderConfName}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
@@ -196,10 +173,9 @@
\noindent\makebox[2ex][r]{\@makefnmark}#1}
-
%%%%%%%%% CAPTION RELATED %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\RequirePackage[labelfont={sf,bf},hypcap=false]{caption}
+\RequirePackage[labelfont={bf},hypcap=false]{caption}
\RequirePackage[hypcap=false,list=true]{subcaption}
\captionsetup[figure]{name=Fig.,labelfont={bf},textfont={}, labelsep=quad} %textformat=period,
@@ -207,15 +183,12 @@
%%%%%%%%%%%%%%%%%% Section headings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% wish to accommodate hyperref
-
-\RequirePackage{textcase} %% Allows uppercase titles and captions without errors from math and citations
\RequirePackage[raggedright,indentafter]{titlesec}
% PRTEC specifies 12 pt headings
-\titleformat{\section}{\bfseries\mathversion{bold}\large\centering}{\thesection.}{0.5em}{\MakeTextUppercase}
-\titleformat{name=\section,numberless}{\bfseries\mathversion{bold}\large\centering}{}{0em}{\MakeTextUppercase}
+\titleformat{\section}{\bfseries\mathversion{bold}\large\centering}{\thesection.}{0.5em}{\MakeUppercase}
+\titleformat{name=\section,numberless}{\bfseries\mathversion{bold}\large\centering}{}{0em}{\MakeUppercase}
\titleformat{\subsection}[runin]{\bfseries}{\thesubsection}{0.5em}{\mathversion{bold}\noindent}[\hspace*{0.5em}]
\titleformat{\subsubsection}[runin]{\itshape}{}{0em}{\noindent\underline}[.\hspace*{0.5em}]
@@ -230,88 +203,81 @@
\setcounter{section}{0}
\pdfbookmark[0]{Appendices}{appendices}
\renewcommand\thesection{\Alph{section}}
- \titleformat{\section}{\bfseries\mathversion{bold}\large\centering}{APPENDIX \thesection:}{0.5em}{\MakeTextUppercase}
+ \titleformat{\section}{\bfseries\mathversion{bold}\large\centering}{APPENDIX \thesection:}{0.5em}{\MakeUppercase}
}
%%%%%%%%%%%%% hyperref %%%%%%%%%%%%%%%%%%%
-\RequirePackage{hyperxmp} %% to fix transfer of metadata to Acrobat pdf
-
-\RequirePackage[%
- unicode, % Unicode encoded PDF strings
- psdextra, % additional support for math in pdf bookmarks
- pdfborder={0 0 0},%
- bookmarks=true, %
- bookmarksnumbered=true,%
- bookmarksopen=true,%
- bookmarksopenlevel=1,%
- colorlinks=true,%%% <=== set false to get black type, but do so in .tex file
+\RequirePackage[psdextra]{hyperref}
+
+\hypersetup{
+ colorlinks=true,
+ pdfborder={0 0 0},
+ bookmarksnumbered=true,
+ bookmarksopen=true,
+ bookmarksopenlevel=1,
+ pdfpagelayout=SinglePage,
+ pdfdisplaydoctitle=true,
+ pdfstartview=Fit,
+ pdfnewwindow=true,
linkcolor=blue, %
- citecolor=blue, % SeaGreen4,%
- urlcolor=blue, % Red3,%
- breaklinks=true,%
- pdftitle={}, % <=== add in .tex file
- pdfkeywords={}, % <=== add in .tex file
- pdfnewwindow=true,%
- pdfpagelayout=TwoPageRight,%
- pdfauthor={}, % <=== add in .tex file
- pdfdisplaydoctitle=true%
- ]{hyperref}
-
+ citecolor=blue, %
+ urlcolor=blue, %
+ filecolor=violet,%
+}
\urlstyle{same} % don't switch to typewriter font
\RequirePackage{doi} % provides hyperlinks for doi in bibliography
\renewcommand{\doitext}{doi:~} % change the default, {doi:}, to this for PRTEC specification
-%% Since \bm is useful in headings, this fix will reduce frequency with which
-%% alternate pdfstrings must be given in section command as \section[pdfstring]{texstring}
+%% Since \bm may be useful in headings, this fix will reduce frequency with which
+%% alternate pdfstrings must be given in revised section command as \section[pdfstring]{texstring}
\pdfstringdefDisableCommands{%
\def\bm#1#{\relax}%
}
-%% Let's also make sure \NoCaseChange in section headings won't break pdf bookmarks
+% Let's disable \( and \) in pdf bookmarks
+\pdfstringdefDisableCommands{%
+ \def\({\relax}%
+ \def\){\relax}%
+}
+
+% Let's also make sure \NoCaseChange in section headings won't break pdf bookmarks
\pdfstringdefDisableCommands{%
\let\NoCaseChange\relax%
}
-%% Let's just remove citations from pdf bookmarks
+% Let's just remove citations from pdf bookmarks
\pdfstringdefDisableCommands{%
\def\cite{\@gobble}%
}
-%% Let's make sure footnotes in section headings don't break pdf bookmarks.
+%% Ensure that tag color does not follow \eqref into bookmarks
+\pdfstringdefDisableCommands{%
+ \def\eqref#1{(\ref{#1})}%
+}
+
+% Let's make sure footnotes in section headings don't break pdf bookmarks.
+% Revised footnote command above is already robust
+
\RequirePackage{etoolbox}
-\robustify{\footnote}
+\robustify\footnote
\pdfstringdefDisableCommands{%
\def\footnote#1{}%
}
-
%% Let's also add \footnote to the \TextUppercase exception list, so that footnote text won't be capitalized
-%% if given in section headings
-\RequirePackage{xpatch}
-\xpatchcmd{\@uclcnotmath}{\@nonchangecase\ref}{\@nonchangecase\ref\@nonchangecase\footnote}{}{}
-
-
-%%% Create an optional argument for unnumbered sections and set pdf bookmark (thru \addcontentsline).
-%%% The optional argument will manually set the pdf bookmark for that section; can be used to avoid hyperref
-%%% errors when macros are in section titles.
-%%% There should not be errors for $$, \cite, \ref, \label, \footnote, or \bm with current construction.
-\let\svsection\section
-\RenewDocumentCommand{\section}{s o m}{%
- \IfBooleanTF {#1}
- {\svsection*{#3}\phantomsection
- {\IfNoValueTF {#2}
- {\addcontentsline{toc}{section}{#3} }
- {\addcontentsline{toc}{section}{#2} }
- }
- }
- {\IfNoValueTF {#2}
- {\svsection{#3}}
- {\svsection[#2]{#3}}
- }
-}
+%% if given in section headings. Ditto for \eqref
+%
+\ifx\AddToNoCaseChangeList\@undefined % see https://github.com/John02139/asmeconf/issues/5
+ \patchcmd{\@uclcnotmath}{\@nonchangecase\ref}{\@nonchangecase\ref\@nonchangecase\footnote}{\typeout{PRTEC patched textcase nonchangecase to include footnote.}}{}
+ \patchcmd{\@uclcnotmath}{\@nonchangecase\ref}{\@nonchangecase\ref\@nonchangecase\eqref}{\typeout{PRTEC patched textcase nonchangecase to include eqref.}}{}
+\else
+ \AddToNoCaseChangeList{\eqref \footnote}
+\fi
+
+%%% There should be no errors for section headings with \(, \), \cite, \ref, \eqref, \label, \footnote, \NoCaseChange, or \bm
%%%%%%%%%%%%% Define special environments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -321,7 +287,7 @@
\providecommand{\@keywords}{\relax}
-\DeclareDocumentCommand{\keywords}{m}{%
+\NewDocumentCommand{\keywords}{m}{%
\IfNoValueTF{#1}{%
\relax}{%
\long\def\@keywords{\par\medskip\noindent{\bfseries\small KEYWORDS: }{\small #1}}%
@@ -331,7 +297,7 @@
\DeclareDocumentEnvironment{abstract}{}{%
\section*{Abstract}%
}
- {\@keywords\bigskip%
+ {\@keywords\ignorespacesafterend%
}
@@ -347,7 +313,7 @@
%% If the second argument of \entry is omitted, a bold section heading is produced, e.g. \entry{Greek Letters}
-\DeclareDocumentCommand{\entry}{m g}{%
+\NewDocumentCommand{\entry}{m g}{%
\IfNoValueTF{#2}{%
\item[\itshape#1\hfill]\smallskip
}{%
@@ -388,7 +354,7 @@
\providecommand\@ConfCity{\hbox{ }}
\newcommand{\HeaderConfName}{%
-\parbox{\linewidth}{\raggedleft\bfseries\sffamily%
+\parbox{\linewidth}{\raggedleft\bfseries\sffamily\small%
\@ConfName\linebreak[4]%\par%
\@ConfDate\@CDsep\@ConfCity%
}%
@@ -400,7 +366,7 @@
\newcommand{\PaperNo}{%
\vspace*{-4.7mm}%
\parbox{\linewidth}{\raggedleft\bfseries\sffamily\Large%
-\MakeTextUppercase{\@paperno}%
+\MakeUppercase{\@paperno}%
}%
}
@@ -410,7 +376,7 @@
\newcommand{\PaperTitle}{%
\par\vspace*{6mm}%
\parbox{\linewidth}{\centering{\bfseries\Large%
-\MakeTextUppercase{\@papertitle}%
+\MakeUppercase{\@papertitle}%
\thispagestyle{title}\par} %% <=== \par gets the font leading to stick so that lines space properly
}%
}
@@ -429,13 +395,13 @@
\NewCoffin{\AffiliationsBlock}
\SetHorizontalCoffin\AffiliationsBlock{}
-\DeclareDocumentCommand{\SetAuthors}{m}{%
+\NewDocumentCommand{\SetAuthors}{m}{%
\SetHorizontalCoffin\AuthorBlock{%
\parbox{\linewidth}{\centering\bfseries\ignorespaces#1\ignorespaces}%
}
}
-\DeclareDocumentCommand{\SetAffiliation}{m m}{%
+\NewDocumentCommand{\SetAffiliation}{m m}{%
\SetVerticalCoffin\AffiliationBlock{\textwidth}{%
\centering\footnotemark[#1]#2\ignorespaces%
}
@@ -448,7 +414,7 @@
\newif\ifCA\CAfalse
\newcommand{\CAemail}[1]{\gdef\@CAemail{#1}}
-\DeclareDocumentCommand{\CorrespondingAuthor}{m}{%
+\NewDocumentCommand{\CorrespondingAuthor}{m}{%
\global\CAtrue%
\CAemail{#1}%
$^\ast$%
@@ -457,13 +423,13 @@
%%% flag for joint first authors (two or more)
\newif\ifJA\JAfalse
-\DeclareDocumentCommand{\JointFirstAuthor}{}{%
+\NewDocumentCommand{\JointFirstAuthor}{}{%
\global\JAtrue%
$^\dagger$%
}
%%% Affiliation mark
-\DeclareDocumentCommand{\affil}{m}{%
+\NewDocumentCommand{\affil}{m}{%
{\mdseries\footnotemark[#1]}%
}
@@ -475,11 +441,11 @@
\oldaffil{#1}\futurelet\nextToken\isOthernote}
\newcommand\isOthernote{%
- \ifx\CorrespondingAuthor\nextToken\textsu{\mdseries,}%
+ \ifx\CorrespondingAuthor\nextToken\textsuperscript{\mdseries,}%
\else%
- \ifx\JointFirstAuthor\nextToken\textsu{\mdseries,}%
+ \ifx\JointFirstAuthor\nextToken\textsuperscript{\mdseries,}%
\else
- \ifx\affil\nextToken\textsu{\mdseries,}%
+ \ifx\affil\nextToken\textsuperscript{\mdseries,}%
\fi%
\fi%
\fi%
@@ -494,7 +460,7 @@
\renewcommand\JointFirstAuthor{%
\oldJointFirstAuthor\futurelet\nextToken\isOthernote}
-\DeclareDocumentCommand{\SetAuthorBlock}{}{%
+\NewDocumentCommand{\SetAuthorBlock}{}{%
\let\savethefootnote\thefootnote
\JoinCoffins\AuthorBlock[hc,b]\AffiliationsBlock[hc,t](0pt,-\baselineskip)
\centerline{\TypesetCoffin\AuthorBlock}
@@ -511,7 +477,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Make the title section
-\DeclareDocumentCommand{\MakeTitlePage}{}{%
+\NewDocumentCommand{\MakeTitlePage}{}{%
\PaperNo
\PaperTitle
\vspace*{2\baselineskip}