summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/multiaudience/sample.tex
blob: a2d9960c66e10a7fd9bd7a86eb7b96c1556746f7 (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
167
168
169
170
171
172
173
174
\documentclass{article}
\usepackage{multiaudience}
\SetNewAudience{admins}
\SetNewAudience{devs}
\SetNewAudience{execs}
\usepackage[colorlinks]{hyperref}
\usepackage{fancyvrb}
\VerbatimFootnotes
\begin{document}

\title{Examples of \textsl{multiaudience} package use}
\date{$ $Date: 2015/07/11 22:49:40 $ $}
\author{Boris Veytsman}
\maketitle

\clearpage
\tableofcontents
\clearpage

\section{Introduction}
\label{sec:intro}

We defined three audiences:
\begin{verbatim}
\SetNewAudience{admins}
\SetNewAudience{devs}
\SetNewAudience{execs}
\end{verbatim}


\section{The \texttt{\textbackslash CurrentAudience} command}
\label{sec:CurrentAudience}

\begin{verbatim}
The current audience is \CurrentAudience.
\end{verbatim}

The current audience is \CurrentAudience.

\section{The \texttt{\textbackslash showto} command}
\label{sec:showto}


Note the nesting here:
\begin{verbatim}
\showto{admins}{This text is visible to admins only\footnote{And
    admins see a footnote}.}
\showto{admins, devs}{This text is visible to admins and
  devs. \showto{devs}{This text is visible to devs.}}  
\showto{-, admins}{This text is \emph{not} visible to admins.}
This text is visible to everybody\footnote{And everybody sees a
  footnote}.  
\end{verbatim}

\showto{admins}{This text is visible to admins only\footnote{And
    admins see a footnote}.}
\showto{admins, devs}{This text is visible to admins and
  devs. \showto{devs}{This text is visible to devs.}}  
\showto{-, admins}{This text is \emph{not} visible to admins.}
This text is visible to everybody\footnote{And everybody sees a
  footnote}.   

\section{The \texttt{shownto} environment}
\label{sec:env}

\begin{verbatim}
\begin{shownto}{admins}
  This is for admins only.
\end{shownto}
\end{verbatim}

\begin{shownto}{admins}
  This is for admins only.
\end{shownto}


\begin{verbatim}
\begin{shownto}{-, admins}
  This is for everybody \emph{but} admins.
\end{shownto}
\end{verbatim}

\begin{shownto}{-, admins}
  This is for everybody \emph{but} admins.
\end{shownto}


\section{Use of verbatim text}
\label{sec:verbatiom}



\begin{verbatim}
\begin{shownto}{-,execs}
We cannot use \texttt{verbatim} inside shownto, but we can use
\texttt{input} with \texttt{verbatim} inside.


We also can use \texttt{path} and \texttt{url} from hyperref package:
\path{a$2}, \url{http://borisv.lk.net/cv/cv.html\#Publications}. 
\input{verbatim}

We also can use \texttt{path} and \texttt{url} from hyperref package:
\path{a$2}, \url{http://borisv.lk.net/cv/cv.html\#Publications}. 
\end{shownto}
\end{verbatim}

\begin{shownto}{-,execs}
We cannot use \texttt{verbatim} inside shownto, but we can use
\texttt{input} with \texttt{verbatim} inside.


We also can use \texttt{path} and \texttt{url} from hyperref package:
\path{a$2}, \url{http://borisv.lk.net/cv/cv.html\#Publications}. 
\input{verbatim}
\end{shownto}

Another option is the use of \verb|\SaveVerb| and friends from
\textsl{fancyvrb} package:

\begin{verbatim}
\begin{SaveVerbatim}{SavedVerb}
This is a verbatim line: ~!@#$%^&*{}:"`'<>?  
\end{SaveVerbatim}

\begin{shownto}{-,devs}
  \UseVerbatim{SavedVerb}
\end{shownto}
\end{verbatim}

\begin{SaveVerbatim}{SavedVerb}
This is a verbatim line: ~!@#$%^&*{}:"`'<>?  
\end{SaveVerbatim}

\begin{shownto}{-,devs}
  \UseVerbatim{SavedVerb}
\end{shownto}

\section{Syntactic sugar}
\label{sec:sugar}

\begin{verbatim}
We have a special footnote command\Footnote{admins}{This footnote is
  for admins only.}.
\end{verbatim}

We have a special footnote command\Footnote{admins}{This footnote is
  for admins only.}.

\begin{verbatim}
\begin{Subsection}{admins}[Admins-only subsection]{This subsection is
    visible only to admins}
We have special sectioning commands.  
\end{Subsection}
\end{verbatim}

\begin{Subsection}{admins}[Admins-only subsection]{This subsection is
    visible only to admins}
We have special sectioning commands.  
\end{Subsection}

\begin{verbatim}
\begin{Subsection}{-,admins}[Not for admins]{This subsection is not
    visible to admins}
  Another example.  \showto{devs}{This is visible to devs only.}
\end{Subsection}
\end{verbatim}

\begin{Subsection}{-,admins}[Not for admins]{This subsection is not
    visible to admins}
  Another example.  \showto{devs}{This is visible to devs only.}
\end{Subsection}

\end{document}