Page Layout ⇒ \partmark in class article?
\partmark in class article?
I was trying to layout something quite difficult (it seems!) in my headline... I can't find any solution...
Actually, I'm working in the class "article" and I want to have the name of the current part in my headlines like this :
Part 1 : Présentation of the software
----------------------------------------------------------------- (\hline)
PART 1 Presentation of the software
Text ...
How can I do that?
(it seems the LaTeX doesn't know the command \partmark in the documentclass "article", I read it was possible in the documentclass "book" for instance, I tried to do \newcommand, but it didn't work out, so... Last thing : LaTeX can put the number of the current part with the command \thepart, so that I think it should be possible to print the name of the part too...)
Thank you for your help and sorry for my possible language mistakes.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: \partmark in class article?
how are you currently setting the headers for your document? Which package(s) do you use? A simple minimal and compilable document showing all the settings related to this problem could save valuable time.
\partmark in class article?
I put that command :
Code: Select all
\newcommand\partmark[1]{\markboth{\MakeUppercase{#1}}{}}
Code: Select all
\makeatletter
\newcommand{\ps@rapport}{
\renewcommand{\@evenhead}{}
\renewcommand{\@oddhead}{\itshape \leftmark \hfil}
\renewcommand{\@evenfoot}{\@oddfoot}
\renewcommand{\@oddfoot}{\hfil - \thepage\ - \hfil}
}
\makeatother
\pagestyle{rapport}
\renewcommand{\@oddhead}{\itshape \leftmark \hfil}
like the lines you can draw using the package fancyhdr with the command \renewcommand{\headrulewidth}{0.2pt}.
I could try to use fancyhdr instead of the default package, but it doesn't work... I wrote :
Code: Select all
\usepackage{fancyhdr}
\fancypagestyle{rapport}{
\renewcommand{\headrulewidth}{0.2pt}
\fancyhead[L]{\itshape \leftmark \hfil}
\fancyhead[R]{}
\fancyfoot[C]{- \thepage\ -}
}
\pagestyle{rapport}
Actually I don't really understand what leftmark and rightmark do... In the first case, leftmark gives me the right thing I want, in the second one, it gives me something else. That's a little bit strange ^^'
Thank you for you help!