我尝试在 KOMA-script 中制作带下划线的标题(部分),但效果不太好……
你能指导我怎么做吗?
以下是 MWE:
% Preview source code
%% LyX 2.3.1-1 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew]{scrartcl}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\addtokomafont{disposition}{\rmfamily}
\setkomafont{part}{\underline\itshape\fontsize{26pt}{26pt}\selectfont}
\setkomafont{partnumber}{\underline\fontsize{26pt}{26pt}\selectfont}
\renewcommand\partheadmidvskip{}
\renewcommand*{\partformat}{Part~ :\thepart~~}
\AtBeginDocument{\renewcommand*{\raggedpart}{\centering}}
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\part{PARTONE}
Hello!
\end{document}
PS 如果我放置\underline
标签它就不起作用,或者将标题刷新到右边(我是希伯来语用户)。
谢谢你!
答案1
使用最新的 KOMA-Script 版本(至少为 3.25 版)
\renewcommand\partlineswithprefixformat[3]{\hfill\underline{#2#3}\hfill}
似乎有效。那么就\raggedpart
不需要重新定义。