duetosymmetry / orcidlink-LaTeX-command

LaTeX style file to add a macro for inserting a linked ORCiD logo
Other
97 stars 49 forks source link

Investigate aastex spacing issue #3

Open jsdillon opened 2 years ago

jsdillon commented 2 years ago

Hi Leo!

Thanks for putting together this helpful package!

I ran into an issue using this package with AASTeX63. If I do \author{Joshua~S.~Dillon\,\orcidlink{0000-0003-3336-9958}} as suggested by the readme, I get:

image

This was fixed by adding some negative space with \!, i.e. \author{Joshua~S.~Dillon\,\orcidlink{0000-0003-3336-9958}\!\!}.

image

I'm not sure if this is just a request to clarify the documentation or if there's a way to make the package pay nicer with commas.

duetosymmetry commented 2 years ago

Nice catch! I did not see this in my test because I only had one author in my test document, so no comma. Ideally we should figure out where the extra space is coming from. This is some interaction between either aastex and TikZ, or perhaps more likely, aastex has (improperly) redefined the \href command from hyperref. Notice that even within ordinary body text (which doesn't get the extra processing that \author gets), there is an extra space afterwards. Anyway, I tested the same thing in a different class (revtex), and did not get an extra space—so it's not something I can fix without digging into aastex to figure out the origin.

jsdillon commented 2 years ago

I figured it was something silly with aastex. Maybe just make a note in the README and call it a day? Your call.

duetosymmetry commented 2 years ago

I'm going to change this issue to be 'investigate aastex spacing issue', so that I later remember to figure out if it's due to aastex interacting strangely with TikZ or hyperref. Once I figure out why, I'll add a section on known interaction with other packages (which I think is recommended practice on the CTAN).

jsdillon commented 2 years ago

Sounds reasonable. LMK if you have trouble replicating the issue.

duetosymmetry commented 2 years ago

I've tracked down that the interaction is between aastex and TikZ, not aastex and hyperref. It does not have to do with which particular TikZ commands are inside the tikzpicture environment. You can get rid of almost everything and still see the same spacing issue in aastex, but not revtex:

\makeatletter
\newcommand{\orcidlinktest}[1]{%
\setlength{\@curXheight}{\fontcharht\font`X}%
\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight,%
xscale=\@OrigHeightRecip*\@curXheight,transform shape]%
\draw (0,0) circle [radius=10em];%
\end{tikzpicture}%
}
\makeatother

...

\begin{document}

...

Body\orcidlinktest{0000-0000-0000-0000}surfing

The two attached images are from respectively aastex and revtex.

image image

I'm on vacation right now so I'm going to stop trying to figure this out...