%20%EC%82%AC%EC%9A%A9.png)
문서에 두 개의 참고문헌(쉬움)을 생성해야 하며, 번호를 매겨야 하며(쉬움), 고유한 \cite
-명령(예: 카테고리로 수행 가능)으로 채워져야 합니다. 문제는 일부 bib 항목이 두 참고 문헌에 모두 있어야 할 가능성이 있다는 것입니다. 여기서 다음 예에서 볼 수 있듯이 문제가 시작됩니다.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=numeric,defernumbers,sortcites]{biblatex}
\DeclareBibliographyCategory{related}
\DeclareBibliographyCategory{main}
\DeclareCiteCommand{\cite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\addtocategory{main}{\thefield{entrykey}}%
\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\citer}[\mkbibparens]
{\usebibmacro{prenote}}
{\addtocategory{related}{\thefield{entrykey}}%
\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\addbibresource{biblatex-examples.bib}
\begin{document}
\cite{shore,sarfraz,spiegelberg}
\citer{spiegelberg}
\cite{weinberg}
\citer{sigfridsson}
\printbibliography[category=main,title=Main List,resetnumbers]
\DeclareFieldFormat{labelnumberwidth}{\mkbibparens{#1}}
\printbibliography[category=related,resetnumbers,title=Related Documents]
\end{document}
Spiegelberg 항목은 첫 번째 참고문헌에서 3번을 가져야 합니다. (그리고 에서 인용할 때 \cite
, 두 번째에서 2번, 에서 인용할 때 \citer
. 나는 지금 보고 있습니다. refsection
(만약 누군가 그것을 "중단하고 재개"할 수 있다면 작동할 것입니다), \DeclareSourceMap
(to 항목 복사) 및 기타 사항이 있지만 실제로는 좋아 보이지 않습니다. 누군가 그것을 수행하는 방법을 알고 있습니까?
답변1
질문에 대한 두 가지 해결책을 찾았습니다.
최신 버전의 biblatex (및 biber 2.0) 사용
항목을 "복제"할 수 있습니다.https://github.com/plk/biblatex/issues/297)
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=numeric,defernumbers,sortcites]{biblatex}
\DeclareBibliographyCategory{related}
\DeclareBibliographyCategory{main}
\DeclareCiteCommand{\cite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\addtocategory{main}{\thefield{entrykey}}%
\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\citer}[\mkbibparens]
{\usebibmacro{prenote}}
{\addtocategory{related}{\thefield{entrykey}}%
\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\addbibresource{biblatex-examples.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\perdatasource{biblatex-examples.bib}
\step[fieldsource=entrykey, match=\regexp{(.*)}, final]
\step[entryclone={rel-$1}]
}
}
}
\begin{document}\nocite{*}
\cite{shore,sarfraz,spiegelberg}
\citer{rel-spiegelberg,rel-springer}
\printbibliography[category=main,title=Main List,resetnumbers]
\DeclareFieldFormat{labelnumberwidth}{\mkbibparens{#1}}
\printbibliography[category=related,resetnumbers,title=Related Documents]
\end{document}
"분할된 참조" 사용
이렇게 하면 다른 인용 명령이 다른 참조 섹션에 배치됩니다. 여기서의 과제는 참조를 일시 중지하고 다시 시작하는 방법을 찾는 것이었습니다. 참조 섹션은 중첩될 수 없으므로 "실제" 참조 섹션이 있는 문서에서는 이 솔루션을 사용할 수 없습니다! 이 솔루션에 대한 토론은 여기에 있습니다.https://github.com/plk/biblatex/issues/307. 시간이 나면 패키지로 변환하겠습니다.
2018의 일부 내부 변경 사항에 맞게 업데이트되었습니다 \blx@refsection@i
.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[sortcites]{biblatex}
\usepackage{xparse,zref}
\addbibresource{biblatex-examples.bib}
\makeatletter
% Commands to label and reference the refsections
% by name. As a refsection can be behind
% \printbibliography a fallback label in the aux is used too
\newcommand\UFblx@labelrefsection[1]{%
\csxdef{refsection@label@#1@num}{\the\c@refsection}%
\zref@setcurrent{default}{\the\c@refsection}%
\zref@labelbyprops{refsection@auxlabel@#1}{default}}
\newcommand\getrefsection[1]{%
\ifcsname refsection@label@#1@num\endcsname
\csname refsection@label@#1@num\endcsname
\else
\zref@extractdefault{refsection@auxlabel@#1}{default}{0}%
\fi}
% a hook at the begin can be useful
\newcommand\splitrefinit[2]{%
\csdef{UFblx@splitrefsection@#1@inithook}{#2}}
\newcommand\UFblx@refsectioncont@i{}
\newcommand\UF@refsectioncont@name{}
\def\UFblx@refsectioncont@i[#1]{%an adapted version of \blx@refsection@i
\endgroup
\ifcsdef{refsection@label@\csuse{UF@refsectioncont@name}@num}%
{\blx@maxsection=\numexpr\csname refsection@label@\csuse{UF@refsectioncont@name}@num\endcsname\relax}%
{\PackageWarning{test}{refsection \UF@refsectioncont@name\space unknown, using refsection 0}{}%
\blx@maxsection=0
}%
\xifinlist{\the\c@refsection}\blx@allrefsections
{}
{\listxadd\blx@allrefsections{\the\c@refsection}}%
\ifcsdef{blx@defaultrefcontexts@\the\c@refsection}
{}
{\global\cslet{blx@defaultrefcontexts@\the\c@refsection}\@empty}%
\ifcsdef{blx@maxsegment@\the\c@refsection}{}%
{\expandafter\newcount\csname blx@maxsegment@\the\c@refsection\endcsname}%
\ifcsdef{blx@sectionciteorder@\the\c@refsection}{}%
{\expandafter\newcount\csname blx@sectionciteorder@\the\c@refsection\endcsname}%
\global\c@refsection\blx@maxsection
\blx@inf@refsec
\blx@secinit
\if@filesw
\blx@auxwrite\@mainaux{}{%
\string\abx@aux@refsection{\the\c@refsection}{\the\c@page}}%
\ifblank{#1}
{}
{\let\blx@bibfiles\@empty
% globals should be first as it might contain macros needed for others
\forlistloop{\listadd\blx@bibfiles}\blx@bibfiles@global}%
\blx@xsanitizeafter{\forcsvlist\blx@refsection@addfile}{#1}%
\blx@refsection@ii
\fi
\endgroup}%
\ExplSyntaxOn
\tl_new:N\l_UFbbx_tmp_biblist_tl
\keys_define:nn {UFbbx}
{
name .tl_set:N = {\UF@refsectioncont@name},
}
\newenvironment{splitrefsection}[1][]%[2][]
{\keys_set_known:nnN {UFbbx} {#1} \l_UFbbx_tmp_biblist_tl
%a hook
\csname UFblx@splitrefsection@\csuse{UF@refsectioncont@name}@inithook\endcsname
%test if new name
\ifcsdef{refsection@label@\csuse{UF@refsectioncont@name}@num}
{%continue known refsection
\let\blx@refsection@i\UFblx@refsectioncont@i
\expandafter\refsection\expandafter[\l_UFbbx_tmp_biblist_tl]
}
{%new labeled refsection:
\expandafter\refsection\expandafter[\l_UFbbx_tmp_biblist_tl]
\UFblx@labelrefsection{\UF@refsectioncont@name}
}
}
{\endrefsection}
\ExplSyntaxOff
\NewDocumentCommand\splitrefcite {r<> o o m}
{\begin{splitrefsection}[name=#1]%
\let\mkbibbrackets\mkbibparens
\IfNoValueTF{#3}
{\IfNoValueTF{#2}
{\cite{#4}}
{\cite[#2]{#4}}}
{\cite[#2][#3]{#4}}%
\end{splitrefsection}}
\DeclareMultiCiteCommand{\@splitrefcites}[\@splitrefwrapper]{\cite}{\multicitedelim}
\newcommand\@splitrefwrapper{}
\NewDocumentCommand\splitrefcites {r<>}
{\renewcommand\@splitrefwrapper[1]{\begin{splitrefsection}[name=#1]\mkbibparens{##1}\end{splitrefsection}}%
\@splitrefcites}
%for the example cites are in parens in splitref.
\splitrefinit{myrefsec}{\let\mkbibbrackets\mkbibparens}
\makeatother
\begin{document}
\cite{shore,sarfraz,spiegelberg}
\splitrefcite<related>{spiegelberg,springer}
\printbibliography[title=Main List]
\DeclareFieldFormat{labelnumberwidth}{\mkbibparens{#1}}
\printbibliography[section=\getrefsection{related},title=Related Documents]
\end{document}