我搜索过类似的错误,通常与使用\titleformat
而不是\titleformat*
这就是我正在使用的
\titleformat*{\subsubsection}{\large\color{gray}}
但是,它给了我错误:
Paragraph ended before \ttl@format@si was complete.
我不确定我遗漏了什么。如果我注释掉上面这一行,那么一切都会正常,但当然,风格不是我想要的。
完整文件如下所示:
\documentclass[letterpaper,12pt]{extreport}
\usepackage{url}
\usepackage{setspace}
\usepackage[bottom]{footmisc}
\usepackage{hyperref}
\usepackage{mathtools}
\usepackage{scrextend}
\usepackage{fancyref}
\usepackage{caption}
\usepackage{enumitem}
\usepackage{color}
\usepackage{xcolor}
\usepackage{multicol}
\usepackage{chapterStyle}
\usepackage{appendices}
\usepackage{subfig}
\usepackage{titlesec}
\usepackage{longtable}
\usepackage{datetime}
\usepackage{perpage}
\MakePerPage{footnote}
\hyphenpenalty=100000
\usepackage[margin=0.5in,headsep=0.2in,footskip=0.1in]{geometry}
\newcommand{\phantomsec}[1]{\phantomsection\label{#1}}
\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancyplain}
\fancyhead{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}
\newcommand\sectionbreak{\ifnum\value{chapter}>1\ifnum\value{section}>1\clearpage\fi\fi}
\newcommand\subsectionbreak{\ifnum\value{chapter}=6\ifnum\value{subsection}>1\clearpage\fi\fi}
\titleformat*{\subsubsection}{\large \color{gray}}
\begin{document}
\pagenumbering{roman}
\maketitle
\setcounter{page}{2}
\pagebreak
\pagebreak
\tableofcontents
\pagebreak
\listofappendices
\pagebreak
\pagenumbering{arabic}
\setcounter{page}{1}
\begin{sloppypar}
\include{./introduction}
\include{./running}
\include{./creatingproject}
\include{./managing}
\include{./configurationfiles}
\include{./workflow}
\include{./end}
\include{./appendex}
\end{sloppypar}
\end{document}
chapterStyle 包如下所示,似乎导致了该问题:
\ProvidesPackage{chapterStyle}[2017/09/23]
\RequirePackage[explicit]{titlesec}
\newlength\chapnumb
\setlength\chapnumb{4cm}
\newcommand{\chaptertitlefont}{\normalfont\sffamily\Huge}
\titleformat{\chapter}[block]
{\normalfont\sffamily}{}{0pt}
{\parbox[b]{\chapnumb}{%
\fontsize{120}{110}\selectfont\thechapter}%
\parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{%
\raggedleft%
\hfill{\chaptertitlefont#1}\\
\rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}}}
\titleformat{name=\chapter,numberless}[block]
{\normalfont\sffamily}{}{0pt}
{\parbox[b]{\chapnumb}{%
\mbox{}}%
\parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{%
\raggedleft%
\hfill{\chaptertitlefont#1}\\
\rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}}}
\endinput
答案1
explicit
如果您使用包中的选项titlesec
,那么您必须unnumbered head
像下面这样编写代码:
\titleformat{\subsubsection}{\large \color{gray}}{}{}{#1}
上述变化将帮助您满足要求...