I wonder if there is any LaTeX library that allows me to obtain a sanitization "black marker" effect in order to conceal omissis information, like for example a secret code in an URL or a password in a code listing.

Please have a look at this to get the idea of what I wish to obtain: document with omissis information and here

Any ideas?

  • Do you want to specify the 'black marker' effect by hand in your code or use some 'keywords'? I would use a wrapper command for a colorbox and a boolean flag which is set before compilation whether portions should be 'blackened' or not. I do not know such a package, but there might be such one anyway.
    – user31729
    Mar 12 '14 at 16:34
  • @ChristianH. anything that can be useful, any command that may help me. Now that I think about it, a highlighter command set as black may help me achieve this.
    – fstab
    Mar 12 '14 at 16:45
  • 5
    There is still one caveat: Do you want to use that document to be printed or just as a .pdf file -- I am not sure, whether 'secret parts' can be nevertheless identified in the pdf code.
    – user31729
    Mar 12 '14 at 16:54

There also is the Steven B. Se­gletes's censor package (documentation).

You can use \censor{blurg} to censor short pieces of text.

Long paragraphs can be blacked out with \blackout{foo\par bar}.

Censoring can be turned off via \StopCensoring.


When shall we \censor{three meet again}, in thunder, lightning or in rain?

Hi \blackout{Hello

Goodbye} Bye

When shall we \censor{three meet again}, in thunder, lightning or in rain?

enter image description here

  • 12
    I have but one thing to say about your solution: ▓▓▓▓▓▓▓! Mar 12 '14 at 17:07
  • @StevenB.Segletes :-)
    – moewe
    Mar 12 '14 at 17:08

Depending on whether you want to mark only short strings of text you could do something like this:

\newif\ifmarksecrets % declare new switch
\marksecretstrue %comment or use \marksecretsfalse to display normal text
   \ifmarksecrets % Show black rule
   \else % Just display text

Foo foo foo \secret{VERY SECRET BAR} foo foo foo.

For larger boxes, TikZ can be used to draw anything anywhere on the page, but I'm in a bit of a hurry so I can't provide an example now.

  • 4
    One should point out that this solution cannot line break in the middle of the censor. Mar 12 '14 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.