I just started using Lyx and I'm very confused. It doesn't allow me to show the LaTeX code so that I cannot edit LaTeX directly. But it also has no apparent options to set certain things.
What I need is this:
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityThere are various possibilities, this just uses the scrbook
class and the scrlayer-scrpage
package, setting the headers for left-header-odd-page (\lohead
), left-header-even-page (\lehead
) and their corresponding commands for the right headers, as well as the centred head command \chead
.
\documentclass{scrbook} % Koma book class
\usepackage{xcolor}
\usepackage{scrlayer-scrpage}
\newcommand{\MyName}{Tom\'a\v{s} Zato}
\usepackage{blindtext}
\clearscrheadfoot%
\rohead{\MyName}
\lehead{\today}
\chead{Project}
\lohead{\today}
\rehead{\MyName}
\cefoot{\thepage} % Page number in centred footer
\begin{document}
\pagestyle{scrheadings}
\blindtext[5] % Filling the document
\end{document}
A version for an oneside
book - document
\documentclass[oneside]{scrbook}
\usepackage{scrlayer-scrpage}
\newcommand{\MyName}{Tom\'a\v{s} Zato}
\usepackage{blindtext}
\clearscrheadfoot%
\ohead{\MyName}
\ihead{\today}
\chead{Project}
\begin{document}
\pagestyle{scrheadings}
\blindtext[6]
\end{document}
oneside
document. Having the project name in the header also clues for oneside. Even if it would be twoside, having the name always on the right is messy. Decide for inner/center/outside. Makes less code as well.
Feb 21, 2015 at 20:32
article-like
? (i.e. with equal margins)
In the settings dialog click on the Modules option.
Select "Custom Header/Footerlines" from the "Available" list and then click on the "Add" button to make it active. Note the advice in the description pane that you must set the Page Layout to "fancy". (Click on the "Page Layout" option and select "fancy" from the "Page style" drop down. Click on "OK" to close the settings dialog.
This will then give you a series of environments in your environment list which you can insert into your LyX document which you can use to set headers and footers using LyX commands. For example, if you select "Left Header" from the list with your cursor in a new paragraph you will see the text "Left Header:" appear in your document. Just type the content of the header in this environment.
Personally, I set these up at the start of the document so they are easy to find.
No LaTeX or preamble changes necessary.
fancyhdr
package or the KOMA classes for thisfancyhdr
commands in LaTeX preambule, but where to put the desired information I have no idea. I found these codes here, on tex.SE - so yes, I have been searching a lot before posting.LateX
code directly into LyX editor.Christian
in code block, or should I?