3

I have a list of biblatex items in a document which additionally has a bibliography section. In this part I want to list some bibliography items with \fullcite but in a different style then the main bibliography.

I can change the number of authors like this:

\begingroup
\defcounter{minnames}{2}
\fullcite{key}
\endgroup

How can I further modify the style of \fullcite?

MWEB

\documentclass[en-US,de-DE]{article}

\usepackage[
  style=authoryear-ibid,
  maxnames=2,
  backend=biber,
  safeinputenc,
  isbn=false,
  doi=false,
  maxcitenames=2,
  urldate=iso8601,
  date=iso8601
]{biblatex}

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

\begin{filecontents}{\jobname.bib}
@book{key,
  author = {Author, A.},
  year = {2001},
  title = {Title},
  publisher = {Publisher},
  pagetotal = {383},
  edition = {1},
  pages = {151--154},
  url = {http://www.google.com},
}
\end{filecontents}

\begin{document}
text1

\fullcite{key}

text2

\cite{key}

text3

\printbibliography[heading=bibintoc]

\end{document}

I want to remove the year, URLs from these items listed by \fullcite as well and any page numbers and the edition of books?

pdf rendering

4
  • know there are "better" ways to make a publications list like tex.stackexchange.com/questions/115143/… but thats not what I need. – Max N Feb 10 '18 at 21:09
  • 2
    Please don't post code fragments. Instead post a minimal document that shows what you're doing and some sample .bib items. And you haven't specified enough information: page numbers from all entry types? Editions from all entry types? etc. – Alan Munn Feb 10 '18 at 21:20
  • I second Alan's request. You probably could do this with the combined use of the \AtNextCitekey hook and \clearfield. But, in this case, it is hard to help without a minimal working example with bibliography (MWEB). – gusbrs Feb 10 '18 at 21:24
  • added mweb. in my original document I have 12 items to list. – Max N Feb 10 '18 at 21:51
4

There are two ways you can do this: you can redefine the \fullcite command to clear the fields you don't want, or as noted in the comments, you can use \AtEverycitekey to do the same thing.

Conceptually, modifying \fullcite seems like the better solution, since using \AtEveryCitekey modifies any citation, so if you want to remove any information from the \fullcite that is normally included in the regular \cite then you must use this solution.

If you're just removing URL, edition and pages from the \fullcite there will be no bad side-effects of using \AtEveryCitekey since it is only the \fullcite citation command that would ever output those fields. But if you want to remove the year as well (as you mention in the comments), then modifying \fullcite is the only way to do it. I've removed the \AtEveryCitekey solution from the code for this reason, but placed it separately at the end.

Depending on the type of information you need to suppress, you may need to use one of \clearfield, \clearlist or \clearname. In the case of publisher, or location, for example, their type is a list, and so you need to use \clearlist to clear them. Section 2.2.2 of the biblatex documentation describes each field and its data type.

\documentclass[en-US,de-DE]{article}

\usepackage[
  style=authoryear-ibid,
  maxnames=2,
  backend=biber,
  safeinputenc,
  isbn=false,
  doi=false,
  maxcitenames=2,
  urldate=iso8601,
  date=iso8601
]{biblatex}

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

\begin{filecontents}{\jobname.bib}
@book{key,
  author = {Author, A.},
  year = {2001},
  title = {Title},
  publisher = {Publisher},
  pagetotal = {383},
  edition = {1},
  pages = {151--154},
  url = {http://www.google.com},
}
\end{filecontents}

\DeclareCiteCommand{\fullcite}
  {\usebibmacro{prenote}}
  {\clearfield{url}%
   \clearfield{pages}%
   \clearfield{pagetotal}%
   \clearfield{edition}%
   \clearfield{labelyear}%
   \usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\begin{document}
text1
\cite{key}

\fullcite{key}

text2

\cite{key}

text3

\printbibliography[heading=bibintoc]

\end{document}

output of code

Using \AtEveryCitekey

As noted above, using \AtEveryCitekey can also work if there is no overlap in the information you need in a regular cite and the information you suppress in the \fullcite. Here's the code to use that method:

\AtEveryCitekey{
\clearfield{url}
   \clearfield{pages}
   \clearfield{pagetotal}
   \clearfield{edition}
   \clearfield{labelyear}
}
14
  • 1
    It would also be safe to just clear these fields in the \AtEveryCitekey hook. That way one doesn't need to redefine \fullcite. – moewe Feb 10 '18 at 23:02
  • 1
    Yes indeed. \AtEveryCite is executed at the beginning of a cite command, at that point the entry data is not yet available. \AtEveryCitekey is executed for every cite entry separately and at a point where the data is available. For \cite{sigfridsson,worman} \AtEveryCite is executed once at the beginning and \AtEveryCitekey once for sigfridsson and once for worman. The two are conceptually similar to \AtBeginBibliography and \AtEveryBibitem. – moewe Feb 10 '18 at 23:15
  • 1
    @MaxN Damn end of line spaces! :) Add % after each \clearfield in the redefinition of \fullcite or use the \AtEveryCitekey version. I've edited the code. Thanks. – Alan Munn Feb 11 '18 at 16:32
  • 1
    @MaxN I've updated the solution. If you want to remove the year, then you can't use the \AtEveryCitekey solution. I've explained how this works. As for finding out about this stuff, much of it is in the biblatex manual, but to understand more of the internals, you also need to browse the actual code of the package. (It would be nice to have a map...). – Alan Munn Feb 11 '18 at 17:01
  • 1
    @MaxN I've added some explanation why. publisher is a list, not a simple field. – Alan Munn Feb 11 '18 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.