1

I want to change the page numbering such that it says something like "F_in_a JAR 2" or add my name on all the pages in a non-intrusive way.

I dont have much experience with latex so for writting a book I went with the Kaobook class since it looked nice now i have no idea how to change the numbering or adding the name to all pages with this class.

Edit

the packages Im using are [spanish]{babel} array wrapfig multirow tabularx multicol subcaption [table,xcdraw]{xcolor} styles/kaobiblio

2 Answers 2

0

Perhaps you can start from here.

If you are using the latest version from GitHub:

\renewpagestyle{scrheadings}{%
    {\smash{\hspace{-\headmarginparwidth}\hspace{-\headmarginparsep}\makebox[\headtotal][l]{%
        \makebox[7\hscale][r]{\thepage}%
        \makebox[3\hscale]{}\rule[-1mm]{0.5pt}{19\vscale-1mm}\makebox[3\hscale]{}%
        \makebox[\headtextwidth][l]{\leftmark}}}}%
    {\smash{\makebox[0pt][l]{\makebox[\headtotal][r]{%
        \makebox[\headtextwidth][r]{\hfill\rightmark}%
        \makebox[3\hscale]{}\rule[-1mm]{0.5pt}{19\vscale-1mm}\makebox[3\hscale]{}%
        \makebox[7\hscale][l]{\thepage}}}}}%
    {\smash{\makebox[0pt][l]{\makebox[\headtotal][r]{%
        \makebox[\headtextwidth][r]{\hfill\rightmark}%
        \makebox[3\hscale]{}\rule[-1mm]{0.5pt}{19\vscale-1mm}\makebox[3\hscale]{}%
        \makebox[7\hscale][l]{\thepage}}}}}%
}{%
    {\hspace{\dimexpr -\headmarginparwidth -\headmarginparsep}\makebox[\headtotal][l]{%
        \makebox[\textwidth][l]{F-in-JAR}%
    }}% 
    {\makebox[0pt][l]{\makebox[\headtotal][r]{%
        \makebox[\headtextwidth][r]{\hfill F-in-JAR}%
    }}}%
    {\makebox[0pt][l]{\makebox[\headtotal][r]{%
        \makebox[\headtextwidth][r]{\hfill F-in-JAR}%
    }}}%
}

If you are using the template on Overleaf from latextemplates.com:

\renewpagestyle{scrheadings}{%
    {\hspace{-\marginparwidth}\hspace{-\marginparsep}\makebox[\overflowingheadlen][l]{%
        \parbox[t][1.7cm][c]{2em}{\hfill\thepage}%
        \makebox[2em][c]{\rule[-1.03cm]{1pt}{1.55cm}}%
        \parbox[t][1.7cm][c]{\textwidth}{\leftmark}}}%
    {\makebox[\overflowingheadlen][r]{%
        \parbox[t][1.7cm][c]{\textwidth}{\hfill\rightmark}%
        \makebox[2em][c]{\rule[-1.03cm]{1pt}{1.55cm}}%
        \parbox[t][1.7cm][c]{2em}{\thepage}}}%
    {\makebox[\overflowingheadlen][r]{%
        \parbox[t][1.7cm][c]{\textwidth}{\hfill\rightmark}%
        \makebox[2em][c]{\rule[-1.03cm]{1pt}{1.55cm}}%
        \parbox[t][1.7cm][c]{2em}{\thepage}}}%
}{%
    {\hspace{\dimexpr -\marginparwidth -\marginparsep}\makebox[\overflowingheadlen][l]{%
        \makebox[\textwidth][l]{F-in-JAR}%
    }}% 
    {\makebox[0pt][l]{\makebox[\overflowingheadlen][r]{%
        \makebox[\textwidth][r]{\hfill F-in-JAR}%
    }}}%
    {\makebox[0pt][l]{\makebox[\overflowingheadlen][r]{%
        \makebox[\textwidth][r]{\hfill F-in-JAR}%
    }}}%
}

It will print F-in-JAR in the footer of every page.

6
  • Thanks so much, it made the name appear, but it also moved the top heading to the full left to the point of cutting it off. I have no idea if you know how to fix that without seeing the rest of the code.
    – F_in_a_JAR
    Commented Mar 30, 2021 at 15:58
  • Are you using an old version of kaobook? Because I remember there was a problem like that in \pagelayout{wide} mode, but it has now been fixed. Moreover the top heading is fine in my tests. Have you maybe done some custom edits to the template files? Commented Mar 30, 2021 at 17:16
  • I'm using the version provided by overleaf don't know if it that would affect that much. And no I haven't edited anything other than the text in the tex files and other than adding the packages or removing the "%" to enable things like showframe. I'm very new to latex I try not to change much yet
    – F_in_a_JAR
    Commented Mar 30, 2021 at 19:37
  • OK, thanks, I have edited my answer. (assuming that you have found the template on latextemplates.com) Commented Mar 31, 2021 at 8:16
  • It works now, yayy! I wanted to ask one final thing. What are some recommended readings to be able to answer questions like this in the future?
    – F_in_a_JAR
    Commented Apr 1, 2021 at 16:03
0

Like this?

You can renewcommand of \thepage.

\documentclass{article}
\renewcommand{\thepage}{F\_in\_a JAR \arabic{page}}

\begin{document}
    Text
    \newpage
    Text
    
    \end{document}

enter image description here

1
  • 1
    it doesnt seem to work. also It seems to not work due to having xcolor. the other packages im using are: usepackage[spanish]{babel} \usepackage{array} \usepackage{wrapfig} \usepackage{multirow} \usepackage{tabularx} \usepackage{multicol} \usepackage{subcaption} \usepackage[table,xcdraw]{xcolor} \usepackage{styles/kaobiblio}
    – F_in_a_JAR
    Commented Mar 30, 2021 at 1:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .