I had previously used the multiaudience package without any problem. But now I have a document with multiple audiences and I need to get the result for two audiences at once. I have 5 audiences, grouped into 2 types of audiences with slight variations. On the one hand there is the type "a,b,c" and on the other the type "x,y". My intention is to define the value "a,x" as the current audience and get the result for both "a" and "x" audiences.
I know I could define the audiences by making all the possible combinations, something like this:
\SetNewAudience{ax}
\SetNewAudience{ay}
\SetNewAudience{bx}
\SetNewAudience{by}
\SetNewAudience{cx}
\SetNewAudience{cy}
But I don't want to do this, I prefer to define the audiences as normal and get the result for two of them.
This is my code as far as I can get to. I've redefined the command \SetNewAudience, but it doesn't work.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multiaudience}
\usepackage{xkvview}
\usepackage{xparse}
%Command provided by user31729 from: https://tex.stackexchange.com/questions/287084/membership-check-on-comma-separated-list/287085?r=SearchResults#287085
\ExplSyntaxOn
\NewDocumentCommand{\IsMember}{mm+m+m}{%
\clist_set:Nx \l_tmpa_clist {#1}
\clist_if_in:NnTF \l_tmpa_clist {#2} {#3} {#4}
}
\ExplSyntaxOff
\makeatletter
\def\showWhenAppropriate{%
\if@MULTAU@include%
\@MULTAU@showntrue%
\else%
\@MULTAU@shownfalse%
\fi%
}
\def\SetNewAudience#1{%
\define@key{MULTAU}{#1}[]{%
\def\@MULTAU@currkey{#1}%
\IsMember{\CurrentAudience}{\@MULTAU@currkey}{\showWhenAppropriate}{\relax}
}%
}
\makeatother
\DefCurrentAudience{a,x}
\SetNewAudience{a}
\SetNewAudience{b}
\SetNewAudience{c}
\SetNewAudience{x}
\SetNewAudience{y}
\begin{document}
Current audience: \CurrentAudience % for testing
\xkvview{} % for testing
\showto{a}{a}
\showto{b}{b}
\showto{c}{c}
\showto{x}{x}
\showto{y}{y}
\showto{a,x}{ax}
\showto{-,a,x}{bcy}
\end{document}
Thanks in advance.