I have large set of contents for the user. For a different user I would like to show different contents. For this I would like to produce different output by showing and not showing some of the contents (say chapters sections subsection) of the document.
My Idea is: While writing chapter/section I declare it to enable showing to a specific user
by setting argument to true or false. For example,
if (user1 == true) then it should be there in
user1.pdf
More specifically, something like:
Macro is: \chapter <chapterName1> [bool arg1][bool arg2][bool arg3]
\chapter <chapterName1> [user1==true][user2==false][user3==false]
\chapter <chapterName2> [user1==true][user2==true][user3==false]
\section <sectionName1> [user1==true][user2==true][user3==true]
If I pass user1
and user3
as 'True', then my output should contain
command (ex) : \def\arg1=true, arg2=false, arg1=true \input{myfile}
chapterName1
sectionName1
How can I do this?
Best Answer
You can start from here. The methods below feature the
environ
package to skip content, but you could also try to use thecomment
package for this purpose.Another possibility with the list of enabled users:
PS: to create all files at once you can start from the answers here
Another possibility is to use only the
comment
package for this purpose without the modifications to thechapter
command.