如何创建和使用像 TeXbook 中那样的“仅适用于巫师”符号?

如何创建和使用像 TeXbook 中那样的“仅适用于巫师”符号?

如何创建一个像 TeXbook 中用于指定仅供巫师使用的材料的符号,如下图红色圆圈所示,只用任意英文字母而不是锯齿形(我希望能够临时确定要显示哪个字母)?以及如何以与 TeX 书中类似的方式将此符号插入我选择的段落开头?

TeX 书中使用的 Wizards Only 符号

答案1

如今,你会在 Ti 中做出类似的事情Z. 我并不经常使用它,所以肯定会有更好的方法,但这里有一个想法:

\documentclass{article}

\usepackage{tikz}

\newcommand{\mydangersymbol}[1]{%
      \begin{tikzpicture}[baseline=(x.base)]
         \draw[rounded corners=.01em] (-.05em,-1.3em)rectangle(.05em,.9em);
         \draw[fill=white,rounded corners=1] (0,.8em)--(.8em,0)--(0,-.8em)--(-.8em,0)--cycle;
         \draw[very thick,line cap=round](-.3em,-1.3em)--(.3em,-1.3em);
         \node(x) at (0,0em) {\normalfont\sffamily\small#1};
      \end{tikzpicture}%
}

\newenvironment{mydanger}[1]{%
  \par\medskip\noindent
  \sbox0{\mydangersymbol{#1}\space}%
  \hangindent\wd0
  \parindent\hangindent
  \hangafter=-2
  \smash{\llap{\box0}}%
  \small
  \ignorespaces
 }{\par\smallskip}

\begin{document}

The symbol \mydangersymbol{A} is used to indicate an anecdote,
whereas the symbol \mydangersymbol{C} is used to indicate a caveat.
Note that using these symbols inline will cause horrible spacing.
\begin{mydanger}{A}
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
\end{mydanger}
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
\begin{mydanger}{C}
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.
Lorem ipsum dolor sit text to fill the line.

And a new paragraph within this \texttt{mydanger}
environment to show what happens when you have
more than one paragraph.
\end{mydanger}

\end{document}

在此处输入图片描述

答案2

相关内容