我有这个命令:
\newcommand{\showfont}
{%
(\foreignlanguage{english}
{%
encoding: \f@encoding{},
family: \f@family{},
series: \f@series{},
shape: \f@shape{},
size: \f@size{},
baseline: \f@baselineskip{}
})
}
它显示了当前行上字体的详细信息。例如:(encoding: T1, family: cmr, series: m, shape: n, size: 12, baseline: 18.0pt )
我怎样才能显示行之间的间距,即:(linespacing: 15pt, encoding: T1, family: cmr, series: m, shape: n, size: 12, baseline: 18.0pt )
例如,假设我正在起诉memoir
并已设定\OnehalfSpacing
,则应该显示我有(linespacing: 15pt, ...)
:
\documentclass[10pt]{memoir}
\usepackage[english]{babel}
\OnehalfSpacing
\makeatletter
\newcommand{\showfont}
{%
(\foreignlanguage{english}
{%
encoding: \f@encoding{},
family: \f@family{},
series: \f@series{},
shape: \f@shape{},
size: \f@size{},
baseline: \f@baselineskip{}
})
}
\makeatother
\begin{document}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
unknown printer took a galley of type and scrambled it to make a type specimen
book. It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the 1960s
with the release of Letraset sheets containing Lorem Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker including
versions of Lorem Ipsum \showfont.
\end{document}
答案1
在注释之后,我构建了如下命令:
\usepackage[english]{babel}
\OnehalfSpacing
\makeatletter
\newcommand{\showfont}
{%
(\foreignlanguage{english}
{%
encoding: \f@encoding{},
family: \f@family{},
series: \f@series{},
shape: \f@shape{},
size: \f@size{},
baseline: \f@baselineskip{},
linespread: \f@linespread{},
linespacing: \the\baselineskip{}%
})%
}
\makeatother