![更改表格和文本的字体](https://linux22.com/image/417505/%E6%9B%B4%E6%94%B9%E8%A1%A8%E6%A0%BC%E5%92%8C%E6%96%87%E6%9C%AC%E7%9A%84%E5%AD%97%E4%BD%93.png)
我有下表
\documentclass{article}
\usepackage{amsmath}
\newcommand*{\myfont}{\fontfamily{qcr}\selectfont}
\begin{document}
Lorem {\myfont ipsum}
{\myfont
\begin{table}[h]
\setlength\tabcolsep{1.5pt}
\begin{tabular}{lllllllll}
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\
A, & B, & C, & D, & E, & F, & G, & H, & I \\
\end{tabular}
\end{table}
}
\end{document}
为什么 'ipsum' 可以显示\myfont
,但表格却不能?我该如何更改表格的字体?
答案1
移动字体类型table
:
\documentclass{article}
\usepackage{amsmath}
\newcommand*{\myfont}{\fontfamily{qcr}\selectfont}
\begin{document}
Lorem {\myfont ipsum}
\begin{table}[ht]
\myfont
\setlength\tabcolsep{1.5pt}
\begin{tabular}{lllllllll}
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\
A, & B, & C, & D, & E, & F, & G, & H, & I \\
\end{tabular}
\end{table}
\end{document}