![\fontsize{}{} 如何工作?](https://linux22.com/image/280334/%5Cfontsize%7B%7D%7B%7D%20%E5%A6%82%E4%BD%95%E5%B7%A5%E4%BD%9C%EF%BC%9F.png)
使用该包,anyfontsize
我可以使用命令\fontsize{}{}
。但第二个参数似乎没有任何效果。我读到那里它与行距有关。它不起作用。
\documentclass{article}
\usepackage{anyfontsize}
\begin{document}
{\fontsize{1cm}{1cm}\selectfont First test : I need to put some text here.}
\bigskip
{\fontsize{1cm}{2cm}\selectfont Second test : I need to put some text here --- does it work?}
\end{document}
有什么线索吗?
答案1
您需要先结束段落,然后才能关闭组。虽然字体大小会在您发出\selectfont
新的行距时更新,但只有在段落结束时才会更新。在您的情况下,组以 结束(以}
)前段落结束(行尾后的空行)。要么写
{\fontsize{1cm}{2cm}\selectfont Second test : I need to put some text here ---
does it work?
}
\par
或者在最后使用:
{\fontsize{1cm}{2cm}\selectfont Second test : I need to put some text here ---
does it work?\par}
\documentclass{article}
\usepackage{anyfontsize}
\begin{document}
{\fontsize{1cm}{1cm}\selectfont First test : I need to put some text here.\par}
\bigskip
{\fontsize{1cm}{2cm}\selectfont Second test : I need to put some text here ---
does it work?\par}
\end{document}