[OS X TeX] hyperref problem
Nitecki, Zbigniew H.
Zbigniew.Nitecki at tufts.edu
Sun Jun 21 16:58:23 EDT 2020
I just finished writing up a longish (50pp) set of notes using TeXShop; in the process I ran into two sets of problems, one involving hyperref, the other a problem with the TeXShop editor. I’m separating my questions into two emails. This one concerns hyperref, for which I can provide a reasonably minimal example. I’ll address my editor problems in a subsequent email.
I have for quite some time used a modification of the \ref macro in latex, which works as follows: labels are always in the format \label{#1:#2}, where #1
identifies a descriptive term like ’Section” or “Theorem” and #2 identifies which one it is; then when I want to refer back to the labeled item, I write \refer{#1}{#2}
and what gets printed is the descriptive term followd by the number. I found this very useful, particularly in writing a book, to make the spelling and capitalization of cross references uniform.
Here is the style file whose main content is that macro:
All has gone well, and as I recall (it’s been a few years) it seemed to work well with hyperref on my book project as well. But this time something went wrong. There are two problems, but I think only the first can be addressed in this forum.
Here are a short sourcefile and pdf output, as well as a log file:
I find that when I compile this, if I immediately click on one of the (red) hyperlinked items, I am taken to the appropriate page (there are only two pages in this example). However, any subsequent click on a hyperlinked item gives me only a little window showing what the text referred to looks like—it doesn’t go to the appropriate page. I should clarify that this behavior is when I am in view in TeXShop.When I open just the pdf (so it opens in Preview, not in TeXShop, the hyperlinks seem to work.
I don’t know if there is something about the \refer macro that is conflcting with \hyperref, and if so, is there a workaround?
The second hyperref problem is harder to pin down. I actually have a lot of self-defined macros, mostly formatting notation, so in my actual source file,
there were both a number of \usepackage commands in the preamble which referred to my macro packages—as well as pstricks and other packages—and a lot of \newcommands specific to the notes.
I initially had the call to \hperref in the middle of my preamble, and then I was experiencing the problem described by the example. But then I looked at the hyperref manual and it said that the call should come after all the other calls. So I moved it, and all hell broke loose. For example, I had at one point decided to use fraktur in one place in the notes, so put in a short sequence of macros for typing a,b,c, d, and A in fraktur. Most of them were ok, except
\newcommand{\c}{\ensuremath{\mathfrak{c}}} led to an “unknown command” error once the hyperref command was moved to immediately precede the
\begin{document}. Also, one of the pstricks routines I used (pst-ode) defined some parameters via the statement
\pstVerb{
/A -1 def
/B 0 def
/C 0 def
/D -2 def
}
and this led to unknown command errors. (They disappeared if I moved the \hyperref call earlier).
Again, I don’t know what is going on, but this one is harder to correct because there are a lot of possible conflicts spread over many files.
However, I found it strange that this problem only occurred when I moved the hyperref call to the end of the preamble.
So for now, I am not using hyperref in these notes, but would like to.
Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155
telephones:
Office (617)627-3843
Dept. (617)627-3234
Dept. fax (617)627-3966
http://www.tufts.edu/~znitecki/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20200621/187158fc/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: refmacros.sty
Type: application/octet-stream
Size: 1521 bytes
Desc: refmacros.sty
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20200621/187158fc/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestofHyperref.tex
Type: application/octet-stream
Size: 1109 bytes
Desc: TestofHyperref.tex
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20200621/187158fc/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestofHyperref.log
Type: application/octet-stream
Size: 15049 bytes
Desc: TestofHyperref.log
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20200621/187158fc/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestofHyperref.pdf
Type: application/pdf
Size: 25225 bytes
Desc: TestofHyperref.pdf
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20200621/187158fc/attachment.pdf>
More information about the MacOSX-TeX
mailing list