<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Zbigniew,<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 22 Jun 2020, at 6:58 am, Nitecki, Zbigniew H. <<a href="mailto:Zbigniew.Nitecki@tufts.edu" class="">Zbigniew.Nitecki@tufts.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">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.
<div class=""><br class="">
</div>
<div class="">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</div>
<div class="">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}</div>
<div class="">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.</div>
<div class="">Here is the style file whose main content is that macro:</div>
<div class=""></div>
</div>
<div style="word-wrap:break-word; line-break:after-white-space" class="">
<meta content="text/html; charset=utf-8" class="">
<div class=""></div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class="">Here are a short sourcefile and pdf output, as well as a log file:</div>
<div class=""><br class="">
</div>
<div class=""></div>
</div>
<div style="word-wrap:break-word; line-break:after-white-space" class="">
<meta content="text/html; charset=us-ascii" class="">
<div class=""></div>
</div>
<div style="word-wrap:break-word; line-break:after-white-space" class="">
<meta content="text/html; charset=us-ascii" class="">
<div class=""></div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class=""></div>
<div class="">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.</div>
<div class="">I don’t know if there is something about the \refer macro that is conflcting with \hyperref, and if so, is there a workaround?</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>No. This will not have anything to do with the (back-end) macros that you use.</div>
<div><br class="">
</div>
<div>The small (Prelink) window is a feature added quite recently (say within 3 years).</div>
<div>It was used in Skim for awhile before it came into TeXshop’s Preview.</div>
<div>Someone else might be able to say exactly when (and why) this feature has been added to the TeXshop front-end.</div>
<div>It should show up simply by hovering your mouse over the active rectangle which is associated with the hyperlink.</div>
<div>Then actually clicking within that rectangle should activate the link as previously.</div>
<div>It may be that once the small Prelink window comes up, you cannot tell where the active rectangle is anymore,</div>
<div>or it may be completely obscured. </div>
<div>Is there a setting to shift where the Prelink window is located, w.r.t. the active rectangle?</div>
<div>Again, someone else may be able to answer this question.</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class=""><br class="">
</div>
<div class="">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,</div>
<div class="">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.</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
Not at all uncommon.</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class="">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.</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Yes.</div>
<div>That recommendation in the hyperref manual was made roughly 20 years ago.</div>
<div>The reasoning is that quite a few macros need to be patched to support automatic creation</div>
<div>of advanced PDF features, such as Bookmarks, hyperlinked cross-references to sections,</div>
<div>citations, etc. as well as external hyperlinking.</div>
<div>It was then thought that it was best to delay Hyperref until as late as possible, so that when it does </div>
<div>its patching, it will build on top of whatever other packages may have done themselves, earlier</div>
<div>within the preamble.</div>
<div><br class="">
</div>
<div>Such advice is now grossly out-dated.</div>
<div>There are better ways to delay the patching until other packages have been loaded.</div>
<div>Nowadays I find it best to load hyperref as early as possible, so that you know what </div>
<div>you have and can build on top of that (using the better methods).</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div>Another thing that is very important is that you don’t define home-grown macros</div>
<div>with names that will be altered by Hyperref, because they are standard in many</div>
<div>ways although you do not actually use them yourself. </div>
<div><br class="">
</div>
<div>This next problem is an example of exactly this.</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class=""> 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</div>
<div class="">\newcommand{\c}{\ensuremath{\mathfrak{c}}} led to an “unknown command” error once the hyperref command was moved to immediately precede the </div>
<div class="">\begin{document}.  </div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>I’m surprised that  \newcommand{\c}{… }  doesn’t throw an error immediately.</div>
<div> \c  is the accent command for a cedilla, as is rather common in French and other languages.</div>
<div>By making this definition, you will never be able to properly typeset a co-author or citation-author’s name</div>
<div>such as   Fran\c{c}ois .</div>
<div><br class="">
</div>
<div>This affects hyperref, because in the advanced features it supports, it is necessary to declare </div>
<div>such macro names for encodings other than ones directed at specific font characters.</div>
<div>Hence all macros in commonly-used language encodings also become defined whenever hyperref is required. </div>
<div><br class="">
</div>
<div><br class="">
</div>
<div>In my mind, having single-letter user-defined macros is a real no-no.</div>
<div>Very many letters are used this way already for various languages and encodings.</div>
<div>Thus you are just asking for trouble when using hyperref, unless you are very careful</div>
<div>in how you choose macro names.</div>
<div><br class="">
</div>
<div>Trying to find single-letter names that are not already used, and remembering what you defined them for </div>
<div>is just a fool’s game. Better is to be more descriptive: e.g.  \frakc  in your case.</div>
<div>Yes, it’s more typing, at first; but with copy/paste and/or command completion it really is not so.</div>
<div>Furthermore, your LaTeX sources become easier to read and understand/proofread  than when every</div>
<div>3rd or 4th letter is a backslash.</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div>Even 2-letter names commonly have another use.   (\it, \rm, \tt, \sc, \sf, \ij, \dj, \dz , … )</div>
<div>The only 2-letter combinations that I use are ones that clearly jolt the mind as to</div>
<div>their intended meaning; e.g. \RR , \QQ, \CC  etc. for  \mathbb  letters, or bold-face symbols.</div>
<div>Using \bb, \cc, \xx, \yy etc.  for vectors is generally acceptable, but beware \tt  and that  \aa  and \AA </div>
<div>already have a meaning.   (think the symbol for Angstrøm units, or in Swedish names).</div>
<div><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class="">Also, one of the pstricks routines I used (pst-ode) defined some parameters via the statement </div>
<div class="">
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
                \pstVerb{</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
                <span class="x_Apple-tab-span" style="white-space:pre"></span>/A -1 def</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
                <span class="x_Apple-tab-span" style="white-space:pre"></span>/B 0 def</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
                <span class="x_Apple-tab-span" style="white-space:pre"></span>/C 0 def</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
                <span class="x_Apple-tab-span" style="white-space:pre"></span>/D -2 def</div>
<div class="" style="margin:0px; font-stretch:normal; font-size:12px; line-height:normal">
                }</div>
<div class="">and this led to unknown command errors.  (They disappeared if I moved the \hyperref call earlier).</div>
<div class="">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.</div>
<div class="">However, I found it strange that this problem only occurred when I moved the hyperref call to the end of the preamble.</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Not so strange, when you realise that  hyperref  is encountering a macro name that it is trying to declare</div>
<div>for a standard meaning, but it has been usurped by something already defined.</div>
<div> </div>
<blockquote type="cite" class="">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class="">
<div class="">So for now, I am not using hyperref in these notes, but would like to.</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>My advice is to go back to loading it early,</div>
<div>and take great care about resolving any errors that you may encounter.</div>
<div><br class="">
</div>
<div>If you have lots of foreign names in your References, check them to make sure</div>
<div> a.  that they are actually typeset correctly;</div>
<div> b.  try to Copy/Paste your whole reference section into a text-file; check</div>
<div>      for errors in the spellings that may result.</div>
<div><br class="">
</div>
<div>Also, I recommend doing:</div>
<div><br class="">
</div>
<div> c.  load the  pdfx  package to generate PDF/A-2u output, to attempt to conform to</div>
<div>      a published standard for Archivability.</div>
<div><br class="">
</div>
<div>There is a lot of stuff in there specifically to allow you to detect and fix the kinds of</div>
<div>errors that are discussed above.</div>
<div>But you’ll need to check your PDFs with validation software.</div>
<div>There are a number of online PDF/A validators, so you don’t need to have purchased</div>
<div>a licence for Acrobat Pro, or other costly software. </div>
<div>(But if your institution gives you cheap access to Acrobat Pro, then it is well worth having.)</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div>Hope this helps.</div>
<div><br class="">
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Ross</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class="">
<div class=""><span class="x_Apple-style-span" style="border-collapse:separate; font-variant-ligatures:normal; font-variant-east-asian:normal; line-height:normal; border-spacing:0px"><span class="x_Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<div class="" style="word-wrap:break-word"><span class="x_Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
<div class="" style="word-wrap:break-word">
<div class="">
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica"><br class="x_Apple-interchange-newline">
Zbigniew Nitecki</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica">Department of Mathematics</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica">Tufts University</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica">Medford, MA 02155</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font:normal normal normal 12px/normal Helvetica; min-height:14px; font-size:12px">
<br class="">
</div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica">telephones:</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica">Office<span class="x_Apple-converted-tab">    </span>(617)627-3843</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica">Dept.<span class="x_Apple-converted-tab">    </span>(617)627-3234</font></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-size:12px">
<font face="Helvetica" size="3" class="" style="font:normal normal normal 12px/normal Helvetica">Dept. fax<span class="x_Apple-converted-tab">    </span>(617)627-3966</font></div>
<span class="x_Apple-style-span" style="font-size:12px"><a href="https://protect-au.mimecast.com/s/70g7Cvl1g2Sv3J4gsQiUiV?domain=tufts.edu/" class="">http://www.tufts.edu/~znitecki/</a></span></div>
</div>
</span><br class="x_Apple-interchange-newline">
</div>
</span><br class="x_Apple-interchange-newline">
</span><br class="x_Apple-interchange-newline">
</div>
<br class="">
</div>
</div>
</div>
<span id="cid:574F147168245346B325733C40CA3CC4@namprd05.prod.outlook.com"><refmacros.sty></span><span id="cid:9E3CE2B30D08894686866724D8EAE339@namprd05.prod.outlook.com"><TestofHyperref.tex></span><span id="cid:8AD7555D046A4047BCD16F87B0B9D4E2@namprd05.prod.outlook.com"><TestofHyperref.log></span><span id="cid:fd70d1a2-2759-4266-869c-b87c5986bcf3@namprd05.prod.outlook.com"><TestofHyperref.pdf></span>-----------
 Please Consult the Following Before Posting -----------<br class="">
TeX FAQ: <a href="https://protect-au.mimecast.com/s/haBqCwV1jpSoW5PQSqKkVT?domain=tex.ac.uk" class="">
https://protect-au.mimecast.com/s/haBqCwV1jpSoW5PQSqKkVT?domain=tex.ac.uk</a><br class="">
List Reminders and Etiquette: <a href="https://protect-au.mimecast.com/s/-dmXCxngGkfZ3pB0SY9yff?domain=sites.esm.psu.edu" class="">
https://protect-au.mimecast.com/s/-dmXCxngGkfZ3pB0SY9yff?domain=sites.esm.psu.edu</a><br class="">
List Archives: <a href="https://protect-au.mimecast.com/s/uahlCyoj8PuYRGJWSR9OPu?domain=dir.gmane.org" class="">
https://protect-au.mimecast.com/s/uahlCyoj8PuYRGJWSR9OPu?domain=dir.gmane.org</a><br class="">
               <a href="https://protect-au.mimecast.com/s/1KPVCzvkmpfKAXnBto1_x6?domain=email.esm.psu.edu" class="">https://protect-au.mimecast.com/s/1KPVCzvkmpfKAXnBto1_x6?domain=email.esm.psu.edu</a><br class="">
TeX on Mac OS X Website: <a href="https://protect-au.mimecast.com/s/w7VKCANpnDCjzxVofMkjBJ?domain=mactex-wiki.tug.org" class="">
https://protect-au.mimecast.com/s/w7VKCANpnDCjzxVofMkjBJ?domain=mactex-wiki.tug.org</a><br class="">
List Info: <a href="https://protect-au.mimecast.com/s/u3O0CBNqgBCvOxAmsv1q37?domain=email.esm.psu.edu" class="">
https://protect-au.mimecast.com/s/u3O0CBNqgBCvOxAmsv1q37?domain=email.esm.psu.edu</a><br class="">
</blockquote>
</div>
<br class="">
<div class=""><br class="">
Dr Ross Moore<br class="">
Department of Mathematics and Statistics 
<div class="">12 Wally’s Walk, Level 7, Room 734<br class="">
Macquarie University, NSW 2109, Australia<br class="">
T: +61 2 9850 8955  |  F: +61 2 9850 8114<br class="">
M:+61 407 288 255  |  E: <a href="mailto:ross.moore@mq.edu.au" class="">ross.moore@mq.edu.au</a><br class="">
<a href="http://www.maths.mq.edu.au" class="">http://www.maths.mq.edu.au</a></div>
<a href="http://mq.edu.au/" target="_blank" style="font-size: 12px; line-height: normal;" class=""></a></div>
<br class="">
</div>
</body>
</html>