【发布时间】:2010-07-10 18:23:25
【问题描述】:
我想更改某些页面部分的文本大小,例如对于逐字块:
\begin{verbatim}
<how to set the font size here to 10 pt? />
\end{verbatim}
【问题讨论】:
标签: latex
我想更改某些页面部分的文本大小,例如对于逐字块:
\begin{verbatim}
<how to set the font size here to 10 pt? />
\end{verbatim}
【问题讨论】:
标签: latex
\begingroup
\fontsize{10pt}{12pt}\selectfont
\begin{verbatim}
% how to set font size here to 10 px ?
\end{verbatim}
\endgroup
【讨论】:
fontsize的第一个参数是要切换到的字体大小,第二个是要使用的行距
例子:
\Large\begin{verbatim}
<how to set font size here to 10 px ? />
\end{verbatim}
\normalsize
\Large 显然可以替换为以下之一:
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge
如果您需要任意字体大小:
【讨论】:
\usepackage{fancyvrb} 包的使用允许在 Verbatim 中定义 fontsize 参数:
\begin{Verbatim}[fontsize=\small]
print "Hello, World"
\end{Verbatim}
你可以指定的字体大小是常用的
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge
【讨论】:
要添加确切的字体大小,您可以使用以下。为我工作,因为在我的情况下,预定义的范围(大、小)与我所需的字体大小不匹配。
\fontsize{10}{12}\selectfont This is the text you need to be in 10px
【讨论】:
http://en.wikibooks.org/wiki/LaTeX/Formatting
改用\alltt 环境。然后使用与外部逐字环境相同的命令设置大小。
【讨论】: