0
\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}

enter image description here

I want to show chapter title in the footer with first letter of word is uppercase. How to make it?

Example:

chapter: LALALA LALALA LALALA

show in footer: Lalala Lalala Lalala

NOTE: If I use english, the word like "and", "or", "a", "an", etc the first letter is not uppercase.

I try code \capitalisewords in Is there a command to make first letter upper case?

But in fancyfoot it doesn't work.

1 Answers1

1

Use this:

\usepackage{mfirstuc}
\ExplSyntaxOn
\newcommand\mycapswords[1]{\ecapitalisewords{\text_lowercase:n {#1}}}
\ExplSyntaxOff

and then

    \fancyfoot[OL]{%
        \mycapswords{\Chaptername}
    }    

enter image description here