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

如何给中英文摘要添加书签? #127

Closed
DRjy opened this Issue Mar 18, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@DRjy
Copy link

DRjy commented Mar 18, 2019

image

如何给中文 摘要 和 Abstract生成目录?
像下表这样的结果
image

@mohuangrui

This comment has been minimized.

Copy link
Owner

mohuangrui commented Mar 18, 2019

国科大给定Word模版规定那些不放入目录。如果你想,把 \chapter*{摘要/Abstract} 中的 * 去掉即可。

@muzimuzhi

This comment has been minimized.

Copy link

muzimuzhi commented Mar 18, 2019

如果你想让「摘要」

  • 在目录中不显示,同时
  • 在 pdf 书签中显示,

就需要手动添加书签,用到的命令参见 hyperref 宏包文档的 4.1 节。

@DRjy

This comment has been minimized.

Copy link
Author

DRjy commented Mar 18, 2019

如果想要目录,和书签中都显示,改怎么弄?谢谢了。

@mohuangrui

This comment has been minimized.

Copy link
Owner

mohuangrui commented Mar 18, 2019

@DRjy

  1. 目录和书签中都显示:

\chapter*{摘\quad 要}\chaptermark{摘\quad 要}% 摘要标题

\chapter*{Abstract}\chaptermark{Abstract}% 摘要标题

中的 * 去掉即可

  1. 只在书签中显示不在目录中显示,按照 @muzimuzhi 所提示的,用:
\chapter*{摘\quad 要}\chaptermark{摘\quad 要}% 摘要标题
\pdfbookmark[1]{摘要}{bmk:zhaiyao}% 加入书签但不加入目录

\chapter*{Abstract}\chaptermark{Abstract}% 摘要标题
\pdfbookmark[1]{Abstract}{bmk:abstract}% 加入书签但不加入目录
@DRjy

This comment has been minimized.

Copy link
Author

DRjy commented Mar 18, 2019

谢谢!完美解决。
不过调节一下这个上下顺序,可能更好看(强迫症啊)

\chapter*{摘\quad 要}\chaptermark{摘\quad 要}% 摘要标题
\pdfbookmark[1]{摘要}{bmk:zhaiyao}% 加入书签但不加入目录

变为:

\pdfbookmark[1]{摘要}{bmk:zhaiyao}% 加入书签但不加入目录
\chapter*{摘\quad 要}\chaptermark{摘\quad 要}% 摘要标题

@DRjy DRjy closed this Mar 18, 2019

@mohuangrui

This comment has been minimized.

Copy link
Owner

mohuangrui commented Mar 18, 2019

@DRjy
如果要调节顺序,那就必须要多加一个命令,即:

\cleardoublepage\pdfbookmark[1]{摘要}{bmk:zhaiyao}% 加入书签但不加入目录
\chapter*{摘\quad 要}\chaptermark{摘\quad 要}% 摘要标题

\cleardoublepage\pdfbookmark[1]{Abstract}{bmk:abstract}% 加入书签但不加入目录
\chapter*{Abstract}\chaptermark{Abstract}% 摘要标题
@muzimuzhi

This comment has been minimized.

Copy link

muzimuzhi commented Mar 18, 2019

因为章节标题自成一段,且这个段落的前后往往有额外的纵向间距。所以,手动添加的书签,其跳转位置是不准确的。

写了篇知乎文章来介绍如何避开这个问题,希望能帮到。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.