stone-zeng / fduthesis

LaTeX thesis template for Fudan University
LaTeX Project Public License v1.3c
811 stars 205 forks source link

页眉相关问题 #263

Closed Aphroditefang closed 2 years ago

Aphroditefang commented 2 years ago

Discussed in https://github.com/stone-zeng/fduthesis/discussions/262

Originally posted by **Aphroditefang** June 24, 2022 您好,关于页眉有两个问题: 1. ![image](https://user-images.githubusercontent.com/34327524/175452707-41630847-1d47-4825-9484-a27ac7af3c82.png) 目录这边的页眉怎么去掉呢? 2. ![image](https://user-images.githubusercontent.com/34327524/175452972-412e21a4-75e7-46bf-856a-9e2db6389b47.png) 这里参考文献能不能移到右边去呢?
Aphroditefang commented 2 years ago

是onside模式,然后利用

\makeatletter
\ExplSyntaxOn
\fancyhead[L]{\small\nouppercase{\fdu@kai \l__fdu_info_title_tl }}
\fancyhead[R]{\small \nouppercase{ \fdu@kai \csname l__fdu_header_center_mark_tl\endcsname\leftmark}}
\ExplSyntaxOff
\makeatother

设置页眉为左侧是文章名,右侧是章节名。 image

正文部分都是对的,参考文献和摘要部分就变成了左侧是文章名字,中间是章节名。

sikouhjw commented 2 years ago
  1. 不要开多个 issue/discussion 提问
  2. 提问要说清模板版本
  3. 目录、参考文献没有出现页眉,请提供 MWE
Aphroditefang commented 2 years ago

1.好的,不小心同时弄了issue和discussion。 2.模板版本是最新的,克隆到本地后,生成thesis文件加并上传到overleaf。目录和参考文献首页没有页眉,但是第二页开始就有页眉了的。

sikouhjw commented 2 years ago
  1. 目录。在 \tableofcontents 后面加上 \pagestyle{fancy},在导言区加上
    \__fdu_patch_cmd:Nnn \tableofcontents
     {
       \__fdu_chapter_no_toc:V \contentsname
     }
     {
       \__fdu_chapter_no_toc:V \contentsname \pagestyle{plain}
     }
  2. 让所有章节在右边显示
    \cs_set_protected:Npn \__fdu_chapter_header:n #1
     {
       \bool_if:NTF \g__fdu_twoside_bool
         { \markboth {#1} {#1} }
         { \markboth { \hfill #1 } { } }
     }
stone-zeng commented 2 years ago
\makeatletter
\ExplSyntaxOn
\cs_set_protected:Npn \__fdu_chapter_header:n #1
  { \markboth {#1} { } }
\fancyhead[L]{\small\nouppercase{\fdu@kai\l__fdu_info_title_tl}}
\fancyhead[R]{\small\nouppercase{\fdu@kai\csname l__fdu_header_center_mark_tl\endcsname\leftmark}}
\ExplSyntaxOff
\makeatother

除每章首页外其余都用「左论文标题、右章名字」的格式作为页眉。

Aphroditefang commented 2 years ago

好的,所有问题都解决了。非常感谢个为耐心的解答,后续应该没什么疑问了