cgnieder / acro

acronyms for LaTeX
LaTeX Project Public License v1.3c
40 stars 9 forks source link

Printed acronym cannot be written on two lines #257

Open leo-leesco opened 1 year ago

leo-leesco commented 1 year ago

Description

I observed this weird behaviour : when I use the short form (composed of multiple words) of an acronym, it appears that it is does not switch lines. I am clueless as to what is causing that, even after trying to go through the .sty.

Thanks for your help !

Preamble

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{babel}

\usepackage{acro}
\acsetup{
    short-plural-ending={},
    make-links=true,
    case-insensitive=true,
    list/sort=true,
    list/heading=chapter*,
    pages/display=all,
    use-id-as-short,
}

\NewAcroPreset{shortcut}{
    first-style=long,
    subsequent-style=alt,
    tag={shortcut},
}

\NewAcroPreset{id=short}{
    short-format={\MakeUppercase},
}

\usepackage[hidelinks]{hyperref}

It seems like the problem is caused by using hyperref (when disabled, all works fine).

MWE

\documentclass[a4paper,11pt,french,oneside]{report} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{textcomp}

% #region acro
\usepackage{acro}
\acsetup{
    short-plural-ending={},
    make-links=true,
    case-insensitive=true,
    list/sort=true,
    list/heading=chapter*,
    pages/display=all,
    use-id-as-short,
}

\NewAcroPreset{test}{
    first-style=short,
    tag={test},
    format={\bfseries\MakeUppercase}
}

\DeclareAcronym{test}{
    short={shoooooooort teeeeeeeest},
    long={loooooooooong teeeeeeeest},
    preset={test},
}

\usepackage[hidelinks]{hyperref} % comment to show the various behaviours

\begin{document}

% normal paragraph

a very long line that does not stop as long as it does not crash \ac{test} qsdfqsdfyug qsdfiugy and blablabla. At this point I'm just trying to show where the line overflows as a comparison

\paragraph{a very long} line that does not stop as long as it does not crash \acl{test} qsdfqsdfyug qsdfiugy and blablabla. At this point I'm just trying to show where the line overflows as a comparison

\end{document}

mwe.pdf