
스타일 파일의 경우 참조 앞에 승인 단락/텍스트 섹션을 자동으로 생성하고 싶습니다(사용자 제공 매크로에 의해 설정된 일부 옵션에 따라). 이 접근 방식은 bibtex
및 에서 모두 작동해야 합니다 biblatex
. 어떻게 해야 하나요?
bibtex를 사용할 때 다음을 앞에 추가하여 이를 달성할 수 있습니다 thebibliography
.
\BeforeBeginEnvironment{thebibliography}{%
\section{Acknowledgements}%
Example text.%
}
이것은 biblatex에서는 작동하지 않습니다. 패치를 해보았습니다\printbibliography
\pretocmd\printbibliography{%
\section{Acknowledgements}%
Example text.%
}{}{}%
그러나 이것은 작동하지 않습니다. 이에 대한 쉽고 우아한 해결책이 있습니까?
++++ MWE 제공을 위한 업데이트
MWE를 제공하지 않은 것에 대해 사과드립니다. 하나의 참조를 포함하는 template.bib가 있다고 가정합니다.
@article{RSA78,
author = {Ronald L. Rivest and Adi Shamir and Leonard M. Adleman},
title = {A Method for Obtaining Digital Signatures and Public-Key Cryptosystems},
pages = {120--126},
year = {1978},
journal = {Communications of the ACM},
volume = {21},
number = {2},
publisher = {ACM New York, NY, USA},
doi = {10.1145/359340.359342},
}
그런 다음 참조 표시 전에 자동으로 단락/섹션을 삽입하고 싶습니다(작성자가 명령을 수정하지 않고). 이것은 MWE입니다:
\documentclass{article}
\begin{document}
This is an example citation~\cite{RSA78}.
\bibliographystyle{alphaurl}
\bibliography{template}
\end{document}
Bibtex를 사용할 때 다음을 사용하여 이를 달성할 수 있습니다.
\documentclass{article}
\usepackage{etoolbox}
\BeforeBeginEnvironment{thebibliography}{%
\section*{Acknowledgements}%
Section text.%
}
\begin{document}
This is an example citation~\cite{RSA78}.
\bibliographystyle{alphaurl}
\bibliography{template}
\end{document}
biblatex/biber를 사용하여 이를 수행하는 방법은 무엇입니까? MWE:
\documentclass{article}
\usepackage{biblatex}
\addbibresource{template.bib}
\begin{document}
This is an example citation~\cite{RSA78}.
\printbibliography
\end{document}
메모 옵션을 사용해도 \printbibliography
원하는 결과를 얻을 수 없습니다.
답변1
biblatex
이러한 종류의 삽입을 위한 인프라가 이미 있으므로 이를 수행하기 위해 내부를 재정의할 필요가 없습니다. 즉, 로 정의된 Bibnote를 선택할 수 있는 prenote
옵션 입니다 . 실제 사용 사례에 따라 호출할 때 설정하거나 를 사용하여 전역 기본값을 설정할 수 있습니다. 이 예에서는 더 의미가 있을 것 같아서 기본값으로 설정하고 로컬로 설정합니다 .\printbibliography
\defbibnote
\printbibliography
\DeclarePrintbibliographyDefaults
prenote
title
\documentclass{article}
\usepackage{biblatex}
\addbibresource{template.bib}
\defbibnote{myprenote}{Section text.}
\DeclarePrintbibliographyDefaults{prenote=myprenote}
\begin{document}
This is an example citation~\cite{RSA78}.
\printbibliography[title=Acknowledgements]
\end{document}
편집하다: 댓글에서 밝혀진 대로(하지만 댓글은 나중에 수정했습니다...) 실제로 원했던 것은 제목 자체 이전의 내용이었습니다. 이를 위해 다음을 설정할 수 있습니다 \defbibheading
.
\documentclass{article}
\usepackage{biblatex}
\addbibresource{template.bib}
\defbibheading{myheading}[\bibname]{%
\section*{Acknowledgements}%
Section text.%
\section*{#1}%
\markboth{#1}{#1}}
\DeclarePrintbibliographyDefaults{heading=myheading}
\begin{document}
This is an example citation~\cite{RSA78}.
\printbibliography
\end{document}