页边空白处的长标题

页边空白处的长标题

我已格式化我的\subsubsection标题:

\renewcommand{\thesubsubsection}{\arabic{subsubsection}}
\titleformat{\subsubsection}
[block]
{\vspace{0.1cm}\fontsize{14}{12} \selectfont}
{\fontsize{10}{12} \selectfont SECTION\ \thesubsubsection}
{0.3em}
{\leading{18pt}\bfseries\fontsize{14}{12} \selectfont}[\vskip 0.5ex \titlerule]

\titlespacing*{\subsubsection}{0pt}{0pt}{10pt}

但对于长标题,结果如下:

在此处输入图片描述

正如您所见,标题位于边距中。

有人知道如何避免这种情况吗?我希望我的标题分为两行,如下所示:

在此处输入图片描述

这是我的代码:

\documentclass[12pt,twoside]{book}
\usepackage[paperheight=240mm,paperwidth=160mm, left=22mm, right = 20mm, top = 20mm, bottom = 22mm]{geometry}

\usepackage[cam,width=17.5truecm,height=25.54truecm,center,dvips,noinfo]{crop}
\usepackage[french]{babel}

\usepackage{leading}
\leading{12.8pt}

\lineskiplimit=-100pt\relax

\usepackage{fontspec}
\usepackage{xltabular}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{lipsum}
\usepackage[newparttoc]{titlesec}%
\usepackage{titletoc}
\usepackage{supertabular}
\usepackage{xcolor}
\definecolor{gray}{HTML}{BCBDC0}
\definecolor{white}{HTML}{FFFFFF}
\usetikzlibrary{positioning,shapes.misc}
\usepackage{emptypage}

\renewcommand{\thesubsubsection}{\arabic{subsubsection}}
\titleformat{\subsubsection}
[block]
{\vspace{0.1cm}\fontsize{14}{12} \selectfont}
{\fontsize{10}{12} \selectfont SECTION\ \thesubsubsection}
{0.3em}
{\leading{18pt}\bfseries\fontsize{14}{12} \selectfont}[\vskip 0.5ex \titlerule]

\titlespacing*{\subsubsection}{0pt}{0pt}{10pt}


\begin{document}
\subsubsection{Affectation du commerce entre Etats membres}
\lipsum[1]
\end{document}


谢谢大家 !

答案1

看看这个是否有效:

\renewcommand{\thesubsubsection}{\arabic{subsubsection}}
\titleformat{\subsubsection}
[block]
{\vspace{0.1cm}\fontsize{14}{12} \selectfont\raggedright} % <------ Added \raggedright, here
{\fontsize{10}{12} \selectfont SECTION\ \thesubsubsection}
{0.3em}
{\leading{18pt}\bfseries\fontsize{14}{12} \selectfont}[\vskip 0.5ex \titlerule]

\titlespacing*{\subsubsection}{0pt}{0pt}{10pt}

相关内容