如何在 LaTeX 文档中加入“经典”的 Lenny 脸?
明天要交一篇论文,我很好奇。例如 ( ͡° ͜ʖ ͡°)
我曾尝试使用该verbatim
环境但无济于事。
答案1
答案2
直接使用堆栈。
\documentclass{article}
\usepackage{stackengine,graphicx,trimclip,scalerel}
\begin{document}
\savestack\eye{\rotatebox{90}{$^\circ\mkern-6mu\raisebox{1pt}{)}$}}
\savestack\nose{\raisebox{3pt}{\scalebox{1}[-1]{\clipbox{0pt 1pt 0pt 0pt}{?}}}}
\savestack\mouth{\rotatebox{90}{(}}
\scaleleftright{(}{\stackanchor[2pt]{\eye \nose \eye}{\mouth}}{)}
\end{document}
从那里直接进入宏:
\documentclass{article}
\usepackage{stackengine,graphicx,trimclip,scalerel}
\savestack\eye{\rotatebox{90}{$^\circ\mkern-6mu\raisebox{1pt}{)}$}}
\savestack\nose{\raisebox{3pt}{\scalebox{1}[-1]{\clipbox{0pt 1pt 0pt 0pt}{?}}}}
\savestack\mouth{\rotatebox{90}{(}}
\newcommand\Lenny{\scaleleftright{(}{\stackanchor[2pt]{\eye \nose \eye}{\mouth}}{)}}
\begin{document}
This is my Lenny face: \Lenny
\end{document}
这是一个不会扭曲行距的变体:
\documentclass{article}
\usepackage[nopar]{lipsum}
\usepackage{stackengine,graphicx,trimclip,scalerel}
\savestack\eye{\rotatebox{90}{$^\circ\mkern-6mu\raisebox{1pt}{)}$}}
\savestack\nose{\raisebox{3pt}{\scalebox{1}[-1]{\clipbox{0pt 1pt 0pt 0pt}{?}}}}
\savestack\mouth{\rotatebox{90}{(}}
\newcommand\Lenny{(\scalerel{\stackanchor[2pt]{\eye \nose \eye}{\mouth}}{)}}
\begin{document}
\lipsum[2] \Lenny{} \lipsum[3]
\end{document}
最后,一个更加均衡的变体,可以呈现来自不同字体系列的 Lenny(通过可选参数):
\documentclass{article}
\usepackage[nopar]{lipsum}
\usepackage{stackengine,graphicx,trimclip,scalerel}
\newcommand\Lenny[1][]{\bgroup#1%
\savestack\eye{\rotatebox{90}{\footnotesize$^\circ\mkern-6mu\raisebox{1pt}{)}$}}%
\savestack\nose{\raisebox{4pt}{\scalebox{1}[-1.3]{\clipbox{0pt 1.5pt 0pt 0pt}{?}}}}%
\savestack\mouth{\rotatebox{90}{(}}%
(\kern-1pt\scalerel{\stackanchor[1.0pt]{$\eye\nose\!\eye$}{\mouth}}{\kern-1pt)}%
\egroup%
}
\begin{document}
{\tiny rmfamily sffamily mirrored-ttfamily}\par
\Lenny\quad
\Lenny[\sffamily]\quad
\scalebox{-1}[1]{\Lenny[\ttfamily]}
\end{document}
答案3
在以下帮助下解毒,我得到了第一个近似值:
\documentclass{article}
\usepackage{tipa}
\usepackage{amsmath}
\begin{document}
$\overset\frown{\smash(^\circ} \underset\smile{\ \text\textinvglotstop} \overset\frown{\ ^\circ} )$
\end{document}
答案4
您可以使用以下代码(基于 David Griffiths 的示例):
\documentclass{report}
\usepackage{graphicx}
\def\len{{\mbox{$\resizebox{.31in}{.08in}{\includegraphics{len}}$}}}
\begin{document}
Here's a sample:
$\resizebox{.31in}{.08in}{\includegraphics{len}}$
Can I put it into a line of type? $\resizebox{.43in}{.11in}{\includegraphics{len}}$
How about using the macro: \len
\begin{equation}
1 + \len = 0
\end{equation}
\end{document}
这是我使用的图片: