
솔루션을 조정하려고 노력 중입니다.여기그리고여기. 내 목표는 다음과 같습니다. 참고문헌을 두 섹션으로 나누기를 원합니다. 첫 번째 섹션 자체는 인용 유형에 따라 여러 하위 섹션으로 분할되어야 하며, 이 첫 번째 섹션의 인용에는 추가 접두사가 있고 AO
색상이 지정되어야 합니다. 두 번째 섹션의 인용에는 접두어, 특정 분할 및 색상이 없습니다.
다음 코드를 사용하면 거의 만족스러운 결과를 얻을 수 있습니다.
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{file1.bib}
@article{article1,
author = {Onymous, Anne},
title = {First Bibliography: An Journal Article},
date = {2000},
}
@inproceedings{inproc1,
author = {Onymous, Anne},
title = {First Bibliography: A Conference Article},
date = {1899},
}
\end{filecontents}
\begin{filecontents}{file2.bib}
@article{article2,
author = {Writer, William},
title = {Second Bibliography: A First Reference},
date = {2010},
}
@article{article2bis,
author = {Poetaster, Paula},
title = {Second Bibliography: A Second Reference},
date = {1767},
}
\end{filecontents}
\usepackage[
backend=biber,
hyperref=true,
backref=true,
giveninits=true,
citestyle=numeric-comp,
bibstyle=numeric,
sortcites=false,
maxbibnames=99,
maxcitenames=2,
sorting=none,
defernumbers=true,
]{biblatex}
\addbibresource{file1.bib}
\addbibresource{file2.bib}
\usepackage[dvipsnames]{xcolor}
% https://tex.stackexchange.com/questions/470852/different-colors-for-each-bib-file-and-custom-prefix
\DeclareSourcemap{
\maps[datatype=bibtex,overwrite]{
\map{
\perdatasource{file1.bib}
\step[fieldset=keywords, fieldvalue={,mypapers}, append]
}
}
\maps[datatype=bibtex,overwrite]{
\map{
\perdatasource{file2.bib}
\step[fieldset=keywords, fieldvalue={,otherpapers}, append]
}
}
}
% https://tex.stackexchange.com/questions/368247/how-to-colorise-specific-entries-in-the-bibliography-and-corresponding-reference
\renewbibmacro{in:}{}
\DeclareFieldFormat{labelprefix}{%
\ifkeyword{mypapers}
{\textcolor{red}{#1}}
{#1}}
\DeclareFieldFormat{labelnumber}{%
\ifkeyword{mypapers}
{\textcolor{red}{#1}}
{#1}}
\begin{document}
\title{Citation Test}
\author{Ann Onymous}
\maketitle
\cite{inproc1} \cite{article1} \cite{article2} \cite{article2bis}
\section*{Publications}
\newrefcontext[labelprefix=AO]
\printbibliography[type=inproceedings,keyword=mypapers,heading=subbibliography,title={Publications in Conference Post-Proceedings}]
\printbibliography[type=article,keyword=mypapers,heading=subbibliography,title={Journal Articles}]
\newrefcontext
\printbibliography[keyword=otherpapers]
\end{document}
그러나 표기가 잘못되어 인용은 각각 AO1
, AO1
다시, 2
로 표기됩니다 3
. 이상적으로는 첫 번째 섹션의 모든 인용이 고유한 카운터를 공유하도록 하고(예 AO1
: AO2
, 등으로 라벨 지정) 두 번째 섹션의 인용은 1부터 다시 시작하도록(즉 1
, 2
, 등으로 라벨 지정 ) 싶습니다 . 나는 첫 번째 것이 끝나는 곳, 즉 3
이 예에서는 시작하는 것에 만족할 것입니다 . 하지만 동일한 레이블로 두 개의 서로 다른 인용을 갖는 것은 불가능합니다…
을 제거하면 newrefcontext
예상한 대로 색상이 지정되고 고유한 번호가 부여되지만 접두사가 없어져서 아쉽습니다.
resetnumbers
의 키를 찾았 \printbibliography
지만 제대로 사용하는 방법을 찾지 못했습니다.
답변1
resetnumbers
거의 다 왔습니다. 명령 에 몇 가지만 있으면 됩니다 \printbiliography
.
\newrefcontext[labelprefix=AO]
\printbibliography[type=inproceedings,keyword=mypapers,heading=subbibliography,title={Publications in Conference Post-Proceedings}]
\printbibliography[resetnumbers=false,type=article,keyword=mypapers,heading=subbibliography,title={Journal Articles}]
\newrefcontext
\printbibliography[resetnumbers=true,keyword=otherpapers]
을 사용할 때는 defernumbers
가지고 있는 각 도구의 실행 횟수에 주의해야 합니다. 보조 파일이 전혀 없는 깨끗한 상태로 시작하십시오(대부분의 편집기에는 모든 등의 파일을 삭제하는 "깨끗한" 기능이 있습니다 .aux
) .bcf
. 그런 다음 latex->biber->latex->latex
. 사용 latex
후 두 번 실행하는 것이 중요합니다 (문서 참조). 대부분의 IDE에서는 using이 필요하다는 경고 와 함께 이 작업을 수행하라고 지시합니다 .biber
defernumbers
biblatex
defernumbers
기술 참고 사항: 모든 참고 문헌 필터링 시스템 type
및 keyword
옵션 \printbibliography
과 함께 고급 필터링 \defbibfilter
및 작업이 완료된 \defbibcheck
후 작동 하므로 데이터 목록에는 필터링 없이 정렬 순서로 모든 항목이 여전히 포함됩니다. 따라서 항목을 필터링할 때 기본적으로 순서/번호 지정에 "구멍"이 남으므로 필터링이 적용된 후 번호 지정을 다시 실행 해야 하므로 추가 실행이 필요합니다.biber
.bbl
defernumbers
latex