Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ editors: list of the editors of the volume, in the form
publisher: published of the conference, generally "Association for Computational Linguistics"
volume_name: a tag used by the ACL Anthology to characterize the new volume in a group of proceedings. For a volume of the main conference, it should be a tag from the list long|short|srw|demo|findings. For other volumes, such as workshops, it should be set to 1
watermark_book_title: [optional] If you do not want to use the text in the book_title as a watermark, you can specify here the alternative form. It is particularly usefull when the book_title is too long: in this case you can copy that text in this field and use the line break symbol \\ and, if the text is enclosed between " ", use \\\\
proceedings_address: [optional] LaTeX table rows that replace the default address shown on the Copyright page of `proceedings.tex`, for ordering physical copies of proceedings. Each row should start with & (for the second column) and end with \\ (LaTeX line break). Use the | (pipe) character for multi-line literal strings in YAML. The lines should be indented consistently (the template will automatically remove the indentation). Example:
proceedings_address: |
& Association for Computational Linguistics (ACL)\\
& 317 Sidney Baker St. S \\
& Suite 400 - 134\\
& Kerrville, TX 78028\\
& USA\\
& Tel: +1-855-225-1962\\
&{\tt [email protected]}\\
```

**Notice**: avoid using LaTeX escape codes but simply use the characters in UTF8, e.g., Rilić instead of Rili'\\{c})).
Expand Down
4 changes: 3 additions & 1 deletion aclpub2/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ def load_configs(root: Path):
Loads all conference configuration files defined in the root directory.
"""
conference = load_config("conference_details", root, required=True)
# Fields that contain raw LaTeX code and should not be escaped
raw_latex_fields = {'proceedings_address'}
for item in conference:
if isinstance(conference[item], str):
if isinstance(conference[item], str) and item not in raw_latex_fields:
conference[item] = normalize_latex_string(conference[item])

papers = load_config("papers", root)
Expand Down
7 changes: 7 additions & 0 deletions aclpub2/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ def session_times(session) -> str:
return f"{start} - {end}"


def dedent_lines(text: str) -> str:
"""Remove leading whitespace from each line while preserving the text."""
import textwrap
return textwrap.dedent(text)


LATEX_JINJA_ENV = jinja2.Environment(
block_start_string="\BLOCK{",
block_end_string="}",
Expand All @@ -114,6 +120,7 @@ def session_times(session) -> str:
index_author=index_author,
index_speakers=index_speakers,
)
LATEX_JINJA_ENV.filters['dedent'] = dedent_lines


def load_template(template: str) -> jinja2.Template:
Expand Down
12 changes: 9 additions & 3 deletions aclpub2/templates/proceedings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
\newpage
\BLOCK{endif}


%%%%%%%%%%%%%
% Copyright %
%%%%%%%%%%%%%
Expand All @@ -128,8 +127,14 @@

\vspace*{2cm}
\noindent
Order copies of this and other ACL proceedings from:
Order copies of this and other \VAR{conference.publisher} proceedings from:

\BLOCK{if conference.proceedings_address is defined}
\vspace*{1cm}
\begin{tabular}{p{1.5cm}l}
\VAR{conference.proceedings_address | dedent}
\end{tabular}
\BLOCK{else}
\vspace*{1cm}
\begin{tabular}{p{1.5cm}l}
& Association for Computational Linguistics (ACL)\\
Expand All @@ -140,6 +145,7 @@
& Tel: +1-855-225-1962\\
&{\tt [email protected]}\\
\end{tabular}
\BLOCK{endif}

\vspace*{1cm}
ISBN \VAR{conference.isbn}
Expand Down Expand Up @@ -453,7 +459,7 @@
\put(0,13){\parbox[t]{\paperwidth}{\centering
\emph{\VAR{title}}, pages \VAR{paper.start_page}--\VAR{paper.end_page} \\
\VAR{conference_dates}, \VAR{conference.start_date.year} \textcopyright
\VAR{conference.start_date.year} Association for Computational Linguistics}}
\VAR{conference.start_date.year} \VAR{conference.publisher}}}
}
\includepdf[pagecommand={\thispagestyle{plain}},pages=-,addtotoc={1,section,1,{\VAR{paper.title}},ref:paper_{\VAR{paper.id}}}]{\VAR{root}/papers/\VAR{paper.file}}
\BLOCK{endfor}
Expand Down
2 changes: 1 addition & 1 deletion aclpub2/templates/watermarked_pdf.tex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
\put(0,13){\parbox[t]{\paperwidth}{\centering
\emph{\VAR{title}}, pages \VAR{paper.start_page}--\VAR{paper.end_page} \\
\VAR{conference_dates}, \VAR{conference.start_date.year} \textcopyright
\VAR{conference.start_date.year} Association for Computational Linguistics}}
\VAR{conference.start_date.year} \VAR{conference.publisher}}}

}
\includepdf[pagecommand={\thispagestyle{plain}},pages=-]{\VAR{root}/papers/\VAR{paper.file}}
Expand Down