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

标题换行页眉不换行的问题 #37

Closed
Droliven opened this issue Mar 15, 2023 · 5 comments
Closed

标题换行页眉不换行的问题 #37

Droliven opened this issue Mar 15, 2023 · 5 comments

Comments

@Droliven
Copy link

image

像这种情况,怎么样才能将标题换行,页眉不换行,试了 \\ 好像页眉会跟着换行

@mengchaoheng
Copy link
Owner

这是个好问题,要求助一下其他人

@note286
Copy link

note286 commented Mar 17, 2023

@mengchaoheng 你抽空看一下,我懒得去看你的代码了,我给个book.cls的示例吧,你照着弄一下,关键就是利用\markboth{}{},设置第一个参数即可。

\documentclass{book}
\usepackage{fancyhdr}
\fancypagestyle{plain}{
\pagestyle{fancy}
\fancyhf{}
\fancyhead[CE]{test}
\fancyhead[CO]{\leftmark}
}
\pagestyle{plain}
\usepackage{lipsum}
\begin{document}
\chapter{title1}
\lipsum[1-20]
\chapter{title2\\title2}
\markboth{\MakeUppercase{\chaptername~\thechapter.~title2--title2}}{}
\lipsum[1-20]
\chapter{title3}
\lipsum[1-20]
\end{document}

image
image

@mengchaoheng
Copy link
Owner

抱歉实在没时间做这个修改。但我有一个疑问,一个章的标题真的需要这么长吗?考虑简称/缩写或者其他手段缩短标题?

@Droliven
Copy link
Author

Droliven commented Mar 17, 2023 via email

@sikouhjw
Copy link

  1. 参考 stone-zeng/fduthesis@c1f9e3e 处理 \\
  2. \chapter[]{}
    \documentclass{book}
    \begin{document}
    \tableofcontents
    \chapter[test1]{test2}
    \newpage
    test
    \end{document}

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

No branches or pull requests

4 participants