How to explicitly end a \part in LaTeX with hyperref - latex

I have a LaTeX document which contains the following:
\tableofcontents
\chapter{Chapter One}
\part{Part One}
...
\part{Final Part}
\chapter{Final Part Chapters}
\chapter{Chapter not Part of Part}
When I compile this to a PDF with hyperref, the last chapter is included as part of the final part in my bookmarks. (I'm including hyperref as shown below.)
\usepackage[xetex,breaklinks,a4paper]{hyperref}
What I would like to know is how to explicitly end the part before the final chapter, so that hyperref promotes this bookmark to top level when the PDF is created.
Any help would be appreciated.

Heiko Oberdiek's bookmark package (an improvement on his work in hyperref) allows you do to this with its \bookmarksetup command.
\documentclass{book}
\usepackage{bookmark,hyperref}
\begin{document}
\tableofcontents
\chapter{Chapter One}
\part{Part One}
\part{Final Part}
\chapter{Final Part Chapters}
\bookmarksetup{startatroot}% this is it
\addtocontents{toc}{\bigskip}% perhaps as well
\chapter{Chapter not Part of Part}
\end{document}
The \bigskip parts adds a little space in the printed table of contents to visually separate the final chapter from the preceding "part".

Related

affiliations and corresponding author comment as footnotes on latex article

I am trying to use the LaTeX article document class to create a simple paper with the authors listed on the title page with their (potentially multiple repeating) affiliations as numeric footnotes and other author comments as symbolic footnotes. For example, I want something like
However, I haven't been able to make this happen despite trying multiple different solutions. Is there a simple way to do this?
I have tried using the bigfoot package to create multiple different types of footnotes combined with footmisc with the multiple option to get multiple footnote markers with commas between them, but I end up with superposed markers and no footnotes. My minimal latex document is:
\documentclass{article}
\title{My title}
\usepackage[multiple]{footmisc}
\usepackage{bigfoot}
\DeclareNewFootnote{AAffil}[arabic]
\DeclareNewFootnote{ANote}[fnsymbol]
\author{
David Kaplan\footnoteAAffil{A University}\footnoteAAffil{Another University}\footnoteANote{Corresponding author}\footnoteANote{Equal contributors}
\and
Prince Charming\FootnotemarkAAffil{2}\FootnotemarkANote{2}
}
\date{\today}
\begin{document}
\maketitle
\end{document}
And the output I get is:
One possibility is to switch to the amsart class and then using the amsaddr package:
\documentclass{amsart}
\title{My title}
\author{David Kaplan $^{1,2,\ast,\dagger}$}
\address{$^1$A University}
\address{$^2$Another University}
\address{$^{\ast}$Corresponding author}
\address{$^{\dagger}$Equal contributors}
\author{Prince Charming $^{1,\dagger}$}
\usepackage[foot]{amsaddr}
\begin{document}
\maketitle
\end{document}
With help from others, I posted a solution to this question here. For completeness, I am copying the solution below:
\documentclass{article} % <---- No titlepage
\title{My title}
%\usepackage[dont-mess-around]{fnpct} % <---- I decided not to use fnpct, but rather put in the commas by hand
\usepackage{bigfoot}
\DeclareNewFootnote{AAffil}[arabic]
\DeclareNewFootnote{ANote}[fnsymbol]
\usepackage{etoolbox}
\makeatletter
\patchcmd\maketitle{\def\#makefnmark{\rlap{\#textsuperscript{\normalfont\#thefnmark}}}}{}{}{}
\makeatother
% Hook into the \thanks command for the article class to print the footnotes
\makeatletter
\def\thanksAAffil#1{% <--- These %'s are necessary for spacing
\footnotemarkAAffil\protected#xdef\#thanks{\#thanks%
\protect\footnotetextAAffil[\the \c#footnoteAAffil]{#1}}%
}
\def\thanksANote#1{%
\footnotemarkANote%
\protected#xdef\#thanks{\#thanks%
\protect\footnotetextANote[\the \c#footnoteANote]{#1}}%
}
\makeatother
\author{% <---- Not sure if these %'s are necessary, but can't hurt
David Kaplan%
\thanksAAffil{A University}$^{,}$\thanksAAffil{Another University}$^{,}$%
\thanksANote{Corresponding author}$^{,}$\thanksANote{Equal contributors}%
, %
Prince Charming%
\footnotemarkAAffil[2]$^{,}$\thanksAAffil{Still another university}$^{,}$\footnotemarkANote[2]$^{,}$%
\thanksANote{Another note}%
, %
Mohamed Ali%
\thanksAAffil{I am the greatest U.}%
}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}
This is the abstract.
\end{abstract}
\section{Introduction}
More Text
\end{document}

\maketitle to use several times with combine in LaTeX

I am trying to make a .tex template for a book of abstracts for the conference. I want the template to be compilable, so the participants are able to see their abstracts separately before submitting. Moreover I want to use the files to compile the book of abstracts with table of contents and titles.
So, I have master file
\documentclass[12pt]{combine}
\usepackage{authblk}
\begin{document}
\tableofcontents
\begin{papers}
\coltocauthor{Crist\'{o}bal Josevich Junta, Fyodor Simeonovich Kivrin}
\coltoctitle{Title of the first abstract}
\import{first}
\coltocauthor{Roman Oyra-Oyra}
\coltoctitle{Title of the second abstract}
\import{second}
\end{papers}
\end{document}
And two imported files are:
\documentclass{article}
\usepackage{authblk}
\title{Title of the first abstract}
\author[1]{Crist\'{o}bal Josevich Junta}
\author[2]{Fyodor Simeonovich Kivrin}
\affil[1]{Department of the Meaning of Life}
\affil[2]{Department of Linear Happiness}
\begin{document}
\maketitle
Text of the first abstract.
\end{document}
and
\documentclass{article}
\usepackage{authblk}
\title{Title of the second abstract}
\author[1]{Roman Oyra-Oyra}
\affil[1]{Laboratory of the most unexpected sciences}
\begin{document}
\maketitle
Text of the second abstract.
\end{document}
The problem is the second \maketitle does not print authors names and their affiliation.
I have tried using redefined \settitle instead of \maketitle
\makeatletter
\newcommand{\settitle}{\#maketitle}
\makeatother
it did not help.
Also, I tried titling package, which led to no change.
I want \maketitle to print the names and affiliations or to find out the better way to automatically make titles for each abstract.

Undefined references using pagesel in Latex

Let's say I have some labels in a part of the document that I exclude using pagesel. However, I want to reference them in the part that I am including. How is that possible?
Below is a minimum example which should print "This is reference 1", but instead prints "This is reference ??".
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[files,2-]{pagesel}
\title{Pagesel problem}
\begin{document}
\maketitle
\section{Introduction}
This is label \label{ref:label1}.
\cleardoublepage
This is reference \ref{ref:label1}
\end{document}
You can retain the labels from pages not shown by first compiling your whole document without the pagesel package and then, in a second step, use the pagesel package with the default nofile option:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[
%files,
2-]{pagesel}
\title{Pagesel problem}
\begin{document}
\maketitle
\section{Introduction}
This is label \label{ref:label1}.
\cleardoublepage
This is reference \ref{ref:label1}
\end{document}
Other possible approach: compile the complete document and then use a tool like pdftk to extract the pages you like.

Adding bibliography to appendices in latex

I am writing my thesis and I am using the chapterbib option. While it makes beautiful bibliographies for my chapters, I can't get it to do the same thing for my appendices.
The preamble:
\documentclass[pdftex, 11pt, onecolumn, openany]{report}
\usepackage{amsmath}
\usepackage[pdftex]{graphicx}
\usepackage{appendix}
\usepackage[sectionbib]{chapterbib}
\usepackage{chapterbib}
\begin{document}
...
\include{background}
\include{ATRPcomp}
\include{CCTcomp}
\appendix
\include{AppCCT}
\end{document}
In each of my chapter sections and appendix I have:
\chapter{Compartmentalization in Catalytic Chain Transfer}
...
\bibliography{references}
Does the chapterbib also work for appendices or is there another option that could help?
I assume the package to work also within the appendix. I fact, when you issue the command \appendix the sectioning commands' behavior is the same, except for the numbering (and perhaps the heading).
In the main matter, the chapter command
\chapter{CCTcomp}
gives you
7 CCtcomp
(7 is an example). The commands sequence
\appendix
\chapter{AppCCT}
gives you
A AppCCT
The bibliography shoud work properly.

No page number for divider pages in LaTeX

I have a report in LaTeX, and i have used the following commands to create my Appendix, however, my lecturer states that any divider pages should be unnumbered.
\documentclass{report}
\usepackage{appendix}
\begin{document}
\include{chap1}
\include{appendix}
\end{document}
Then in appendix.tex
\appendix
\pagestyle{empty}
\appendixpage
\noappendicestocpagenum
\addappheadtotoc
This creates the Appendices divider page, but still puts a page number on it in the footer. There is no page number in the TOC, as expected.
How can I remove it from the footer?
I looked at the appendix.sty source, and I see the problem: line 74, in the definition of \#chap#pppage, issues a \thispagestyle{plain} command, thus overriding your \pagestyle{empty} for this page. The inelegant but direct way to fix this is to redefine the command without this line - issue the following code after importing the package.
Revised, tested version
\documentclass{report}
\usepackage{appendix}
%==== The action ================
\makeatletter
\def\#chap#pppage{%
\clear#ppage
\if#twocolumn\onecolumn\#tempswatrue\else\#tempswafalse\fi
\null\vfil
\markboth{}{}%
{ \centering \interlinepenalty \#M
\normalfont \Huge \bfseries \appendixpagename\par}%
\if#dotoc#pp\addappheadtotoc\fi
\vfil\newpage
\if#twoside
\if#openright \null \thispagestyle{empty}\newpage\fi
\fi
\if#tempswa \twocolumn\fi
}
\makeatother
%==== Back to the document ========
\begin{document}
\tableofcontents
\chapter{Blah}
Rhubarb, rhubarb, rhubarb.
\appendix
\pagestyle{empty}
\appendixpage
\noappendicestocpagenum
\addappheadtotoc
\chapter{Boff}
Cabbages, cabbages, cabbages.
\end{document}
The TeX FAQ might come in handy here:
I asked for “empty”, but the page is numbered
If you use \pagestyle{empty} and you
find some pages are numbered anyway,
you are probably encountering one of
the style decisions built into the
standard LaTeX classes: that certain
special pages should always appear
with \pagestyle{plain}, with a page
number at the centre of the page foot.
The special pages in question are
those (in article class) containing a
\maketitle, or (in book and report
classes) \chapter or \part commands.
The simple solution is to reissue the
page style after the command, with
effect for a single page, as, for
example (in article):
\maketitle
\thispagestyle{empty}
So give adding \thispagestyle{empty} after your \appendix a try.
try changing \pagestyle{empty} to \thispagestyle{empty} and put it after \addappheadtotoc.
Try instead:
\pagenumbering{gobble}
\begin{appendices} \newpage
\clearpage
\pagenumbering{arabic}
\addtocounter{page}{100}
\tableofcontents
\newpage
*Special thanks to https://tex.stackexchange.com/questions/6639/removing-page-numbers-but-not-headers!

Resources