我有一份详尽的参考书目,其中包含大量来自期刊的文章。
出于编辑原因,我需要包括期刊名称的缩写并在最终参考书目之后,列出所查阅期刊的索引。当然,理想的命令是,在文件的每个条目中\printbiblist{shortjournal}
插入。shortjournal={}
.bib
以下是我的特别输入:
\usepackage[style=verbose-trad2]{biblatex}
\DeclareBibliographyDriver{shortjournal}{%
\printfield{journaltitle}}
\DeclareBibliographyDriver{shorttitle}{%
\printfield{title}}
\DeclareFieldFormat{journaltitle}{\em\printfield{shortjournal}}
\AtBeginBiblist{shortjournal}{\DeclareFieldFormat{journaltitle}{\em#1}}
但是,我有两个问题需要解决。
首先涉及缩写列表的排序。我希望它是按字母顺序排列的:按缩写的字母顺序排列。请注意,当然,选择缩写的任何编译器都有责任避免重复,以防止缩写本身混淆:这意味着单级排序就足够了。然而,在我看来,默认情况下顺序是引用的顺序。
我尝试修改 refcontext ( \newrefcontext{sorting=sortshortjournals}
) 并创建一个排序模板 ( \DeclareSortingTemplate{sortshortjournals}
),其唯一字段确实是 shortjournal ( {\sort{\field{SHORTJOURNAL}}}
)。但是,我失败了。
第二个问题是,对于我从期刊中引用的每篇文章(无论是卷、期还是年份),列表都会再次引用缩写。相反,我希望每个缩写只有一个项目。在这方面,我甚至无法假设一些尝试。
这是我的例子:ciccio_example_shortjournal_list。
顺便一提:如果我在条目中使用journal={}
而不是 ,这有关系吗journaltitle={}
(但是,我知道 与 的区别issuetitle={}
)?
添加遵从初步反馈。我包含了所有代码,以便在问题中直接重现我的问题。
\documentclass{article}
\usepackage[style=verbose-trad2]{biblatex}
\begin{filecontents}{\jobname.bib}
@XDATA{jtif,
JOURNALTITLE = {Journal of Tremendously Interesting Facts},
SHORTJOURNAL = {JTIF},
}
@XDATA{jtio,
JOURNALTITLE = {Journal of Tremendously Interesting Opinions},
SHORTJOURNAL = {JTIO},
}
@ARTICLE{test1,
AUTHOR = {John Smith},
TITLE = {Nothing to do},
SHORTHAND = {JSNTD},
SHORTTITLE = {NTD},
XDATA = {jtif},
VOLUME = {2},
NUMBER = {1},
YEAR = {1947}
}
@ARTICLE{test2,
AUTHOR = {John Tumble},
TITLE = {I am so happy},
SHORTHAND = {JTISH},
SHORTTITLE = {ISH},
XDATA = {jtif},
VOLUME = {1},
NUMBER = {1},
YEAR = {1946}
}
@ARTICLE{test3,
AUTHOR = {Francis Coppola},
TITLE = {I come from Italy},
SHORTHAND = {FCICFI},
SHORTTITLE = {ICFI},
XDATA = {jtif},
VOLUME = {2},
NUMBER = {3},
YEAR = {1947}
}
@ARTICLE{test5,
AUTHOR = {Francis Coppola},
TITLE = {I hate Milan},
SHORTHAND = {FCIHM},
SHORTTITLE = {IHM},
XDATA = {jtio},
VOLUME = {9},
NUMBER = {1},
YEAR = {1954}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\DeclareBibliographyDriver{shortjournal}{%
\printfield{journaltitle}}
\DeclareBibliographyDriver{shorttitle}{%
\printfield{title}}
\DeclareFieldFormat{journaltitle}{\em\printfield{shortjournal}}
\AtBeginBiblist{shortjournal}{\DeclareFieldFormat{journaltitle}{\em#1}}
\DeclareSortingTemplate{sortshortjournals}{
\sort{\field{SHORTJOURNAL}}
\sort{\field{JOURNALTITLE}}
}
\begin{document}
\nocite{*}
% \printshorthands% With biber, just an alias for \printbiblist{shorthand}
\printbibliography
\vspace{32pt}
\newrefcontext{sorting=sortshortjournals}
\noindent\textbf{Please, I would like each element to be indicated only once and not multiple times, as it is now. Then, I prefere an alphabetical order too.}
\printbiblist[title={Journal Shorthands}]{shortjournal}
% As you can see, the list shows me more time the same item
% I prefere to have only once the same item
% Possible, in alphabetical order
% \printbiblist[title={Title Shorthands}]{shorttitle}
\end{document}
答案1
为了正确排序,您需要定义一个名为的排序模板shortjournal
。为了只打印一次期刊缩写,您可以定义一个 bibcheck,如下所示手册biblatex
(第 3.8.3 条)参考书目列表,第 95-97 页)。
\documentclass{article}
\usepackage[style=verbose-trad2]{biblatex}
\renewbibmacro*{journal}{%
\ifboolexpr{
test {\iffieldundef{journaltitle}}
and
test {\iffieldundef{journalsubtitle}}
}
{}
{\iffieldundef{shortjournal}
{\printtext[journaltitle]{%
\printfield[titlecase]{journaltitle}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{journalsubtitle}}}
{\printfield[journaltitle]{shortjournal}}%
\newunit}%
\iffieldundef{journaltitleaddon}
{}
{\printfield{journaltitleaddon}}}
\DeclareBibliographyDriver{shortjournal}{%
\printfield{journaltitle}}
\defbibcheck{shortjournal}{%
\iffieldundef{shortjournal}
{\skipentry}
{\iffieldundef{journaltitle}
{\skipentry}
{\ifcsdef{sjcheck@\therefsection
-\strfield{shortjournal}=\strfield{journaltitle}}
{\skipentry}
{\savefieldcs{journaltitle}{sjcheck@\therefsection
-\strfield{shortjournal}=\strfield{journaltitle}}}}}}
\DeclareSortingTemplate{shortjournal}{
\sort{\field{SHORTJOURNAL}}
\sort{\field{JOURNALTITLE}}
}
\DeclareBibliographyDriver{shorttitle}{%
\printfield{title}}
\begin{filecontents}{\jobname.bib}
@XDATA{jtif,
JOURNALTITLE = {Journal of Tremendously Interesting Facts},
SHORTJOURNAL = {JTIF},
}
@XDATA{jtio,
JOURNALTITLE = {Journal of Tremendously Interesting Opinions},
SHORTJOURNAL = {JTIO},
}
@ARTICLE{test1,
AUTHOR = {John Smith},
TITLE = {Nothing to do},
SHORTHAND = {JSNTD},
SHORTTITLE = {NTD},
XDATA = {jtif},
VOLUME = {2},
NUMBER = {1},
YEAR = {1947}
}
@ARTICLE{test2,
AUTHOR = {John Tumble},
TITLE = {I am so happy},
SHORTHAND = {JTISH},
SHORTTITLE = {ISH},
XDATA = {jtif},
VOLUME = {1},
NUMBER = {1},
YEAR = {1946}
}
@ARTICLE{test3,
AUTHOR = {Francis Coppola},
TITLE = {I come from Italy},
SHORTHAND = {FCICFI},
SHORTTITLE = {ICFI},
XDATA = {jtif},
VOLUME = {2},
NUMBER = {3},
YEAR = {1947}
}
@ARTICLE{test5,
AUTHOR = {Francis Coppola},
TITLE = {I hate Milan},
SHORTHAND = {FCIHM},
SHORTTITLE = {IHM},
XDATA = {jtio},
VOLUME = {9},
NUMBER = {1},
YEAR = {1954}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\printbiblist[title={Journal Shorthands}]{shortjournal}
% As you can see, the list shows me more time the same item
% I prefere to have only once the same item
% Possible, in alphabetical order
% \printbiblist[title={Title Shorthands}]{shorttitle}
\end{document}