Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 适配longtable宏包 #513

Merged
merged 3 commits into from
May 26, 2024
Merged

feat: 适配longtable宏包 #513

merged 3 commits into from
May 26, 2024

Conversation

YDX-2147483647
Copy link
Collaborator

@YDX-2147483647 YDX-2147483647 commented May 25, 2024

继续 #499#504

对比

旧(左)新(右)对比:

图片

新版

图片
图片

新版 + \BITSetup

\BITSetup{
  misc/floatSeparation = -1.5, % 仅测试,随意指定的
  misc/tabularRowSeparation = 1.25, % 本科表格行高
}

图片
图片

设置

测试用例

% !TeX program = xelatex
% !BIB program = biber

\documentclass[type=bachelor]{bithesis}
% \BITSetup{
%   misc/floatSeparation = -1.5,
%   misc/tabularRowSeparation = 1.25,
% }

\usepackage{tabularx}
\usepackage{longtable}

\usepackage{zhlipsum}

\begin{document}

\frontmatter
\mainmatter

\zhlipsum[1][name=zhufu]

\begin{table}[ht]
  \centering
  \caption{Tabular Lg} % 都含“Lg”两个伸长的字母,控制变量
  \begin{tabular}{*{5}{>{\centering\arraybackslash}p{5em}}}
    \toprule
    项目    & 产量    & 销量    & 产值   & 比重    \\ \midrule
    手机    & 1000  & 10000 & 500  & 50\%  \\
    计算机   & 5500  & 5000  & 220  & 22\%  \\
    笔记本电脑 & 1100  & 1000  & 280  & 28\%  \\ \midrule
    合计    & 17600 & 16000 & 1000 & 100\% \\ \bottomrule
  \end{tabular}
\end{table}

\zhlipsum[2-3][name=zhufu]

\begin{table}[ht]
  \centering
  \caption{Tabular* Lg}
  \begin{tabular*}{32em}{@{\extracolsep{\fill}}ccccc}
    \toprule
    项目    & 产量    & 销量    & 产值   & 比重    \\ \midrule
    手机    & 1000  & 10000 & 500  & 50\%  \\
    计算机   & 5500  & 5000  & 220  & 22\%  \\
    笔记本电脑 & 1100  & 1000  & 280  & 28\%  \\ \midrule
    合计    & 17600 & 16000 & 1000 & 100\% \\ \bottomrule
  \end{tabular*}
\end{table}

\zhlipsum[4-6][name=zhufu]

\begin{table}[ht]
  \centering
  \caption{Tabularx Lg}
  \begin{tabularx}{32em}{*{5}{>{\centering\arraybackslash}X}}
    \toprule
    项目    & 产量    & 销量    & 产值   & 比重    \\ \midrule
    手机    & 1000  & 10000 & 500  & 50\%  \\
    计算机   & 5500  & 5000  & 220  & 22\%  \\
    笔记本电脑 & 1100  & 1000  & 280  & 28\%  \\ \midrule
    合计    & 17600 & 16000 & 1000 & 100\% \\ \bottomrule
  \end{tabularx}
\end{table}

\zhlipsum[7-9][name=zhufu]

\begin{longtable}[ht]{ccccc}
  \caption{Long table Lg}                 \\
  \toprule
  项目    & 产量    & 销量    & 产值   & 比重    \\
  \midrule
  \endfirsthead
  \multicolumn{5}{l}{续表}               \\
  \toprule
  项目    & 产量    & 销量    & 产值   & 比重    \\
  \midrule
  \endhead
  \midrule
  \multicolumn{5}{r}{{续下页}}            \\
  \endfoot
  \bottomrule
  \endlastfoot
  手机    & 1000  & 10000 & 500  & 50\%  \\
  计算机   & 5500  & 5000  & 220  & 22\%  \\
  笔记本电脑 & 1100  & 1000  & 280  & 28\%  \\ \midrule
  合计    & 17600 & 16000 & 1000 & 100\% \\
\end{longtable}

\zhlipsum[10-13][name=zhufu]

\end{document}

@YDX-2147483647 YDX-2147483647 changed the title feat: 支持用misc/tabularRowSeparation调节longtable宏包 feat: 适配longtable宏包 May 25, 2024
@YDX-2147483647 YDX-2147483647 marked this pull request as ready for review May 26, 2024 07:13
@fky2015
Copy link
Contributor

fky2015 commented May 26, 2024

牛!

@YDX-2147483647 YDX-2147483647 added this pull request to the merge queue May 26, 2024
Merged via the queue into BITNP:main with commit f5f24e5 May 26, 2024
3 checks passed
@YDX-2147483647 YDX-2147483647 deleted the long branch May 26, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants