56

On a related note to How do I make my document look like it was written by a Cthulhu-worshipping madman?, I want to create a LaTeX command that blurs the text so it's unreadable.

Unfortunately, whatever I google to get ideas on how to do this, I find forum posts from everyone and his aunt having problems with the fonts being blurry. Nothing about how to get there...

  • Extra points: make it unsearchable/uncopyable. – Andrestand Sep 16 '14 at 11:29
48

Using a variation of the technique Dissecting paragraphs with \lastbox described in Section 5.9.6 of TeX by Topic, you can produce a blur effect; the idea is to use two copies for each line and typeset the line and its copies superimposed:

\documentclass{article}
\usepackage{lipsum}

\newbox\flinebox 
\newbox\slinebox
\newbox\mlinebox
\def\duplines{\setlength\parindent{0pt}
  \setbox\flinebox\lastbox
  \ifvoid\flinebox\relax
  \else
  \setbox\slinebox\hbox{\copy\flinebox}
  \setbox\mlinebox\hbox{\copy\flinebox}
  \unskip\unpenalty
  {\duplines}
  \box\flinebox\vspace*{-2.3ex}
  \box\mlinebox\vspace*{-2.3ex}
  \box\slinebox \fi
}

\newcommand\BlurText[1]{%
  \vbox{#1\par\duplines}}

\begin{document}

\BlurText{\lipsum[1]}

\end{document}

enter image description here

In a comment, doncherry suggested horizontally shifting the layers to decrease legibility; this can be done using this definition of \duplines:

\def\duplines{\setlength\parindent{0pt}
  \setbox\flinebox\lastbox
  \ifvoid\flinebox\relax
  \else
  \setbox\slinebox\hbox{\copy\flinebox}
  \setbox\mlinebox\hbox{\copy\flinebox}
  \unskip\unpenalty
  {\duplines}
  \box\flinebox\vspace*{-2.4ex}
  \makebox[\textwidth]{\hspace*{2pt}\box\mlinebox}\vspace*{-2.4ex}
  \makebox[\textwidth]{\hspace*{4pt}\box\slinebox}\fi
}

and defining \BlurText as before, here's the new result of \BlurText{\lipsum[1]}:

enter image description here

And a little modification using some color:

\usepackage{xcolor}

and in \duplines:

  {\color{black!50}\box\flinebox\vspace*{-2.4ex}
  \makebox[\textwidth]{\hspace*{2pt}\box\mlinebox}\vspace*{-2.4ex}
  \makebox[\textwidth]{\hspace*{4pt}\box\slinebox}}

enter image description here

  • 4
    Note: Some packages use similar technique to get fake bold font. e.g. \pmb from amsbsy and \CJKbold from CJK. – Leo Liu Nov 29 '11 at 18:35
  • 26
    That should carry a health warning! – Loop Space Nov 29 '11 at 18:39
  • 17
    Any Cthulu worshiping madman would be proud of this document. – doncherry Nov 29 '11 at 18:47
  • 17
    I can still read this just fine, but I do worship Chutulu regularly.. – N3buchadnezzar Nov 29 '11 at 20:26
  • 13
    @Gonzalo: Is it possible to shift one or two layers of text horizontally as well? This might decrease legibility further. (What a thing to say in a TeX community ... :) – doncherry Nov 29 '11 at 20:34
6

Here is a TikZ-solution.

\newcommand{\blurred}[3]{
\draw [black!#1] node at (#2,#2) {#3};
\draw [black!#1] node at (0,#2) {#3};
\draw [black!#1] node at (#2,0) {#3};
\draw [black!#1] node at (-#2,#2) {#3};
\draw [black!#1] node at (-#2,0) {#3};
\draw [black!#1] node at (0,-#2) {#3};
\draw [black!#1] node at (#2,-#2) {#3};
\draw [black!#1] node at (-#2,-#2) {#3};
}

\newcommand{\blurry}[1]{
\blurred{5}{0.04}{#1}
\blurred{13}{0.017}{#1}
\blurred{10}{0.012}{#1}
\blurred{15}{0.007}{#1}
\blurred{20}{0.003}{#1}
\blurred{10}{0.0015}{#1}
\draw [black!40] node at (0,0) {#1};
}

For example:

\begin{tikzpicture}
\blurry{This text is a little bit blurry.}
\end{tikzpicture}

blurry example

In order to strengthen the blur effect, you will have to play with the numbers in the \blurry-command.

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.