Breakurl does not work with htmladdnormallink

Thomas Schneider schneidt at
Sun Aug 29 08:57:14 CEST 2021

Dear TeXers and Vilar Camara Neto:

I am using:

% latex --version
pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2021)
which has:
breakurl version 1.40 (2013/04/10)

My URLs break with \url but not with \htmladdnormallink.  I looked
into the source code for breakurl

and found that the file breakurl.dtx is the actual source code.  It
has this line:


and later

% Now the synonyms |\url| and |\urlalt| are (re)defined, unless the
% |preserveurlmacro| option is given.
%    \begin{macrocode}
\if at preserveurlmacro\else\let\url\burl\let\urlalt\burlalt\fi
%    \end{macrocode}

The command \url is actually a synonym of \burl, which may be most of
the issue, but \htmladdnormallink takes TWO arguments and it turns out
that this has to be accounted for properly.

I'm calling \url this way:


and my \htmladdnormallink looks like this:


HOWEVER the first argument can be anything one wants; the actual URL
used for the link is the second argument.  I use this double form in
over 3000 bibtex references inside 'note = '.  This way most of the
time the link shows the actual url in my references and I can fix it
if there are problems (like blanks or underscores).  Putting '\\' into
the first argument does break the lines but I would have to adjust
each one and the bibtex entry would fail for different documents
since, for example, some documents have twocolumn which requires more
breaks than one column documents.  So it needs to be an automatic wrap

A solution would be to have breakurl add breaks to the first argument
of \htmladdnormallink.  I was able to do this by adding one line to
breakurl.dtx.  Here are the diffs between the original and the
modified breakurl.dtx:

> %tdszq Possible new code: replace '\url' with '\htmladdnormallink':
> % \DeclareRobustCommand{\burl}{\htmladdnormallink} % tdszq
> %tdszq additional code:
> \if at preserveurlmacro\else\let\htmladdnormallink\burl\let\urlalt\burlalt\fi

Unfortunately although this breaks the \htmladdnormallink lines, the
URL appears twice because of the method I'm using.  A solution would
be to switch my \htmladdnormallink to \url and I'm investigating that
but with thousands of references I have to do it carefully.

In the meantime I suggest that breakurl be modified to break the first
argument and only use the second argument for the link.

Exmple code is in the zip file attached.


  Thomas D. Schneider, Ph.D.
  Senior Investigator
  National Institutes of Health
  National Cancer Institute
  Center for Cancer Research
  RNA Biology Laboratory
  Biological Information Theory Group
  Frederick, Maryland  21702-1201
  schneidt at
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/x-zip-compressed
Size: 29719 bytes
Desc: not available
URL: <>

More information about the texhax mailing list.