Paquete de acrónimos: combine la primera aparición del acrónimo con la siguiente cita/paréntesis

Paquete de acrónimos: combine la primera aparición del acrónimo con la siguiente cita/paréntesis

Estoy usando el acronympaquete. A menudo sucede en mis textos que tengo algo como:

1. We first use a \ac{NA} \citep{exocom2019} and then the text continues.

2. We learn a \ac{VL} (i.e., something we did not know before).

Lo que quedará como lo siguiente en un texto.

  1. Primero utilizamos un Nuevo Acrónimo (NA) (Exocom, 2019) y luego el texto continúa.

  2. Aprendemos una lección valiosa (VL) (es decir, algo que no sabíamos antes).

¿Hay alguna forma en el acronympaquete de hacer esto para poder fusionar los paréntesis? En cierto modo, la salida se convierte en algo como:

  1. Primero usamos un Nuevo Acrónimo (NA; Exocom, 2019) y luego el texto continúa.

  2. Aprendemos una lección valiosa (VL; es decir, algo que no sabíamos antes).

En caso de que alguien tenga otra buena solución o solución alternativa al problema, hágamelo saber.

PD: intenté actualizar los ejemplos y agregar código según lo solicitado. Espero que eso ayude.

PPS: una MWE

--- mwe.tex ---

\documentclass[12pt]{book}

\usepackage[printonlyused]{acronym} % used for the nice acronyms
\usepackage[style=authoryear-comp,citestyle=authoryear,natbib=true,backend=bibtex,maxbibnames=99,maxcitenames=1]{biblatex} %NEW BIB: needed so that bibentry works

\bibliography{mweBib}

\begin{document}

\begin{acronym}
    \acro{NA}{New Acronym} 
    \acro{VL}{Valuable Lesson} 
\end{acronym}

1. We first use a \ac{NA} \citep{exocom2019} and then the text continues.

2. We learn a \ac{VL} (i.e., something we did not know before).
\end{document}

--- mweBib.bib ---

@inproceedings{exocom2019,
  title={My title},
  author={Exocom},
  year={2019},
  booktitle = {Proc. Stackexchange}
}

--- dominio ---

latexmk -pvc mwe.tex

Respuesta1

Esto es posible con el acropaquete:

  • La cita ya está integrada configurando la opción cite/group = truey agregando la cita a la definición del acrónimo.

  • Es posible realizar una adición única redefiniendo la plantilla predeterminada...

      \RenewAcroTemplate{long-short}{%
        \acroiffirstTF{%
          \acrowrite{long}%
          \acspace(%
            \acroifT{foreign}{\acrowrite{foreign}, }%
            \acrowrite{short}%
            \acroifT{alt}{ \acrotranslate{or} \acrowrite{alt}}%
            \acaddition % <<< new
            \acrogroupcite
          )%
        }{%
          \acrowrite{short}%
          \acaddition % <<< new
        }%
      }
    

    ...y el comando \ac:

      \providecommand\acaddition{}
      \RenewAcroCommand\ac{mo}{%
        \IfNoValueF{#2}{\def\acaddition{, #2}}%
        \UseAcroTemplate{first}{#1}%
      }
    

    Los comandos definidos por \NewAcroCommandy amigos son locales para un grupo, por lo que no necesitamos preocuparnos por la definición \acadditionposterior.

Un ejemplo completo:

ingrese la descripción de la imagen aquí

\documentclass{article}

\usepackage[style=authoryear-comp,citestyle=authoryear]{biblatex}
\addbibresource{\jobname.bib}


\begin{filecontents}{\jobname.bib}
@inproceedings{exocom2019,
  title={My title},
  author={Exocom},
  year={2019},
  booktitle = {Proc. Stackexchange}
}
\end{filecontents}

\usepackage{acro}

\RenewAcroTemplate{long-short}{%
  \acroiffirstTF{%
    \acrowrite{long}%
    \acspace(%
      \acroifT{foreign}{\acrowrite{foreign}, }%
      \acrowrite{short}%
      \acroifT{alt}{ \acrotranslate{or} \acrowrite{alt}}%
      \acaddition % <<< new
      \acrogroupcite
    )%
  }{%
    \acrowrite{short}%
    \acaddition % <<< new
  }%
}

\providecommand\acaddition{}
\RenewAcroCommand\ac{mo}{%
  \IfNoValueF{#2}{\def\acaddition{, #2}}%
  \UseAcroTemplate{first}{#1}%
}

\acsetup{
  cite/group = true
}

\DeclareAcronym{NA}{
  short = NA ,
  long = New Acronym ,
  cite = exocom2019
}
\DeclareAcronym{VL}{
  short = VL ,
  long = Valuable Lesson
}

\begin{document}

\begin{enumerate}
  \item We first use a \ac{NA} and then the text continues.
  \item We learn a \ac{VL}[i.e., something we did not know before].
\end{enumerate}

\end{document}

información relacionada