Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 a 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?

share|improve this question
    
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. –  Christian Hupfer Mar 12 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 at 16:45
4  
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. –  Christian Hupfer Mar 12 at 16:54

2 Answers 2

up vote 12 down vote accepted

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.

\documentclass{article}
\usepackage{censor}

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

Hi \blackout{Hello

Goodbye} Bye

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

enter image description here

share|improve this answer
5  
I have but one thing to say about your solution: ▓▓▓▓▓▓▓! –  Steven B. Segletes Mar 12 at 17:07
    
@StevenB.Segletes :-) –  moewe Mar 12 at 17:08

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

\documentclass{article}
\usepackage{calc}
\newif\ifmarksecrets % declare new switch
\marksecretstrue %comment or use \marksecretsfalse to display normal text
\newcommand{\secret}[1]{
   \ifmarksecrets % Show black rule
      \rule{\widthof{#1}}{\heightof{#1}}
   \else % Just display text
      #1
   \fi   
   }

\begin{document}
Foo foo foo \secret{VERY SECRET BAR} foo foo foo.
\end{document}

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.

share|improve this answer
3  
One should point out that this solution cannot line break in the middle of the censor. –  Steven B. Segletes Mar 12 at 17:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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