我的章节标题有奇怪的空格

我的章节标题有奇怪的空格

几乎每个 \subsubsection 和 \section 的标题都变成了这样。

在此处输入图片描述

\section{Statics of a particle}

\subsection{equilibrium and solving equation}

这是我用于打包和更新的命令。(如果您需要更多信息以及在哪个区域,请告诉我)

这是错误信息:

段落中第 422-422 行的 \hbox 未满(badness 10000)

\documentclass[14pt,a4paper,twoside]{book}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{xcolor}
\definecolor{ocre}{RGB}{52,177,201} % Define the orange color used for highlighting throughout the book
\usepackage{avant}
\usepackage{grffile} 
\usepackage{eso-pic}
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{amsmath}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{float}
\usepackage{amssymb}
\usepackage{tocloft}
\usepackage{titlesec}
\usepackage{multicol}
\usepackage[english]{babel}
\setlength{\columnsep}{1cm}


\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\contentsname}{Mechanics 1 Content}
\renewcommand{\cftsecfont}{\bfseries}

另外我还有另一个关于 latex 让我下载包的问题;

所需文件:tex\latex\arabi\bblopts.cfg

无法卸载。这是问题的一部分吗?我不确定为什么它每次都尝试安装该包。

这是我的完整代码......我只是认为这样更容易让您看到全貌;

https://www.sharelatex.com/project/57a8479fee5936ac58848ea6

答案1

如果我对(子)部分标题格式的唯一抱怨是可怕的间距,那么我只需添加\raggedright基本定义:

\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large\bfseries\raggedright}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\large\bfseries\raggedright}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries\raggedright}}
\makeatother

(这些是直接从 中提取的book.cls\newcommand更改为 \renewcommand,并\raggedright添加到内容规范的末尾。)

答案2

我编译了这段代码并且它看起来很好:

\documentclass[14pt,a4paper,twoside]{book}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{xcolor}
\definecolor{ocre}{RGB}{52,177,201} % Define the orange color used for highlighting throughout the book
\usepackage{avant}
\usepackage{grffile} 
\usepackage{eso-pic}
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{amsmath}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{float}
\usepackage{amssymb}
\usepackage{tocloft}
\usepackage{titlesec}
\usepackage{multicol}
\usepackage[english]{babel}
\setlength{\columnsep}{1cm}


\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\contentsname}{Mechanics 1 Content}
\renewcommand{\cftsecfont}{\bfseries}



\begin{document}

    \section{Statics of a particle}

    \subsection{equilibrium and solving equation}
\end{document}

在此处输入图片描述

相关内容