![Biblatex를 사용하여 장별 참고문헌에 번호가 없는 장을 포함하는 올바른 방법](https://rvso.com/image/254690/Biblatex%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%EC%9E%A5%EB%B3%84%20%EC%B0%B8%EA%B3%A0%EB%AC%B8%ED%97%8C%EC%97%90%20%EB%B2%88%ED%98%B8%EA%B0%80%20%EC%97%86%EB%8A%94%20%EC%9E%A5%EC%9D%84%20%ED%8F%AC%ED%95%A8%ED%95%98%EB%8A%94%20%EC%98%AC%EB%B0%94%EB%A5%B8%20%EB%B0%A9%EB%B2%95.png)
나는 논문 마지막 부분에 장별 참고문헌을 생성하기 위해 문서 3.11.4
의 예를 사용해 왔습니다 . biblatex
번호가 없는 장에 대한 소개를 시도하기 전까지는 훌륭하게 작동합니다. 그러면 서론에는 서론이 나오지 않습니다. MWE는 다음과 같습니다.
\documentclass{book}
\usepackage[sorting = none, style = numeric, refsegment = chapter, cite reset = chapter]{bib latex}
\usepackage{nameref}
\defbibheading{bibintoc}{%
\addcontentsline{toc}{chapter}{\bibname}%
\section*{References for Chapter \ref{refsegment:\therefsection\therefsegment} - \nameref{refsegment:\therefsection\therefsegment}}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\chapter*{Introduction}
\cite{A01}
\chapter{Chapter 1}
\cite{A01,B02}
\backmatter
\printbibheading
\bibbysegment[heading = bibintoc]
\end{document}
번호가 없는 소개에 대한 참조 섹션을 사용하여 해결 방법을 찾았습니다. 해결 방법의 MWE는 다음과 같습니다.
\documentclass{book}
\usepackage[sorting = none, style = numeric, refsegment = chapter, cite reset = chapter]{bib latex}
\usepackage{nameref}
\defbibheading{bibintoc}{%
\addcontentsline{toc}{chapter}{\bibname}%
\section*{References for Chapter \ref{refsegment:\therefsection\therefsegment} - \nameref{refsegment:\therefsection\therefsegment}}}
\defbibheading{bibintoc2}{%
\addcontentsline{toc}{chapter}{\bibname}%
\section*{References for the \nameref{refsection:\therefsection}}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\chapter*{Introduction}
\begin{refsection}
\cite{A01}
\end{refsection}
\chapter{Chapter 1}
\cite{A01,B02}
\backmatter
\printbibheading
\printbibliography[section=1,heading=bibintoc2]
\bibbysegment[heading = bibintoc]
\end{document}
나는 인용과 함께 번호가 없는 결론을 추가할 때까지 이것에 만족했습니다. 그런 다음 코드가 중단되어 오류를 biblatex
반환합니다 nested refsections
. 이에 대한 MWE는 다음과 같습니다.
\documentclass{book}
\usepackage[sorting = none, style = numeric, refsegment = chapter, cite reset = chapter]{bib latex}
\usepackage{nameref}
\defbibheading{bibintoc}{%
\addcontentsline{toc}{chapter}{\bibname}%
\section*{References for Chapter \ref{refsegment:\therefsection\therefsegment} - \nameref{refsegment:\therefsection\therefsegment}}}
\defbibheading{bibintoc2}{%
\addcontentsline{toc}{chapter}{\bibname}%
\section*{References for the \nameref{refsection:\therefsection}}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\chapter*{Introduction}
\begin{refsection}
\cite{A01}
\end{refsection}
\chapter{Chapter 1}
\cite{A01,B02}
\chapter*{Conclusion}
\begin{refsection}
\cite{C03}
\end{refsection}
\backmatter
\printbibheading
\printbibliography[section=1,heading=bibintoc2]
\bibbysegment[heading = bibintoc]
\end{document}
이 문제를 해결하는 방법에 대한 아이디어가 있습니까? 아니면 문서 의 \chapter*
예를 사용하여 올바르게 구현하는 방법이 더 좋습니다 .3.11.4
biblatex
도움을 주셔서 미리 감사드립니다!
답변1
번호가 없는 장에서 \newrefsegment
및 수동으로 호출할 수 있습니다 .\citereset
\chapter*{Introduction}
\newrefsegment
\citereset
하지만 참고문헌 세그먼트의 제목은 일관되게 형식을 지정할 수 없습니다. 이에 대한 다양한 방법이 있습니다. 여기서는 \chapter
및 \chapter*
.
\documentclass{book}
\usepackage[sorting=none,refsegment=chapter,citereset=chapter]{biblatex}
\usepackage{nameref}
\makeatletter
% Extend biblatex's \chapter patch to \chapter* and save data for titles
\def\blx@refpatch@chapter#1{%
\ifundef\chapter
{\blx@err@nodocdiv{chapter}}
{\pretocmd\@makechapterhead
{#1%
\csdef{subbib:\therefsection\therefsegment}{%
Chapter~\ref{refsegment:\therefsection\therefsegment}}}
{}{\blx@err@patch{\string\@makechapterhead}}%
\pretocmd\@makeschapterhead
{#1%
\csdef{subbib:\therefsection\therefsegment}{%
\nameref{refsegment:\therefsection\therefsegment}}}
{}{\blx@err@patch{\string\@makeschapterhead}}}}
\makeatother
\defbibheading{subbibliography}{%
\section*{References for \csuse{subbib:\therefsection\therefsegment}}}
\addbibresource{biblatex-examples.bib}
\begin{document}
\tableofcontents
\chapter*{Introduction}
\cite{reese}
\chapter{First chapter}
\cite{companion}
\chapter*{Unnumbered chapter}
\cite{glashow,weinberg}
\chapter{Second chapter}
\cite{glashow}
\chapter*{Conclusion}
\cite{reese}
\printbibheading[heading=bibintoc]
\bibbysegment[heading=subbibliography]
\end{document}
이 접근 방식은 장별 참조 섹션에도 적용됩니다.
\documentclass{book}
\usepackage[sorting=none,refsection=chapter]{biblatex}
\usepackage{nameref}
\makeatletter
% Extend biblatex's \chapter patch to \chapter*, save data for titles
\def\blx@refpatch@chapter#1{%
\ifundef\chapter
{\blx@err@nodocdiv{chapter}}
{\pretocmd\@makechapterhead
{#1\csdef{subbib:\therefsection}{Chapter~\ref{refsection:\therefsection}}}
{}{\blx@err@patch{\string\@makechapterhead}}%
\pretocmd\@makeschapterhead
{#1\csdef{subbib:\therefsection}{\nameref{refsection:\therefsection}}}
{}{\blx@err@patch{\string\@makeschapterhead}}}}
\makeatother
\defbibheading{subbibliography}{\section*{References for \csuse{subbib:\therefsection}}}
\addbibresource{biblatex-examples.bib}
\begin{document}
...
\printbibheading[heading=bibintoc]
\bibbysection[heading=subbibliography]
\end{document}
답변2
\endrefsegment
번호가 없는 "결론" 장 이전의 마지막 부분을 수동으로 종료하려면 를 사용해야 합니다 .
\documentclass{book}
\usepackage[sorting = none, style = numeric, refsegment = chapter, cite reset = chapter]{bib latex}
\usepackage{nameref}
\defbibheading{bibintoc}{%
\addcontentsline{toc}{chapter}{\bibname}%
\section*{References for Chapter \ref{refsegment:\therefsection\therefsegment} - \nameref{refsegment:\therefsection\therefsegment}}}
\defbibheading{bibintoc2}{%
\addcontentsline{toc}{chapter}{\bibname}%
\section*{References for the \nameref{refsection:\therefsection}}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\chapter*{Introduction}
\begin{refsection}
\cite{A01}
\end{refsection}
\chapter{Chapter 1}
\cite{A01,B02}
\endrefsegment
\chapter*{Conclusion}
\begin{refsection}
\cite{C03}
\end{refsection}
\backmatter
\printbibheading
\printbibliography[section=1,heading=bibintoc2]
\bibbysegment[heading = bibintoc]
\printbibliography[section=2,heading=bibintoc2]
\end{document}
이것이 즉각적인 문제를 해결하는 동안 서론과 결론에 s를 사용하는 해결 방법은 refsection
이 장에 대해 완전히 독립적인 참고 문헌 레이블을 생성합니다(결론에서 C. Cuthor의 작업에 레이블 "1"이 할당된 방식에 유의하십시오). 다음 솔루션은 s에서만 작동합니다 refsegment
(따라서 전체 문서에 대해 고유한 레이블을 얻습니다).
별표 버전을 사용하지 마십시오
\chapter*
.\chapter
또한서론과 결론을 위해. 이렇게 하면refsegment
해당 장에 (양수) 번호가 할당되고 를 사용하여 해당 참조를 인쇄할 수 있습니다\bibbysegment
.\frontmatter
,\mainmatter
및 를 사용하면\backmatter
서론과 결론에 번호가 없는 장을 만들 수 있습니다. (실제로는 로마자 페이지 번호 매기기로 전환되는 것을 방지하기 위해\boolfalse{@mainmatter}
대신 사용합니다\frontmatter
.)\therefsegment
front-resp 이후 의 값을 저장할 새 카운터를 선언합니다 . 표제의 새로운 정의에 이러한 카운터를 사용하여bibintoc2
앞/주/뒤 참조에 대한 다른 형식을 얻습니다.
\documentclass{book}
\usepackage[sorting=none,style =numeric,refsegment=chapter,citereset=chapter]{biblatex}
\usepackage{nameref}
\newcounter{segmentendfront}
\newcounter{segmentendmain}
\defbibheading{bibintoc2}{%
\addcontentsline{toc}{chapter}{\refname}%
\section*{\refname\ for
\ifnumgreater{\therefsegment}{\value{segmentendfront}}{%
\ifnumgreater{\therefsegment}{\value{segmentendmain}}{%
the
}{%
Chapter~\ref{refsegment:\therefsection\therefsegment} --
}%
}{%
the
}%
\nameref{refsegment:\therefsection\therefsegment}%
}%
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\boolfalse{@mainmatter}% instead of \frontmatter, which would also switch
%to Roman page numbering
\chapter{Introduction}
\cite{A01}
\mainmatter
\setcounter{segmentendfront}{\therefsection\therefsegment}
\chapter{First chapter}
\cite{A01,B02}
\chapter{Second chapter}
\cite{B02}
\backmatter
\setcounter{segmentendmain}{\therefsection\therefsegment}
\chapter{Conclusion}
\cite{C03}
\printbibheading
\bibbysegment[heading=bibintoc2]
\end{document}
답변3
나는 당신이 이것을 할 수 있다고 생각합니다 :
\chapter*{Introduction}
\begin{refsegment}
\cite{A01}
\end{refsegment}
편집: 결론에 대한 참조 세그먼트의 문제는 두 번째 참조 세그먼트가 있다는 것이 아니라 옵션을 사용하면 명령 refsegment=chapter
이 \chapter
a \begin{refsegment}
(또는 아날로그 항목)를 삽입하고 `\chapter*에 의해 닫히지 않는다는 것입니다.
결론이 나오기 전에 이 세그먼트를 중지할 수 있습니다.
\endrefsegment
\chapter*{Conclusion}
(더 나은 해결책은 패치하는 것입니다 \chapter*
.)