0

Is there a way to randomize font family throughout a document? The reason behind doing this is to help pay more attention when reviewing a document. Mainly because we tend to pay more attention to the text if fonts randomly and often change throughout a document.

ZanCoul
  • 300
  • We tend to pay more attention to the fonts. We tend to pay less attention to the content. Good typography is not noticed precisely because it does not distract readers from the content. – cfr Mar 16 '17 at 02:31
  • 1
    @cfr I think the OP will only use this magic for his personal proof reading and not for anybody else, if that's what you mean :). – Dr. Manuel Kuehner Mar 16 '17 at 08:55

1 Answers1

1

How's that for a start? I am sure that the experts here can make it more flexible and more automatic.

The \marginpar stuff is just to demonstrate/debug the random numbers.

\documentclass{article}

\usepackage{lmodern}

% http://tex.stackexchange.com/questions/5116
% \IfEqCase
\usepackage{xstring}

% \pgfmathparse and \pgfmathresult
\usepackage{tikz}

\newcommand{\myRandomFontCommand}[1]{%
    \IfEqCase*{#1}{%
    {1}{\normalfont\bfseries}%
    {2}{\normalfont\rmfamily}%
    {3}{\normalfont\ttfamily}%
    {4}{\normalfont\itshape}%
    {5}{\normalfont\scshape}%
    }[]%
}%

% Inspiration
%\rmfamily
%\sffamily 
%\ttfamily
%\mdseries
%\bfseries
%\itshape
%\scshape

% \blindtext
\usepackage{blindtext}

\begin{document}

\pgfmathparse{random(1,5)}
\myRandomFontCommand{\pgfmathresult}
\marginpar{\protect\pgfmathresult}

\blindtext

\pgfmathparse{random(1,5)}
\myRandomFontCommand{\pgfmathresult}
\marginpar{\protect\pgfmathresult}

\blindtext

\pgfmathparse{random(1,5)}
\myRandomFontCommand{\pgfmathresult}
\marginpar{\protect\pgfmathresult}

\blindtext

\pgfmathparse{random(1,5)}
\myRandomFontCommand{\pgfmathresult}
\marginpar{\protect\pgfmathresult}

\blindtext

\pgfmathparse{random(1,5)}
\myRandomFontCommand{\pgfmathresult}
\marginpar{\protect\pgfmathresult}

\blindtext

\end{document}

enter image description here enter image description here

Alternative (a more automatic approach)

%% (same preamble)

\begin{document}

\everypar={
\pgfmathparse{random(1,5)}
\myRandomFontCommand{\pgfmathresult}
\marginpar{\protect\pgfmathresult}
}

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\end{document}

But I do really not know if everypar is a good choice...

  • This is a great start! Is there a way that each word instead of paragraph could be randomized? – ZanCoul Mar 16 '17 at 01:12
  • @ZanCoul That's out of my league, sorry. I would guess that it is not easy and maybe to much effort considering the benefits (just an opinion). In addition, it's likely that there may be some side effects (interaction with other commands and so on) that cause trouble. I would go for another approach and would try too improve your prove reading skills/methods :). – Dr. Manuel Kuehner Mar 16 '17 at 01:14
  • I hesitate to encourage this, but cfr-lm would provide more options than lmodern does. However, I utterly deplore the whole idea. I think it is nuts. – cfr Mar 16 '17 at 02:32
  • @cfr You could at least like the solution and upvote it :). – Dr. Manuel Kuehner Mar 16 '17 at 09:00
  • @cfr Just read the documentation of your lm package, very cool. – Dr. Manuel Kuehner Mar 16 '17 at 09:06