Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factor out latex details #33

Merged
merged 6 commits into from
Nov 23, 2022
Merged
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
4 changes: 0 additions & 4 deletions grammarly.tex

This file was deleted.

171 changes: 2 additions & 169 deletions paper.tex
Original file line number Diff line number Diff line change
Expand Up @@ -57,132 +57,14 @@

\usepackage{xargs}
\usepackage{lipsum}
\usepackage[textsize=tiny]{todonotes}
\usepackage{xparse}
\usepackage{xifthen, xstring}
\usepackage[normalem]{ulem}
\usepackage{xspace}
\usepackage{marginnote}
\usepackage{etoolbox}


\makeatletter
\font\uwavefont=lasyb10 scaled 652
\newcommand\colorwave[1][blue]{\bgroup\markoverwith{\lower3\p@\hbox{\uwavefont\textcolor{#1}{\char58}}}\ULon}

\newcommand\highlight[2]{{\color{#1}{\colorwave[#1]{#2}}}}
\makeatother

\makeatletter
\newcommand\InFloat[2]{\ifnum\@floatpenalty<0\relax#1\else#2\fi}
\makeatother

\ifx\paperversion\paperversiondraft
\newcommand\createtodoauthor[2]{
\def\tmpdefault{emptystring}
\expandafter\newcommand\csname #1\endcsname[2][\tmpdefault]{% comment to avoid spurious whitespace
\def\tmp{##1}% comment to avoid spurious whitespace
\InFloat{
\smash{
\marginnote{
\todo[inline,linecolor=#2,backgroundcolor=#2,bordercolor=#2]
{\textbf{#1 (Figure):} ##2}
}
}
}{\ifthenelse{\equal{\tmp}{\tmpdefault}} % Is there text to highlight?
{\todo[linecolor=#2,backgroundcolor=#2,bordercolor=#2]{\textbf{#1:} ##2}\ignorespaces}
{\ifthenelse{\equal{##2}{}} % Is there a note?
{\highlight{#2}{##1}}
{\highlight{#2}{##1}\todo[linecolor=#2,backgroundcolor=#2,bordercolor=#2]
{\textbf{#1:} ##2}% comment to avoid spurious whitespace
}% comment to avoid spurious whitespace
}% comment to avoid spurious whitespace
}% comment to avoid spurious whitespace
}
}
\else
\newcommand\createtodoauthor[2]{%
\expandafter\newcommand\csname #1\endcsname[2][]{##1}%
}%
\fi

% Broaden margins to make room for todo notes
\makeatletter
\patchcmd{\@addmarginpar}{\ifodd\c@page}{\ifodd\c@page\@tempcnta\m@ne}{}{}
\makeatother
\ifx\paperversion\paperversiondraft
\makeatletter
\if@ACM@journal
\geometry{asymmetric}
\paperwidth=\dimexpr \paperwidth + 3.5cm\relax
\oddsidemargin=\dimexpr\oddsidemargin + 0cm\relax
\evensidemargin=\dimexpr\evensidemargin + 0cm\relax
\marginparwidth=\dimexpr \marginparwidth + 3cm\relax
\setlength{\marginparwidth}{4.6cm}
% This makeatletter box helps to move notes to the right
\makeatletter
\long\def\@mn@@@marginnote[#1]#2[#3]{%
\begingroup
\ifmmode\mn@strut\let\@tempa\mn@vadjust\else
\if@inlabel\leavevmode\fi
\ifhmode\mn@strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi
\fi
\@tempa{%
\vbox to\z@{%
\vss
\@mn@margintest
\if@reversemargin\if@tempswa
\@tempswafalse
\else
\@tempswatrue
\fi\fi
%\if@tempswa
\rlap{%
\if@mn@verbose
\PackageInfo{marginnote}{xpos seems to be \@mn@currxpos}%
\fi
\begingroup
\ifx\@mn@currxpos\relax\else\ifx\@mn@currxpos\@empty\else
\kern-\dimexpr\@mn@currxpos\relax
\fi\fi
\ifx\@mn@currpage\relax
\let\@mn@currpage\@ne
\fi
\if@twoside\ifodd\@mn@currpage\relax
\kern\oddsidemargin
\else
\kern\evensidemargin
\fi
\else
\kern\oddsidemargin
\fi
\kern 1in
\endgroup
\kern\marginnotetextwidth\kern\marginparsep
\vbox to\z@{\kern\marginnotevadjust\kern #3
\vbox to\z@{%
\hsize\marginparwidth
\linewidth\hsize
\kern-\parskip
\marginfont\raggedrightmarginnote\strut\hspace{\z@}%
\ignorespaces#2\endgraf
\vss}%
\vss}%
}%
}%
}%
\endgroup
}
\makeatother
\else
\paperwidth=\dimexpr \paperwidth + 6cm\relax
\oddsidemargin=\dimexpr\oddsidemargin + 3cm\relax
\evensidemargin=\dimexpr\evensidemargin + 3cm\relax
\marginparwidth=\dimexpr \marginparwidth + 3cm\relax
\setlength{\marginparwidth}{4.6cm}
\fi
\makeatother
\fi
\input{tex/setup.tex}
\input{tex/acm.tex}

% We use the following color scheme
%
Expand Down Expand Up @@ -246,55 +128,6 @@
\DeclareRobustCommand\circled[2][]{\ifthenelse{\isempty{#1}}{\tikz[baseline=(char.base)]{\node[shape=circle,fill=pairedOneLightBlue,inner sep=1pt] (char) {#2};}}{\autoref{#1}: \hyperref[#1]{\tikz[baseline=(char.base)]{\node[shape=circle,fill=pairedOneLightBlue,inner sep=1pt] (char) {#2};}}}}


\ifx\acmversion\acmversionjournal
%% Journal information (used by PACMPL format)
%% Supplied to authors by publisher for camera-ready submission
\acmJournal{PACMPL}
\acmVolume{1}
\acmNumber{1}
\acmArticle{1}
\acmYear{2017}
\acmMonth{1}
\acmDOI{10.1145/nnnnnnn.nnnnnnn}
\startPage{1}
\else
%% Conference information (used by SIGPLAN proceedings format)
%% Supplied to authors by publisher for camera-ready submission
\acmConference[PL'17]{ACM SIGPLAN Conference on Programming Languages}{January 01--03, 2017}{New York, NY, USA}
\acmYear{2017}
\acmISBN{978-x-xxxx-xxxx-x/YY/MM}
\acmDOI{10.1145/nnnnnnn.nnnnnnn}
\startPage{1}
\fi

%% Copyright information
%% Supplied to authors (based on authors' rights management selection;
%% see authors.acm.org) by publisher for camera-ready submission
%\setcopyright{none} %% For review submission
%\setcopyright{acmcopyright}
%\setcopyright{acmlicensed}
%\setcopyright{rightsretained}
%\copyrightyear{2017} %% If different from \acmYear


%% Bibliography style
\bibliographystyle{ACM-Reference-Format}
%% Citation style
%% Note: author/year citations are required for papers published as an
%% issue of PACMPL.
%\citestyle{acmauthoryear} %% For author/year citations
%\citestyle{acmnumeric} %% For numeric citations
%\setcitestyle{nosort} %% With 'acmnumeric', to disable automatic
%% sorting of references within a single citation;
%% e.g., \cite{Smith99,Carpenter05,Baker12}
%% rendered as [14,5,2] rather than [2,5,14].
%\setcitesyle{nocompress} %% With 'acmnumeric', to disable automatic
%% compression of sequential references within a
%% single citation;
%% e.g., \cite{Baker12,Baker14,Baker16}
%% rendered as [2,3,4] rather than [2-4].


\begin{document}

%% Title information
Expand Down
47 changes: 47 additions & 0 deletions tex/acm.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
\ifx\acmversion\acmversionjournal
%% Journal information (used by PACMPL format)
%% Supplied to authors by publisher for camera-ready submission
\acmJournal{PACMPL}
\acmVolume{1}
\acmNumber{1}
\acmArticle{1}
\acmYear{2017}
\acmMonth{1}
\acmDOI{10.1145/nnnnnnn.nnnnnnn}
\startPage{1}
\else
%% Conference information (used by SIGPLAN proceedings format)
%% Supplied to authors by publisher for camera-ready submission
\acmConference[PL'17]{ACM SIGPLAN Conference on Programming Languages}{January 01--03, 2017}{New York, NY, USA}
\acmYear{2017}
\acmISBN{978-x-xxxx-xxxx-x/YY/MM}
\acmDOI{10.1145/nnnnnnn.nnnnnnn}
\startPage{1}
\fi

%% Copyright information
%% Supplied to authors (based on authors' rights management selection;
%% see authors.acm.org) by publisher for camera-ready submission
%\setcopyright{none} %% For review submission
%\setcopyright{acmcopyright}
%\setcopyright{acmlicensed}
%\setcopyright{rightsretained}
%\copyrightyear{2017} %% If different from \acmYear


%% Bibliography style
\bibliographystyle{ACM-Reference-Format}
%% Citation style
%% Note: author/year citations are required for papers published as an
%% issue of PACMPL.
%\citestyle{acmauthoryear} %% For author/year citations
%\citestyle{acmnumeric} %% For numeric citations
%\setcitestyle{nosort} %% With 'acmnumeric', to disable automatic
%% sorting of references within a single citation;
%% e.g., \cite{Smith99,Carpenter05,Baker12}
%% rendered as [14,5,2] rather than [2,5,14].
%\setcitesyle{nocompress} %% With 'acmnumeric', to disable automatic
%% compression of sequential references within a
%% single citation;
%% e.g., \cite{Baker12,Baker14,Baker16}
%% rendered as [2,3,4] rather than [2-4].
127 changes: 127 additions & 0 deletions tex/setup.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Broaden margins to make room for todo notes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\makeatletter
\patchcmd{\@addmarginpar}{\ifodd\c@page}{\ifodd\c@page\@tempcnta\m@ne}{}{}
\makeatother
\ifx\paperversion\paperversiondraft
\makeatletter
\if@ACM@journal
\geometry{asymmetric}
\paperwidth=\dimexpr \paperwidth + 3.5cm\relax
\oddsidemargin=\dimexpr\oddsidemargin + 0cm\relax
\evensidemargin=\dimexpr\evensidemargin + 0cm\relax
\marginparwidth=\dimexpr \marginparwidth + 3cm\relax
\setlength{\marginparwidth}{4.6cm}
% This makeatletter box helps to move notes to the right
\makeatletter
\long\def\@mn@@@marginnote[#1]#2[#3]{%
\begingroup
\ifmmode\mn@strut\let\@tempa\mn@vadjust\else
\if@inlabel\leavevmode\fi
\ifhmode\mn@strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi
\fi
\@tempa{%
\vbox to\z@{%
\vss
\@mn@margintest
\if@reversemargin\if@tempswa
\@tempswafalse
\else
\@tempswatrue
\fi\fi
%\if@tempswa
\rlap{%
\if@mn@verbose
\PackageInfo{marginnote}{xpos seems to be \@mn@currxpos}%
\fi
\begingroup
\ifx\@mn@currxpos\relax\else\ifx\@mn@currxpos\@empty\else
\kern-\dimexpr\@mn@currxpos\relax
\fi\fi
\ifx\@mn@currpage\relax
\let\@mn@currpage\@ne
\fi
\if@twoside\ifodd\@mn@currpage\relax
\kern\oddsidemargin
\else
\kern\evensidemargin
\fi
\else
\kern\oddsidemargin
\fi
\kern 1in
\endgroup
\kern\marginnotetextwidth\kern\marginparsep
\vbox to\z@{\kern\marginnotevadjust\kern #3
\vbox to\z@{%
\hsize\marginparwidth
\linewidth\hsize
\kern-\parskip
\marginfont\raggedrightmarginnote\strut\hspace{\z@}%
\ignorespaces#2\endgraf
\vss}%
\vss}%
}%
}%
}%
\endgroup
}
\makeatother
\else
\paperwidth=\dimexpr \paperwidth + 6cm\relax
\oddsidemargin=\dimexpr\oddsidemargin + 3cm\relax
\evensidemargin=\dimexpr\evensidemargin + 3cm\relax
\marginparwidth=\dimexpr \marginparwidth + 3cm\relax
\setlength{\marginparwidth}{4.6cm}
\fi
\makeatother
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Add \createtodoauthor command
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage[textsize=tiny]{todonotes}
\usepackage[normalem]{ulem}

\makeatletter
\font\uwavefont=lasyb10 scaled 652
\newcommand\colorwave[1][blue]{\bgroup\markoverwith{\lower3\p@\hbox{\uwavefont\textcolor{#1}{\char58}}}\ULon}

\newcommand\highlight[2]{{\color{#1}{\colorwave[#1]{#2}}}}
\makeatother

\makeatletter
\newcommand\InFloat[2]{\ifnum\@floatpenalty<0\relax#1\else#2\fi}
\makeatother

\ifx\paperversion\paperversiondraft
\newcommand\createtodoauthor[2]{
\def\tmpdefault{emptystring}
\expandafter\newcommand\csname #1\endcsname[2][\tmpdefault]{% comment to avoid spurious whitespace
\def\tmp{##1}% comment to avoid spurious whitespace
\InFloat{
\smash{
\marginnote{
\todo[inline,linecolor=#2,backgroundcolor=#2,bordercolor=#2]
{\textbf{#1 (Figure):} ##2}
}
}
}{\ifthenelse{\equal{\tmp}{\tmpdefault}} % Is there text to highlight?
{\todo[linecolor=#2,backgroundcolor=#2,bordercolor=#2]{\textbf{#1:} ##2}\ignorespaces}
{\ifthenelse{\equal{##2}{}} % Is there a note?
{\highlight{#2}{##1}}
{\highlight{#2}{##1}\todo[linecolor=#2,backgroundcolor=#2,bordercolor=#2]
{\textbf{#1:} ##2}% comment to avoid spurious whitespace
}% comment to avoid spurious whitespace
}% comment to avoid spurious whitespace
}% comment to avoid spurious whitespace
}
}
\else
\newcommand\createtodoauthor[2]{%
\expandafter\newcommand\csname #1\endcsname[2][]{##1}%
}%
\fi
File renamed without changes.
File renamed without changes.