![\maketitle 缺失数字视为零。计量单位非法(插入 pt)。未定义控制序列](https://linux22.com/image/391178/%5Cmaketitle%20%E7%BC%BA%E5%A4%B1%E6%95%B0%E5%AD%97%E8%A7%86%E4%B8%BA%E9%9B%B6%E3%80%82%E8%AE%A1%E9%87%8F%E5%8D%95%E4%BD%8D%E9%9D%9E%E6%B3%95%EF%BC%88%E6%8F%92%E5%85%A5%20pt%EF%BC%89%E3%80%82%E6%9C%AA%E5%AE%9A%E4%B9%89%E6%8E%A7%E5%88%B6%E5%BA%8F%E5%88%97.png)
我按照您提到的进行了编辑,但是\begin{document}
和\end{document}
从一开始就按照您提到的位置放置,但错误仍然存在。
我遇到了以下错误,但找不到解决方案。有人能帮我吗?这是我的代码示例:
\usepackage{blindtext}
\usepackage[colorlinks=true,linkcolor=black]{hyperref}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{alphabeta}
\usepackage[document]{ragged2e}
\usepackage{microtype}
\usepackage{fancyhdr}
\usepackage[export]{adjustbox}
\fancypagestyle{plain}{
\fancyhf{}% Clear header/footer
\fancyhead{}
\fancyhead[L,RO]{\nouppercase\leftmark}
\fancyhead[R]{\thepage}
}
\pagestyle{plain}% Set page style to plain.
\graphicspath{ {C:/Users/.../Desktop/Manual/} }
\author{...}
\title{...}
\date{}
\makeatletter
\renewcommand{\maketitle}{
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command
for the horizontal
lines, change thickness
here
\center % Center everything on the page
\textsc{\LARGE \textwidth ....}\\[1.5cm]
\textsc{\Large ...}\\[0.5cm]
\textsc{\large ...}\\[0.5cm]
\HRule \\[0.8cm]
{ \huge \bfseries A guide of .....}\\[0.4cm] % Title of your document
\HRule \\[1.5cm]
\begin{flushleft}
\begin{center}
\centering
\includegraphics[width=\textwidth]{logo}
\end{center}
\end{flushleft}
\vfill
\begin{minipage}{0.4\textwidth}
\begin{center} \large
\emph{Author:}\\
A \texts{P}
\end{center}
\end{minipage}
\vfill
%~
\end{titlepage}
}
\makeatother
\date{}
\begin{document}
\maketitle
\newpage
\tableofcontents{}
\chapter{Ε..}
\vfill
\begin{center}
\includegraphics[max size={\textwidth}{\textheight}]{home_page_gr}
\end{center}
\end{document}
答案1
可编译(无错误)代码:
\documentclass{report}
\usepackage{blindtext}
\usepackage[colorlinks=true,linkcolor=black]{hyperref}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{alphabeta}
\usepackage[document]{ragged2e}
\usepackage{microtype}
\usepackage{fancyhdr}
\usepackage[export]{adjustbox}
\fancypagestyle{plain}{
\fancyhf{}% Clear header/footer
\fancyhead{}
\fancyhead[L,RO]{\nouppercase\leftmark}
\fancyhead[R]{\thepage}
}
\pagestyle{plain}% Set page style to plain.
\graphicspath{ {C:/Users/.../Desktop/Manual/} }
\author{...}
\title{...}
\date{}
\begin{document}
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command
\center % Center everything on the page
\textsc{\LARGE ....}\\[1.5cm]
\textsc{\Large ...}\\[0.5cm]
\textsc{\large ...}\\[0.5cm]
\HRule \\[0.8cm]
{ \huge \bfseries A guide of .....}\\[0.4cm] % Title of your document
\HRule \\[1.5cm]
\begin{flushleft}
\begin{center}
\centering
\includegraphics[width=\textwidth]{example-image-a}
\end{center}
\end{flushleft}
\vfill
\begin{minipage}{0.4\textwidth}
\begin{center} \large
\emph{Author:}\\
A \textsc{P}
\end{center}
\end{minipage}
\vfill
%~
\end{titlepage}
\newpage
\tableofcontents{}
\chapter{Ε..}
\vfill
\begin{center}
\includegraphics[max size={\textwidth}{\textheight}]{example-image-b}
\end{center}
\end{document}
我所做出的改变:
- 解决主要问题:我明白了问题
\textwidth
所在\textsc{\LARGE \textwidth ....}\\[1.5cm]
。我不太明白为什么会这样。或者您想添加当前边距宽度吗? - 在原始代码中,
Defines a new command
被 识别为注释%
,但for the horizontal lines, change thickness here
事实并非如此。我决定删除它们:) - 为了解决错误
Undefined control sequence
:我将\texts
中的 (未定义)更改A \texts{P}
为\textsc
。好吧,P 已经是大写,所以这个命令根本没有必要…… - 当然,我无法编译您的文档,因为我没有图像
logo
和home_page_gr
,所以我使用example-image-a
和example-image-b
来代替。