以下 mwe 显示嵌入两行的标题。问题是,如果标题包含“g”、“j”、“p”、“q”等字母,则底线非常接近这些特定字母。使用命令vspace
我可以更正它,以获得所需的结果。
我正在寻找makro 的形式 mytitle{<title>}
无论标题使用什么字母,它都会返回所需的标题布局。
所提及的 mwe:
\documentclass[12pt,numbers=noenddot]{scrartcl}
% layout (geometry, one page, margins)
\usepackage[a4paper,left=80pt,right=80pt,top=60pt,bottom=80pt,headsep=20pt,footskip=10pt]{geometry}
\pagestyle{empty}
% linespacing
\usepackage[onehalfspacing]{setspace}
% no indent
\parindent0pt
% skip lenghts
\setlength{\smallskipamount}{4pt}
\setlength{\medskipamount}{8pt}
\setlength{\bigskipamount}{20pt}
% fonts
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\begin{document}
Titles without height corrections:
\medskip
\hrule height 0.7pt
\smallskip
\large
\textbf{Normal Title}
\smallskip
\hrule height 0.7pt
\medskip
\medskip
\normalsize
\hrule height 0.7pt
\smallskip
\large
\textbf{Irregular Title}
\hrule height 0.7pt
\medskip
\medskip
\normalsize
Title corrected with vspace:
\medskip
\hrule height 0.7pt
\smallskip
\large
\textbf{Irregular Title}
\vspace{1.5pt}
\hrule height 0.7pt
\medskip
\medskip
\normalsize
\end{document}
结果:
答案1
这样就摆脱了“跳过”并使用了\addstackgap[2pt]{}
来自stackengine
包的。
\documentclass[12pt,numbers=noenddot]{scrartcl}
% layout (geometry, one page, margins)
\usepackage[a4paper,left=80pt,right=80pt,top=60pt,bottom=80pt,headsep=20pt,footskip=10pt]{geometry}
\pagestyle{empty}
% linespacing
\usepackage[onehalfspacing]{setspace}
% no indent
\parindent0pt
% skip lenghts
\setlength{\smallskipamount}{4pt}
\setlength{\medskipamount}{8pt}
\setlength{\bigskipamount}{20pt}
% fonts
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{stackengine}
\begin{document}
Titles without height corrections:
\medskip
\hrule height 0.7pt
\large
\addstackgap[2pt]{\textbf{Normal Title}}
\hrule height 0.7pt
\medskip
\medskip
\normalsize
\hrule height 0.7pt
\large
\addstackgap[2pt]{\textbf{Irregular Title}}
\hrule height 0.7pt
\medskip
\medskip
\normalsize
\end{document}