Insertar espacio vertical después de una referencia particular (bibtex)

Insertar espacio vertical después de una referencia particular (bibtex)

Me gustaría insertar un espacio vertical después de una referencia particular en la sección de referencias con BibTeX, idealmente con una secuencia de comandos como:

\cite{ABC-2001} 
\refvspace{1cm} 
\cite{XYZ-2002}

Las referencias se importan con \bibliography{references.bib}. El orden es el orden de citación. El estilo de la bibliografía es personalizado, pero digamos que es \bibliographystyle{unsrt}para mayor precisión.

¿Cómo hacer esto sin modificar el archivo babero?

Un posible punto de partida:

\documentclass{article}
\begin{filecontents}{refs.bib}
@misc{P, author = {P}, year = {2001}}
@misc{Q, author = {Q}, year = {2002}}
@misc{A, author = {A}, year = {2001}}
@misc{B, author = {B}, year = {2002}}
\end{filecontents}

\begin{document}
    This is a survey on different topics.

    \section*{Topic 1}

    Text \cite{P}. Text \cite{Q}.

    \section*{Topic 2}

    % TODO: Visually separate the two topics in the bibliography here

    Text \cite{A}. Text \cite{B}.

    \bibliographystyle{unsrt}
    \bibliography{refs}
\end{document}

Respuesta1

Consideremos su opinión:

\cite{ABC-2001} 
\refvspace{1cm} 
\cite{XYZ-2002}

Podemos asignar alguna \vspacemacro que se relacione con la cita de XYZ-2002. Es decir, llamar \vspace{1cm}en cuanto encuentre \bibitem{XYZ-2002}en la bibliografía.

El siguiente ejemplo mínimo logra esto:

ingrese la descripción de la imagen aquí

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{refs.bib}
@misc{P, author = {P}, year = {2001}}
@misc{Q, author = {Q}, year = {2002}}
@misc{A, author = {A}, year = {2001}}
@misc{B, author = {B}, year = {2002}}
\end{filecontents}

\makeatletter
\let\@refvspace\relax
\providecommand{\refvspace}[1]{%
  \gdef\@refvspace{#1}% Store \refvspace
}
\let\old@cite\cite% Store \cite in \old@cite
\renewcommand{\cite}[1]{%
  \ifx\@refvspace\relax
    % No \refvspace was used
  \else
    \begingroup
    % Create vspace macro
    \edef\x{\endgroup
      \noexpand\global\noexpand\@namedef{#1@vspace}{\noexpand\vspace{\@refvspace}}}\x
    \global\let\@refvspace\relax
  \fi
  \old@cite{#1}}% Process regular \cite
\let\old@bibitem\bibitem% Store \bibitem in \old@bibitem
\renewcommand{\bibitem}[1]{%
  \csname #1@vspace\endcsname% Insert \vspace macro
  \old@bibitem{#1}}% Process regular \bibitem
\makeatother

\begin{document}
This is a survey on different topics.

\section*{Topic 1}

Text \cite{P}. \refvspace{\baselineskip}Text \cite{Q}.

\section*{Topic 2}

\refvspace{1cm}

Text \cite{A}. Text \cite{B}.

\bibliographystyle{unsrt}
\bibliography{refs}

\end{document}

Advertencias:

  • El ejemplo anterior es bastante trivial y elimina los argumentos opcionales de \citey \bibitem. Sin embargo, eso se puede restaurar si es necesario.

  • El contenido no está escrito para el .bibni para el .bbly por lo tanto sólo funcionaría si el\bibliography ocurre lo mismo.despuéstodas tus \refvspacemacros.

información relacionada