多个缺失数字,视为零。和非法计量单位(插入 pt)。在 \section 上

多个缺失数字,视为零。和非法计量单位(插入 pt)。在 \section 上

我正在使用 TeXStudio 编写,并使用“pdflatex.exe -synctex=1 -interaction=nonstopmode "Fallout Equestria - Torn Skies".tex”创建 pdf

我使用 MikTex 进行了更新。之前一切都很顺利。现在我不断收到这些错误:

缺少数字,视为零。\subsection{Preface +} 非法计量单位(插入 pt)。 \subsection{Preface +} 缺少数字,视为零。\subsection{Preface +} 非法计量单位(插入 pt)。 \subsection{Preface +}

主文件如下所示:

\input{FormatDigital.tex}
\input{header.tex}
\input{definition.tex}

\begin{document}
    \AddToShipoutPicture*{\BackgroundPic}
    \fontfamily{\familydefault}
    \null
    \thispagestyle{empty}
    \addtocounter{page}{-1}
    \newpage
    \setcounter{page}{0}
    \tableofcontents
    \pagebreak
    \setcounter{chapter}{-1}
    With the usual slight crackling static of Old World Technology, the Holotape player comes to life, lighting up controls, buttons and the Screen of a Stable-Tec terminal. After the usual boot screen, instructions flare up:\\
    \terminalscreen{    
        \termline{Files marked with a - are pure text.}
        \termline{Files marked with a + are audio recordings.}
        \termline{Files marked with a * are audio-visual recordings.}
        \termline{Files marked with a \# are Rapid Inject Memory Recordings (R.I.M.R.).}
        \termline{}
        \termline{Always make sure to use the proper interface for the different file types.}
        \termline{Please keep the R.I.M.R. interface properly maintained and sanitary}
        \termline{to prevent infections, injuries and fatal brain damage.}
        \termline{}
        \termline{Enjoy!}
    }
    \renewcommand{\chaptername}{Directory}
    \chapter{Introduction}
        \section{Preface +}
            \input{Content/Vorwort.tex}
...
\vfill
Last Edit: \today
\end{document}

格式数字:

\documentclass[11pt,a4paper,oneside,titlepage,emulatestandardclasses]{scrbook}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\renewcommand{\familydefault}{\sfdefault}

标头:

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[autostyle=true]{csquotes}
%Ancors in der Inhaltsangabe
\usepackage[pdftex,
    pdfauthor={Silver Fire},
    pdftitle={Fallout Equestria - Torn Skies},
    pdfsubject={},
    pdfkeywords={Fallout Equestria, sidefic, gore, grimdark, alternate universe},
    pdfproducer={Latex with hyperref},
    pdfcreator={pdflatex}]{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}
%Titelbild
\usepackage{graphicx}
\usepackage{eso-pic}
%Alle sections auf neuen Seiten anfangen
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}


% Schusterjungen und Hurenkinder vermeiden
\clubpenalty = 10000
\widowpenalty = 10000 
\displaywidowpenalty = 10000

和定义:

\author{Silver Fire}
\title{Fallout Equestria}
\subtitle{Torn Skies}
\date{}%entfernt das datum aus dem titel

\renewcommand{\>}{\textgreater}

\newcommand{\termline}[1]{\>\space #1\\}

\newcommand{\terminalscreen}[1]
{
    \begin{quote}
        #1
    \end{quote}
}

\renewcommand{\familydefault}{\sfdefault}

\newcommand\BackgroundPic{
    \put(0,0){
        \parbox[b][\paperheight]{\paperwidth}{
            \vfill
            \centering
            \includegraphics[width=\paperwidth,height=\paperheight,
            keepaspectratio]{Images/Title.png}
            \vfill
        }}}

我知道代码太长了。抱歉。我对 LaTeX 的熟练程度不如自己想象的那么高。如果需要,我可以提供完整的错误检查源代码。

答案1

在日志文件中可以找到原因:

类 scrbook 信息:停用titlesec解决方法,(scrbook),因为输入行 4 上的包比预期的要新。

软件包已更新titlesec。如果您确实想将新版本与 KOMA-Script 类一起使用,则必须安装 KOMA-Script 版本 3.20 的预发布版本。2016 /03/21 v2.10.2 也titlesec激活了解决方法。另请参阅titlesec因 titlesec 的使用而导致的失败(德语)。

更新 KOMA-Sript 版本 3.20于 2016/05/10 发布。它可在 CTAN、MiKTeX 2.9 和 TeX Live 2016 中使用。

建议无titlesec

但是您可以确保某个部分在新页面上开始,而无需使用包titlesec:重新定义在标题前\sectionlinesformat插入。\clearpagesection

\documentclass[oneside,titlepage,emulatestandardclasses]{scrbook}[2015/10/03]
\usepackage{blindtext}%\dummy text

\renewcommand{\familydefault}{\sfdefault}

\makeatletter
\renewcommand{\sectionlinesformat}[4]{%
  \ifstr{#1}{section}{\clearpage}{}%
  \@hangfrom{\hskip #2#3}{#4}%
}
\makeatother

\begin{document}
\blinddocument
\addsec{Test}
\end{document}

在此处输入图片描述

答案2

我仔细查看了日志文件,发现以下提示:

Class scrbook Warning: Usage of package `titlesec' together
(scrbook)              with a KOMA-Script class is not recommended.
(scrbook)              I'd suggest to use the package only
(scrbook)              if you really need it, because it breaks several
(scrbook)              KOMA-Script features, i.e., option `headings' and
(scrbook)              the extended optional argument of the section
(scrbook)              commands.
(scrbook)              Nevertheless, using requested
(scrbook)              package `titlesec' on input line 25.

我使用“titlsec”来确保每个部分都从新页面开始。直到今天,这都不是问题。我猜是 KOMA 脚本更新造成的。

相关内容