## LaTeX forum ⇒ Text Formatting ⇒ Managing censorship by class of document?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
ygini
Posts: 2
Joined: Mon Aug 08, 2016 6:45 pm

### Managing censorship by class of document?

Hello

I'm using LaTeX to write confidential documents, for those document I use the traffic light protocol (https://www.us-cert.gov/tlp) manage by 4 different custom classes used to add color and sharing instruction in header and footnote.

Those documents are used for many purpose and I would like to be able to censor some informations of the document based on the current traffic light.

I've found multiple solutions on different forum but nothing who fit my needs for now.

My main problem is, the content to protect can be in a middle of a paragraph or in a table cell, It can be regular text, \verb|| text, or even \url{} text.

My main idea was to use my custom classes to create and renew custom commands (like \GreenSecret, \AmberSecret, \RedSecret) to specify when a block of text must be redacted or not.

What do you think? What would be the best solution and implementation?

I'm new to this level of LaTeX customization so I don't really know what to look as a good source of inspiration. I've only written custom classes for custom look, nothing more.
Last edited by cgnieder on Wed Sep 21, 2016 8:08 pm, edited 1 time in total.

Tags:

SteWo
Posts: 1
Joined: Tue Sep 20, 2016 3:07 pm
Hi ygini!

I never had to deal with such a requirement but I would take a look at the ifthenelse-package: Define via \setboolean four 'levels' as boolean variables and use them nested. E.g. like so:
\setboolean level0 true\setboolean level1 true\setboolean level2 false\setboolean level3 false ... \ifthenelse level0{some general text and within:	\ifthenelse level1	{some lightly confidential text and within		\ifthenelse level2		{some really confidential text and within			\ifthenelse level3			{area-51 information}		}	}}

Got the idea? This example's output should only show the text up to what may be shown for levels 0 and 1 but not levels 2 and 3. As this is not actual code you might want to study the relevant documentation.

Hope I could help.

Best
Last edited by cgnieder on Wed Sep 21, 2016 8:09 pm, edited 1 time in total.

cgnieder
Site Moderator
Posts: 1985
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:
Here is some idea. I hope the code is self-explanatory. Feel free to ask if it isn't:


Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim