如何控制乳胶中pgf/tikz图形的字体大小?
我正在 pgf/tikz 中创建图表。当我在文档中使用它们时,它们会被缩放,其中一些位于类似 minipage/subfig 的环境中。发生这种情况时,字体大小会随着图形而缩放,从而使它们非常小或难以阅读。我已经阅读了该手册,但到目前为止,我试图控制它尚未成功。
有没有办法直接设置字体大小?有哪些选择?
下面给出的一个问题展示了如何使用 \tikzstyle 字体选项来指定 tikzpicture 环境中的字体大小。
现在我正在使用:
\beginppgfgraphicnamed{graph}
\input{graph.tex}
\endpgfgraphicnamed
输入文件中使用 tikzpicture 环境。无论如何,我正在使用的设置中可以指定字体大小吗?也许这就是问题所在? graph.tex 文件是通过另一个程序自动生成的。
除了为单个图形设置字体大小之外,最好有一个参数来全局设置所有 tikz 图形的字体大小? 我猜问题是 minipage 中的缩放或子图。
非常感谢,
杰伊
I'm creating graphs in pgf/tikz. When I use these in my document they are scaled, several are in minipage/subfig like environments. When this happens the font sizes are scaled with the graphics making them very small or unreadable. I've been through the manual but have so far been unsuccessful in my attempts to control this.
Is there a way to set the font size directly? What options are there?
One aswer given below shows how to how to use the \tikzstyle font option to specify the font size within the tikzpicture environment.
Right now I am using:
\beginppgfgraphicnamed{graph}
\input{graph.tex}
\endpgfgraphicnamed
The tikzpicture environment is used in the input file. Are there anyways to specify font size in the setup I'm using? Is this perhaps the issue? The graph.tex file is generated automatically via another program.
In addition to setting font size for individual graphics it would be ideal to have a parameter to globally set font size for all tikz graphics? I guess the issue is the scaling in minipage or subfig.
Many thanks,
Jay
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
将为您提供每个节点上的字体大小控制。
will give you font size control on every node.
我发现更好的控制是使用scalefnt包:
I found the better control would be using scalefnt package:
我相信米卡的方式值得回答,因为作为评论不够明显:
I believe Mica's way deserves the rank of answer, since is not visible enough as a comment:
您还可以使用:
anyfontsize
软件包的巨大优势scalefnt
的优点是不需要将整个{tikzpicture}
包含在\scalefont
环境中。只需将
\usepackage{anyfontsize}
添加到序言中即可实现字体缩放魔法。You can also use:
The huge advantage of the
anyfontsize
package overscalefnt
is that one does not need to enclose the entire{tikzpicture}
within a\scalefont
environment.Just adding
\usepackage{anyfontsize}
to the preamble is all that is required for the font scaling magic to happen.