1

I am writing a report where I would like to reduce the time taken to format amino acids and use for the rest of my PhD. I created a command that takes 2 arguments and one optional to format amino acid residues such as αLys232. Some of the amino acids have had post-translational modifications and need referencing with an asterisk after the name (Lys) and before the position number (232) like αLys*232. However, the spacing is not desirable using just * and I was wondering if there were more aesthetic solutions using tikz or another method I am not aware of.

This is how my MWE currently looks:

enter image description here

The one with the normal asterisk has too much space between the name and number (to be expected). The one with \textsuperscript from an answer by @Werner to Shrink size of footnote asterisk would look better with the asterisk positioned a bit more to the left but not directly over the s like an accent. I used the search term asterisk in the The Comprehensive LaTeX Symbol List – Symbols accessible from LaTeX but couldn't find an asterisk accent that looks how I would like. This is (poorly drawn and) what I would like:

enter image description here

How can I shift the \textsuperscript asterisk more to the left to reduce space between the name (Lys) and number or via another method please?

MWE:

\documentclass{article}

\usepackage{textgreek}

\newcommand\normalAsterisk[2]{\MakeUppercase#1*#2}
\newcommand\wernerAsterisk[2]{\MakeUppercase#1\textsuperscript{\footnotesize *}#2} % https://tex.stackexchange.com/a/585874/273733
\newcommand\withoutAsterisk[2]{\MakeUppercase#1#2}
\newcommand\greekAsterisk[3][]{#1\MakeUppercase#2#3}

\begin{document}

\noindent Foo bar baz \greekAsterisk[\textalpha]{lys}{232}.\bigskip

\noindent
\begin{tabular}{ll}
This is without the asterisk & \withoutAsterisk{lys}{232} \\
This is with the normal asterisk & \normalAsterisk{lys}{232} \\
This is with \verb|\textsuperscript| & \wernerAsterisk{lys}{232} \\
\end{tabular}

\end{document}
0

2 Answers 2

2

The math mode asterisk is centered around the math axis

* versus ∗

(the rendering above is just to show the idea).

\documentclass{article}

\DeclareRobustCommand{\aas}{% AminoAcidStar
  \textsuperscript{$*$}%
}

\begin{document}

Lys\aas 232

\end{document}

enter image description here

If you want to reduce the space around the asterisk, you can experiment different values in the following.

\documentclass{article}

\DeclareRobustCommand{\aas}{% AminoAcidStar
  \textsuperscript{$\mkern-1mu*\mkern-1.5mu$}%
}

\begin{document}

Lys\aas 232

\end{document}

enter image description here

An even smaller symbol (but it seems too small)

\documentclass{article}

\DeclareRobustCommand{\aas}{% AminoAcidStar
  \textsuperscript{$\scriptstyle\mkern-1mu*\mkern-1.5mu$}%
}

\begin{document}

Lys\aas 232

\end{document}

enter image description here

2

You can set the font size of the asterisk but also the font size of the superscript to control a bit also the height of the symbol, and use a \makebox to control the space between Lys and 232 according to your taste. If that is not enough, you can always use also \kern and/or a \raisebox to fine tune the x and/or y position of the asterik, respectively. Example:

mwe

\documentclass{article}
\newcommand\wernerAsterisk[2]{\MakeUppercase#1\textsuperscript{\footnotesize *}#2} % https://tex.stackexchange.com/a/585874/273733
\begin{document}
Lys232\par
\wernerAsterisk{lys}{232}\par
Lys{\footnotesize\textsuperscript{\makebox[2pt]{\tiny *}}}232\par 
Lys{\small\textsuperscript{\makebox[0pt]{\tiny\kern-.15em *}}}232\par
\end{document}
1
  • +1 I wish I could tick both answers as they were helpful, I hope this is fine, thanks a lot for the help :)
    – JamesT
    Feb 15, 2023 at 12:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .