whutug / whu-thesis

:memo: 武汉大学毕业论文 LaTeX 模版 2024
LaTeX Project Public License v1.3c
931 stars 200 forks source link

为硕博论文添加一个去掉空白页的模式以上传图书馆 #117

Closed yaochenzhu closed 5 months ago

yaochenzhu commented 2 years ago

在现有硕博论文的模板中,如果使用one-side模式,则奇偶页页眉都是论文标题;而使用two-side模式的话,虽然奇偶页页眉交替出现硕/博论文与论文标题,但如果新chapter不在奇数页的话,上一个chapter结束会有空页。这的确符合硕博论文打印的要求,但本院要求将论文电子版上传图书馆时去掉论文中所有的空白页。所以我在想能不能定义一个去掉空白页的模式,在模式里把\cleardoublepage命令renew为clearpage:\renewcommand{\cleardoublepage}{},这样就可以达到去掉空白页,且使用正确的页眉上传图书馆的目的了

tanukihee commented 2 years ago

需要页码连续吗,不需要的话其实可以随便一个 pdf 编辑软件给删掉就行(

yaochenzhu commented 2 years ago

需要页码连续吗,不需要的话其实可以随便一个 pdf 编辑软件给删掉就行(

主要就是想保证页码连续,所以在two-side模式里 \renewcommand{\cleardoublepage}{\clearpage} 貌似可以临时解决问题

whuryl commented 1 year ago

需要页码连续吗,不需要的话其实可以随便一个 pdf 编辑软件给删掉就行(

主要就是想保证页码连续,所以在two-side模式里\renewcommand{\cleardoublepage}{\clearpage}貌似可以临时解决问题

您好!麻烦请问一下具体是怎样修改的?谢谢!

DDshimakaze commented 1 year ago

总结一下楼主的方法,给不知道怎么改的人指个路,在使用了twoside模式以后,直接在whu-thesis.cls开头部分添加下面这一句代码即可 \renewcommand{\cleardoublepage}{\clearpage}

%% This program is a LaTeX class file for bachelor thesis template
%% of Wuhan University
%%
%% Copyright (c) 2019 -- 2021 WHUTUG <https://github.com/whutug>
%%
%% This project uses the MIT License, see LICENSE for more details.
%% ----------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3 , xparse , l3keys2e}
\ProvidesExplClass{whu-thesis}{2021/05/20}{0.6d}
  {Wuhan University Thesis Template}
\renewcommand{\cleardoublepage}{\clearpage} % [修改]:去除空白页及其页码
% TODO 引擎处理修改为英文
\msg_new:nnn { whu-thesis } { 引擎不支持 }
  {
    whu-thesis ~ 不支持 ~ #1 ~ 引擎。\\\\

    请使用 ~ XeLaTeX ~ 或 ~ LuaLaTeX ~ 进行编译!
  }

\sys_if_engine_xetex:F
  {
    \sys_if_engine_luatex:F
      {
        \msg_fatal:nnx { whu-thesis } { 引擎不支持 }
          { \c_sys_engine_str }
      }
  }

如代码块所示,本人加在了这个位置,亲测可以在满足页眉奇偶页交替出现硕/博论文与论文标题的同时,解决章节前的空白页及页码连续的问题

SwitWu commented 5 months ago

Completed in f5fb45d9cac4fcc6cd698e148298d2575be4b746