我按照您提到的方式進行了編輯,但\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
代替。