我正在写论文陈述,想在结尾处放一个问号图像以表示问题。有人能给我一些代码来画一个漂亮的问号吗?
要求:
- 使用 Pgf/Tikz 编码
- 好看
- 高度可定制
- 不要太不正式
我可以在 Tikz 中绘图,但我不知道如何绘制大而漂亮的图画,但我可以稍微修改代码。
编辑:我说不要太随意,但我也希望它不要太正式。类似于这,但不一定非得是 3D 的。
答案1
下面是一个更好的例子。不过,这绝对不是一个简单的结构:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.1]
\draw (48.656200,67.906197)..controls (48.656200,75.199203) and (43.636700,84.164101)..(26.421900,84.164101)
..controls (13.507800,84.164101) and (6.457030,75.796898)..(6.457030,68.144501)
..controls (6.457030,63.839802) and (9.683590,62.882801)..(11.476600,62.882801)
..controls (13.507800,62.882801) and (16.378901,64.320297)..(16.378901,67.906197)
..controls (16.378901,70.656197) and (14.347700,72.808601)..(11.359400,72.808601)
..controls (10.640600,72.808601) and (10.402300,72.808601)..(10.160200,72.687500)
..controls (12.793000,78.902298) and (19.726601,81.773399)..(26.062500,81.773399)
..controls (39.570301,81.773399) and (39.570301,73.046898)..(39.570301,68.503899)
..controls (39.570301,61.449200) and (37.417999,59.179699)..(35.386700,57.027302)
..controls (27.257799,48.300800) and (24.628901,37.179699)..(24.628901,29.886700)
--(24.628901,24.148399)..controls (24.628901,21.996099) and (24.628901,21.519501)..(25.941401,21.519501)
..controls (27.257799,21.519501) and (27.257799,22.355499)..(27.257799,24.507799)
--(27.257799,28.929701)..controls (27.257799,35.984402) and (30.128901,46.503899)..(42.203098,55.472698)
..controls (45.550800,57.984402) and (48.656200,61.687500)..(48.656200,67.906197)
--cycle;
\draw (31.679701,5.859380)..controls (31.679701,8.964840) and (29.050800,11.597700)..(25.941401,11.597700)
..controls (22.355499,11.597700) and (20.085899,8.726560)..(20.085899,5.859380)
..controls (20.085899,2.269530) and (22.953100,0.000000)..(25.824200,0.000000)
..controls (29.171900,0.000000) and (31.679701,2.628910)..(31.679701,5.859380)
--cycle;
\end{tikzpicture}
\end{document}
当然,代码本身并不是那么有用,所以我是这样获取它的:
我想使用makempy
,但我无法让它在我的计算机上运行(带有 TeXLive 2009 的 Debian),所以我基本上模仿了它应该做的事情:
我从这个 TeX 文档开始
qmark.tex
::
\startTEXpage[scale=10000]$?$\stopTEXpage
我处理了context
:
texexec qmark.tex
然后将生成的pdf转换为postscript:
pdftops qmark.pdf
然后我将其转换为 metapost 文件pstoedit
:
pstoedit -dt -f mpost qmark.ps > qmark.mp
生成的 mpfile 为:
% Converted from PostScript(TM) to MetaPost by pstoedit
% MetaPost backend contributed by Scott Pakin <scott+ps2ed_AT_pakin.org>
% pstoedit is Copyright (C) 1993 - 2009 Wolfgang Glunz <wglunz35_AT_pstoedit.net>
% Generate structured PostScript
prologues := 1;
% Display a given string with its *baseline* at a given location
% and with a given rotation angle
vardef showtext(expr origin)(expr angle)(expr string) =
draw string infont defaultfont scaled defaultscale
rotated angle shifted origin;
enddef;
beginfig(1);
linecap := butt;
linejoin := mitered;
fill (48.656200,67.906197)..controls (48.656200,75.199203) and (43.636700,84.164101)..(26.421900,84.164101)
..controls (13.507800,84.164101) and (6.457030,75.796898)..(6.457030,68.144501)
..controls (6.457030,63.839802) and (9.683590,62.882801)..(11.476600,62.882801)
..controls (13.507800,62.882801) and (16.378901,64.320297)..(16.378901,67.906197)
..controls (16.378901,70.656197) and (14.347700,72.808601)..(11.359400,72.808601)
..controls (10.640600,72.808601) and (10.402300,72.808601)..(10.160200,72.687500)
..controls (12.793000,78.902298) and (19.726601,81.773399)..(26.062500,81.773399)
..controls (39.570301,81.773399) and (39.570301,73.046898)..(39.570301,68.503899)
..controls (39.570301,61.449200) and (37.417999,59.179699)..(35.386700,57.027302)
..controls (27.257799,48.300800) and (24.628901,37.179699)..(24.628901,29.886700)
--(24.628901,24.148399)..controls (24.628901,21.996099) and (24.628901,21.519501)..(25.941401,21.519501)
..controls (27.257799,21.519501) and (27.257799,22.355499)..(27.257799,24.507799)
--(27.257799,28.929701)..controls (27.257799,35.984402) and (30.128901,46.503899)..(42.203098,55.472698)
..controls (45.550800,57.984402) and (48.656200,61.687500)..(48.656200,67.906197)
--cycle;
fill (31.679701,5.859380)..controls (31.679701,8.964840) and (29.050800,11.597700)..(25.941401,11.597700)
..controls (22.355499,11.597700) and (20.085899,8.726560)..(20.085899,5.859380)
..controls (20.085899,2.269530) and (22.953100,0.000000)..(25.824200,0.000000)
..controls (29.171900,0.000000) and (31.679701,2.628910)..(31.679701,5.859380)
--cycle;
fill (55.277302,0.000000)--cycle;
endfig;
end
请注意,metapost 中的路径语法与 tikz 中的相同,因此我删除了除填充命令之外的所有行,并用
\draw
tikz 的命令替换了填充命令。
编写一个可以完成所有这些工作的脚本应该相当容易。
结果如下:
答案2
只需从你喜欢的字体中缩放一个问号,然后使用 TikZ 在它周围绘制你需要的任何内容:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.symbols}
\begin{document}
\tikz\node[%
draw=blue,
fill=blue!10,
cloud,
line width=1mm,
font=\fontfamily{ppl}\fontsize{10cm}{12cm}\selectfont]{?};
\end{document}
答案3
选择轮廓字体:
\documentclass{article}
\begin{document}
\usefont{T1}{fxb}{o}{b}\fontsize{10cm}{10.5cm}\selectfont?
\end{document}
答案4
您要求的是一个简单的结构。这里是一个简单的路径。更复杂的版本是绘制标记的轮廓,然后可以用不同的效果填充它。
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[line width=0.5,line cap=round] (1.5,0) .. controls ++(0,2) and ++(0,-2) .. (4,4)
to[out=90,in=0] (2,6)
to[out=180,in=90] (0,4);
\fill (1.5,-1) circle (0.25);
\end{tikzpicture}
\end{document}
结果是
如果您对尺寸给出指示,我可以相应地调整图纸。