Debian Codegraph @

texmf-dist/source/latex/debate/debate.dtx

raw
1 % \iffalse meta-comment
2 % (The MIT License)
3 %
4 % Copyright (c) 2021-2022 Yegor Bugayenko
5 %
6 % Permission is hereby granted, free of charge, to any person obtaining a copy
7 % of this software and associated documentation files (the 'Software'), to deal
8 % in the Software without restriction, including without limitation the rights
9 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 % copies of the Software, and to permit persons to whom the Software is
11 % furnished to do so, subject to the following conditions:
12 %
13 % The above copyright notice and this permission notice shall be included in all
14 % copies or substantial portions of the Software.
15 %
16 % THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 % SOFTWARE.
23 % \fi
24
25 % \CheckSum{0}
26 %
27 % \CharacterTable
28 % {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
29 % 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
30 % Digits \0\1\2\3\4\5\6\7\8\9
31 % Exclamation \! Double quote \" Hash (number) \#
32 % Dollar \$ Percent \% Ampersand \&
33 % Acute accent \' Left paren \( Right paren \)
34 % Asterisk \* Plus \+ Comma \,
35 % Minus \- Point \. Solidus \/
36 % Colon \: Semicolon \; Less than \<
37 % Equals \= Greater than \> Question mark \?
38 % Commercial at \@ Left bracket \[ Backslash \\
39 % Right bracket \] Circumflex \^ Underscore \_
40 % Grave accent \` Left brace \{ Vertical bar \|
41 % Right brace \} Tilde \~}
42
43 % \GetFileInfo{debate.dtx}
44 % \DoNotIndex{\endgroup,\begingroup,\let,\else,\fi,\newcommand,\newenvironment}
45
46 % \iffalse
47 %<*driver>
48 \ProvidesFile{debate.dtx}
49 %</driver>
50 %<package>\NeedsTeXFormat{LaTeX2e}
51 %<package>\ProvidesPackage{debate}
52 %<*package>
53 [2022-10-29 0.2.1 Debates Between Reviewers]
54 %</package>
55 %<*driver>
56 \documentclass{ltxdoc}
57 \usepackage[tt=false, type1=true]{libertine}
58 \usepackage{debate}
59 \usepackage{href-ul}
60 \usepackage[dtx]{docshots}
61 \usepackage{microtype}
62 \AddToHook{env/verbatim/begin}{\microtypesetup{protrusion=false}}
63 \PageIndex
64 \EnableCrossrefs
65 \CodelineIndex
66 \RecordChanges
67 \begin{document}
68 \DocInput{debate.dtx}
69 \PrintChanges
70 \PrintIndex
71 \end{document}
72 %</driver>
73 % \fi
74
75 % \title{|debate|: \LaTeX{} Package \\ for Debates Between Reviewers\thanks{The sources are in GitHub at \href{https://github.com/yegor256/debate}{yegor256/debate}}}
76 % \author{Yegor Bugayenko \\ \texttt{[email protected]}}
77 % \date{\filedate, \fileversion}
78 %
79 % \maketitle
80 %
81 % \textbf{NB!}
82 % If you want to use |tcolorbox| package, make sure you include
83 % |debate| first.
84
85 % \section{Introduction}
86 %
87 % This package helps you organize debates between a few people
88 % right inside your documents:
89
90 % \begin{docshot}
91 % \documentclass{article}
92 % \usepackage{debate}
93 % \usepackage[paperwidth=3in]{geometry}
94 % \pagestyle{empty}
95 % \begin{document}\noindent
96 % Never argue with stupid people,
97 % \debate[Jeff]{I disagree!}
98 % \debate[Anna]{I won't argue...}
99 % they will drag you down to their
100 % level and then beat you with
101 % experience -- \emph{Mark Twain}
102 % \end{document}
103 % \end{docshot}
104
105 % \section{Package Options}
106
107 % \begin{macro}{hide}
108 % You can hide them all using |hide| package option.
109 % \end{macro}
110
111 % \StopEventually{}
112
113 % \section{Implementation}
114
115 % \changes{v0.1.0}{2021/09/26}{Initial version}
116
117 % First, we include a few packages:
118 % \begin{macrocode}
119 \RequirePackage{xcolor}
120 \PassOptionsToPackage{most}{tcolorbox}
121 \RequirePackage{tcolorbox}
122 % \end{macrocode}
123
124 % Then, we parse package options:
125 % \begin{macrocode}
126 \RequirePackage{xkeyval}
127 \makeatletter
128 \newif\ifdebate@hide
129 \DeclareOptionX{hide}{\debate@hidetrue}
130 \ProcessOptionsX\relax
131 \makeatother
132 % \end{macrocode}
133
134 % \begin{macro}{\debate}
135 % Finally, we define |\debate| command:
136 % \begin{macrocode}
137 \makeatletter\newcommand\debate[2][Reviewer]{%
138 \ifdebate@hide%
139 #1%
140 \else%
141 {%
142 \begin{tcolorbox}[frame hidden,sharp corners,
143 enhanced,borderline west={1pt}{0pt}{red},
144 interior hidden,boxsep=0pt,left=0pt,right=0pt,
145 top=0pt,bottom=0pt,beforeafter skip balanced=0pt]
146 \sffamily\color{gray}%
147 \raggedright%
148 \addtolength\leftskip{18pt}%
149 \setlength\parskip{0pt}%
150 \setlength\parindent{0pt}%
151 \textcolor{red}{\bfseries\scshape #1}: #2
152 \end{tcolorbox}%
153 \vspace{-\parskip}%
154 }%
155 \fi%
156 }\makeatother
157 % \end{macrocode}
158 % \end{macro}
159
160 % \Finale
161
162 %\clearpage
163 %
164 %\PrintChanges
165 %\clearpage
166 %\PrintIndex