Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error while using together the betwen revtex4-1 and hyperref (! TeX capacity exceeded, sorry)

499 views
Skip to first unread message

lomov.vl

unread,
Sep 21, 2012, 6:10:24 AM9/21/12
to
Hello,

I prepared small example which shows problem when using revtex4-1 class and hyperref package:

<file name="ex.ltx">
\documentclass[preprint]{revtex4-1}

\begin{document}

\title{Minimal not-working document (example)}
\author{Vladimir Lomov}
\email{\url{lomo...@gmail.com}}
\affiliation{Home, Irkutsk, Russia}

\begin{abstract}
This is minimal example document exhibiting problem with interaction
between revtex4-1 and hyperref.
\end{abstract}

%\pacs{12.21 Af}
%\keywords{Simulation}

\maketitle

\input{tufte}

\end{document}
</file>

<file name="ex.rty">
\ProvidesFile{ex.rty}

\usepackage{hyperref}

\endinput
</file>

Compiling the `ex.ltx' file with `pdflatex' in up-to-date TL 2012 I get:
...
(/usr/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/gettitlestring.sty
)) (./ex.out) (./ex.out)
! TeX capacity exceeded, sorry [input stack size=5000].
\@makeother #1->\catcode `#1
12\relax
l.18 \maketitle

! ==> Fatal error occurred, no output PDF file produced!
Transcript written on ex.log.

Any ideas how to fix this?

---
WBR, Vladimir Lomov

Enrico Gregorio

unread,
Sep 21, 2012, 11:13:34 AM9/21/12
to
lomov.vl <Lomo...@gmail.com> wrote:

> Hello,
>
> I prepared small example which shows problem when using revtex4-1 class and
> hyperref package:
>
> <file name="ex.ltx">
> \documentclass[preprint]{revtex4-1}
>
> \begin{document}
>
> \title{Minimal not-working document (example)}
> \author{Vladimir Lomov}
> \email{\url{lomo...@gmail.com}}
> \affiliation{Home, Irkutsk, Russia}
> [...]
> Any ideas how to fix this?

Remove \url:

\email{lomo...@gmail.com}

Ciao
Enrico

lomov.vl

unread,
Sep 21, 2012, 11:34:19 AM9/21/12
to
Hello,
Thank you Enrico, I didn't suspect the `url' macro but without it the `email' will be typeset in roman, and this is another, my problem.

---
WBR, Vladimir Lomov

Dan Luecking

unread,
Sep 21, 2012, 3:26:18 PM9/21/12
to
Here's a work-around. I redefined \email. This is the same
as revtex's definition, but the address (#2) is wrapped
in \nolinkurl. One wonders why revtex doen't include this
already.

\documentclass[preprint]{revtex4-1}
\makeatletter
\renewcommand*\email[1][]{\begingroup\sanitize@url\@email{#1}}%
\def\@email#1#2{%
\endgroup
% typeset email address with \nolinkurl:
\@AF@join{#1\href{mailto:#2}{\nolinkurl{#2}}}%
}%
\makeatother


Dan
To reply by email, change LookInSig to luecking

lomov.vl

unread,
Sep 24, 2012, 1:50:59 AM9/24/12
to
Hello,

суббота, 22 сентября 2012 г., 4:28:01 UTC+9 пользователь Dan Luecking написал:
> On Fri, 21 Sep 2012 08:34:19 -0700 (PDT), "lomov.vl"
>
[omitted]
>
>>> Remove \url:
>
>>>
>
>>>
>
>>>
>
>>> \email{lomo...@gmail.com}
>
>>>
>
>>>
>
>>>
>
>>> Ciao
>
>>>
>
>>> Enrico
>
> >
>
>>Thank you Enrico, I didn't suspect the `url' macro but without it the
>
>>`email' will be typeset in roman, and this is another, my problem.
>
>
>
> Here's a work-around. I redefined \email. This is the same
>
> as revtex's definition, but the address (#2) is wrapped
>
> in \nolinkurl. One wonders why revtex doen't include this
>
> already.
>
>
>
> \documentclass[preprint]{revtex4-1}
>
> \makeatletter
>
> \renewcommand*\email[1][]{\begingroup\sanitize@url\@email{#1}}%
>
> \def\@email#1#2{%
>
> \endgroup
>
> % typeset email address with \nolinkurl:
>
> \@AF@join{#1\href{mailto:#2}{\nolinkurl{#2}}}%
>
> }%
>
> \makeatother
>

Sorry, but this doesn't work for me, I found that "error" and message can give also `\texttt'.

I prepared several test files, may be they can help to find workaround.

ex1-*: simple documents with `\url' macro in `\email';
-1 without `hyperref' package;
-2 package `hyperref' added to document preamble;
-3 code suggested by Dan (Luecking) added into preamble before `hyperref' package inclusion;
-4 the same as `-3' but the order is changed, now `hyperref' included before the code.

ex2-* the same as `ex1-*' set but uses `\texttt' macro instead of `\url'.

ex3-*: uses revtex4-1 feature, that macros and part of preamble can be placed to `rty' file accompany the document, `\url' macro is used;
-1 `hyperref' package is included in rty file;
-2 the code is included into preamble;
-3 the same as `-3' above but code in rty file;
-4 the same as `-4' above.

ex4-*: as `ex3-*' but uses `\texttt' macro instead of `\url'.

Results:

TD \ TS | 1 | 2 | 3 | 4 |
--------+---+---+---+---+
ex1 | + | - | - | - |
ex2 | + | - | - | - |
ex3 | - | - | - | - |
ex4 | - | - | - | - |
--------+---+---+---+---+

From log files:
`\url':

! TeX capacity exceeded, sorry [input stack size=5000].
\@makeother #1->\catcode `#1
12\relax
l.18 \maketitle

`\texttt':

! TeX capacity exceeded, sorry [input stack size=5000].
\Hy@href {->\hyper@normalise
\href@ {
l.18 \maketitle

I put tests here:
https://github.com/vp1981/revtex4-1-hyperref

---
WBR, Vladimir Lomov

Dan Luecking

unread,
Sep 24, 2012, 11:09:23 AM9/24/12
to
On Sun, 23 Sep 2012 22:50:59 -0700 (PDT), "lomov.vl"
<Lomo...@gmail.com> wrote:

>Hello,
>
>???????, 22 ???????? 2012�?., 4:28:01 UTC+9 ???????????? Dan Luecking ???????:
>> On Fri, 21 Sep 2012 08:34:19 -0700 (PDT), "lomov.vl"
>>
>[omitted]
>>
>> Here's a work-around. I redefined \email. This is the same
>> as revtex's definition, but the address (#2) is wrapped
>> in \nolinkurl. One wonders why revtex doen't include this
>> already.
>>
>> \documentclass[preprint]{revtex4-1}
>> \makeatletter
>> \renewcommand*\email[1][]{\begingroup\sanitize@url\@email{#1}}%
>> \def\@email#1#2{%
>> \endgroup
>> % typeset email address with \nolinkurl:
>> \@AF@join{#1\href{mailto:#2}{\nolinkurl{#2}}}%
>> }%
>> \makeatother
>>
>
>Sorry, but this doesn't work for me, I found that "error" and
>message can give also `\texttt'.

The above code is to be used _instead_ of using \url inside
\email. That is ex1-3.ltx should look like this:

%% ex1-3.ltx
\documentclass[preprint]{revtex4-1}
\makeatletter
\renewcommand*\email[1][]{\begingroup\sanitize@url\@email{#1}}%
\def\@email#1#2{%
\endgroup
% typeset email address with \nolinkurl:
\@AF@join{#1\href{mailto:#2}{\nolinkurl{#2}}}%
}%
\makeatother

\usepackage{hyperref}

\begin{document}

\title{Minimal not-working document (example)}
\author{Vladimir Lomov}
% the url typesetting is inside definition of \email.
% No need for it here.
\email{iggy...@gmail.com}
\affiliation{Home, Irkutsk, Russia}

\begin{abstract}
This is minimal example document exhibiting problem with interaction
between revtex4-1 and hyperref.
\end{abstract}

\maketitle
\input{tufte}
\end{document}


lomov.vl

unread,
Sep 24, 2012, 9:03:46 PM9/24/12
to
Hello,

25-09-2012, 0:11:17 UTC+9 Dan Luecking wrote:
> On Sun, 23 Sep 2012 22:50:59 -0700 (PDT), "lomov.vl"
[...]
> The above code is to be used _instead_ of using \url inside
>
> \email. That is ex1-3.ltx should look like this:
Thanks, now I got it!

> Dan

---
WBR, Vladimir Lomov

0 new messages