diff options
author | Karl Berry <karl@freefriends.org> | 2021-10-03 20:31:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-10-03 20:31:26 +0000 |
commit | 01ff03dce6921c6e40b65ec78befdf9124b1709d (patch) | |
tree | 4fcff1a7ba2f46361380244ed9b971a5f4aa3b60 /Master/texmf-dist/source/latex | |
parent | 01cdae6b339b202e0d8798701b0f36a3bd36dd60 (diff) |
multiaudience (3oct21)
git-svn-id: svn://tug.org/texlive/trunk@60688 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/multiaudience/Makefile | 62 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/multiaudience/multiaudience.dtx | 57 |
2 files changed, 108 insertions, 11 deletions
diff --git a/Master/texmf-dist/source/latex/multiaudience/Makefile b/Master/texmf-dist/source/latex/multiaudience/Makefile new file mode 100644 index 00000000000..91ea935010a --- /dev/null +++ b/Master/texmf-dist/source/latex/multiaudience/Makefile @@ -0,0 +1,62 @@ +# +# +# This file is in public domain +# +# $Id: Makefile,v 1.4 2021/10/02 22:18:28 boris Exp $ +# + +PACKAGE=multiaudience +PDF = sample-execs.pdf sample-devs.pdf sample-admins.pdf sample-admins,execs.pdf sample-admins,devs.pdf sample-execs,devs.pdf + + +all: $(PACKAGE).pdf ${PDF} + +%.pdf: %.dtx $(PACKAGE).sty + pdflatex $< + - bibtex $* + pdflatex $< + - makeindex -s gind.ist -o $*.ind $*.idx + - makeindex -s gglo.ist -o $*.gls $*.glo + pdflatex $< + while ( grep -q '^LaTeX Warning: Label(s) may have changed' $*.log) \ + do pdflatex $<; done + + + + +%.sty: %.ins %.dtx + pdflatex $< + +sample-%.pdf: sample.tex $(PACKAGE).sty + pdflatex -jobname sample-$* "\def\CurrentAudience{$*}\input{sample.tex}" + -bibtex sample-$* + pdflatex -jobname sample-$* "\def\CurrentAudience{$*}\input{sample.tex}" + while ( grep -q '^LaTeX Warning: Label(s) may have changed' sample-$*.log) \ + do pdflatex -jobname sample-$* "\def\CurrentAudience{$*}\input{sample.tex}"; done + + +.PRECIOUS: $(PACKAGE).cfg $(PACKAGE).sty + + +clean: + $(RM) $(PACKAGE).sty *.log *.aux \ + *.cfg *.glo *.idx *.toc \ + *.ilg *.ind *.out *.lof \ + *.lot *.bbl *.blg *.gls *.hd \ + *.dvi *.ps *.tgz *.zip *.brf + +veryclean: clean + $(RM) $(PACKAGE).pdf ${PDF} + +distclean: veryclean + +# +# Archive for the distribution. Includes typeset documentation +# +archive: all clean + tar -czvf $(PACKAGE).tgz -C .. --exclude '*~' --exclude '*.tgz' --exclude CVS $(PACKAGE) + +zip: all clean + ${MAKE} $(PACKAGE).sty + $(RM) *.log + zip -r $(PACKAGE).zip * -x '*~' -x '*.tgz' -x '*.zip' -x CVS -x 'CVS/*' diff --git a/Master/texmf-dist/source/latex/multiaudience/multiaudience.dtx b/Master/texmf-dist/source/latex/multiaudience/multiaudience.dtx index 15ef56e89fd..04128b728cc 100644 --- a/Master/texmf-dist/source/latex/multiaudience/multiaudience.dtx +++ b/Master/texmf-dist/source/latex/multiaudience/multiaudience.dtx @@ -1,7 +1,7 @@ % \iffalse -% $Id: multiaudience.dtx,v 1.6 2015/08/02 23:02:42 boris Exp $ +% $Id: multiaudience.dtx,v 1.9 2021/10/02 22:21:51 boris Exp $ % -%% Copyright 2015, Boris Veytsman <borisv@lk.net +%% Copyright 2015-2021, Boris Veytsman <borisv@lk.net %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either %% version 1.3 of this license or (at your option) any @@ -22,13 +22,13 @@ %</gobble> %<style>\ProvidesPackage{multiaudience} %<*style> -[2015/08/02 v1.02 Generating versions for different audiences from the +[2021/10/02 v1.04 Generating versions for different audiences from the same source] % \end{macrocode} %</style> %<*gobble> % \fi -% \CheckSum{81} +% \CheckSum{85} % % %% \CharacterTable @@ -134,8 +134,8 @@ same source] % This trick allows one to generate all versions of output from the % command line: % \begin{verbatim} -% pdflatex -jobnane file-execs "\def\CurrentAudience{execs}\input{file}" -% pdflatex -jobnane file-devs "\def\CurrentAudience{devs}\input{file}" +% pdflatex -jobname file-execs "\def\CurrentAudience{execs}\input{file}" +% pdflatex -jobname file-devs "\def\CurrentAudience{devs}\input{file}" % ... % \end{verbatim} % @@ -201,7 +201,7 @@ same source] % TEXT~1 will be visible only to devs and execs, while TEXT~2 only to % devs. % \begin{verbatim} -% \begin{shownto}{devs, execs} +% \begin{shownto}{devs,execs} % TEXT 1 % \begin{shownto}{devs} % TEXT 2 @@ -298,6 +298,38 @@ same source] % \begin{verbatim} % \NewMultiaudienceSectionEnv{Section}{\section} % \end{verbatim} +% +% \subsection{Combined audiences} +% \label{ug:combinations} +% +% Sometimes one wants to create a document for several audiences. You +% can do this using comma-separated lists in \cs{CurrentAudience}, for +% example, +% \begin{verbatim} +% \DefCurrentAudience{execs,admins} +% \end{verbatim} +% +% +% \emph{Important:} there should be no spaces in the definition. The +% definition |\DefCurrentAudience{execs, admins}| will \emph{not} work! +% +% The resulting audience is the union of the audiences in the +% definition. Thus a fragment is included if either: +% \begin{enumerate} +% \item The list of audiences for the fragment does not start with +% |-|, and at least one of the current audiences is mentioned in the +% list. +% \item The list of audiences for the fragment starts with |-|, and +% none of the current audiences is mentioned in the list. +% \end{enumerate} +% For example, suppose the current audience is |execs,admins|. Then +% the following is true: +% \begin{enumerate} +% \item |\showto{devs}{...}|---excluded. +% \item |\showto{devs,admins}{...}|---included. +% \item |\showto{-, devs}{...}|---included. +% \item |\showto{-, devs, admins}{...}|---excluded. +% \end{enumerate} % % %\StopEventually{\clearpage} @@ -380,20 +412,23 @@ same source] % \end{macro} % % \begin{macro}{\SetNewAudience} +% \changes{v1.04}{2021/10/02}{Added facility for a list of current +% audiences} % Definition of a new audience. We create a new key that switches % visibility on or off. % \begin{macrocode} \def\SetNewAudience#1{% \define@key{MULTAU}{#1}[]{% \def\@MULTAU@currkey{#1}% - \ifx\@MULTAU@currkey\CurrentAudience\relax + \@for\@tempa:=\CurrentAudience \do{% + \ifx\@MULTAU@currkey\@tempa\relax \if@MULTAU@include \@MULTAU@showntrue \else \@MULTAU@shownfalse - \fi - \fi}% -} + \fi% + \fi% +}}} % \end{macrocode} % % \end{macro} |