Hi,
I have two questions:
1 - The easier one) If I want to have an unnumbered section (\section*{...}) how can I get it to show up in \rightmark? I know how to add it to the Table of Contents (\addcontentsline) and that adds it to the PDF structure as well but I don't really know how to work with \rightmark.
2 - Possibly harder) I've defined an environment and would like to get a list of all of those to put with my ToC (something like List of Figures, Tables, Listings, etc. but for my environment). I've been told this can be done with the `float' package, but I'd rather not have my environment be a float. Does anyone know any other ways to achieve this?
I'm sorry if this is a duplicate, I couldn't find these in the forums before.
YP
Page Layout ⇒ Two Questions: List of My Own Environment & Section Markers
NEW: TikZ book now 40% off at Amazon.com for a short time.
Two Questions: List of My Own Environment & Section Markers
Hi,
1) Use \marboth or \markright.
2) You can use, for example, the \newlistof command provided by the tocloft package; see Section 2.4 "New list of ..." of the package documentation for a detailed explanation.
1) Use \marboth or \markright.
2) You can use, for example, the \newlistof command provided by the tocloft package; see Section 2.4 "New list of ..." of the package documentation for a detailed explanation.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Two Questions: List of My Own Environment & Section Mark
Thank you so much for the quick answer - I haven't had time to get back here much with the end of the semester.
The tocloft package works great! But could you explain a little more how to work with \markboth & \markright? My first attempts made the formatting pretty wild.]
YP
The tocloft package works great! But could you explain a little more how to work with \markboth & \markright? My first attempts made the formatting pretty wild.]
YP
Two Questions: List of My Own Environment & Section Markers
You're welcome - No problem.youngprof wrote:Thank you so much for the quick answer - I haven't had time to get back here much with the end of the semester...
Of course I can explain a little more, but it would be better if you let us know exactly how do you want your headers/footers to look like for the unnumbered section created with \section*.youngprof wrote:...The tocloft package works great! But could you explain a little more how to work with \markboth & \markright?..
This little example perhaps could give you some hints:
Code: Select all
\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{\rightmark}
\usepackage{lipsum} % just to generate some text for the example
\begin{document}
\section{Test section}
\markright{Test section}
\lipsum[1-30]
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Two Questions: List of My Own Environment & Section Markers
Great!! - I think this should illustrate what I'd like to do:
1) I'd like page 5 to have "A Different Section" where "A First Section" is now showing up.
2) I'd like page 2 to be blank, but for how it still has a header - I thought \thispagestyle would work but it doesn't work for {empty} or {plain}
3)If you have advice on how I could get the two "A"'s to line up in the toc too that'd be great but I might be able to get that out of tocloft (I haven't really worked with it yet).
Thank you again
Code: Select all
\documentclass[10pt]{book}
\usepackage{lastpage, fancyhdr, lipsum}
\pagestyle{fancyplain}
\lhead[\fancyplain{}{MY NAME}]{\fancyplain{}{\rightmark}}
\rhead[\fancyplain{}{\rightmark}]{\fancyplain{}{MY NAME}}
\title{abc}
\author{def}
\begin{document}
\tableofcontents
\thispagestyle{empty}
\chapter{The First Chapter}
\section{A First Section}
\lipsum[1-4]
\section*{A Different Section}
\addcontentsline{toc}{section}{A Different Section}
\lipsum[5-12]
\end{document}
2) I'd like page 2 to be blank, but for how it still has a header - I thought \thispagestyle would work but it doesn't work for {empty} or {plain}
3)If you have advice on how I could get the two "A"'s to line up in the toc too that'd be great but I might be able to get that out of tocloft (I haven't really worked with it yet).
Thank you again
Two Questions: List of My Own Environment & Section Markers
Regarding #2 - I just figured that out
forces the \thispagestyle onto page 2 where it's not fighting with \tableofcontents.
Thanks for your help with the other 2 though!
Code: Select all
\tableofcontents~\\
\newpage
\thispagestyle{plain}
Thanks for your help with the other 2 though!