Lista de Siglas sin interlineado

Lista de Siglas sin interlineado

Utilizo el acronympaquete -para mis siglas.

Para crear mi Lista de Acrónimos tengo el siguiente código en mi main.tex:

\usepackage[printonlyused, withpage]{acronym}
...
\section*{List of Acronyms}
\input{../assets/acronyms}

y las siglas.tex se ven así:

\begin{acronym}
...
  \acro{JSON}{JavaScript Object Notation}
  \acro{JSONP}{JavaScript Object Notation with Padding}

  \acro{REST}{Representational State Transfer}
...
\end{acronym}

El resultado es este: ingrese la descripción de la imagen aquí

Realmente no me gustan los espacios entre las siglas y preferiría que no haya espacio entre líneas, como en mi Lista de listados:

ingrese la descripción de la imagen aquí

Respuesta1

Dado que el acronymentorno es en realidad sólo un descriptionentorno, una posibilidad es especificar la naturaleza itemsepdel acronymentorno:

\documentclass{report}
\usepackage[withpage]{acronym}

\begin{document}

\tableofcontents

\section*{List of Acronyms}

\begin{acronym}[JSONP]\itemsep0pt %change this amount as desired
  \acro{JSON}{JavaScript Object Notation}
  \acro{JSONP}{JavaScript Object Notation with Padding}
  \acro{REST}{Representational State Transfer}
\end{acronym}

\section{Foo}

\ac{JSON} and \ac{JSONP}.

\section{Bar}

\ac{REST}.

\end{document}

acrónimo

Respuesta2

El entorno a parchear se llama AC@deflist, al que queremos agregar \setlength{\itemsep}{0pt}.

\documentclass{report}
\usepackage[printonlyused,withpage]{acronym}
\usepackage{xpatch}

\makeatletter
\xpatchcmd{\AC@deflist}
  {\addtolength{\leftmargin}{\labelsep}}
  {\addtolength{\leftmargin}{\labelsep}\setlength{\itemsep}{0pt}}
  {}{}
\makeatother

\begin{document}

\tableofcontents

\section*{List of Acronyms}

\begin{acronym}[JSONP]
  \acro{JSON}{JavaScript Object Notation}
  \acro{JSONP}{JavaScript Object Notation with Padding}
  \acro{REST}{Representational State Transfer}
\end{acronym}

\section{Foo}

\ac{JSON} and \ac{JSONP}.

\section{Bar}

\ac{REST}.

\end{document}

ingrese la descripción de la imagen aquí

Respuesta3

acronymUsos internos description. Por lo tanto, puede (1) redefinir acronymusando su propia estructura de lista o (2) justo antes acronymde redefinir description. Aquí está el segundo enfoque. Agregué \itemsep0pt\parsep0pta la definición estándar de description.

\documentclass{article}

\usepackage{acronym}
\pagestyle{empty}
\begin{document}

\renewenvironment{description}
{\list{}{\labelwidth0pt\itemindent-\leftmargin
    \parsep0pt\itemsep0pt\let\makelabel\descriptionlabel}}
               {\endlist}
\begin{acronym}
  \acro{JSON}{JavaScript Object Notation}
  \acro{JSONP}{JavaScript Object Notation with Padding}
  \acro{REST}{Representational State Transfer}
\end{acronym}
\end{document}

ingrese la descripción de la imagen aquí

ACTUALIZARCuando perpagese utiliza la opción, el paquete agrega un error adicional \\, probablemente un error. Entonces, en este caso también necesitamos redefinir la forma en que el paquete imprime los elementos:

\documentclass{article}
\usepackage[printonlyused, withpage]{acronym}
\pagestyle{empty}
\makeatletter
\def\AC@@acro#1[#2]#3{%
  \ifAC@nolist%
  \else%
  \ifAC@printonlyused%
    \expandafter\ifx\csname acused@#1\endcsname\AC@used%
       \item[\protect\AC@hypertarget{#1}{\aclabelfont{#2}}] #3%
          \ifAC@withpage%
            \expandafter\ifx\csname r@acro:#1\endcsname\relax%
               \PackageInfo{acronym}{%
                 Acronym #1 used in text but not spelled out in
                 full in text}%
            \else%
               \dotfill\pageref{acro:#1}% Sputious \\ deleted
            \fi
          \fi%
    \fi%
 \else%
    \item[\protect\AC@hypertarget{#1}{\aclabelfont{#2}}] #3%
 \fi%
 \fi%
 \begingroup
    \def\acroextra##1{}%
    \@bsphack
    \protected@write\@auxout{}%
       {\string\newacro{#1}[\string\AC@hyperlink{#1}{#2}]{#3}}%
    \@esphack
  \endgroup}
\makeatother

\begin{document}
We use \ac{JSON}, \ac{JSONP}, \ac{REST}.

\renewenvironment{description}
{\list{}{\labelwidth0pt\itemindent-\leftmargin
    \parsep0pt\itemsep0pt\let\makelabel\descriptionlabel}}
               {\endlist}
\begin{acronym}
  \acro{JSON}{JavaScript Object Notation}
  \acro{JSONP}{JavaScript Object Notation with Padding}

  \acro{REST}{Representational State Transfer}
\end{acronym}
\end{document}
 \documentclass{beamer}
    \usepackage{graphicx}
    \begin{document}

    \begin{figure}
    \begin{center}
    \input{tmp1.tex}
    \caption{Enter caption here}
    \label{Enter label here}
    \end{center}
    \end{figure}

  \end{document}

ingrese la descripción de la imagen aquí

Respuesta4

Sé que esto ya tiene algunos años. Sin embargo, tuve el mismo problema y encontré una solución más sencilla que quiero compartir.

Al definir la lista de siglas como en la pregunta:

\begin{acronym}
...
  \acro{JSON}{JavaScript Object Notation}
  \acro{JSONP}{JavaScript Object Notation with Padding}

  \acro{REST}{Representational State Transfer}
...
\end{acronym}

Simplemente agregue el acrónimo más largo entre corchetes después de la declaración de inicio, como este:

\begin{acronym}[JSONP]
...
  \acro{JSON}{JavaScript Object Notation}
  \acro{JSONP}{JavaScript Object Notation with Padding}

  \acro{REST}{Representational State Transfer}
...
\end{acronym}

Sí, eso es todo, \itemsep0ptsólo es necesario si necesita un interlineado personalizado.

información relacionada