summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/multiaudience/multiaudience.sty
blob: 6861e8a3552ba4ba14f8fed66cc43404fc455f14 (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
%%
%% This is file `multiaudience.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% multiaudience.dtx  (with options: `style')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from multiaudience.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file multiaudience.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% 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
%% later version.
%% The latest version of the license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2003/06/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Boris Veytsman
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{multiaudience}
[2021/10/02 v1.04 Generating versions for different audiences from the
same source]
\providecommand*\CurrentAudience{default}
\def\DefCurrentAudience#1{\def\CurrentAudience{#1}}
\newif\if@MULTAU@shown
\@MULTAU@showntrue
\newif\if@MULTAU@include
\@MULTAU@includetrue
\RequirePackage{xkeyval}
\define@key{MULTAU}{-}[]{\@MULTAU@showntrue\@MULTAU@includefalse}
\def\SetNewAudience#1{%
  \define@key{MULTAU}{#1}[]{%
    \def\@MULTAU@currkey{#1}%
    \@for\@tempa:=\CurrentAudience \do{%
      \ifx\@MULTAU@currkey\@tempa\relax
        \if@MULTAU@include
           \@MULTAU@showntrue
        \else
           \@MULTAU@shownfalse
        \fi%
    \fi%
}}}
\long\def\showto#1#2{\@MULTAU@shownfalse\@MULTAU@includetrue
  \setkeys{MULTAU}{#1}%
  \if@MULTAU@shown#2\fi
  \@MULTAU@showntrue\@MULTAU@includetrue}
\RequirePackage{environ}
\NewEnviron{shownto}[1]{%
  \@MULTAU@shownfalse\@MULTAU@includetrue
  \setkeys{MULTAU}{#1}%
  \if@MULTAU@shown\BODY\fi}{\@MULTAU@showntrue\@MULTAU@includetrue}
\def\DefMultiaudienceCommand#1#2{\long\def#1##1##2{\showto{##1}{#2{##2}}}}
\DefMultiaudienceCommand{\Footnote}{\footnote}
\def\NewMultiaudienceSectionEnv#1#2{%
  \NewEnviron{#1}[1]{%
    \@MULTAU@shownfalse\@MULTAU@includetrue
    \setkeys{MULTAU}{##1}%
    \if@MULTAU@shown\expandafter#2\BODY\fi}%
  {\@MULTAU@showntrue\@MULTAU@includetrue}}
\NewMultiaudienceSectionEnv{Section}{\section}
\NewMultiaudienceSectionEnv{Subsection}{\subsection}
\NewMultiaudienceSectionEnv{Subsubsection}{\subsubsection}
\NewMultiaudienceSectionEnv{Paragraph}{\paragraph}
\NewMultiaudienceSectionEnv{Subparagraph}{\subparagraph}
\endinput
%%
%% End of file `multiaudience.sty'.