该问题基于以下主题: 我怎样才能使我的文档看起来像是由崇拜克苏鲁的疯子写的? ,doncherry 在其中提供了一个很好的答案,并且评分最高。(我无法在该主题上发布我的问题,我不知道为什么,所以我在这里开始了一个新主题。)
但是,我试过他的代码后,发现在自定义环境下,LaTeX 无法自动连字\Cthulhu
。我认为这种无能的原因是使用了turnbox
,它会将每个单词随机旋转,而不是旋转每个字母。这只是我的猜测。无论如何,没有连字,文档看起来很奇怪,也不美观。
我的问题:
如何为用户 doncherry 提供的 Cthulhu 风格的文档启用自动连字功能?
根据 doncherry 的回答,我怎样才能将每个字母以随机角度旋转,而不是旋转每个单词?
多谢!
答案1
我没有字体,所以这个疯子使用现代计算机。
\documentclass[17pt]{extarticle}% This is a document class providing more font size options
\usepackage[svgnames]{xcolor}
\usepackage{graphicx}
%\usepackage{emerald}% font package
\usepackage[doublespacing]{setspace}% line spacing
\usepackage[T1]{fontenc}
\usepackage{wallpaper}
% thanks to Bruno Le Floch: http://tex.stackexchange.com/q/9331/4012
% and in his comments to http://tex.stackexchange.com/a/29458/4012
\usepackage{rotating}
\usepackage[first=-6,last=6]{lcg}% you can play around with these values
\makeatletter
\newcommand{\globalrand}{\rand\global\cr@nd\cr@nd}
\makeatother
\newcommand{\randomrotation}[1]{\globalrand\turnbox{\value{rand}}{#1}\phantom{#1}}
% thanks to Martin Scharrer: http://tex.stackexchange.com/q/11598/4012
\makeatletter
\def\cthulhu#1{%
\@cthulhu#1 \@empty
}
\def\@cthulhu#1 #2{%
\setbox0\hbox{\ifx\foo#1\global\let\xxfoo\relax\else\global\let\xxfoo\randomrotation\fi}%
\xxfoo{#1}\space
\ifx #2\@empty\else
\expandafter\@cthulhu
\fi
#2%
}
\def\foo#1{\yyfoo#1\relax}
\def\yyfoo#1\-#2\relax{%
\discretionary{\randomrotation{#1-}}{\randomrotation{#2}}{\randomrotation{#1#2}}}
\makeatother
% ----------
\newcommand{\eldersign}{X}
\renewcommand*{\rmdefault}{fts}
\textwidth=.6\textwidth
\hyphenpenalty=-0
\begin{document}\pagestyle{empty}
%\CenterWallPaper{}{backgroundimagefile}
\centering% that madman wouldn't justify his writings
\color{MidnightBlue}% my pick for "looks like ink"
\cthulhu{Hello, I am crazy. I am a Cthulhu \foo{worsh\-ipping} \foo{gibb\-ering} \foo{mad\-man}, \foo{un\-hinged} by
the horrors I have witnessed. I am a Cthulhu \foo{worsh\-ipping} \foo{gibb\-ering} \foo{mad\-man}, \foo{un\-hinged} by
the \foo{horr\-ors} I have witnessed. I am a Cthulhu \foo{worsh\-ipping} \foo{gibb\-ering} \foo{mad\-man}, \foo{un\-hinged} by
the horrors I have witnessed. I am a Cthulhu \foo{worsh\-ipping} \foo{gibb\-ering} \foo{mad\-man}, \foo{un\-hinged} by
the horrors I have witnessed. I am a Cthulhu \foo{worsh\-ipping} \foo{gibb\-ering} \foo{mad\-man}, \foo{un\-hinged} by
the horrors I have witnessed.} \eldersign
\end{document}