缺失数字,视为第零

缺失数字,视为第零

有人知道为什么我会收到“缺失数字,视为零”和“非法计量单位(插入 pt)”吗?提前致谢。:)

\documentclass{SAMP}
\pagestyle{plain}
\begin{document}

\makeatletter
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{\small \textit{\@title} \\}
\fancyfoot[C]{\thepage}
\makeatother

\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\graphicspath{{Figures/}}

\lhead{\includegraphics[width=3cm]{Figures/bristolLogo.png}}
\rhead{\includegraphics[width=2.25cm]{Figures/Axiom Logo.png}}


%%%%%%%%%%%%%% Actual Content %%%%%%%%%%%%%%

\section{Test}


\clearpage

\addcontentsline{toc}{section}{References}
% Set to IEEE style
\bibliographystyle{ieeetr}
% Get the references from references.bib
\bibliography{References.bib}

\end{document}
\ProvidesClass{SAMP}

\LoadClass[11pt]{article}

% Setup margins
\usepackage{geometry}
\geometry{
    a4paper,
    top=25.4mm,
    right=25.4mm,
    bottom=25.4mm,
    left=25.4mm
    }

% Use parskip to leave line between paragraphs as per style
\usepackage{parskip}

% Use fancyhdr package to allow for header style
\usepackage{fancyhdr}

%\setlength\headheight{26pt} 

% Standard packages for coloured text, postscript figures (MATLAB figure export)
%  and nice-looking maths
\usepackage[table,xcdraw]{xcolor} %% added by Theo, please don't get mad if wrong

\definecolor{intro}{rgb}{0.844, 0.902, 0.938}
\definecolor{conclusion}{rgb}{0.980, 0.86, 0.832}

\usepackage{color}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{svg}
\usepackage{bm}
\usepackage{textcomp, gensymb}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{hyperref}
\usepackage{ltablex}
\usepackage{framed}

\RequirePackage{tikz} % for creating graphics and diagrams
\RequirePackage{tikz-3dplot} % for 3D graphics in TikZ
\RequirePackage{pgfplots} % for creating plots and diagrams
\RequirePackage[most]{tcolorbox} % for creating colored boxes and frames
\RequirePackage{microtype} % Improves typography
\RequirePackage{indentfirst} % Indent the first paragraph of a section
\usepackage{titlesec}

% Setup caption style
\usepackage[justification=centering]{caption}
\usepackage{subcaption}
\usepackage{cleveref}

% Reduce the itemize item separation
\usepackage{enumitem}
\setitemize{noitemsep}

\usepackage{pifont}
\usepackage{cite}
\usepackage{siunitx}
\usepackage{multirow}
\usepackage{fontspec}
% \usepackage[explicit]{titlesec}
\setmainfont{Times New Roman}
\usepackage{setspace}
\setstretch{1.5}


\usetikzlibrary{%
    decorations.pathreplacing, % Create decorative path elements that replace parts of the original path.
    decorations.pathmorphing, % Create decorative path elements that morph the original path.
    decorations.markings, % Place decorations along a path.
    shapes.multipart, % Create nodes with multiple parts.
    shapes.geometric, % Provide additional geometric shapes.
    arrows.meta, % Define arrowheads for paths.
    tikzmark, % Place markers on a path or in a TikZ picture.
    fadings, % Create gradient and transparency effects.
    arrows, % Provide additional arrowheads.
    angles, % Measure and display angles between lines.
    quotes, % Place quotes on a path.
    calc, % Provide additional mathematical functions.
    3d, % Create three-dimensional TikZ diagrams.
}

% Colours - (change the hexadecimal code to the colour which you want)
\definecolor{myDColor}{HTML}{98c1d9} % Blue
\definecolor{myLColor}{HTML}{ee6c4d} % Orange
\definecolor{myVDColor}{HTML}{293241} % Dark Blue


% This command create a polygon on the left side of the section title
\newcommand{\polygonSection}{%
\begin{tikzpicture}[remember picture, overlay,baseline=1.5ex]
\node[%
    regular polygon sides   = 6, 
    rounded corners,
    regular polygon,
    minimum size            = 1.58cm,
    ultra thick,
    inner sep               = 0pt,
    fill                    = myLColor!85,
    anchor                  = south
] at (current page.north west |- 0,-0.075) (red polygon) {};
\foreach \i in {2.5,...,4.5}{%
    \node[%
        myDColor,
        regular polygon sides   = 6, 
        regular polygon,
        rounded corners,
        minimum size            = \i cm,
        ultra thick,
        draw,
    ] at (red polygon) {};
}
\end{tikzpicture}}


\titleformat{\section}[display]
    {\normalfont\bfseries\color{myVDColor}\LARGE}{}{}
    {\polygonSection\hspace{0.5em}}

答案1

有两个错误:

  1. “没有\title给出”

    • 所以设置一个标题:\title{My Title}
  2. “缺失数字,视为零”

    • 更正\titleformat命令并赋予它一个数字:
    \titleformat{\section}[display]
        {\normalfont\bfseries\color{myVDColor}\LARGE}{\thesection}{1em}
        {\polygonSection\hspace{0.5em}}
    

相关内容