summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/anonymous-acm/anonymous-acm.sty
blob: 21964043f6fe288359794bfa05e3905244f4bab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
%% anonymous-acm.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-acm}
\NeedsTeXFormat{LaTeX2e}


% Define anonymous condition
\newif\ifAnonCondition\AnonConditiontrue

% Declare options
\DeclareOption{true}{\AnonConditiontrue}
\DeclareOption{false}{\AnonConditionfalse}
\DeclareOption*{\PackageWarning{anonymous-acm}{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