I need to modify specific citation commands to use certain fields, and not others, depending on the type of reference being cited. Is there a way to do this using BibLaTeX (with a bibtex backend)?

Specifically, I would like to redefine

  • \citeyearpar for patents so that it prints just the patent number (and no parentheses), and
  • \citealp for patents so that it prints the patent number with the abbreviated country name associated with the patent type (from § of the BibLaTeX documentation; e.g. "US") prepended (no space);

and I would like to define some additional (helper) citations including

  • \citepatass to print the assignee,
  • \citepatissue to print the issue date, and
  • \citepatlabel to a long identifying the issuing country, e.g. "U.S. Patent".

For a variety of reasons I need to limit the citation commands I use (primarily) to the natbib commands (e.g. \citep, \citet and all the others listed in § 3.6.9 of the BibLaTeX documentation). Generally I will be using the verbose style for both citations and my bibliography.

Additionally I'd like for citations of patents after the first to behave like the commands show the patent number rather than shortened verbose output.

\RequirePackage{xpatch}     % For the patches below
\RequirePackage{hyphenat}   % See -- http://code.google.com/p/tufte-latex/issues/detail?id=60
    bibstyle=verbose, citestyle=verbose,    % bibstyle extensively modifed below
    doi=true, url=true,                     % excluded from citations below
    citecounter=true, citetracker=true,
    backref=true, backrefstyle=two,
    abbreviate=false            % Ideally, I'd like to abbreviate the patent locations, but nothing else

% For tufte-like behavior (I never use \cite itself); see -- http://tex.stackexchange.com/a/47763/7844
% Not directly related to the question but included for completeness

% Some reordering and exclusions; see -- http://tex.stackexchange.com/q/46804/7844
% Not directly related to the question but included for completeness


% Better patent numbers, from -- http://tex.stackexchange.com/a/45584/7844
% Not directly related to the question but included for completeness

     author = {Edison, Thomas},
     title = {I'm too busy inventing to write books},
     year = {1920}}
     author = {Edison, Thomas},
     title = {Another book I don't have the time to write},
     year = {1921}}
    author = {Edison, Thomas},
    title = {My first great invention},
    month = jan, year = {1911},
    number = {266701}}
    author = {Edison, Thomas},
    title = {A second fantastic invention}, 
    month = feb, year = {1912},
    number = {266702}}
    author = {Edison, Thomas},
    title = {A third remarkable contraption},   
    month = mar, year = {1913},
    number = {266703},
    year = {1913}}


\subsection*{Some things that already work correctly}
This citation\citep{edisonpatant1} of an \citeauthor{edisonpatant1} patent works pretty much as desired. Note that I use \texttt{citep} to generate citations as footnotes. While other \texttt{natbib} citations commands do not.\footnote{This is necessary so that they can be used in footnotes. For example, citing \citealt{edisonpatant2} here embeds the verbose description; similarly for the author (\citeauthor{edisonpatant2}) or the year for a non-patent (\citeyear{edisonbook1})}. 
\subsection*{Basic patent-related citation changes}
I'd like to use at least one of the basic \texttt{natbib} macros that do not produce verbose output to print the  \textit{patent number}, in place of its default behavior. For example, instead of the year, for \texttt{citeyear}, instead of "\citeyear{edisonpatant1,edisonpatant2,edisonpatant3}" I want to have "266,701; 266,7021; 266,703". Additionally I'd like to co-opt another command (perhaps  \texttt{citealp}) to work similarly, but prepend the type string, e.g. US 266,701; US 266,7021; US 266,703". I realize that there are issues with combining such output with the normal behavior of these macros, and am happy to accept an error if patents are combined with non-patents in a single such macro invocation.
\subsection*{Patent behavior for subsequent citations}
Finally, I'd like for citations of patents after the first to behave like the commands above: they should show the patent number\footnote{US 266,701} rather than the normal shortened verbose output\citep{edisonpatant1}.
\subsection*{But wait, there's more}
While I'm at it (and only because perhaps it's easier to do in context of these modifications), I'd like to abbreviate \textit{only} the location in the bibliography (even with \texttt{abbreviate=false} in the options to \texttt{biblatex}), and omit location entirely from citations.
  • 2
    Please provide a minimal example. Mar 23, 2012 at 15:32
  • @MarcoDaniel: MWE added.
    – orome
    Mar 23, 2012 at 17:41
  • @raxacoricofallapatorius So you only use 6-digit patent numbers and indicate one country in the location list field? I'm busy ATM, but if this post goes without additional answers for a few days I'll try to post one for you.
    – Audrey
    Mar 23, 2012 at 17:51
  • @Audrey: I can't be sure what the constraints on the patent numbers might be, they could have arbitrary digits (or even letters); it's only currently that I assume 6 digits for the purpose of formatting US patent numbers. But yes, one "location", actually the "type" -- i.e the issuing country. The key thing is to this behavior be automatic for the relevant (co-opted) basic natbib macros. E.g. automatically invoking something like lockstep's suggested new macros below, when patents are supplied to, for example, \citealp.
    – orome
    Mar 23, 2012 at 17:57
  • 1
    @raxacoricofallapatorius I think I'll leave you with lockstep's answer as dedicated citation commands are probably the way to go. Your request for compact, sorted citations based on location and patent number can't be met without some style restrictions and biber.
    – Audrey
    Mar 26, 2012 at 14:02

1 Answer 1


Citation commands should be able to cope with multiple keys in their mandatory argument, and those keys may be of different entry types. Also, the \citeyearpar command will wrap its output (the content of one or multiple year fields) into a single set of parentheses. Therefore I don't think it's a good idea (though it may be possible) to redefine \citeyearpar according to the entry type of one of its multiple keys. Instead, I suggest to define a \citenumber macro which resembles \citeyearpar, but prints the content of the number field(s) and omits the surrounding parentheses.

Your suggested redefinition of \citealp faces an additional obstacle: The country name strings of section of the biblatex manual are used in the patent's location field, but this field is optional and (as a list field) allows multiple entries, so the output of a possible \citelocnumber macro may not be as pretty as you expect.



  {\ifentrytype{patent}{\printfield{number}}{\GenericError{}{Not a patent entry}{}{}}}

   \ifentrytype{patent}{\printfield{number}}{\GenericError{}{Not a patent entry}{}{}}}





% Commenting the following in will raise a generic error
% \citepatnumber{knuth:ct:a}



enter image description here

  • I see the problem. Is there a way to define the macros as you propose, and then detect, within, for example, \citeyearpar whether all of the arguments are patents, "switching" to your \citenumber if they are (and perhaps logging an error if the user attempts to combine patents and non-patents)?
    – orome
    Mar 23, 2012 at 16:57
  • @raxacoricofallapatorius Right now, I have no idea. Maybe some one else (e.g., Audrey) will come up with something.
    – lockstep
    Mar 23, 2012 at 17:03
  • @raxacoricofallapatorius biblatex processes the entries in a citation list one at a time. So what you're asking for will require two passes through the list. It can be done - \textcite in the verbose styles is an example. Can you at least partly fulfill Marco's request for a MWE? Some concrete examples with a bib file would be helpful.
    – Audrey
    Mar 23, 2012 at 17:34
  • @Audrey: MWE added.
    – orome
    Mar 23, 2012 at 17:42
  • 1
    @raxacoricofallapatorius I added a generic error message. Requirements (3) and (4) are tricky, and I can't promise anything.
    – lockstep
    Mar 23, 2012 at 22:28

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.