This is a follow-up question to How can Acrobat features be controlled from within LaTeX?
It seems that xpatch
package makes REVTeX unstable and even appears to turn off some of its features. Thus, instead of making an Acrobat 5 document it makes Acrobat 9 if both are installed. More worrisome, however, is the sudden change of behavior for unknown reasons. I was working with a document and all went just fine but all of a sudden my WinEdt refused to compile it. Numerous errors showed cross-referencing problems. It turned out the culprit is \affiliation{}
. As soon as I removed it, the problem disappeared. Unfortunately, I cannot demonstrate it in a MWE because it doesn't show up there. What shows up in a MWE is another problem---\section{}
does not accept \textbf{}
:
\documentclass[onecolumn,twoside]{revtex4}
\usepackage{xpatch}% http://ctan.org/pkg/xpatch
\makeatletter
\xpatchcmd{\@ssect@ltx}{\@xsect}{\edef\@currentlabelname{#8}\@xsect}{}{}% Patch \<section>*
\xpatchcmd{\@sect@ltx}{\@xsect}{\edef\@currentlabelname{#8}\@xsect}{}{}% Patch \<section>
\makeatother
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\hypersetup{pdfstartview=FitH,pdfpagemode=UseNone}
\begin{document}
\title{Title}
\author{Author}
\affiliation{Affiliation}
\maketitle
%\section*{FirstSection--$E \times H$ vs.$\ \textbf{E} \times \textbf{H}$}
\section*{FirstSection}
\label{sec:marker1}
In \nameref{sec:marker2} it is stated that \ldots
\section*{SecondSection} \label{sec:marker2}
You can also see in \nameref{sec:marker1} that \ldots
\end{document}
As you can see, the above example works as long as \section*{FirstSection--$E \times H$ vs.$\ \textbf{E} \times \textbf{H}$}
, containing
\textbf{}
characters, is remmed out. If you un-rem it and instead rem out \section*{FirstSection}
the compilation crashes.
Do you think I should live with it and have the affiliation follow the author in \author{}
and instead of \textbf{Something}
should use \bf Something \rm
instead or there are radical solutions of this instability, if at all?
\protected@edef
rather than just\edef
.\affiliation
macro is not 'long'. That has nothing to do withxpatch
: you see the same without loading it. Probably the author of REVTeX does not expect affiliations to be large blocks of text.revtex4
, but ratherrevtex4-1
. This may seem like an incremental difference, but there's something like a 10 year gap between the two!