Commit 996c01e4 authored by liziwl's avatar liziwl
Browse files

同步上游关于图表距离的修复

parent 64e02f89
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -32,8 +32,8 @@ Changelog 维护应保持最新版本在文件上面的原则,日期格式按
## [Unreleased](https://github.com/SUSTech-CRA/sustech-master-thesis/compare/v1.3.13...HEAD)
## [Unreleased](https://github.com/SUSTech-CRA/sustech-master-thesis/compare/v1.3.13...HEAD)


### Changed
### Changed
- 允许论文题目和章节题目出现特殊的小写字母
- 允许论文题目和章节题目出现特殊的小写字母

- 同步上游关于图表距离的修复,浮动对象整体上下距离调整为12bp。


## [1.3.13](https://github.com/SUSTech-CRA/sustech-master-thesis/compare/v1.3.12...v1.3.13)
## [1.3.13](https://github.com/SUSTech-CRA/sustech-master-thesis/compare/v1.3.12...v1.3.13)
### Added
### Added
+36 −0
Original line number Original line Diff line number Diff line
@@ -224,3 +224,39 @@ class HelloWorldApp {
  $\Delta B^{\ast}\leftarrow \Delta B$\;}
  $\Delta B^{\ast}\leftarrow \Delta B$\;}
  $r\leftarrow r+1$\;}
  $r\leftarrow r+1$\;}
\end{algorithm}
\end{algorithm}

\newpage
\section{测试}

图题在图之下,段前空 6 磅,段后空 12 磅。图整体前后距离未定义,目前默认距离:段前空 12 磅,段后空 12 磅。

图前,图前,图前,图前,图前,图前,图前,图前,图前,图前,图前。

\begin{figure}[htbp]
  \centering
  \includegraphics[height=12bp,width=50bp]{example-image-a.pdf}\hspace*{6bp}
  \includegraphics[height=6bp,width=50bp]{example-image-a.pdf}
  \caption{图高度为12bp vs 6bp}
\end{figure}

图后,图后,图后,图后,图后,图后,图后,图后,图后,图后,图后。

表题在表之上,段前空 12 磅,段后空 6 磅。表整体前后距离未定义,目前默认距离:段前空 12 磅,段后空 12 磅。

表前,表前,表前,表前,表前,表前,表前,表前,表前,表前,表前。

\begin{table}[htbp]
  \centering
  \caption{简单表格}
    \begin{tabular}{cc}
    \toprule
    column1 & column2\\
    \midrule
    column1 & column2\\
    \bottomrule
    \end{tabular}
  \label{label}
\end{table}

表后,表后,表后,表后,表后,表后,表后,表后,表后,表后,表后。
\emph{图表前后是否有空行不影响图表与正文之间的距离}
+39 −8
Original line number Original line Diff line number Diff line
@@ -2639,20 +2639,53 @@
%
%
% 图表浮动体的默认位置设为 |h|。
% 图表浮动体的默认位置设为 |h|。
%    \begin{macrocode}
%    \begin{macrocode}
\def\fps@figure{h}
\def\fps@figure{htbp}
\def\fps@table{h}
\def\fps@table{htbp}
%    \end{macrocode}
%    \end{macrocode}
%
%
% 设置浮动对象和文字之间的距离
% 设置浮动对象和文字之间的距离
%    \begin{macrocode}
%    \begin{macrocode}
\setlength{\floatsep}{6bp}
\setlength{\floatsep}{12\p@ \@plus 2\p@ \@minus 2\p@}
\setlength{\textfloatsep}{6bp}
\setlength{\textfloatsep}{12\p@ \@plus 2\p@ \@minus 2\p@}
\setlength{\intextsep}{6bp}
\setlength{\intextsep}{12\p@ \@plus 2\p@ \@minus 2\p@}
\setlength{\@fptop}{0bp \@plus1.0fil}
\setlength{\@fptop}{0bp \@plus1.0fil}
\setlength{\@fpsep}{12bp \@plus2.0fil}
\setlength{\@fpsep}{12bp \@plus2.0fil}
\setlength{\@fpbot}{0bp \@plus1.0fil}
\setlength{\@fpbot}{0bp \@plus1.0fil}
%    \end{macrocode}
%    \end{macrocode}
%
%
% 由于 LaTeX2e kernel 的问题,图表等浮动体与文字前后的距离不一致,需要进行 patch。
% 参考 \href{https://github.com/tuna/thuthesis/issues/614}{tuna/thuthesis/issues\#614}、
% \url{https://www.zhihu.com/question/46618031} 和
% \url{https://tex.stackexchange.com/a/40363/82731}。
%    \begin{macrocode}
\patchcmd{\@addtocurcol}%
  {\vskip \intextsep}%
  {\edef\save@first@penalty{\the\lastpenalty}\unpenalty
   \ifnum \lastpenalty = \@M  % hopefully the OR penalty
     \unpenalty
   \else
     \penalty \save@first@penalty \relax % put it back
   \fi
   \ifnum\outputpenalty <-\@Mii
     \addvspace\intextsep
     \vskip\parskip
   \else
     \addvspace\intextsep
   \fi}%
  {}{\thu@patch@error{\@addtocurcol}}
\patchcmd{\@addtocurcol}%
  {\vskip\intextsep \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi}%
  {\ifnum\outputpenalty <-\@Mii
     \aftergroup\vskip\aftergroup\intextsep
     \aftergroup\nointerlineskip
   \else
     \vskip\intextsep
   \fi}%
  {}{\thu@patch@error{\@addtocurcol}}
\patchcmd{\@getpen}{\@M}{\@Mi}
  {}{\thu@patch@error{\@getpen}}
%    \end{macrocode}
%
% 下面这组命令使浮动对象的缺省值稍微宽松一点,从而防止幅度对象占据过多的文本页面,
% 下面这组命令使浮动对象的缺省值稍微宽松一点,从而防止幅度对象占据过多的文本页面,
% 也可以防止在很大空白的浮动页上放置很小的图形。
% 也可以防止在很大空白的浮动页上放置很小的图形。
%    \begin{macrocode}
%    \begin{macrocode}
@@ -2703,10 +2736,8 @@
  skip           = 6bp,
  skip           = 6bp,
  figureposition = bottom,
  figureposition = bottom,
  tableposition  = top,
  tableposition  = top,
  justification  = centering
  justification  = centering,
}
}
\captionsetup[figure]{belowskip=12bp}
\captionsetup[table]{belowskip=12bp}
\captionsetup[sub]{font=thu}
\captionsetup[sub]{font=thu}
%    \end{macrocode}
%    \end{macrocode}
%
%
+1 −1

File changed.

Contains only whitespace changes.