[Tex/LaTex] How to add the name on every page corner in Lyx


My teacher has asked me to add my name on every page of my report. Is there a nice way of doing this so my name appears in a subtle way?

Best Answer

For adding your name to the header/footer, LyX provides "fancy" heading via the fancyhdr package. First, activate these style headings (Document > Settings... > Page Layout > Heading Style):

enter image description here

Now add the following code to your LaTeX Preamble (also under Document > Settings...):

\fancyhf{}               % Clear fancy header/footer
\fancyfoot[L]{My name}   % My name in Left footer
\fancyfoot[R]{\thepage}  % Page number in Right footer
\let\ps@plain\ps@fancy   % Plain page style = fancy page style

The first three lines set clears the header/footer, and sets the L and R footer respectively. The last three lines replaces the plain page style (typically associated with title pages and the like) to be equivalent to the fancy page style. This might not be necessary in your case.