templates/acl/acl.sty
templates/acl/acl.styBrowse 56 files
4,145 tokens
11,615 bytes
Token encoding: o200k_base
Snapshot 24fd22b
← Back to SKILL.md
1% This is the LaTex style file for *ACL.2% The official sources can be found at3%4% https://github.com/acl-org/acl-style-files/5%6% This package is activated by adding7%8% \usepackage{acl}9%10% to your LaTeX file. When submitting your paper for review, add the "review" option:11%12% \usepackage[review]{acl}13 14\newif\ifacl@finalcopy15\newif\ifacl@anonymize16\newif\ifacl@linenumbers17\newif\ifacl@pagenumbers18\DeclareOption{final}{\acl@finalcopytrue\acl@anonymizefalse\acl@linenumbersfalse\acl@pagenumbersfalse}19\DeclareOption{review}{\acl@finalcopyfalse\acl@anonymizetrue\acl@linenumberstrue\acl@pagenumberstrue}20\DeclareOption{preprint}{\acl@finalcopytrue\acl@anonymizefalse\acl@linenumbersfalse\acl@pagenumberstrue}21\ExecuteOptions{final} % final copy is the default22 23% include hyperref, unless user specifies nohyperref option like this:24% \usepackage[nohyperref]{acl}25\newif\ifacl@hyperref26\DeclareOption{hyperref}{\acl@hyperreftrue}27\DeclareOption{nohyperref}{\acl@hyperreffalse}28\ExecuteOptions{hyperref} % default is to use hyperref29\ProcessOptions\relax30 31\typeout{Conference Style for ACL}32 33\usepackage{xcolor}34 35\ifacl@linenumbers36 % Add draft line numbering via the lineno package37 % https://texblog.org/2012/02/08/adding-line-numbers-to-documents/38 \usepackage[switch,mathlines]{lineno}39 40 % Line numbers in gray Helvetica 8pt41 \font\aclhv = phvb at 8pt42 \renewcommand\linenumberfont{\aclhv\color{lightgray}}43 44 % Zero-fill line numbers45 % NUMBER with left flushed zeros \fillzeros[<WIDTH>]<NUMBER>46 \newcount\cv@tmpc@ \newcount\cv@tmpc47 \def\fillzeros[#1]#2{\cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi48 \cv@tmpc=1 %49 \loop\ifnum\cv@tmpc@<10 \else \divide\cv@tmpc@ by 10 \advance\cv@tmpc by 1 \fi50 \ifnum\cv@tmpc@=10\relax\cv@tmpc@=11\relax\fi \ifnum\cv@tmpc@>10 \repeat51 \ifnum#2<0\advance\cv@tmpc1\relax-\fi52 \loop\ifnum\cv@tmpc<#1\relax0\advance\cv@tmpc1\relax\fi \ifnum\cv@tmpc<#1 \repeat53 \cv@tmpc@=#2\relax\ifnum\cv@tmpc@<0\cv@tmpc@=-\cv@tmpc@\fi \relax\the\cv@tmpc@}%54 \renewcommand\thelinenumber{\fillzeros[3]{\arabic{linenumber}}}55 \AtBeginDocument{\linenumbers}56 57 \setlength{\linenumbersep}{1.6cm}58 59 % Bug: An equation with $$ ... $$ isn't numbered, nor is the previous line.60 61 % Patch amsmath commands so that the previous line and the equation itself62 % are numbered. Bug: multline has an extra line number.63 % https://tex.stackexchange.com/questions/461186/how-to-use-lineno-with-amsmath-align64 \usepackage{etoolbox} %% <- for \pretocmd, \apptocmd and \patchcmd65 66 \newcommand*\linenomathpatch[1]{%67 \expandafter\pretocmd\csname #1\endcsname {\linenomath}{}{}%68 \expandafter\pretocmd\csname #1*\endcsname {\linenomath}{}{}%69 \expandafter\apptocmd\csname end#1\endcsname {\endlinenomath}{}{}%70 \expandafter\apptocmd\csname end#1*\endcsname {\endlinenomath}{}{}%71 }72 \newcommand*\linenomathpatchAMS[1]{%73 \expandafter\pretocmd\csname #1\endcsname {\linenomathAMS}{}{}%74 \expandafter\pretocmd\csname #1*\endcsname {\linenomathAMS}{}{}%75 \expandafter\apptocmd\csname end#1\endcsname {\endlinenomath}{}{}%76 \expandafter\apptocmd\csname end#1*\endcsname {\endlinenomath}{}{}%77 }78 79 %% Definition of \linenomathAMS depends on whether the mathlines option is provided80 \expandafter\ifx\linenomath\linenomathWithnumbers81 \let\linenomathAMS\linenomathWithnumbers82 %% The following line gets rid of an extra line numbers at the bottom:83 \patchcmd\linenomathAMS{\advance\postdisplaypenalty\linenopenalty}{}{}{}84 \else85 \let\linenomathAMS\linenomathNonumbers86 \fi87 88 \AtBeginDocument{%89 \linenomathpatch{equation}%90 \linenomathpatchAMS{gather}%91 \linenomathpatchAMS{multline}%92 \linenomathpatchAMS{align}%93 \linenomathpatchAMS{alignat}%94 \linenomathpatchAMS{flalign}%95 }96\else97 % Hack to ignore these commands, which review mode puts into the .aux file.98 \newcommand{\@LN@col}[1]{}99 \newcommand{\@LN}[2]{}100 \newcommand{\nolinenumbers}{}101\fi102 103\PassOptionsToPackage{a4paper,margin=2.5cm,heightrounded=true}{geometry}104\RequirePackage{geometry}105 106\setlength\columnsep{0.6cm}107\newlength\titlebox108\setlength\titlebox{11\baselineskip}109% \titlebox should be a multiple of \baselineskip so that110% column height remaining fits an exact number of lines of text111 112\flushbottom \twocolumn \sloppy113 114% We're never going to need a table of contents, so just flush it to115% save space --- suggested by drstrip@sandia-2116\def\addcontentsline#1#2#3{}117 118\ifacl@pagenumbers119 \pagenumbering{arabic}120\else121 \thispagestyle{empty}122 \pagestyle{empty}123\fi124 125%% Title and Authors %%126 127\let\Thanks\thanks % \Thanks and \thanks used to be different, but keep this for backwards compatibility.128 129\newcommand\outauthor{%130 \begin{tabular}[t]{c}131 \ifacl@anonymize132 \bfseries Anonymous ACL submission133 \else134 \bfseries\@author135 \fi136 \end{tabular}}137 138% Mostly taken from deproc.139\AtBeginDocument{140\def\maketitle{\par141 \begingroup142 \def\thefootnote{\fnsymbol{footnote}}143 \twocolumn[\@maketitle]144 \@thanks145 \endgroup146 \setcounter{footnote}{0}147 \let\maketitle\relax148 \let\@maketitle\relax149 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}150\def\@maketitle{\vbox to \titlebox{\hsize\textwidth151 \linewidth\hsize \vskip 0.125in minus 0.125in \centering152 {\Large\bfseries \@title \par} \vskip 0.2in plus 1fil minus 0.1in153 {\def\and{\unskip\enspace{\rmfamily and}\enspace}%154 \def\And{\end{tabular}\hss \egroup \hskip 1in plus 2fil155 \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\bfseries}%156 \def\AND{\end{tabular}\hss\egroup \hfil\hfil\egroup157 \vskip 0.25in plus 1fil minus 0.125in158 \hbox to \linewidth\bgroup\large \hfil\hfil159 \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\bfseries}160 \hbox to \linewidth\bgroup\large \hfil\hfil161 \hbox to 0pt\bgroup\hss162 \outauthor163 \hss\egroup164 \hfil\hfil\egroup}165 \vskip 0.3in plus 2fil minus 0.1in166}}167}168 169% margins and font size for abstract170\renewenvironment{abstract}%171 {\begin{center}\large\textbf{\abstractname}\end{center}%172 \begin{list}{}%173 {\setlength{\rightmargin}{0.6cm}%174 \setlength{\leftmargin}{0.6cm}}%175 \item[]\ignorespaces%176 \@setsize\normalsize{12pt}\xpt\@xpt177 }%178 {\unskip\end{list}}179 180% Resizing figure and table captions - SL181% Support for interacting with the caption, subfigure, and subcaption packages - SL182\RequirePackage{caption}183\DeclareCaptionFont{10pt}{\fontsize{10pt}{12pt}\selectfont}184\captionsetup{font=10pt}185 186\RequirePackage{natbib}187% for citation commands in the .tex, authors can use:188% \citep, \citet, and \citeyearpar for compatibility with natbib, or189% \cite, \newcite, and \shortcite for compatibility with older ACL .sty files190\renewcommand\cite{\citep} % to get "(Author Year)" with natbib191\newcommand\shortcite{\citeyearpar}% to get "(Year)" with natbib192\newcommand\newcite{\citet} % to get "Author (Year)" with natbib193\newcommand{\citeposs}[1]{\citeauthor{#1}'s (\citeyear{#1})} % to get "Author's (Year)"194 195\bibliographystyle{acl_natbib}196 197% Bibliography198 199% Don't put a label in the bibliography at all. Just use the unlabeled format200% instead.201\def\thebibliography#1{\vskip\parskip%202\vskip\baselineskip%203\def\baselinestretch{1}%204\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi%205\vskip-\parskip%206\vskip-\baselineskip%207\section*{References\@mkboth208 {References}{References}}\list209 {}{\setlength{\labelwidth}{0pt}\setlength{\leftmargin}{\parindent}210 \setlength{\itemindent}{-\parindent}}211 \def\newblock{\hskip .11em plus .33em minus -.07em}212 \sloppy\clubpenalty4000\widowpenalty4000213 \sfcode`\.=1000\relax}214\let\endthebibliography=\endlist215 216 217% Allow for a bibliography of sources of attested examples218\def\thesourcebibliography#1{\vskip\parskip%219\vskip\baselineskip%220\def\baselinestretch{1}%221\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi%222\vskip-\parskip%223\vskip-\baselineskip%224\section*{Sources of Attested Examples\@mkboth225 {Sources of Attested Examples}{Sources of Attested Examples}}\list226 {}{\setlength{\labelwidth}{0pt}\setlength{\leftmargin}{\parindent}227 \setlength{\itemindent}{-\parindent}}228 \def\newblock{\hskip .11em plus .33em minus -.07em}229 \sloppy\clubpenalty4000\widowpenalty4000230 \sfcode`\.=1000\relax}231\let\endthesourcebibliography=\endlist232 233% sections with less space234\def\section{\@startsection {section}{1}{\z@}{-2.0ex plus235 -0.5ex minus -.2ex}{1.5ex plus 0.3ex minus .2ex}{\large\bfseries\raggedright}}236\def\subsection{\@startsection{subsection}{2}{\z@}{-1.8ex plus237 -0.5ex minus -.2ex}{0.8ex plus .2ex}{\normalsize\bfseries\raggedright}}238%% changed by KO to - values to get the initial parindent right239\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-1.5ex plus240 -0.5ex minus -.2ex}{0.5ex plus .2ex}{\normalsize\bfseries\raggedright}}241\def\paragraph{\@startsection{paragraph}{4}{\z@}{1.5ex plus242 0.5ex minus .2ex}{-1em}{\normalsize\bfseries}}243\def\subparagraph{\@startsection{subparagraph}{5}{\parindent}{1.5ex plus244 0.5ex minus .2ex}{-1em}{\normalsize\bfseries}}245 246% Footnotes247\footnotesep 6.65pt %248\skip\footins 9pt plus 4pt minus 2pt249\def\footnoterule{\kern-3pt \hrule width 5pc \kern 2.6pt }250\setcounter{footnote}{0}251 252% Lists and paragraphs253\parindent 1em254\topsep 4pt plus 1pt minus 2pt255\partopsep 1pt plus 0.5pt minus 0.5pt256\itemsep 2pt plus 1pt minus 0.5pt257\parsep 2pt plus 1pt minus 0.5pt258 259\leftmargin 2em \leftmargini\leftmargin \leftmarginii 2em260\leftmarginiii 1.5em \leftmarginiv 1.0em \leftmarginv .5em \leftmarginvi .5em261\labelwidth\leftmargini\advance\labelwidth-\labelsep \labelsep 5pt262 263\def\@listi{\leftmargin\leftmargini}264\def\@listii{\leftmargin\leftmarginii265 \labelwidth\leftmarginii\advance\labelwidth-\labelsep266 \topsep 2pt plus 1pt minus 0.5pt267 \parsep 1pt plus 0.5pt minus 0.5pt268 \itemsep \parsep}269\def\@listiii{\leftmargin\leftmarginiii270 \labelwidth\leftmarginiii\advance\labelwidth-\labelsep271 \topsep 1pt plus 0.5pt minus 0.5pt272 \parsep \z@ \partopsep 0.5pt plus 0pt minus 0.5pt273 \itemsep \topsep}274\def\@listiv{\leftmargin\leftmarginiv275 \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}276\def\@listv{\leftmargin\leftmarginv277 \labelwidth\leftmarginv\advance\labelwidth-\labelsep}278\def\@listvi{\leftmargin\leftmarginvi279 \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}280 281\abovedisplayskip 7pt plus2pt minus5pt%282\belowdisplayskip \abovedisplayskip283\abovedisplayshortskip 0pt plus3pt%284\belowdisplayshortskip 4pt plus3pt minus3pt%285 286% Less leading in most fonts (due to the narrow columns)287% The choices were between 1-pt and 1.5-pt leading288\def\@normalsize{\@setsize\normalsize{11pt}\xpt\@xpt}289\def\small{\@setsize\small{10pt}\ixpt\@ixpt}290\def\footnotesize{\@setsize\footnotesize{10pt}\ixpt\@ixpt}291\def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}292\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}293\def\large{\@setsize\large{14pt}\xiipt\@xiipt}294\def\Large{\@setsize\Large{16pt}\xivpt\@xivpt}295\def\LARGE{\@setsize\LARGE{20pt}\xviipt\@xviipt}296\def\huge{\@setsize\huge{23pt}\xxpt\@xxpt}297\def\Huge{\@setsize\Huge{28pt}\xxvpt\@xxvpt}298 299% The hyperref manual (section 9) says hyperref should be loaded after natbib300\ifacl@hyperref301 \PassOptionsToPackage{breaklinks}{hyperref}302 \RequirePackage{hyperref}303 % make links dark blue304 \definecolor{darkblue}{rgb}{0, 0, 0.5}305 \hypersetup{colorlinks=true, citecolor=darkblue, linkcolor=darkblue, urlcolor=darkblue}306\else307 % This definition is used if the hyperref package is not loaded.308 % It provides a backup, no-op definiton of \href.309 % This is necessary because \href command is used in the acl_natbib.bst file.310 \def\href#1#2{{#2}}311 \usepackage{url}312\fi313