考虑以下 TeX 代码:
\documentclass{article}
\begin{document}
\begin{itemize}
\item[1] abc
\item[2] def
\end{itemize}
\end{document}
如何改变 1..2 项目编号的字体大小?
答案1
你的意思是像这样?
\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate]{font=\huge\bfseries}
\begin{document}
\begin{enumerate}
\item abc
\item def
\end{enumerate}
\end{document}
请注意
\begin{itemize}
\item[1] abc
\item[2] def
\end{itemize}
可能没有按照您的意愿执行。您要求使用“逐项列举”环境,然后使用一组手动枚举数字覆盖通常提供的项目符号。您可能更喜欢使用\begin{enumerate} \item ... \end{enumerate}
我上面写的方法。
如果您需要或想要使用该itemize
环境,您可以采用我的建议并使用:
\usepackage{enumitem}
\setlist[itemize]{font=\huge\bfseries}
比较输出:
\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate]{font=\huge\bfseries}
\setlist[itemize]{font=\huge\bfseries}
\begin{document}
\begin{enumerate}
\item abc
\item def
\end{enumerate}
\begin{itemize}
\item[1] abc
\item[2] def
\end{itemize}
\end{document}
临时编辑(如果这解决了问题,请编辑该问题以便将来对其他人有用。)
鉴于评论中提到的链接,以及表示不想改变现有文件的愿望(我不建议将其作为一般做法),也许这就是您正在寻找的内容:
将此行添加到您的序言中(根据需要修改特征):
\setbeamerfont*{shahzad}{size=\footnotesize,series=\bfseries,shape=\itshape}
然后替代
\usebeamerfont*{shahzad}
为了
\usebeamerfont*{itemize \beameritemnestingprefix item}%
完整示例:
\documentclass{beamer}
\usepackage{lmodern}
\setbeamerfont*{shahzad}{size=\footnotesize,series=\bfseries,shape=\itshape}
\makeatletter
\newcommand\ChangeItemFont[3]{%
\renewcommand{\itemize}[1][]{%
\beamer@ifempty{##1}{}{\def\beamer@defaultospec{#1}}%
\ifnum \@itemdepth >2\relax\@toodeep\else
\advance\@itemdepth\@ne
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
\usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
\usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
\list
{\usebeamertemplate{itemize \beameritemnestingprefix item}}
{\def\makelabel####1{%
{%
\hss\llap{{%
% \usebeamerfont*{itemize \beameritemnestingprefix item}%
\usebeamerfont*{shahzad}%
\usebeamercolor[fg]{itemize \beameritemnestingprefix item}####1}}%
}%
}%
\ifnum\@itemdepth=1\relax
#1%
\else
\ifnum\@itemdepth=2\relax
#2%
\else
\ifnum\@itemdepth=3\relax
#3%
\fi%
\fi%
\fi%
}
\fi%
\beamer@cramped%
\raggedright%
\beamer@firstlineitemizeunskip%
}}
\makeatother
\begin{document}
\begin{frame}
\frametitle{Font size changed}
\ChangeItemFont{\fontsize{30}{36}\selectfont}{\scriptsize}{\LARGE}
\begin{itemize}
\item[1] First item. % <-- note this one
\begin{itemize}
\item First subitem.
\begin{itemize}
\item[1] First subsubitem. % <-- note this one
\item Second subsubitem.
\item Third subsubitem.
\item Fourth subsubitem.
\end{itemize}
\item Second subitem.
\end{itemize}
\item Second item.
\item Third item.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Regular font size}
\begin{itemize}
\item First item.
\begin{itemize}
\item First subitem.
\begin{itemize}
\item[1] First subsubitem.
\item Second subsubitem.
\item Third subsubitem.
\item Fourth subsubitem.
\end{itemize}
\item Second subitem.
\end{itemize}
\item Second item.
\item Third item.
\end{itemize}
\end{frame}
\end{document}
但最终,你应该改变未来文档的做法。长期来看,使用itemize
环境会导致问题。enumerate