我正在使用以下代码为我的学生创建姓名标牌。如何才能将字体大小增加到更大\Huge
?我想缩放单词的大小而不缩放整个图片。
\documentclass[12pt,ngerman]{scrartcl}
\usepackage[left=1cm,right=1cm,top=1.5cm,bottom=0.5cm,a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{pgffor}
\usepackage{tikz}
\usepackage{xcolor}
\usetikzlibrary{positioning}
\pagestyle{empty}
\setlength{\parskip}{0pt}
\begin{document}
\foreach \x in {Donald Tiberius Duck,Mickey Sherlock Mouse}{
\begin{tikzpicture}
[mybox/.style={rectangle,black,xshift=0cm,yshift=0cm,minimum width=0.99\textwidth,font=\Huge\bfseries,draw=black,very thick,align=center, minimum height=0.475\textheight}]
\node at (0,0) [mybox] {\x};
\node at (0,0.475\textheight) [mybox] {};
\end{tikzpicture}\clearpage}
\end{document}
答案1
您可以使用\fontsize{50}{60}
可 font=\fontsize{40}{48}\bfseries,
缩放字体(\selectfont
如果没有使用,则需要\bfseries
)。使用\usepackage{lmodern}
您将获得
\documentclass[12pt,ngerman]{scrartcl}
\usepackage[left=1cm,right=1cm,top=1.5cm,bottom=0.5cm,a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{pgffor}
\usepackage{tikz}
\usepackage{xcolor,lmodern}
\usetikzlibrary{positioning}
\pagestyle{empty}
\setlength{\parskip}{0pt}
\begin{document}
\foreach \x in {Donald Tiberius Duck,Mickey Sherlock Mouse}{
\begin{tikzpicture}
[mybox/.style={rectangle,black,xshift=0cm,yshift=0cm,minimum width=0.99\textwidth,font=\fontsize{40}{48}\bfseries,draw=black,very thick,align=center, minimum height=0.475\textheight}]
\node at (0,0) [mybox] {\x};
\node at (0,0.475\textheight) [mybox,] {};
\end{tikzpicture}\clearpage}
\end{document}