Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use biblatex for citation, and it provides things such as \citetitle and \fullcite. \fullcite is almost what I want, but it starts with the authors not with the title. \citetitle will only cite the title but not the other data of the record. Is there a way to fully cite a bibkey by title first:

"A novel approach...", F. Bar, B. Foo, In: "Novel Approaches of Novelty", 1656.

Consider the following code:

\documentclass{article}
\usepackage{lipsum}
\usepackage{biblatex}
\usepackage{filecontents}
\begin{filecontents}{foobar.bib}
@article{foobar,
  author={Bar Foo and Foo Bar},
  title={A novel approach for citations},
  journal={FOOBAR},
  volume={23},
  year={2042},
}
\end{filecontents}
\addbibresource{foobar.bib}

\begin{document}

This chapter is based on: \fullcite{foobar}\vspace{1cm}

This chapter is based on: \citetitle{foobar}\vspace{1cm}

But I still want to have it in normal mode as this \textcite{foobar}.
\printbibliography
\end{document}

Which will render to the following: enter image description here

What I want is, to keep the references (and bib-style) and textcites as they are, but to change \fullcite{foobar} to start with the title (or simulate this behaviour):

enter image description here

share|improve this question
    
But you still want your bibliography to have the conventional order of "Author: Title ...", right? What biblatex style do you use? Would you mind creating a short MWE? –  moewe Feb 25 at 10:01
    
Yes you are right. Working on MWE right now... –  math Feb 25 at 10:02

1 Answer 1

up vote 3 down vote accepted

This should be as easy as

\makeatletter
\DeclareCiteCommand{\bfullcite}
  {\usebibmacro{prenote}}
  {\renewcommand*{\newunitpunct}{\addcomma\space}%
   \settoggle{blx@useauthor}{false}%
   \settoggle{blx@useeditor}{false}%
   \settoggle{blx@usetranslator}{false}%
   \usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\makeatother

We define a new command \bfullcite (of course you can overwrite \fullcite) and (locally and temporarily) toggle useauthor, useeditor and usetranslator to false, so their names appear after the title.

This however, may not give what you want with respect to editors' names, so we employ the following very ugly modification

\makeatletter
\DeclareCiteCommand{\bfullcite}
  {\usebibmacro{prenote}}
  {\renewbibmacro*{byeditor}{%
    \ifnameundef{editor}
      {}
      {\printnames[byeditor]{editor}%
      \setunit{\addcomma\space}%
      \usebibmacro{bytypestrg}{editor}{editor}%
      \newunit}%
    \usebibmacro{byeditorx}}%
  \renewbibmacro*{byeditorx}{%
    \ifnameundef{editora}
      {}
      {\printnames[byeditor]{editor}%
       \setunit{\addcomma\space}%
       \usebibmacro{bytypestrg}{editor}{editor}%
       \newunit}%
    \ifnameundef{editorb}
      {}
      {\printnames[byeditorb]{editorb}%
       \setunit{\addcomma\space}%
       \usebibmacro{bytypestrg}{editorb}{editor}%
       \newunit}%
    \ifnameundef{editorc}
      {}
      {\printnames[byeditorc]{editorc}%
       \setunit{\addcomma\space}%
       \usebibmacro{bytypestrg}{editorc}{editor}%
       \newunit}}%
  \renewbibmacro*{bytranslator}{%
    \ifnameundef{translator}
      {}
      {\printnames[bytranslator]{translator}%
       \setunit{\addcomma\space}%
       \bibstring{bytranslator}}}%
  \renewbibmacro*{byeditor+others}{%
    \ifnameundef{editor}
      {}
      {\printnames[byeditor]{editor}%
       \clearname{editor}%
       \setunit{\addcomma\space}%
       \usebibmacro{byeditor+othersstrg}%
       \newunit}%
    \usebibmacro{byeditorx}%
    \usebibmacro{bytranslator+others}}%
  \renewbibmacro*{bytranslator+others}{%
    \ifnameundef{translator}
      {}
      {\printnames[bytranslator]{translator}%
       \clearname{translator}%
       \setunit{\addcomma\space}%
       \usebibmacro{bytranslator+othersstrg}%
       \newunit}%
    \usebibmacro{withothers}}%
  \renewbibmacro*{bytypestrg}[2]{%
    \iffieldundef{#1type}
      {\bibstring{#2}}
      {\ifbibxstring{\thefield{#1type}}
         {\bibstring{\thefield{#1type}}}
         {\printtext{\thefield{#1type}}}}}
  \makeatletter
  \renewbibmacro*{byeditor+othersstrg}{%
    \iffieldundef{editortype}
      {\def\abx@tempa{editor}}
      {\edef\abx@tempa{\thefield{editortype}}}%
    \let\abx@tempb=\empty
    \ifnamesequal{editor}{translator}
      {\appto\abx@tempa{tr}%
       \appto\abx@tempb{\clearname{translator}}}
      {}%
    \ifnamesequal{editor}{commentator}
      {\appto\abx@tempa{co}%
       \appto\abx@tempb{\clearname{commentator}}}
      {\ifnamesequal{editor}{annotator}
         {\appto\abx@tempa{an}%
          \appto\abx@tempb{\clearname{annotator}}}
         {}}%
    \ifnamesequal{editor}{introduction}
      {\appto\abx@tempa{in}%
       \appto\abx@tempb{\clearname{introduction}}}
      {\ifnamesequal{editor}{foreword}
         {\appto\abx@tempa{fo}%
          \appto\abx@tempb{\clearname{foreword}}}
         {\ifnamesequal{editor}{afterword}
            {\appto\abx@tempa{af}%
             \appto\abx@tempb{\clearname{afterword}}}
            {}}}%
    \ifbibxstring{\abx@tempa}
      {\printtext{\bibstring{\abx@tempa}}\abx@tempb}
      {\usebibmacro{bytypestrg}{editor}{editor}}}%
  \renewbibmacro*{bytranslator+othersstrg}{%
    \def\abx@tempa{translator}%
    \ifnamesequal{translator}{commentator}
      {\appto\abx@tempa{co}%
       \clearname{commentator}}
      {\ifnamesequal{translator}{annotator}
         {\appto\abx@tempa{an}%
          \clearname{annotator}}
         {}}%
    \ifnamesequal{translator}{introduction}
      {\appto\abx@tempa{in}%
       \clearname{introduction}}
      {\ifnamesequal{translator}{foreword}
         {\appto\abx@tempa{fo}%
          \clearname{foreword}}
         {\ifnamesequal{translator}{afterword}
            {\appto\abx@tempa{af}%
             \clearname{afterword}}
            {}}}%
    \bibstring{\abx@tempa}}%
   \renewcommand*{\newunitpunct}{\addcomma\space}%
   \settoggle{blx@useauthor}{false}%
   \settoggle{blx@useeditor}{false}%
   \settoggle{blx@usetranslator}{false}%
   \usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\makeatother

in which the editor macros are made to print "Eddie Ditorm, ed." instead of "edited by Eddie Ditor".

MWE

\documentclass[british,a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{biblatex}
\usepackage{hyperref}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{foobar,
  author={Bar Foo and Foo Bar},
  title={A novel approach for citations},
  journal={FOOBAR},
  volume={23},
  year={2042},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\makeatletter
\DeclareCiteCommand{\bfullcite}
  {\usebibmacro{prenote}}
  {\renewbibmacro*{byeditor}{%
    \ifnameundef{editor}
      {}
      {\printnames[byeditor]{editor}%
      \setunit{\addcomma\space}%
      \usebibmacro{bytypestrg}{editor}{editor}%
      \newunit}%
    \usebibmacro{byeditorx}}%
  \renewbibmacro*{byeditorx}{%
    \ifnameundef{editora}
      {}
      {\printnames[byeditor]{editor}%
       \setunit{\addcomma\space}%
       \usebibmacro{bytypestrg}{editor}{editor}%
       \newunit}%
    \ifnameundef{editorb}
      {}
      {\printnames[byeditorb]{editorb}%
       \setunit{\addcomma\space}%
       \usebibmacro{bytypestrg}{editorb}{editor}%
       \newunit}%
    \ifnameundef{editorc}
      {}
      {\printnames[byeditorc]{editorc}%
       \setunit{\addcomma\space}%
       \usebibmacro{bytypestrg}{editorc}{editor}%
       \newunit}}%
  \renewbibmacro*{bytranslator}{%
    \ifnameundef{translator}
      {}
      {\printnames[bytranslator]{translator}%
       \setunit{\addcomma\space}%
       \bibstring{bytranslator}}}%
  \renewbibmacro*{byeditor+others}{%
    \ifnameundef{editor}
      {}
      {\printnames[byeditor]{editor}%
       \clearname{editor}%
       \setunit{\addcomma\space}%
       \usebibmacro{byeditor+othersstrg}%
       \newunit}%
    \usebibmacro{byeditorx}%
    \usebibmacro{bytranslator+others}}%
  \renewbibmacro*{bytranslator+others}{%
    \ifnameundef{translator}
      {}
      {\printnames[bytranslator]{translator}%
       \clearname{translator}%
       \setunit{\addcomma\space}%
       \usebibmacro{bytranslator+othersstrg}%
       \newunit}%
    \usebibmacro{withothers}}%
  \renewbibmacro*{bytypestrg}[2]{%
    \iffieldundef{#1type}
      {\bibstring{#2}}
      {\ifbibxstring{\thefield{#1type}}
         {\bibstring{\thefield{#1type}}}
         {\printtext{\thefield{#1type}}}}}
  \makeatletter
  \renewbibmacro*{byeditor+othersstrg}{%
    \iffieldundef{editortype}
      {\def\abx@tempa{editor}}
      {\edef\abx@tempa{\thefield{editortype}}}%
    \let\abx@tempb=\empty
    \ifnamesequal{editor}{translator}
      {\appto\abx@tempa{tr}%
       \appto\abx@tempb{\clearname{translator}}}
      {}%
    \ifnamesequal{editor}{commentator}
      {\appto\abx@tempa{co}%
       \appto\abx@tempb{\clearname{commentator}}}
      {\ifnamesequal{editor}{annotator}
         {\appto\abx@tempa{an}%
          \appto\abx@tempb{\clearname{annotator}}}
         {}}%
    \ifnamesequal{editor}{introduction}
      {\appto\abx@tempa{in}%
       \appto\abx@tempb{\clearname{introduction}}}
      {\ifnamesequal{editor}{foreword}
         {\appto\abx@tempa{fo}%
          \appto\abx@tempb{\clearname{foreword}}}
         {\ifnamesequal{editor}{afterword}
            {\appto\abx@tempa{af}%
             \appto\abx@tempb{\clearname{afterword}}}
            {}}}%
    \ifbibxstring{\abx@tempa}
      {\printtext{\bibstring{\abx@tempa}}\abx@tempb}
      {\usebibmacro{bytypestrg}{editor}{editor}}}%
  \renewbibmacro*{bytranslator+othersstrg}{%
    \def\abx@tempa{translator}%
    \ifnamesequal{translator}{commentator}
      {\appto\abx@tempa{co}%
       \clearname{commentator}}
      {\ifnamesequal{translator}{annotator}
         {\appto\abx@tempa{an}%
          \clearname{annotator}}
         {}}%
    \ifnamesequal{translator}{introduction}
      {\appto\abx@tempa{in}%
       \clearname{introduction}}
      {\ifnamesequal{translator}{foreword}
         {\appto\abx@tempa{fo}%
          \clearname{foreword}}
         {\ifnamesequal{translator}{afterword}
            {\appto\abx@tempa{af}%
             \clearname{afterword}}
            {}}}%
    \bibstring{\abx@tempa}}%
   \renewcommand*{\newunitpunct}{\addcomma\space}%
   \settoggle{blx@useauthor}{false}%
   \settoggle{blx@useeditor}{false}%
   \settoggle{blx@usetranslator}{false}%
   \usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\makeatother
\begin{document}
  \bfullcite{wilde}

  \bfullcite{foobar}

  \bfullcite{matuz:doody}

  \printbibliography
\end{document}

enter image description here

share|improve this answer
    
Thank you very much esp. for taking care of the editor stuff, which indeed looks very complicated. –  math Feb 25 at 12:28
    
@math Well ... it certainly looks complicated (and is hideous), but maybe there is a short and sweet way to do it (there often is with biblatex) I'm not aware of. –  moewe Feb 25 at 13:20
    
Oh.. I didn't want to complain! I am very happy with it, as I would not be able to solve this by myself. –  math Feb 25 at 15:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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