我有下表
\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}