简体   繁体   中英

Use Biblatex to get an overview of the keywords from my sources

Hi I'm using LaTeX to write a literature review and BibLaTeX to print my sources and bibliography.

I would like to get an overview of all the keywords used in the articles I have gathered so far, and since I have them all in a .bib file I figured that there probably is some easy way to get all the keywords from there. I know I could write a Python script or something similar to get them from the .bib -file without LaTeX, but is there a way to do it with LaTeX? I mean ofc there is, but is there an easier way that utilises BibLaTeX and the BibTeX-format of the file with the info? From what I can gather BibLaTeX has the support for using keywords to sort the bibliography, or include/exclude certain sources based on keywords, but I can't find if or how I can print other information from the .bib than the full source. I've found \\printfield in the documentation but it's not recognised when I use it in my document, even though the \\textcite and the \\printbibliography works fine so I'm guessing I'm using it wrong. Here's how I've tried to use it:

\documentclass[a4paper]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}

\usepackage[style=authoryear,backend=biber]{biblatex}

\addbibresource{sample.bib}

\title{Test}
\author{Me}

\begin{document}
\maketitle

\section*{Citation examples}
\parencite{Smith:2012qr}.
\printfield{keywords}

\printbibliography

\end{document}

I hope my question is clear enough. Thank you.


Regarding my specciffic use case:

I want to have a normal bibliography as well as this keyword overview, so I prefer a solution that doesn't change the standard \\printbibliography. But if you have a solution like that I would still be curious about it, if it's easier accomplished than writing a python script it would still be useful as a backup plan if I can't figure this out properly. And I would still likely learn something from a solution like that too, because I haven't really found a way to do that either so far.

Preferably I would want to get a list of unique key words, and also be able to format how they are displayed. For example I would like to be able to print them in a table and make sure they all are printed with the same capsulation because there are some instances of all-caps in the .bib-file. But also here I would likely learn things from solutions that just prints them as-is in the .bib-file, including doubles.

Bonus: If there is a solution that would also sort them according to how many times they show up, that would be really exellent. But all of these specciffics for my use case is probably things I can look into separately once I have learned a basic solution, so I accknowledge that they are a bit off topic.

Based on this question https://tex.stackexchange.com/questions/332292/listing-indexing-and-linking-keywords-in-biblatex you could use one of the packages for index creation, eg imakeidx :

\documentclass{article}

\begin{filecontents*}[overwrite]{\jobname.bib}
    @article{Padial2010,
        title={The Integrative Future Of Taxonomy},
        author={Padial, J.M. and Miralles, A. and la Riva, I.D. and Vences, M.},
        journal={Frontiers in Zoology},
        year={2010},
        volume={7},
        number={16},
        pages={1--14},
        note={Cited by 4},
        abstract={Text},
        publisher={Some Publishing},
        doi={10.1186/1742-9994-7-16},
        issn={1742-9994},
        file={./2004_Jensen_Homecoming.pdf},
        keywords={biology, taxonomy},
    }
    
        @article{Padissal2010,
            title={The Integrative Future Of Taxonomy},
            author={Padial, J.M. and Miralles, A. and la Riva, I.D. and Vences, M.},
            journal={Frontiers in Zoology},
            year={2010},
            volume={7},
            number={16},
            pages={1--14},
            note={Cited by 4},
            abstract={Text},
            publisher={Some Publishing},
            doi={10.1186/1742-9994-7-16},
            issn={1742-9994},
            file={./2004_Jensen_Homecoming.pdf},
            keywords={math, taxonomy},
        }
\end{filecontents*}

\usepackage{biblatex}
\addbibresource{\jobname.bib}

\usepackage{imakeidx}
\makeindex[name=keywords, title=List of Keywords]
\DeclareIndexFieldFormat{keywords}{\forcsvfield{\index[keywords]}{keywords}}
\AtEveryBibitem{\indexfield{keywords}}


\begin{document}
    \nocite{*} 
    \printbibliography
    
    \printindex[keywords]
\end{document}

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM