我有一份很长的文档(我的实验室笔记本),其中的参考书目按主题类别进行分类。我想
- 以不同颜色显示我已阅读过的项目(在主题类别中),或者
- 将“已读”项目分类到不同的类别并用不同的颜色打印。
我知道如何用蛮力做到这一点。例如,
\DeclareBibliographyCategory{Cat1}
\defbibheading{Cat1}{\section*{Cat1}}
\DeclareBibliographyCategory{Cat2}
\defbibheading{Cat2}{\section*{Cat2}}
\DeclareBibliographyCategory{Read}
\defbibheading{Read}{\section*{Read}}
进而
\bibbycategory
我按类别获得了书目,但我不知道如何使“已读”项目呈现不同的颜色。
或者我可以做
\printbibliography[category=Cat1]
\printbibliography[category=Cat2]
{\color{blue}
\printbibliography[category=Read]}
但随后我必须列出所有类别,而且由于这些都是我研究的主题领域,类别列表可能会变得很长,而我却失去了自动化流程的优势。
理想的情况是
\bibbycategory[notcategory=Read]
{\color{blue}
\printbibliography[category=Read]}
但是 \bibbycategory 当然没有这样的选项,我不知道如何做这么简单的事情。有什么建议吗?
梅威瑟:
\documentclass[nobib, sfsidenotes]{tufte-book}
\usepackage[dvipsnames]{xcolor}
%
\usepackage[natbib, authordate, ibidtracker=false, backend=biber,
doi=false, url=false, arxiv=false, isbn=false, eprint=false, autocite=inline, backref=true]{biblatex-chicago}
%
\usepackage{filecontents}
\begin{filecontents*}{jobname.bib}
@article{greenwade93,
author = "George D. Greenwade",
title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
year = "1993",
journal = "TUGBoat",
volume = "14",
number = "3",
pages = "342--351"
}
@book{goossens93,
author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
title = "The LaTeX Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@book{fictional01,
author = "Donald Trump",
title = "A huge book, the best book",
year = "2001",
publisher = "The Trump Organization",
address = "New York, NY"
}
\end{filecontents*}
%
\addbibresource{jobname.bib}
%
\DeclareBibliographyCategory{Cat1}
\defbibheading{Cat1}{\section*{Cat1}}
\DeclareBibliographyCategory{Cat2}
\defbibheading{Cat2}{\section*{Cat2}}
\DeclareBibliographyCategory{Read}
\defbibheading{Read}{\section*{Read}}
%
\newcommand{\addcite}[2]{%
{\color{blue}\fullcite{#2}}\addtocategory{#1}{#2}
}
\newcommand{\donecite}[2]{%
{\color{ProcessBlue}\fullcite{#2}}\addtocategory{Read}{#2}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
Blah, blah, blah
Things I need to read in the next hour:
\begin{itemize}
%\item \addcite{Cat1}{greenwade93}
% change \addcite{} to \donecite{} when I've read it
\item This is important: \donecite{Cat1}{greenwade93}
\item This is even more important: \addcite{Cat2}{goossens93}
\item People tell me to read this: \addcite{Cat1}{fictional01}
\end{itemize}
%
%
\printbibheading[heading=bibintoc]
%
\bibbycategory
%
%\printbibheading[heading=bibintoc]
%\printbibliography[notcategory=Read]
%
%{\color{blue}
%\printbibliography[category=Read, heading=Read]
%}
\end{document}
答案1
你可以给整个读通过设置颜色来参考书目\defbibheading
:
\defbibheading{Read}{\color{blue}\section*{Read}}