1

I am trying to use this code to order my references by author. I am on TeXworks and I am using Biber at the moment.I want to list all refernces with the author Weber in it.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[style=alphabetic,maxnames=6,natbib=true,backend=biber]{biblatex}
%\bibliography{biblatex-examples}
\addbibresource{bibpractice.bib}

\begin{document}
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=author,
            match=Weber,
            final]
      \step[fieldset=keywords, fieldvalue=weber]
    }
  }
}

\printbibliography[keyword=weber]
\printbibliography[notkeyword=weber]
\end{document}

This is the error I get:

INFO - This is Biber 2.7 INFO - Logfile is 'biberpractice.blg' ERROR - Cannot find control file 'biberpractice.bcf'! - did you pass the "backend=biber" option to BibLaTeX? INFO - ERRORS: 1

moewe
  • 175,683
Michael
  • 87
  • 2
    What bibliography package and style are you using? As far as I am aware this is only supported by biblatex with Biber (maybe also with BibTeX as backend, but Biber is preferred). We need to see an MWE/MWEB. Can you explain in more detail why you need this feature? I don't see what ids has to do with citing co-authors. – moewe Oct 12 '17 at 15:02
  • Im using \usepackage{cite} and the \bibliographystyle{ieeetr}. Sorry I'm new to using LaTeX and BibTeX. I am trying to find a command in LaTeX that will go through my bib file (which is full of articles and publications) and list all of which that are referenced by the specified author. I tried to make IDS for each author trying to act as a type of keyword instead of the cite key. – Michael Oct 13 '17 at 12:47
  • Sorry, I still don't quite understand what you want (but that might just be my limited grasp of the English language). You can edit your question to include the additional information and to make it more clear. – moewe Oct 13 '17 at 13:27
  • I edited by question. I am trying find a command that will filter through my bib file (full of a bunch of references with numerous authors) and list all references by the author specified. – Michael Oct 16 '17 at 13:20
  • I have added an MWE that works and filters out citations by 'Knuth'. I have a hunch that you might have more basic problems with Biber at the moment. Have a look at Biblatex with Biber: Configuring my editor to avoid undefined citations and Troubleshooting for biber if my MWE does not work for you (you should not alter the MWE in any way it will work out of the box, the file biblatex-examples.bib is automatically found if biblatex is installed properly). – moewe Oct 16 '17 at 13:32

1 Answers1

2

Your MWE is almost there. \DeclareSourcemap should go into the preamble.

Here we filter out citations authored by Knuth and Sigfridsson. Note that you have to \cite or \nocite{*} all the entries you want to consider for filtering.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[style=alphabetic, maxnames=6, natbib=true, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=author,
            match=Knuth,
            final]
      \step[fieldset=keywords, fieldvalue=knuth]
    }
    \map{
      \step[fieldsource=author,
            match=Sigfridsson,
            final]
      \step[fieldset=keywords, fieldvalue=sigfridsson]
    }
  }
}

\begin{document}
\nocite{sigfridsson,knuth:ct:a,companion,worman,knuth:ct:c}
\printbibliography[keyword=knuth]
\printbibliography[keyword=sigfridsson]
\printbibliography[notkeyword=knuth,notkeyword=sigfridsson]
\end{document}

enter image description here

moewe
  • 175,683
  • When Im using TeXworks and after I hold ctrl "T" the pdfLaTeX only shows "Hi, I'm Kant {knuth:ct,knuth:ct:a,companion}" Is the software not up to date? – Michael Oct 16 '17 at 14:31
  • @Michael Did you compile my MWE? It does not contain anything related to Kant. Please have a look at the two links I gave in my comment to your question. – moewe Oct 16 '17 at 14:56
  • Sorry I got my examples I was working with mixed. I tried to compile your MWE but it gives me ERROR - Cannot find control file 'knuth.bcf'! - did you pass the "backend=biber" option to BibLaTeX? – Michael Oct 16 '17 at 18:48
  • @Michael Check your set up with https://tex.stackexchange.com/q/154751/35864. Did you set your editor up to use a 'build folder'? Or did you tell it to move auxiliary files to a different directory? Can you show a picture of your TeXworks configuration. – moewe Oct 16 '17 at 18:51
  • I dont know if I should be using Biber or not, I saw a solution that required it so thats why I am using it. I already added biber to my TeXworks and im using UTF-8 under my preferences. – Michael Oct 17 '17 at 13:01
  • @Michael Using Biber is a very good idea. I can't quite say what goes wrong on your side because I don't know what you try to compile and how you do that. – moewe Oct 17 '17 at 13:06
  • @Michael Please take my MWE from the answer without any modifications and place it in a new, empty folder. Then compile it using your editor. What files get produced? Does a new folder appear? What errors/warnings do you get in the .log and .blg files (both are plain text files, even though Windows might say otherwise)? – moewe Oct 17 '17 at 13:11
  • I used XeLaTeX the biber then XeLaTeX again and it worked now! Thank you. Now how should I edit this to work with my bib file? I have a bib file with numerous inproceedings and articles from different authors, and want to seperate them all by each specific author. Do I just need to use the \declaresourcemap for each seperate author? – Michael Oct 17 '17 at 13:21
  • @Michael Almost, you can only have one \DeclareSourcemap per document, but you can have several \maps. I'll post an example. – moewe Oct 17 '17 at 13:26
  • @Michael See the edited answer, please. – moewe Oct 17 '17 at 13:31