3

When using numeric style the \citet{key} command outputs Lastname [n]. I'd like this to output Lastname F. [n] where F is a Firstname initial. p.s. Here is MWE code

\documentclass[a4paper]{article}
\usepackage{fontspec}
\setmainfont[
BoldFont={DeJavu Serif Bold},
ItalicFont={DeJavu Serif Italic},
BoldItalicFont={DeJavu Serif BoldItalic}
]{DeJavu Serif}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{baez/article,
    author       = {Baez, John C. and Lauda, Aaron D.},
    title        = {Higher-Dimensional Algebra {V}: 2-Groups},
    journaltitle = {Theory and Applications of Categories},
    date         = 2004,
    volume       = 12,
    pages        = {423-491},
    version      = 3,
    eprint       = {math/0307200v3},
    eprinttype   = {arxiv},
    langid       = {english},
    langidopts   = {variant=american},
    annotation   = {An \texttt{article} with \texttt{eprint} and
        \texttt{eprinttype} fields. Note that the arXiv reference is
        transformed into a clickable link if \texttt{hyperref} support
        has been enabled.  Compare \texttt{baez\slash online}, which
        is the same item given as an \texttt{online} entry},
    hyphenation={english},
}
@article{another,
    author       = {Another,Author and One more, Author},
    title        = {Title},
    journaltitle = {Journal},
    date         = 2004,
    volume       = 12,
    pages        = {423-491},
    version      = 3,
    eprint       = {math/0307200v3},
    eprinttype   = {arxiv},
    langid       = {english},
    langidopts   = {variant=american},
    hyphenation={english},
}
\end{filecontents*}

\usepackage[english]{babel}
\usepackage[natbib=true,
style=numeric,
isbn=true,
url=true,
defernumbers=false,
sorting=nyt, 
firstinits=true,
backend=biber,
language=auto,  
autolang=other]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
\citet{another} \\
Some text \\
\citet{baez/article} \\
\nocite{*}
\printbibliography
\end{document}

I'd like to have Baez,J.C. and Lauda,A.D. [2] italic shape is preferable :) p.s. It was noted to me in comments,that correct way to cite is J.C. Baez and A.D. Lauda [2] , but question remains :how to output name initials in numeric citation style

10
  • It would be far preferable to include an MWE here. That way, if the other post is edited, this question will still remain meaningful to future readers. If you rely on a link, the content may change if the content of the link is deleted or updated. – cfr Sep 19 '15 at 19:59
  • The example given there is rather more complex than this question suggests. Do you really want something which also satisfies desiderata not specified in this question? Because you are likely to get answers which don't take account of such desiderata, as the question is currently given. – cfr Sep 19 '15 at 20:01
  • The \citet command is designed for use in text. Normally - at least in English - it would not make sense to say As Smith J. [18] proved in 1954.... If you used an initial you'd want As J. Smith [18] proved in 1954.... Do you want this for use with another language where the conventions are different? – cfr Sep 19 '15 at 20:27
  • Yes, you are right, but there is no 'J.' in output..for other language i an switch first-last/last-first right? – Levan Shoshiashvili Sep 19 '15 at 20:30
  • 1
2

It seems that

\DeclareNameAlias{labelname}{family-given}

would do the job. You get full names (if available) with giveninits=false and initials with giveninits=true.


With

\DeclareNameFormat{labelname}{%
  \ifnum\value{uniquename}<2
    \usebibmacro{name:family-given}
      {\namepartfamily}
      {\namepartgiveni}
      {\namepartprefix}
      {\namepartsuffix}%
  \or
    \usebibmacro{name:family-given}
      {\namepartfamily}
      {\namepartgiven}
      {\namepartprefix}
      {\namepartsuffix}%
  \fi
  \usebibmacro{name:andothers}}

you will always get initials, except if full names are needed to disambiguate. (That only applies to giveninits=false, with giveninits=true only initials are available at all times.) To enable that feature you need to set the uniquename option when loading.

See also firstinits for citations only


You can get a different order by replacing family-given by given-family in any of the above.

7
  • Sorry I dont understand this :"To enable that feature you need to set the labelname option when loading." – Levan Shoshiashvili Sep 20 '15 at 15:18
  • @LevanShoshiashvili If you want to use that feature you will have to add labelname to the loading-time options, if you load biblatex with \usepackage[style=numeric, backend=biber]{biblatex} you will need \usepackage[style=numeric, backend=biber, labelname]{biblatex} instead. Or you just add \ExecuteBibliographyOptions{labelname} to your preamble. – moewe Sep 20 '15 at 16:19
  • added after biblatex package call declarenameformat command above and after it `\ExecuteBibliographyOptions{labelname}' and get error :Package keyval Error: labelname undefined. \ExecuteBibliographyOptions{labelname} – Levan Shoshiashvili Sep 20 '15 at 16:42
  • @LevanShoshiashvili Well this is pretty embarrassing: The option I'm talking about is actually called uniquename and not labelname. I'm really sorry. You can read up about it in the manual. Please replace all mentions of labelname above with uniquename. – moewe Sep 20 '15 at 16:49
  • 'firstinits=true,uniquename ` in option gives initials in both bibliography and in citation and `firstinits=false, uniquename' option full name in bibliography and initials in citation, but withiut 'uniquename' i get same – Levan Shoshiashvili Sep 20 '15 at 17:02

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.