考虑以下 MWE:
\documentclass{article}
% HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
\usepackage{xcolor}
\newcommand{\header}[2]{%
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, anchor=north, minimum width=\paperwidth, minimum height=5cm,yshift=00.00pt] (box) at (current page.north){};
\node [anchor=center] (name) at (box) {%
\fontsize{40pt}{72pt}\color{black}%
{#1}{#2}
};
\end{tikzpicture}
\vspace{30pt}
}
% DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\header{Name}{Surname}
\end{document}
为什么当我指定时,输出会以如此小的字体显示 \fontsize{40pt}{72pt}
?有人能帮我以更大的字体大小显示输出吗?
另外,我想将“姓氏”一词加粗,但我做不到。有什么帮助吗?
提前感谢大家的时间。
答案1
\documentclass{article}
% HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
\usepackage{xcolor}
\newcommand{\header}[2]{%
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, anchor=north, minimum width=\paperwidth, minimum height=5cm,yshift=00.00pt] (box) at (current page.north){};
\node [anchor=center] (name) at (box) {%
\fontsize{40pt}{72pt}\color{black}%
{\normalfont#1}{\bfseries#2} % <<<<---- changes to your code
};
\end{tikzpicture}
\vspace{30pt}
}
% DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\header{Name}{ Surname}
\end{document}