代码中的字符串位置与输出 pdf 中的位置不对应

代码中的字符串位置与输出 pdf 中的位置不对应

我有如下代码,我想在上面的位置插入字符串“222222222222222222222222222”,\date{today} 如代码所示,它出现在第一页,并且today位于第二页。我怎样才能让它们位于同一页(及上方today)?

编辑 此外,当我输入 2 次时\date{today}它只出现一次,为什么?

\documentclass[
    a4paper, % Page size
    fontsize=10pt, % Base font size
    twoside=true, % Use different layouts for even and odd pages (in ipt documentation for an in-depth explanation)
]{kaobook}


\let\providelength\relax
\usepackage{dialogue}


% Choose the language
\ifxetexorluatex
    \let\providelength\relax
    \usepackage{polyglossia}
    \setmainlanguage{english}
\else
    \let\providelength\relax
    \usepackage[english]{babel} % Load characters and hyphenation
\fi
\usepackage[english=british]{csquotes}  % English quotes



%\documentclass{book}



\usepackage{amsmath,amssymb}
\usepackage{mathrsfs}

\usepackage{imakeidx}
\usepackage{hyperref}

\makeindex
\usepackage{enumitem}
\usepackage{etoolbox}
\usepackage{indentfirst}

\usepackage[Lenny]{fncychap}

 \usepackage[natbib=true]{biblatex}

 % include the chapter number
 \setlist[enumerate]{label=\thechapter.\arabic{*},resume}

 % restart the enumerate list every chapter
 \preto\chapter{%
   \restartlist{enumerate}%
}














% Load packages for testing
\usepackage{blindtext}
 
\usepackage{kaobiblio}
\addbibresource{main.bib} % Bibliography file




% Load mathematical packages for theorems and related environments
\usepackage[framed=true]{kaotheorems}

% Load the package for hyperreferences
\usepackage{kaorefs}

\graphicspath{{examples/documentation/images/}{images/}} % Paths in which to look for images

\makeindex[columns=3, title=Alphabetical Index, intoc] % Make LaTeX produce the files required to compile the index

\makeglossaries % Make LaTeX produce the files required to compile the glossary
\input{glossary.tex} % Include the glossary definitions

\makenomenclature % Make LaTeX produce the files required to compile the nomenclature

 
\usepackage{indentfirst}

\begin{document}

 
\titlehead{The \texttt{proper} class}
\subject{}

\title[Example and documentation of the {\normalfont\texttt{kaobook}} class]{On the {\normalfont\texttt{Second  }} and  }
\subtitle{Provability }

\author[Y]{J K\thanks{A \LaTeX\ lover}}

\date{\today}
22222222222222222222222222
\date{\today}


999999999999999
\publishers{ submitted in  }

%----------------------------------------------------------------------------------------

\frontmatter % Denotes the start of the pre-document content, uses roman numerals

%----------------------------------------------------------------------------------------
%   OPENING PAGE
%----------------------------------------------------------------------------------------

 
\makeatletter
\uppertitleback{\@titlehead} % Header
 
 
\maketitle

 
\index{preface}




%----------------------------------------------------------------------------------------
%   TABLE OF CONTENTS & LIST OF FIGURES/TABLES
%----------------------------------------------------------------------------------------

\begingroup % Local scope for the following commands

% Define the style for the TOC, LOF, and LOT
%\setstretch{1} % Uncomment to modify line spacing in the ToC
%\hypersetup{linkcolor=blue} % Uncomment to set the colour of links in the ToC
\setlength{\textheight}{230\hscale} % Manually adjust the height of the ToC pages

% Turn on compatibility mode for the etoc package
\etocstandarddisplaystyle % "toc display" as if etoc was not loaded
\etocstandardlines % "toc lines" as if etoc was not loaded

\tableofcontents % Output the table of contents

\listoffigures % Output the list of figures

% Comment both of the following lines to have the LOF and the LOT on different pages
\let\cleardoublepage\bigskip
\let\clearpage\bigskip

\listoftables % Output the list of tables

\endgroup

%----------------------------------------------------------------------------------------
%   MAIN BODY
%----------------------------------------------------------------------------------------


\end{document}

答案1

快速而肮脏的黑客攻击:

\documentclass[
    a4paper, % Page size
    fontsize=10pt, % Base font size
    twoside=true, % Use different layouts for even and odd pages (in ipt documentation for an in-depth explanation)
]{kaobook}


\let\providelength\relax
\usepackage{dialogue}


% Choose the language
\ifxetexorluatex
    \let\providelength\relax
    \usepackage{polyglossia}
    \setmainlanguage{english}
\else
    \let\providelength\relax
    \usepackage[english]{babel} % Load characters and hyphenation
\fi
\usepackage[english=british]{csquotes}  % English quotes



%\documentclass{book}



\usepackage{amsmath,amssymb}
\usepackage{mathrsfs}

\usepackage{imakeidx}
\usepackage{hyperref}

\makeindex
\usepackage{enumitem}
\usepackage{etoolbox}
\usepackage{indentfirst}

\usepackage[Lenny]{fncychap}

 \usepackage[natbib=true]{biblatex}

 % include the chapter number
 \setlist[enumerate]{label=\thechapter.\arabic{*},resume}

 % restart the enumerate list every chapter
 \preto\chapter{%
   \restartlist{enumerate}%
}














% Load packages for testing
\usepackage{blindtext}
 
\usepackage{kaobiblio}
\addbibresource{main.bib} % Bibliography file




% Load mathematical packages for theorems and related environments
\usepackage[framed=true]{kaotheorems}

% Load the package for hyperreferences
\usepackage{kaorefs}

\graphicspath{{examples/documentation/images/}{images/}} % Paths in which to look for images

\makeindex[columns=3, title=Alphabetical Index, intoc] % Make LaTeX produce the files required to compile the index

\makeglossaries % Make LaTeX produce the files required to compile the glossary
\input{glossary.tex} % Include the glossary definitions

\makenomenclature % Make LaTeX produce the files required to compile the nomenclature

 
\usepackage{indentfirst}

\addtokomafont{date}{\includegraphics[width=3cm]{example-image-duck}\endgraf}

\begin{document}

 
\titlehead{The \texttt{proper} class}
\subject{}

\title[Example and documentation of the {\normalfont\texttt{kaobook}} class]{On the {\normalfont\texttt{Second  }} and  }
\subtitle{Provability }

\author[Y]{J K\thanks{A \LaTeX\ lover}}

\date{\today}

\publishers{ submitted in  }

%----------------------------------------------------------------------------------------

\frontmatter % Denotes the start of the pre-document content, uses roman numerals

%----------------------------------------------------------------------------------------
%   OPENING PAGE
%----------------------------------------------------------------------------------------

 
\makeatletter
\uppertitleback{\@titlehead} % Header
 
 
\maketitle

 
\index{preface}




%----------------------------------------------------------------------------------------
%   TABLE OF CONTENTS & LIST OF FIGURES/TABLES
%----------------------------------------------------------------------------------------

\begingroup % Local scope for the following commands

% Define the style for the TOC, LOF, and LOT
%\setstretch{1} % Uncomment to modify line spacing in the ToC
%\hypersetup{linkcolor=blue} % Uncomment to set the colour of links in the ToC
\setlength{\textheight}{230\hscale} % Manually adjust the height of the ToC pages

% Turn on compatibility mode for the etoc package
\etocstandarddisplaystyle % "toc display" as if etoc was not loaded
\etocstandardlines % "toc lines" as if etoc was not loaded

\tableofcontents % Output the table of contents

\listoffigures % Output the list of figures

% Comment both of the following lines to have the LOF and the LOT on different pages
\let\cleardoublepage\bigskip
\let\clearpage\bigskip

\listoftables % Output the list of tables

\endgroup

%----------------------------------------------------------------------------------------
%   MAIN BODY
%----------------------------------------------------------------------------------------


\end{document}

在此处输入图片描述

相关内容