我正在按照这个模板撰写我的硕士论文:
https://fenix.tecnico.ulisboa.pt/downloadFile/1407993358863322/Thesis_template_LaTeX_v7.zip
我尝试过fleqn
在论文.tex文件,但公式周围有大量垂直空间。我查找了一些可能的问题,但最终我真的不明白是什么原因造成的。
有人可以帮忙吗?
谢谢!
% ----------------------------------------------------------------------
% Set the document class
% ----------------------------------------------------------------------
\documentclass[10pt,a4paper,twoside,fleqn]{report}
\usepackage[utf8]{inputenc} % <<<<< Linux
\usepackage[english]{babel} % <<<<< English
\renewcommand{\rmdefault}{phv}
\renewcommand{\sfdefault}{phv}
\def\FontLn{% 16 pt normal
\usefont{T1}{phv}{m}{n}\fontsize{16pt}{16pt}\selectfont}
\def\FontLb{% 16 pt bold
\usefont{T1}{phv}{b}{n}\fontsize{16pt}{16pt}\selectfont}
\def\FontMn{% 14 pt normal
\usefont{T1}{phv}{m}{n}\fontsize{14pt}{14pt}\selectfont}
\def\FontMb{% 14 pt bold
\usefont{T1}{phv}{b}{n}\fontsize{14pt}{14pt}\selectfont}
\def\FontSn{% 12 pt normal
\usefont{T1}{phv}{m}{n}\fontsize{12pt}{12pt}\selectfont}
\usepackage{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\usepackage{setspace}
\renewcommand{\baselinestretch}{1.5}
\usepackage{graphicx}
\usepackage{amsmath} % AMS mathematical facilities for LaTeX.
\usepackage{amsthm} % Typesetting theorems (AMS style).
\usepackage{amsfonts} %
\usepackage{subfigure}
\usepackage{subfigmat}
\usepackage{dcolumn}
\newcolumntype{d}{D{.}{.}{-1}} % column aligned by the point separator '.'
\newcolumntype{e}{D{E}{E}{-1}} % column aligned by the exponent 'E'
\usepackage{nomencl}
\makenomenclature
%
% Group variables according to their symbol type
%
\RequirePackage{ifthen}
\ifthenelse{\equal{\languagename}{english}}%
{ % English
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{R}}{%
\item[\textbf{Roman symbols}]}{%
\ifthenelse{\equal{#1}{G}}{%
\item[\textbf{Greek symbols}]}{%
\ifthenelse{\equal{#1}{S}}{%
\item[\textbf{Subscripts}]}{%
\ifthenelse{\equal{#1}{T}}{%
\item[\textbf{Superscripts}]}{}}}}}%
}{% Portuguese
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{R}}{%
\item[\textbf{Simbolos romanos}]}{%
\ifthenelse{\equal{#1}{G}}{%
\item[\textbf{Simbolos gregos}]}{%
\ifthenelse{\equal{#1}{S}}{%
\item[\textbf{Subscritos}]}{%
\ifthenelse{\equal{#1}{T}}{%
\item[\textbf{Sobrescritos}]}{}}}}}%
}%
\usepackage[number=none]{glossary}
\setglossary{gloskip={}}
\makeglossary
\usepackage{rotating}
\usepackage[pdftex]{hyperref} % enhance documents that are to be
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin Document %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% Set plain page style (no headers, footer with centered page number)
\pagestyle{plain}
% Set roman numbering (i,ii,...) before the start of chapters
\pagenumbering{roman}
% -----------------------------------------------------------------------------
\subsection{Equations}
\label{subsection:equations}
Equations can be inserted in different ways.
The simplest way is in a separate line like this
\begin{equation}
\frac{{\rm d} q_{ijk}}{{\rm d} t} + {\cal R}_{ijk}({\bf q}) = 0 \,.
\label{eq:ode}
\end{equation}
If the equation is to be embedded in the text. One can do it like this ${\partial {\cal R}}/{\partial {\bf q}}=0$.
It may also be split in different lines like this
\begin{eqnarray}
{\rm Minimize} && Y({\bf \alpha},{\bf q}({\bf \alpha})) \nonumber \\
{\rm w.r.t.} && {\bf \alpha} \,, \label{eq:minimize} \\
{\rm subject~to} && {\cal R}({\bf \alpha},{\bf q}({\bf \alpha})) = 0 \nonumber \\
&& C ({\bf \alpha},{\bf q}({\bf \alpha})) = 0 \,. \nonumber
\end{eqnarray}
It is also possible to use subequations. Equations~\ref{eq:continuity}, \ref{eq:momentum} and \ref{eq:energy} form the Naver--Stokes equations~\ref{eq:NavierStokes}.
\begin{subequations}
\begin{equation}
\frac{\partial \rho}{\partial t} + \frac{\partial}{\partial x_j}\left( \rho u_j \right) = 0 \,,
\label{eq:continuity}
\end{equation}
\begin{equation}
\frac{\partial}{\partial t}\left( \rho u_i \right) + \frac{\partial}{\partial x_j} \left( \rho u_i u_j + p \delta_{ij} - \tau_{ji} \right) = 0, \quad i=1,2,3 \,,
\label{eq:momentum}
\end{equation}
\begin{equation}
\frac{\partial}{\partial t}\left( \rho E \right) + \frac{\partial}{\partial x_j} \left( \rho E u_j + p u_j - u_i \tau_{ij} + q_j \right) = 0 \,.
\label{eq:energy}
\end{equation}
\label{eq:NavierStokes}%
\end{subequations}
% ----------------------------------------------------------------------
\end{document}
% ----------------------------------------------------------------------
答案1
你有
> 10.0pt plus 2.0pt minus 5.0pt.
l.82 \showthe\abovedisplayskip
?
> 0.0pt plus 3.0pt.
l.83 \showthe\abovedisplayshortskip
因此,永远不可能使用短跳转,因为fleqn
上面会有 10pt 的额外空间equation
,但无论如何,间距都是错误的,因为显示数学之前永远不应该有空行,因为它总是在等式之前生成一个虚假的白色空行。同样,不要一个接一个地使用等式,而是使用多行显示,例如gather
带有和不带有 fleqn 的输出
\documentclass[10pt,a4paper,twoside,
%fleqn
]{report}
% not required in recent latex \usepackage[utf8]{inputenc} % <<<<< Linux
\usepackage[english]{babel} % <<<<< English
\renewcommand{\rmdefault}{phv}
\renewcommand{\sfdefault}{phv}
\def\FontLn{% 16 pt normal
\usefont{T1}{phv}{m}{n}\fontsize{16pt}{16pt}\selectfont}
\def\FontLb{% 16 pt bold
\usefont{T1}{phv}{b}{n}\fontsize{16pt}{16pt}\selectfont}
\def\FontMn{% 14 pt normal
\usefont{T1}{phv}{m}{n}\fontsize{14pt}{14pt}\selectfont}
\def\FontMb{% 14 pt bold
\usefont{T1}{phv}{b}{n}\fontsize{14pt}{14pt}\selectfont}
\def\FontSn{% 12 pt normal
\usefont{T1}{phv}{m}{n}\fontsize{12pt}{12pt}\selectfont}
\usepackage{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\usepackage{setspace}
\renewcommand{\baselinestretch}{1.5}
\usepackage{graphicx}
\usepackage{amsmath} % AMS mathematical facilities for LaTeX.
\usepackage{amsthm} % Typesetting theorems (AMS style).
\usepackage{amsfonts} %
\usepackage{subfigure}
\usepackage{subfigmat}
\usepackage{dcolumn}
\newcolumntype{d}{D{.}{.}{-1}} % column aligned by the point separator '.'
\newcolumntype{e}{D{E}{E}{-1}} % column aligned by the exponent 'E'
\usepackage{nomencl}
\makenomenclature
%
% Group variables according to their symbol type
%
\RequirePackage{ifthen}
\ifthenelse{\equal{\languagename}{english}}%
{ % English
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{R}}{%
\item[\textbf{Roman symbols}]}{%
\ifthenelse{\equal{#1}{G}}{%
\item[\textbf{Greek symbols}]}{%
\ifthenelse{\equal{#1}{S}}{%
\item[\textbf{Subscripts}]}{%
\ifthenelse{\equal{#1}{T}}{%
\item[\textbf{Superscripts}]}{}}}}}%
}{% Portuguese
\renewcommand{\nomgroup}[1]{%
\ifthenelse{\equal{#1}{R}}{%
\item[\textbf{Simbolos romanos}]}{%
\ifthenelse{\equal{#1}{G}}{%
\item[\textbf{Simbolos gregos}]}{%
\ifthenelse{\equal{#1}{S}}{%
\item[\textbf{Subscritos}]}{%
\ifthenelse{\equal{#1}{T}}{%
\item[\textbf{Sobrescritos}]}{}}}}}%
}%
% not in texlive\usepackage[number=none]{glossary}
%\setglossary{gloskip={}}
%\makeglossary
\usepackage{rotating}
\usepackage[pdftex]{hyperref} % enhance documents that are to be
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin Document %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% Set plain page style (no headers, footer with centered page number)
\pagestyle{plain}
% Set roman numbering (i,ii,...) before the start of chapters
\pagenumbering{roman}
%\showthe\abovedisplayskip
%\showthe\abovedisplayshortskip
% -----------------------------------------------------------------------------
\subsection{Equations}
\label{subsection:equations}
Equations can be inserted in different ways.
The simplest way is in a separate line like this
\begin{equation}
\frac{\mathrm{d} q_{ijk}}{\mathrm{d} t} + {\cal R}_{ijk}(\mathbf{q}) = 0 \,.
\label{eq:ode}
\end{equation}
If the equation is to be embedded in the text. One can do it like this ${\partial {\cal R}}/{\partial \mathbf{q}}=0$.
It may also be split in different lines like this
\begin{eqnarray}
\mathrm{Minimize} && Y(\mathbf{\alpha},\mathbf{q}(\mathbf{\alpha})) \nonumber \\
\mathrm{w.r.t.} && \mathbf{\alpha} \,, \label{eq:minimize} \\
\mathrm{subject~to} && {\cal R}(\mathbf{\alpha},\mathbf{q}(\mathbf{\alpha})) = 0 \nonumber \\
&& C (\mathbf{\alpha},\mathbf{q}(\mathbf{\alpha})) = 0 \,. \nonumber
\end{eqnarray}
It is also possible to use subequations. Equations~\ref{eq:continuity}, \ref{eq:momentum} and \ref{eq:energy} form the Naver--Stokes equations~\ref{eq:NavierStokes}.
\begin{subequations}
\begin{gather}
\frac{\partial \rho}{\partial t} + \frac{\partial}{\partial x_j}\left( \rho u_j \right) = 0 \,,
\label{eq:continuity}
\\
\frac{\partial}{\partial t}\left( \rho u_i \right) + \frac{\partial}{\partial x_j} \left( \rho u_i u_j + p \delta_{ij} - \tau_{ji} \right) = 0, \quad i=1,2,3 \,,
\label{eq:momentum}
\\
\frac{\partial}{\partial t}\left( \rho E \right) + \frac{\partial}{\partial x_j} \left( \rho E u_j + p u_j - u_i \tau_{ij} + q_j \right) = 0 \,.
\label{eq:energy}
\end{gather}
\label{eq:NavierStokes}%
\end{subequations}
% ----------------------------------------------------------------------
\end{document}