![Раскрашивание конкретных ссылок в библиографии](https://rvso.com/image/370302/%D0%A0%D0%B0%D1%81%D0%BA%D1%80%D0%B0%D1%88%D0%B8%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%20%D0%BA%D0%BE%D0%BD%D0%BA%D1%80%D0%B5%D1%82%D0%BD%D1%8B%D1%85%20%D1%81%D1%81%D1%8B%D0%BB%D0%BE%D0%BA%20%D0%B2%20%D0%B1%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D0%B3%D1%80%D0%B0%D1%84%D0%B8%D0%B8.png)
В пересмотренных версиях рукописи мы обычно отмечаем новые изменения цветным текстом. Этот вопрос касается различных способов, которыми это можно сделать для определенных ссылок в файле .bib
. Существуют предыдущие решения по этому вопросу, но они меня не удовлетворяют.Вот этотпросто сделайте работу для одной ссылки.Здесьявляется расширением предыдущего для нескольких ссылок с использованием нескольких вложенных ifstreqal
. Но это может стать действительно бесполезным, когда количество цветных ссылок увеличивается.
Я имею в виду код, который получает все метки цветных ссылок, не вовлекая пользователя в создание вложенных структур.
Другие новые решения также приветствуются.
Вот с чего можно начать:
\documentclass{article}
\usepackage{filecontents}
\usepackage{color}
\usepackage{etoolbox}
\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"
}
@article{fuente,
author = "D. de la Fuente and J.G. Castaño and M. Morcillo",
title = "Long-term atmospheric corrosion of zinc",
journal = "Corrosion Science",
volume = "49",
year = "2007",
pages = "1420–1436",
}
@article{nature,
author = "Rosa Rademakers and Manuela Neumann and Ian R. Mackenzie",
title = "Advances in understanding the molecular basis of frontotemporal dementia - elongated title",
journal = "Nature Reviews Neurology",
volume = "8",
year = "2012",
pages = "423-434",
doi = "10.1038/nrneurol.2012.117",
}
}
\end{filecontents}
\let\mybibitem\bibitem
\renewcommand{\bibitem}[1]{%
\ifstrequal{#1}{greenwade93}
{\color{blue}\mybibitem{#1}}
{\color{black}\mybibitem{#1}}%
}
\begin{document}
This is my document \cite{fuente} and we have another \cite{nature}. We can speak also about \LaTeX! So two more reference are \cite{greenwade93} and \cite{goossens93}
\bibliographystyle{ieeetr}
\bibliography{jobname}
\end{document}
решение1
С помощью biblatex/biber довольно легко отмечать ссылки:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage[style=ieee]{biblatex}
\addbibresource{biblatex-examples.bib}
\DeclareBibliographyCategory{changed}
\addtocategory{changed}{doody,angenendt}
\AtEveryBibitem{\ifcategory{changed}{\color{red}}{}}
\DeclareFieldFormat{labelnumberwidth}{\ifcategory{changed}{\textcolor{green}{\mkbibbrackets{#1}}}{\mkbibbrackets{#1}}}
\begin{document}
\cite{doody,herrmann,angenendt}
\printbibliography
\end{document}