Page Layout ⇒ Two Questions: List of My Own Environment & Section Markers
Two Questions: List of My Own Environment & Section Markers
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Two Questions: List of My Own Environment & Section Markers
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.
Re: Two Questions: List of My Own Environment & Section Mark
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}Two Questions: List of My Own Environment & Section Markers
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
Code: Select all
\tableofcontents~\\
\newpage
\thispagestyle{plain}
Thanks for your help with the other 2 though!