2

I have the following problem: I need a kind of very simple "double citing system". For normal literature I use the author-year style in biblatex without problems. I made following small changes:

\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}
\renewcommand{\postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{#1}

The problem is now I want to cite old books (early modern period) in a different way (not as author-year), something like this:

 Shortauthor, *shorttitle*, p. 124

I think a solution is to write an own cite command, something like this, which seems to work well:

\DeclareBibliographyDriver{myshort}{%
 \usebibmacro{begentry}%
  \ifboolexpr{ test{\ifnameundef{shortauthor}} 
            or test {\iffieldundef{shorttitle}}}
   {\usedriver{}{\thefield{entrytype}}}
   {\printnames{shortauthor}%
    \setunit{\addcomma\space}%
    \printfield{shorttitle}\isdot}%
    \usebibmacro{finentry}%
  }

  \DeclareCiteCommand{\mycite}[\mkbibfootnote]
   {\usebibmacro{prenote}}
   {\usedriver{}{myshort}}
   {\multicitedelim}
    {\usebibmacro{postnote}}

BUT (and this is my actual question): is there a way to:

  • disable the small capitals of the author?
  • put the title in cursive?
  • get the "p." for pages back?

That is, a way of somehow disable for this concrete command the general options I put with the renewcommands, etc.

2
  • By ‘cursive’, I suppose you mean italic?
    – Bernard
    Commented Dec 12, 2014 at 19:54
  • Yes, of course. Sorry for the mistake.
    – rogorido
    Commented Dec 12, 2014 at 22:28

1 Answer 1

2

A useful trick for situations like this is to create a toggle that it is turned on when you enter the command and turned off when leaving the command:

\newtoggle{mycite}

\renewcommand*{\mkbibnamelast}[1]{\iftoggle{mycite}{#1}{\textsc{#1}}}
\renewcommand{\postnotedelim}{\iftoggle{mycite}{\addcomma\addspace}{\addcolon\space}}
\DeclareFieldFormat{postnote}{#1}

and then, when you define your new cite command:

\DeclareCiteCommand{\mycite}[\mkbibfootnote]
   {\toggletrue{mycite}\usebibmacro{prenote}}
   {\usebibmacro{mycite}}
   {\multicitedelim}
   {\usebibmacro{postnote}\togglefalse{mycite}}

By the way, you cannot use \usedriver{}{\thefield{entrytype} within the definition of \DeclareBibliographyDriver: it will enter in an infinite loop and TeX will report an error. What you can do is to define a new bib macro. For example, using your definition as a starting point (and adjusted to put the (short)title in itialic):

\newbibmacro{mycite}{
   \ifboolexpr
     {test {\ifnameundef{shortauthor}} or
      test {\iffieldundef{shorttitle}}}
     {\usedriver{}{\thefield{entrytype}}} 
     {\printnames{shortauthor}%
     \setunit{\addcomma\space}%
     \mkbibemph{\printfield{shorttitle}}}
}
3
  • thanks a lot. This seems to work perfectly. Except for getting back the p. or pp. I have put \DeclareFieldFormat{postnote}{\iftoggle{mycite}{p.#1}{#1}}, but I can imagine I should use a macro instead of "p.", but which one?
    – rogorido
    Commented Dec 12, 2014 at 22:31
  • I ignore that on purpose (and forgot to add the reason in my answer). I think you should put p. or pp. in the post note directly. What about if you refer to a chapter instead of a page?
    – Guido
    Commented Dec 12, 2014 at 22:35
  • You're right. Thanks a lot again! This was very helpful!
    – rogorido
    Commented Dec 12, 2014 at 22:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .