summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/multiaudience/sample.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/multiaudience/sample.tex
Initial commit
Diffstat (limited to 'macros/latex/contrib/multiaudience/sample.tex')
-rw-r--r--macros/latex/contrib/multiaudience/sample.tex174
1 files changed, 174 insertions, 0 deletions
diff --git a/macros/latex/contrib/multiaudience/sample.tex b/macros/latex/contrib/multiaudience/sample.tex
new file mode 100644
index 0000000000..a2d9960c66
--- /dev/null
+++ b/macros/latex/contrib/multiaudience/sample.tex
@@ -0,0 +1,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}