\documentclass[twoside,11pt]{book}
\usepackage{fancyhdr,xcolor,lipsum}
\let\Chaptermark\chaptermark
\def\chaptermark#1{\def\Chaptername{#1}\Chaptermark{#1}}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot{}
\colorlet{myfancycolor}{black}
\fancypagestyle{mystyle}{
\renewcommand*\footrulewidth{1pt}
\fancyfoot[OR]{%
\kern-3ex % all material is shifted up by 3ex
\color{myfancycolor}
\hrule height1pt % your \hrule
\hfil
\hbox{\rlap{\vrule height1.3em width2em depth.7em}% you black box
\hbox to2em{\hss\color{white}{\textsf{\thepage}}\hss}}%
}
\fancyfoot[OL]{%
\Chaptername
}
\fancyfoot[EL]{%
\kern-3ex % all material is shifted up by 3ex
\color{myfancycolor}
\hrule height1pt % your \hrule
\hbox{\rlap{\vrule height1.3em width2em depth.7em}% you black box
\hbox to2em{\hss\color{white}{\textsf{\thepage}}\hss}}%
}
\fancyfoot[ER]{%
\rightmark
}
}
\pagestyle{mystyle}
\begin{document}
\frontmatter
\chapter{PREFACE}
\lipsum[1-2]
\tableofcontents
\mainmatter
\chapter{LALALA LALALA LALALA}
\lipsum[1-8]
\end{document}
我想在页脚中显示章节标题,且单词首字母大写。如何实现?
例子:
章节:啦啦啦啦啦啦啦啦
在页脚显示:Lalala Lalala Lalala
注意:如果我使用英语,像“and”、“or”、“a”、“an”等单词的首字母不大写。
我尝试\capitalisewords
代码有没有命令可以将首字母变为大写?
但fancyfoot
它不起作用。