26

In the question Enumerate after \label an admirable answer addresses the problem of how to label and link the theorem number when the theorem begins with an enumerated list, and while doing so, how to start the list on the same line as the theorem header.

The answer (by Heiko Oberdiek) involves placing a unique hyper-anchor between the theorem header and the start of the list.

Unfortunately, this works only with direct pdf output, not when the job is compiled to dvi and then converted to ps/pdf. In the .dvi output, the beginning of the list is invariably shifted to the next line.

The question here is, what is different between the two TeX engines that prevents the .dvi output from being the same as the .pdf output? And is there a package that remedies this lapse?

Rationale

We need to fix the problem that dvips adds an extra line when theorems begin with enumerate, because the the AMS production stream requires the dvi route for output destined for print, so the use of pdftex or xetex is not an option. And, since the linked output for on-line posting is created using pdflatex, the paging of the two different outputs would be different, which is not an option either.

The question is often asked, Why does AMS production depend on dvips?

The reason for the dvi requirement mainly involves the need to evaluate the quality of graphics before publication (this is also the reason that AMS requests .eps files). The goal is for graphics to accurately convey the intended information on the printed page as well as in electronic form; the requirements of offset printing are quite different from what looks good on screen.

Automated checking of features like line width, color differentiation (including the ability to distinguish color density and contrast, and the effects of grayscaling) and size of type in context is relatively simple when a graphic file is in PostScript form, even when scaling is applied via \includegraphics, but nearly impossible once the graphic is embedded in a final .pdf file, when (as a colleague has described it) everything has been turned into hamburger. GUI tools do exist for examining pdf graphics, but these require evaluation of each graphic individually, and increase the time required for checking; this, in turn, increases both the cost of production, and the elapsed time until proof can be returned to authors and thus to the printer.

8
  • 10
    Oh my, uppercase in action! It is official! Commented Mar 11, 2016 at 20:26
  • 3
    Well in pdf mode pdftex can use \pdfdest, when going through dvi suitable commands has to be used - and somewhere in the middle of them there is a leavevmode. But probably only Heiko could say if it is needed. You could try \makeatletter\begingroup\let\leavevmode\relax \hyper@anchor{\@currentHref}\endgroup\makeatother. Commented Mar 11, 2016 at 22:19
  • 1
    Somewhat unrelated point, but it should be relatively straightforward to use the original EPS graphics in a PDF document. However, I don't know if there are version restrictions in the workflow preventing that, or if that would make for too many changes in established procedures for authors and others. Commented Mar 11, 2016 at 22:36
  • 1
    Any reason to use dvi in XXIst century? Commented Mar 16, 2016 at 0:22
  • 5
    @IgorKotelnikov -- i tried really hard to explain why in the question. using dvi cuts the human time for the production cycle significantly, and that in turn cuts the cost of publishing books and journals. human time is better spent on meaningful tasks like copyediting for comprehension and accuracy. as soon as reasonable, cost-effective automatic means of verifying that what is in a pdf file will produce the desired result on a high-speed printing press, it will be adopted. Commented Mar 16, 2016 at 2:46

1 Answer 1

5

you just need to put the anchor somewhere safe, here I attach it to the theorem header (which hasn't been typeset yet, it's hanging around in the box \@labels waiting for a paragraph to start).

I added some page breaks so that it is easier to see what happens when you click on a link.

\documentclass[12pt]{article}

\usepackage{amsthm}
\usepackage[colorlinks]{hyperref}

\newtheorem{thm}{Theorem}
\def\thmautorefname{Theorem}

\begin{document}


aa
\clearpage
\begin{thm}

\makeatletter
\setbox\@labels\hbox{\hyper@anchor{\@currentHref}\box\@labels}%
\makeatother
\label{thm:test}
\begin{enumerate}
\item First thing.
\item Second thing.
\item Third thing.
\end{enumerate}
\end{thm}

\clearpage
Theorem~\ref{thm:test} and \autoref{thm:test}.

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .