我想将该部分的标题居中,但是不起作用:
\renewcommand*\raggedpart{\centering}
\setkomafont{part}{\itshape\fontsize{26pt}{26pt}\selectfont}
\setkomafont{partnumber}{\fontsize{26pt}{26pt}\selectfont}
\renewcommand\partheadmidvskip{}
\renewcommand*{\partformat}{part~ :\thepart~~}
我也尝试过不使用 * (在第一行):
\renewcommand\raggedpart{\centering}
\setkomafont{part}{\itshape\fontsize{26pt}{26pt}\selectfont}
\setkomafont{partnumber}{\fontsize{26pt}{26pt}\selectfont}
\renewcommand\partheadmidvskip{}
\renewcommand*{\partformat}{part~ :\thepart~~}
两者都不起作用....
那么,我怎样才能使标题居中?
编辑:
我也尝试了这个:\let\raggedpart\centering
但是它仍然不起作用......
文件如下:
% 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}
\newcommand*\raggedchapter{\centering}
\let\raggedpart\centering
\setkomafont{part}{\itshape\fontsize{26pt}{26pt}\selectfont}
\setkomafont{partnumber}{\fontsize{26pt}{26pt}\selectfont}
\renewcommand\partheadmidvskip{}
\renewcommand*{\partformat}{Part~ :\thepart~~}
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
\part{PART ONE}
Hello!
\end{document}
谢谢你!
答案1
\raggedpart
被重新定义scrartcl-xetex-bidi.def
为
\def\raggedpart{\if@RTL\raggedleft\else\raggedright\fi}
因此,您必须重新定义\raggedpart
或\setdefaultlanguage{hebrew}
使用
\AtBeginDocument{\renewcommand*{\raggedpart}{\centering}}