0

I haven't been able to look up an answer for this.

The idea is to use the acronym with the greek letter alpha or gamma for example, while using the regular unicode greek character in the text.

The issue with acronym is that putting the unicode character in the acronym will not make it appear in the acronym section but only in the text.

Currently my solution makes it appear as a math alpha in the text :

I'm using Quarto with pdf output, thus using latex :

---
title: "quarto-test-env"
format: pdf
header-includes:
- \usepackage{acronym}
- \usepackage{upgreek}
keep-tex: true
mainfont: "Times New Roman"
---

# Acronyms


\begin{acronym}
  \acro{ifng}[IFN-$\mupgamma$]{interferon gamma}
  \acro{tnfa}[TNF-$\mupalpha$]{tumor necrosis factor alpha}
  \acro{nfkb}[NF-κB]{nuclear factor-kappa B}
\end{acronym}

# Regular text

- \ac{tnfa}
- \ac{ifng}

I want TNF-α and not \ac{tnfa} ; IFN-γ and not \ac{ifng}.
When I use unicode characters in acronym such as \ac{nfkb}, it doesn't display in the acronym but in the regular text only.



I want to make it appear using unicode characters like : TNF-α ; IFN-γ

I'm using Times News Roman as the font.

Is there a solution for that or do I have to scrap the idea ?

Thanks for the help.

5
  • Can you give a full LaTeX document reproducing your issue? I don't immediately see why this wouldn't work.
    – Dai Bowen
    Jun 22 at 14:24
  • Welcome to tex.sx. Jun 22 at 14:29
  • I'm not sure how to share a full document here so here's a gist. This is the .tex file generated by Quarto. gist.github.com/Minh-AnhHuynh/4d67c2d07336399993cb639c594bb43e With this minimal example the acronyms do work, however they are displayed in math mode in the text and not the unicode. I don't know how to make a separate "math for acronym and then unicode for text". Ultimately my problem would be fixed if I could use unicode inside the acronyms. Jun 22 at 14:31
  • @Minh-AnhHuynh I'm still a bit lost. Does $\mupgamma$ produce the γ glyph that you want or not?
    – Dai Bowen
    Jun 23 at 11:38
  • @DaiBowen To be clear, it doesn't produce the greek letter in unicode that I want but it does produce it in math-mode. Basically I want the acronym to work both in their acronym page but also in regular text mode using unicode. It looks weird and incoherent for the reader to have an unusual looking "IFN-γ" just because that's how it is written in regular text in sci papers. If I used "IFN-γ" in unicode as my acronym, it would appear in the text but not in the acronym (it seems the package doesn't support unicode). So I have to use math mode ($\mupgamma$), but another problem appears. Jun 26 at 12:52

1 Answer 1

0

I can't reproduce your issue with characters appearing in text but not the list or vice versa (either from the supplied gist or minimal code) and can't imagine why this might happen. My guess would be there's either something you're not showing or Quarto/pandoc are responsible.

As far as getting upright Greek characters to work with acronym (at least when supplying the optional short form argument) goes, there's nothing special about the use of acronym, it's the same problem as with general text (see e.g. Upright Greek letters in text mode (not upgreek), Upright Lowercase $\pi$, How to easily use UTF-8 with LaTeX?, Upright Greek font fitting to Computer Modern)).

With pdflatex one example would be

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{acronym}
\usepackage{upgreek}
\DeclareUnicodeCharacter{03B3}{$\upgamma$}

\begin{document}
\begin{acronym}
  \acro{ifng}[IFN-γ]{interféron gamma}
  \acro{tnfa}[TNF-$\upalpha$]{tumor necrosis factor alpha}
\end{acronym}

\ac{tnfa}
\ac{ifng}
\end{document}

IFN-γ interféron gamma

TNF-α tumor necrosis factor alpha

tumor necrosis factor alpha (TNF-α) interféron gamma (IFN-γ)

or with lualatex with a suitable font

\documentclass{article}
\usepackage{libertine}
\usepackage{acronym}

\begin{document}
\begin{acronym}
  \acro{ifng}[IFN-γ]{interféron gamma}
  \acro{tnfa}[TNF-α]{tumor necrosis factor alpha}
\end{acronym}

\ac{tnfa}
\ac{ifng}
\end{document}

IFN-γ interféron gamma

TNF-α tumor necrosis factor alpha

tumor necrosis factor alpha (TNF-α) interféron gamma (IFN-γ)

In all these cases, the alpha and gamma characters copy over as the U+03B1 and U+03B3 characters.

5
  • Thank you for your answer. By using the code provided and compiling it with latex (still using RStudio but without using Quarto), they actually do appear! I apologize for my unclear question, I have updated the code provided to display an example of a greek letter not showing such as NF-KB. It seems to me it is Quarto that is doing something to the acronym package and I am not sure what or why. Jul 17 at 14:50
  • Ahhh, what does {\bfseries α} print from your Quarto setup?
    – Dai Bowen
    Jul 17 at 15:04
  • I have used the command and it just prints a bolded alpha. Anyway, I have used the libertine package, and the problem is strangely fixed ? The font looks nice, so perhaps I can use this font from now on, but only if my manuscript doesn't require me to use a specific font. The problem is kind of solved, but does persist for the Times New Roman font. Thank you! Jul 17 at 16:03
  • 1
    Per this discussion, the problem seems to come when using the default KOMA class documentclass. If using a document class article, the issue seems to go away. Unfortunately I am stuck using the scrreprt documentclass because I use the listof=totoc in the document class options. Jul 17 at 16:59
  • Ooh, interesting, that might give me something to go on I'll let you know.
    – Dai Bowen
    Jul 17 at 17:10

You must log in to answer this question.

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