.png)
BibTeX를 사용하여 참조 섹션의 특정 참조 뒤에 수직 공백을 삽입하고 싶습니다. 이상적으로는 다음과 같은 일련의 명령을 사용합니다.
\cite{ABC-2001}
\refvspace{1cm}
\cite{XYZ-2002}
참조는 으로 가져옵니다 \bibliography{references.bib}
. 순서는 인용순입니다. 참고문헌 스타일은 사용자 정의 스타일이지만 \bibliographystyle{unsrt}
명확성을 위한 것이라고 가정하겠습니다.
bib 파일을 수정하지 않고 이를 수행하는 방법은 무엇입니까?
가능한 출발점:
\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}
답변1
귀하의 의견을 고려해 보겠습니다.
\cite{ABC-2001}
\refvspace{1cm}
\cite{XYZ-2002}
\vspace
에 대한 인용에 연결되는 일부 매크로를 할당할 수 있습니다 XYZ-2002
. 즉, 참고 문헌에서 \vspace{1cm}
찾은 즉시 전화하세요.\bibitem{XYZ-2002}
다음의 최소 예제는 이를 달성합니다.
\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}
주의사항:
위의 예는 매우 간단하며
\cite
및 에서 선택적 인수를 제거합니다\bibitem
. 그러나 필요한 경우 복원할 수 있습니다..bib
콘텐츠는 또는 에 기록되지 않으므로.bbl
다음 경우에만 작동합니다.\bibliography
다음이 발생하는~ 후에모든\refvspace
매크로.