Text FormattingHyperlink to Acronyms with acro

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
asmithb
Posts: 24
Joined: Tue Feb 23, 2021 12:04 pm

Hyperlink to Acronyms with acro

Post by asmithb »

Dear Sir or Madam,

I am using the acro package to print my list of acronyms in my table of contents. However, I also want to link the words in the content when I use \ac to the respective acronym in the list. How could I do it? I do not want the page number in the list though. Here are my codes:

Code: Select all

\documentclass[12pt,twoside]{report}
\usepackage{acro,hyperref}
\usepackage[utf8]{inputenc}



\usepackage{dcolumn} %% Chapter 2, format D{}{}{}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}


\DeclareUnicodeCharacter{2061}{}

\usepackage[nottoc,notlot,notlof]{tocbibind}


\acsetup{make-links=true}
\acsetup{list/display=all}

%Adding my tex file with my list of acronyms


\DeclareAcronym{NOC}
{class = A,
    long=National Oil Company,
     short={NOC}
}


\DeclareAcronym{PDVSA}
{class = A,
    long=Petróleos de Venezuela Sociedad Anónima,
     short=PDVSA
}


\DeclareAcronym{YPFB}
{class = A,
    long=Yacimientos Petrolíferos Fiscales Bolivanos,
     short={YPFB}
}



\begin{document}

\tableofcontents

\addcontentsline{toc}{chapter}{List of Acronyms}
\printacronyms[include-classes=A,name=List of Acronyms,heading=chapter*, template=toc,display=all,sort=true]



\chapter{National Oil Companies}
The Bolivian \ac{NOC}, \ac{YPFB}, has played a supervisory role in the industry. In contrast, Venezuela's \ac{PDVSA} plays a direct role in the exploitation of its oil fields.

\end{document}
Last edited by asmithb on Mon Dec 27, 2021 10:30 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Hyperlink to Acronyms with acro

Post by Ijon Tichy »

IMHO your question is quite unclear. See https://latex.org/forum/viewtopic.php?p=116936#p116936. However, maybe section 20 of the acro manual could help you, e.g., option make-links or link-only-first.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
asmithb
Posts: 24
Joined: Tue Feb 23, 2021 12:04 pm

Hyperlink to Acronyms with acro

Post by asmithb »

This is another question. My question here is related to the hyperlinks, not to the table of contents of my previous question (I already solved that problem)
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Hyperlink to Acronyms with acro

Post by Ijon Tichy »

Nevertheless the second sentence in the linked comment is also relevant for this question, because the shown code is still not working and seems not to show your problem. You can try it, using the Run LaTeX here button, below your code.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
asmithb
Posts: 24
Joined: Tue Feb 23, 2021 12:04 pm

Hyperlink to Acronyms with acro

Post by asmithb »

I have added more information to my post, but I still do not know why I cannot run it. I could run it in Overleaf.
Post Reply