summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/anonymous/anonymous.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/anonymous/anonymous.sty')
-rw-r--r--macros/latex/contrib/anonymous/anonymous.sty78
1 files changed, 78 insertions, 0 deletions
diff --git a/macros/latex/contrib/anonymous/anonymous.sty b/macros/latex/contrib/anonymous/anonymous.sty
new file mode 100644
index 0000000000..173e61a4d4
--- /dev/null
+++ b/macros/latex/contrib/anonymous/anonymous.sty
@@ -0,0 +1,78 @@
+%% anonymous.sty
+%% version 1.0 09-May-2020
+%% Maintained by Brett A. Becker: brett.becker@ucd.ie
+
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3 of this license or any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+
+% This program is distributed in the hope that it will be useful
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+% designed to be used with acmart.cls - required for full functionality
+
+%% Identification
+%% The package identifies itself and the LaTeX version needed
+\ProvidesPackage{anonymous}
+\NeedsTeXFormat{LaTeX2e}
+
+
+% Define anonymous condition
+\newif\ifAnonCondition\AnonConditiontrue
+
+% Declare options
+\DeclareOption{true}{\AnonConditiontrue}
+\DeclareOption{false}{\AnonConditionfalse}
+\DeclareOption*{\PackageWarning{anonymous}{Unknown ‘\CurrentOption’}}
+\ProcessOptions\relax
+
+% Anonymous Authors
+\newcommand{\authoranon}[1]{#1}
+\ifAnonCondition
+\renewcommand{\authoranon}[1]{
+\author{Anonymous Author(s)}
+}
+\else
+\renewcommand{\authoranon}[1]{#1}
+\fi
+
+% Anonymous Arbitrary Text
+\newcommand{\textanon}[2]{#1}
+\ifAnonCondition
+\renewcommand{\textanon}[2]{\ifstrequal{}{#2}{<text removed for peer review>}{#2}}
+\else
+\renewcommand{\textanon}[2]{#1}
+\fi
+
+% Anonymous Links
+\newcommand{\linkanon}[2]{\href{#1}{#2}}
+\ifAnonCondition
+\renewcommand{\linkanon}[2]{<anonymous link>}
+\else
+\renewcommand{\linkanon}[2]{\href{#1}{#2}}
+\fi
+
+\newcommand{\textlinkanon}[2]{\href{#1}{#2}}
+\ifAnonCondition
+\renewcommand{\textlinkanon}[2]{#2}
+\else
+\renewcommand{\textlinkanon}[2]{\href{#1}{#2}}
+\fi
+
+% Anonymous Citations & References
+\newcommand{\citeanon}[2][\ ]{\cite[#1]{#2}}
+\ifAnonCondition
+\renewcommand{\citeanon}[2][\ ]{[anonymous]}
+\else
+\renewcommand{\citeanon}[2][@]{\ifstrequal{@}{#1}{\cite{#2}}{\cite[#1]{#2}}}
+\fi
+
+% Anonymous Acknowledgments
+\ifAnonCondition
+\excludecomment{acks}
+\fi