我正在制作一个行距表来帮助对齐垂直跳过。以下是精简版:
\documentclass[11pt]{memoir}
\pagestyle{empty}
\usepackage{fontspec}
\defaultfontfeatures[\rmfamily,\sffamily]{Ligatures=TeX}
\setmainfont{baskervillef}
\newlength{\normallead}
% --- DOCUMENT ---
\begin{document}
\normalsize % 11pt
\setlength{\normallead}{\baselineskip}
\ttfamily
\large
\begin{tabular}{l l l l l l}
normal & \the\normallead & \the2\normallead & \the3\normallead & \the4\normallead & \the5\normallead \\
\end{tabular}
\end{document}
对于实际的情况,我重复了对所有其他字体大小(即、等)的操作。我需要我的表格包含不同前导值的倍数:\normalsize
、、等,但似乎我无法在命令中使用乘数。除了对前导值进行硬编码或为每个倍数创建 之外,还有其他方法可以做到这一点吗?\normallead
\large
\small
\normallead
2\normallead
3\normallead
\the
\newlength
答案1
使用\the\dimexpr...
\documentclass[11pt]{memoir}
\pagestyle{empty}
%\usepackage{fontspec}
%\defaultfontfeatures[\rmfamily,\sffamily]{Ligatures=TeX}
%\setmainfont{baskervillef}
\newlength{\normallead}
% --- DOCUMENT ---
\begin{document}
\normalsize % 11pt
\setlength{\normallead}{\baselineskip}
\ttfamily
\large
\begin{tabular}{l l l l l l}
normal & \the\normallead & \the\dimexpr2\normallead &
\the\dimexpr3\normallead & \the\dimexpr4\normallead &
\the\dimexpr5\normallead \\
\end{tabular}
\end{document}