summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/debate/debate.dtx
blob: 8e51f41e7a7b91c35ae80dc61734d632a116a55a (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
% \iffalse meta-comment
% (The MIT License)
%
% Copyright (c) 2021-2022 Yegor Bugayenko
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the 'Software'), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in all
% copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE.
% \fi

% \CheckSum{0}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}

% \GetFileInfo{debate.dtx}
% \DoNotIndex{\endgroup,\begingroup,\let,\else,\fi,\newcommand,\newenvironment}

% \iffalse
%<*driver>
\ProvidesFile{debate.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{debate}
%<*package>
[2022-10-29 0.2.1 Debates Between Reviewers]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage[tt=false, type1=true]{libertine}
\usepackage{debate}
\usepackage{href-ul}
\usepackage[dtx]{docshots}
\usepackage{microtype}
\AddToHook{env/verbatim/begin}{\microtypesetup{protrusion=false}}
\PageIndex
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
	\DocInput{debate.dtx}
	\PrintChanges
	\PrintIndex
\end{document}
%</driver>
% \fi

% \title{|debate|: \LaTeX{} Package \\ for Debates Between Reviewers\thanks{The sources are in GitHub at \href{https://github.com/yegor256/debate}{yegor256/debate}}}
% \author{Yegor Bugayenko \\ \texttt{yegor256@gmail.com}}
% \date{\filedate, \fileversion}
%
% \maketitle
%
% \textbf{NB!}
% If you want to use |tcolorbox| package, make sure you include
% |debate| first.

% \section{Introduction}
%
% This package helps you organize debates between a few people
% right inside your documents:

% \begin{docshot}
% \documentclass{article}
% \usepackage{debate}
% \usepackage[paperwidth=3in]{geometry}
% \pagestyle{empty}
% \begin{document}\noindent
% Never argue with stupid people,
% \debate[Jeff]{I disagree!}
% \debate[Anna]{I won't argue...}
% they will drag you down to their
% level and then beat you with
% experience -- \emph{Mark Twain}
% \end{document}
% \end{docshot}

% \section{Package Options}

% \begin{macro}{hide}
% You can hide them all using |hide| package option.
% \end{macro}

% \StopEventually{}

% \section{Implementation}

% \changes{v0.1.0}{2021/09/26}{Initial version}

% First, we include a few packages:
%    \begin{macrocode}
\RequirePackage{xcolor}
\PassOptionsToPackage{most}{tcolorbox}
\RequirePackage{tcolorbox}
%    \end{macrocode}

% Then, we parse package options:
%    \begin{macrocode}
\RequirePackage{xkeyval}
\makeatletter
\newif\ifdebate@hide
\DeclareOptionX{hide}{\debate@hidetrue}
\ProcessOptionsX\relax
\makeatother
%    \end{macrocode}

% \begin{macro}{\debate}
% Finally, we define |\debate| command:
%    \begin{macrocode}
\makeatletter\newcommand\debate[2][Reviewer]{%
  \ifdebate@hide%
    #1%
  \else%
    {%
      \begin{tcolorbox}[frame hidden,sharp corners,
        enhanced,borderline west={1pt}{0pt}{red},
        interior hidden,boxsep=0pt,left=0pt,right=0pt,
        top=0pt,bottom=0pt,beforeafter skip balanced=0pt]
        \sffamily\color{gray}%
        \raggedright%
        \addtolength\leftskip{18pt}%
        \setlength\parskip{0pt}%
        \setlength\parindent{0pt}%
        \textcolor{red}{\bfseries\scshape #1}: #2
      \end{tcolorbox}%
      \vspace{-\parskip}%
    }%
  \fi%
}\makeatother
%    \end{macrocode}
% \end{macro}

% \Finale

%\clearpage
%
%\PrintChanges
%\clearpage
%\PrintIndex