Debian Codegraph @

texmf-dist/doc/latex/multiaudience/sample.tex

raw
1 \documentclass{article}
2 \usepackage{multiaudience}
3 \SetNewAudience{admins}
4 \SetNewAudience{devs}
5 \SetNewAudience{execs}
6 \usepackage[colorlinks]{hyperref}
7 \usepackage{fancyvrb}
8 \VerbatimFootnotes
9 \begin{document}
10
11 \title{Examples of \textsl{multiaudience} package use}
12 \date{$ $Date: 2015/07/11 22:49:40 $ $}
13 \author{Boris Veytsman}
14 \maketitle
15
16 \clearpage
17 \tableofcontents
18 \clearpage
19
20 \section{Introduction}
21 \label{sec:intro}
22
23 We defined three audiences:
24 \begin{verbatim}
25 \SetNewAudience{admins}
26 \SetNewAudience{devs}
27 \SetNewAudience{execs}
28 \end{verbatim}
29
30
31 \section{The \texttt{\textbackslash CurrentAudience} command}
32 \label{sec:CurrentAudience}
33
34 \begin{verbatim}
35 The current audience is \CurrentAudience.
36 \end{verbatim}
37
38 The current audience is \CurrentAudience.
39
40 \section{The \texttt{\textbackslash showto} command}
41 \label{sec:showto}
42
43
44 Note the nesting here:
45 \begin{verbatim}
46 \showto{admins}{This text is visible to admins only\footnote{And
47 admins see a footnote}.}
48 \showto{admins, devs}{This text is visible to admins and
49 devs. \showto{devs}{This text is visible to devs.}}
50 \showto{-, admins}{This text is \emph{not} visible to admins.}
51 This text is visible to everybody\footnote{And everybody sees a
52 footnote}.
53 \end{verbatim}
54
55 \showto{admins}{This text is visible to admins only\footnote{And
56 admins see a footnote}.}
57 \showto{admins, devs}{This text is visible to admins and
58 devs. \showto{devs}{This text is visible to devs.}}
59 \showto{-, admins}{This text is \emph{not} visible to admins.}
60 This text is visible to everybody\footnote{And everybody sees a
61 footnote}.
62
63 \section{The \texttt{shownto} environment}
64 \label{sec:env}
65
66 \begin{verbatim}
67 \begin{shownto}{admins}
68 This is for admins only.
69 \end{shownto}
70 \end{verbatim}
71
72 \begin{shownto}{admins}
73 This is for admins only.
74 \end{shownto}
75
76
77 \begin{verbatim}
78 \begin{shownto}{-, admins}
79 This is for everybody \emph{but} admins.
80 \end{shownto}
81 \end{verbatim}
82
83 \begin{shownto}{-, admins}
84 This is for everybody \emph{but} admins.
85 \end{shownto}
86
87
88 \section{Use of verbatim text}
89 \label{sec:verbatiom}
90
91
92
93 \begin{verbatim}
94 \begin{shownto}{-,execs}
95 We cannot use \texttt{verbatim} inside shownto, but we can use
96 \texttt{input} with \texttt{verbatim} inside.
97
98
99 We also can use \texttt{path} and \texttt{url} from hyperref package:
100 \path{a$2}, \url{http://borisv.lk.net/cv/cv.html\#Publications}.
101 \input{verbatim}
102
103 We also can use \texttt{path} and \texttt{url} from hyperref package:
104 \path{a$2}, \url{http://borisv.lk.net/cv/cv.html\#Publications}.
105 \end{shownto}
106 \end{verbatim}
107
108 \begin{shownto}{-,execs}
109 We cannot use \texttt{verbatim} inside shownto, but we can use
110 \texttt{input} with \texttt{verbatim} inside.
111
112
113 We also can use \texttt{path} and \texttt{url} from hyperref package:
114 \path{a$2}, \url{http://borisv.lk.net/cv/cv.html\#Publications}.
115 \input{verbatim}
116 \end{shownto}
117
118 Another option is the use of \verb|\SaveVerb| and friends from
119 \textsl{fancyvrb} package:
120
121 \begin{verbatim}
122 \begin{SaveVerbatim}{SavedVerb}
123 This is a verbatim line: ~!@#$%^&*{}:"`'<>?
124 \end{SaveVerbatim}
125
126 \begin{shownto}{-,devs}
127 \UseVerbatim{SavedVerb}
128 \end{shownto}
129 \end{verbatim}
130
131 \begin{SaveVerbatim}{SavedVerb}
132 This is a verbatim line: ~!@#$%^&*{}:"`'<>?
133 \end{SaveVerbatim}
134
135 \begin{shownto}{-,devs}
136 \UseVerbatim{SavedVerb}
137 \end{shownto}
138
139 \section{Syntactic sugar}
140 \label{sec:sugar}
141
142 \begin{verbatim}
143 We have a special footnote command\Footnote{admins}{This footnote is
144 for admins only.}.
145 \end{verbatim}
146
147 We have a special footnote command\Footnote{admins}{This footnote is
148 for admins only.}.
149
150 \begin{verbatim}
151 \begin{Subsection}{admins}[Admins-only subsection]{This subsection is
152 visible only to admins}
153 We have special sectioning commands.
154 \end{Subsection}
155 \end{verbatim}
156
157 \begin{Subsection}{admins}[Admins-only subsection]{This subsection is
158 visible only to admins}
159 We have special sectioning commands.
160 \end{Subsection}
161
162 \begin{verbatim}
163 \begin{Subsection}{-,admins}[Not for admins]{This subsection is not
164 visible to admins}
165 Another example. \showto{devs}{This is visible to devs only.}
166 \end{Subsection}
167 \end{verbatim}
168
169 \begin{Subsection}{-,admins}[Not for admins]{This subsection is not
170 visible to admins}
171 Another example. \showto{devs}{This is visible to devs only.}
172 \end{Subsection}
173
174 \end{document}