代码:

代码:

下面的代码编译为pdf目录后有一个空白页,文档在第 3 页停止,并且多余的文本溢出了页面。

这是我以前从未遇到过的非常奇怪的行为,使用相同的前导码设置。如果有人能解释为什么会发生这种情况,我将不胜感激。

代码:

% Created 2020-10-08 Thu 00:38
% Intended LaTeX compiler: pdflatex

\documentclass[12pt,a4paper]{article}
%\documentclass[12pt,a4paper]{ctexart}

\usepackage{xeCJK}
\usepackage{zhnumber} % package for Chinese formatting of date time (use /zhtoday)
\usepackage[yyyymmdd]{datetime} % set date time to numeric

% For Generation of Citations and Bibliography
\usepackage[notes, isbn=false, backend=biber]{biblatex-chicago}
\bibliography{/Users/satibodhi/Creation/notes/bibliography/thesis}

% Set default indentation

\setlength\parindent{24pt}

% Set Paper Size, Page Layout (another variable is 'bindingoffset')
\usepackage[margin = 1.5in, paper = a4paper, inner = 2.5cm,
outer = 2.5cm, top = 3cm, bottom = 2.5cm]{geometry}

% Keep paragraph indentation while having a line break in between paragraphs.
\edef\restoreparindent{\parindent=\the\parindent\relax}
\usepackage{parskip}
\restoreparindent

% Indent first paragraph.
\usepackage{indentfirst}

\usepackage{titlesec}
\usepackage{titling}
\usepackage{fontspec} % packages for title and section-heading font setting.
\usepackage{newunicodechar} % custom fallback font for certain unicode characters.
\usepackage{tocloft} % adding the tocloft package for toc customization

% Set Header and Numbering Depth
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{5}

% Set Font.
\setsansfont{Times New Roman}
\setmainfont{Calibri} % Set serifed font to Calibri. Originally set to 'Times New Roman', but it cannot display certain characters such as ①②③.
\setCJKmainfont{Songti TC}
\setCJKsansfont{Kaiti TC} % Set Chinese font. NOTE: Remember to append CJK before of the font class. CJK HAS to be there for the font to show.
\setCJKmonofont{PingFang TC}

% Set fallback fonts for ㊀ characters.

\newCJKfontfamily\fallbackfont{PingFang TC}
\newunicodechar{㊀}{{\fallbackfont ㊀}}
\newunicodechar{㊁}{{\fallbackfont ㊁}}
\newunicodechar{㊂}{{\fallbackfont ㊂}}
\newunicodechar{㊃}{{\fallbackfont ㊃}}
\newunicodechar{㊄}{{\fallbackfont ㊄}}
\newunicodechar{㊅}{{\fallbackfont ㊅}}
\newunicodechar{㊆}{{\fallbackfont ㊆}}
\newunicodechar{㊇}{{\fallbackfont ㊇}}
\newunicodechar{㊈}{{\fallbackfont ㊈}}
\newunicodechar{㊉}{{\fallbackfont ㊉}}

% WHEN \documentclass is set to {article},
% zhnum[style={Traditional,Financial}] doesn't work with the section counter,
% so we define our own counter and increase it every time in \thesection.

\newcounter{mysec}[section]
\renewcommand\thesection{%
    \addtocounter{mysec}{1}%
    \zhnum[style={Traditional,Financial}]{mysec}、} % 大標題序號:壹、貳、參、…
\renewcommand\thesubsection{\zhnum{subsection}、} % added a 、小標題序號:一、二、三、…
\renewcommand\thesubsubsection{(\zhnum{subsubsection})} % added parentheses
% (full-width, don't know if that's what you want) 副標題序號:(一)(二)(三)
\renewcommand\theparagraph{\arabic{paragraph}} % arabic numbering for paragraph
\renewcommand\thesubparagraph{} % no subparagraph numbering

% we have to adjust the spacing in the toc because the section label is longer than usual
\addtolength\cftsecnumwidth{1em}
\addtolength\cftsubsecindent{1em}
\addtolength\cftsubsubsecindent{1em}

% Set formats for each heading level. 'sffamily' will point to the sans-serif font. In this case, 「楷體」.

% here we need to make sure the normal section counter is accessed
\titleformat{\section}{\LARGE\bfseries\sffamily\filcenter}
    {\zhnum[style={Traditional,Financial}]{section}、}{.5em}{}

\titleformat*{\subsection}{\Large\bfseries\sffamily}
\titleformat*{\subsubsection}{\large\bfseries\sffamily} % Set formats for each heading level. 'sffamily' will point to the sans-serif font. In this case, 「楷體」.

% The `titlesec` package is used over here to make use of `\paragraph` and `\subparagraph` as headings. Up to five levels of headings can be implemented this way.

% no extra version for numberless is necessary since no numbers are used anyways
% also you get newlines from omitting the [display] in \titleformat already
\titleformat{\paragraph}[block]
    {\large\bfseries\sffamily}{\theparagraph}{0em}{}
\titleformat{\subparagraph}[block]
    {\large\bfseries\sffamily}{}{0em}{}
% we need the following so that they don't indent (second argument, 0em);
% you'll have to adjust the spacing though since this is not display style anymore:
\titlespacing*{\paragraph}{0em}{3.25ex plus 1ex minus .2ex}{.75ex plus .1ex}
\titlespacing*{\subparagraph}{0em}{3.25ex plus 1ex minus .2ex}{.75ex plus .1ex}

% Set title font.
\renewcommand{\maketitlehooka}{\sffamily}

% Set quotation font.
\usepackage{etoolbox}
\newCJKfontfamily\quotefont{Kaiti TC}
\AtBeginEnvironment{quote}{\quotefont\normalsize}

% Tweak default settings.
\renewcommand{\baselinestretch}{1.2} % Set line width.
\renewcommand{\contentsname}{\hfill\bfseries\Large 目\hspace{0.5cm} 錄\hfill} % Translate content page title to Chinese.
\renewcommand{\cftaftertoctitle}{\hfill} % Center contents title.
\renewcommand{\abstractname}{摘要} % Translate abstract title to Chinese.
\renewcommand{\tablename}{表} % Translate table to Chinese.
\renewcommand{\figurename}{圖} % Translate figure to Chinese.

% For text-boxes

\usepackage{mdframed}
\BeforeBeginEnvironment{minted}{\begin{mdframed}}
\AfterEndEnvironment{minted}{\end{mdframed}}

% For tables

\usepackage{float}
\restylefloat{table}

% [FIXME] ox-latex 的設計不良導致 hypersetup 必須在這裡插入
\usepackage{hyperref}
\hypersetup{
  colorlinks=true, %把紅框框移掉改用字體顏色不同來顯示連結
  linkcolor=[rgb]{0,0.37,0.53},
  citecolor=[rgb]{0,0.47,0.68},
  filecolor=[rgb]{0,0.37,0.53},
  urlcolor=[rgb]{0,0.37,0.53},
  pagebackref=true,
  linktoc=all,}

\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\title{Annotated Bibliography Sample}
\begin{document}

\maketitle
\tableofcontents \clearpage
\section{情感教育理論}
\label{sec:org4e5e8b3}

\subsection{儒學史脈絡中的道德情感理論}
\label{sec:org7731e3f}

\subsubsection*{Nivison, D. S. (1996). The ways of confucianism: investigations in Chinese philosophy. Chicago: Open Court.}
\label{sec:org89a9863}



\subsubsection*{Shun, K. (1997). Mencius and early Chinese thought. Stanford, Calif: Stanford University Press.}
\label{sec:org9a03f46}


\subsubsection*{Virág, C. (2004). "That which encompasses the Myriad cares": Subjectivity, knowledge, and the ethics of emotion in Tang and Song China (Doctoral dissertation). Harvard University.}
\label{sec:orge4c47c9}


\subsubsection*{Chan, A. K. (2007). The Nature of the Sage and the Emotions: A Debate in Wei-Jin Philosophy Revisited. Journal of Chinese Philosophy and Culture 2, 196–226.}
\label{sec:org258739b}


\subsubsection*{Kim, M. (2008): An inquiry into the development of the ethical theory of emotions in the "Analects" and the "Mencius"}
\label{sec:orga5bd938}


\subsubsection*{Lo, Y. K. (2012). Mind-Heart and Emotions in the Analects. In G. Tamburello (Eds.), Concepts and Categories of Emotion in East Asia (pp. 71–86). Rome: Carocci editore.}
\label{sec:org60c7db6}


\subsubsection*{Virág, C. (2014). Early confucian perspectives on emotions. In V. Shen (Eds.), Dao Companion to Classical Confucian Philosophy (pp.203–225). : Springer, Dordrecht.}
\label{sec:orge2be0cd}


\subsubsection*{Virág, C. (2017). The emotions in early Chinese philosophy. New York, NY: Oxford University Press.}
\label{sec:org2e3eedf}


\subsection{心理學對情感的認知}
\label{sec:org8023f3a}

\subsubsection*{Griffiths, P. E. (1997). What emotions really are: the problem of psychological categories. Chicago, Ill.: University of Chicago Press.}
\label{sec:orgf4a2034}

\section{羞愧感研究}
\label{sec:org3238d23}

\subsection{羞愧與同理心}
\label{sec:org47b3841}

\subsubsection*{Zahavi, D. (2015). Self and other exploring subjectivity, empathy and shame. Corby: Oxford University Press.}
\label{sec:org9dbac8f}

\subsubsection*{Stearns, P. N. (2017). Shame: a brief history. Urbana, Illinois: University of Illinois Press.}
\label{sec:orgb1ba550}
\end{document}

结果:

奇怪的结果

答案1

按照上面评论中@Mico 的指示,添加\null到每个空的小节即可解决问题。

\begin{document}

\maketitle
\tableofcontents \clearpage
\section{情感教育理論}
\label{sec:org4e5e8b3}

\subsection{儒學史脈絡中的道德情感理論}
\label{sec:org7731e3f}

\subsubsection*{Nivison, D. S. (1996). The ways of confucianism: investigations in Chinese philosophy. Chicago: Open Court.}
\label{sec:org89a9863}

\null

\subsubsection*{Shun, K. (1997). Mencius and early Chinese thought. Stanford, Calif: Stanford University Press.}
\label{sec:org9a03f46}

\null

\subsubsection*{Virág, C. (2004). "That which encompasses the Myriad cares": Subjectivity, knowledge, and the ethics of emotion in Tang and Song China (Doctoral dissertation). Harvard University.}
\label{sec:orge4c47c9}

\null

\subsubsection*{Chan, A. K. (2007). The Nature of the Sage and the Emotions: A Debate in Wei-Jin Philosophy Revisited. Journal of Chinese Philosophy and Culture 2, 196–226.}
\label{sec:org258739b}

\null

\subsubsection*{Kim, M. (2008): An inquiry into the development of the ethical theory of emotions in the "Analects" and the "Mencius"}
\label{sec:orga5bd938}

\null

\subsubsection*{Lo, Y. K. (2012). Mind-Heart and Emotions in the Analects. In G. Tamburello (Eds.), Concepts and Categories of Emotion in East Asia (pp. 71–86). Rome: Carocci editore.}
\label{sec:org60c7db6}

\null

\subsubsection*{Virág, C. (2014). Early confucian perspectives on emotions. In V. Shen (Eds.), Dao Companion to Classical Confucian Philosophy (pp.203–225). : Springer, Dordrecht.}
\label{sec:orge2be0cd}

\null

\subsubsection*{Virág, C. (2017). The emotions in early Chinese philosophy. New York, NY: Oxford University Press.}
\label{sec:org2e3eedf}

\null

\subsection{心理學對情感的認知}
\label{sec:org8023f3a}

\subsubsection*{Griffiths, P. E. (1997). What emotions really are: the problem of psychological categories. Chicago, Ill.: University of Chicago Press.}
\label{sec:orgf4a2034}

\null

\section{羞愧感研究}
\label{sec:org3238d23}

\subsection{羞愧與同理心}
\label{sec:org47b3841}

\subsubsection*{Zahavi, D. (2015). Self and other exploring subjectivity, empathy and shame. Corby: Oxford University Press.}
\label{sec:org9dbac8f}

\null

\subsubsection*{Stearns, P. N. (2017). Shame: a brief history. Urbana, Illinois: University of Illinois Press.}
\label{sec:orgb1ba550}

\null

\end{document}

结果:

结果不错

相关内容