# BibLaTeX: Making verbose-authoryear fullbibliography at once

Because @Andy found that my question has an inconsequence, I rewrote my question with new style (cbx) file (thanks!).

Verbose is a good style in our research field, in so far as books are cited only in footnote. But I want to refer some books (some elementary sources and some secondary) also in body with the following way. A current popular citation style in humanities is:

Notice that citation forms of the books, one of which has "Im folgenden Zitat..." (henceforth cited as...) and the other one does not have. Some sources in my .bib file have a definition of the shorthand field, the other have no definition. Classical books, such as Kant's Kritik der praktischen Vernunft, have an abbreviation. In this case the source should be display with it (neither "Kant, 1788" nor "Kant, KpV", but just "KpV"), while the other sources are cited as author-year (I need no declaration "henceforth cited as..." in this case).

As I found http://www.latex-community.org/forum/viewtopic.php?f=4&t=852 , I'd want to do like this. Following code, which is modified from verbose.cbx, is saved as "verbose-authoryear.cbx". The file, which ist named "verbose-authoryear.bbx", is same as verbose-authoryear.bbx.

\ProvidesFile{verbose.cbx}
[\abx@cbxid $Id: verbose.cbx,v 1.6 2011/07/29 19:21:28 lehman stable$]

\InitializeCitationStyle{\numgdef{\cbx@resetcount}{\cbx@resetcount+1}}
\DeclareFieldFormat{bibhypertarget}{%
\bibhypertarget{\iffootnote{f}{t}:\cbx@resetcount:\thefield{entrykey}}{#1}}
\newcommand*{\cbx@resetcount}{0}
\newbibmacro*{cite:citepages}{}
\newbibmacro*{cite:full:citepages}{}
\newbibmacro*{cite:postnote}{}

\DeclareBibliographyOption{citepages}[permit]{%
\ifcsdef{cbx@opt@citepages@#1}
{\csuse{cbx@opt@citepages@#1}}
{\PackageError{biblatex}
{Invalid option 'citepages=#1'}
{Valid values are 'permit', 'suppress', 'omit', 'separate'.}}}

\providebibmacro*{cite:citepages}{}
\providebibmacro*{cite:full:citepages}{}
\providebibmacro*{cite:postnote}{}

\def\cbx@opt@citepages@permit{%
\renewbibmacro*{cite:citepages}{}%
\renewbibmacro*{cite:full:citepages}{}%
\renewbibmacro*{cite:postnote}{\usebibmacro{postnote}}}

\def\cbx@opt@citepages@suppress{%
\renewbibmacro*{cite:citepages}{}%
\renewbibmacro*{cite:full:citepages}{%
\clearfield{pages}%
\clearfield{pagetotal}}%
\renewbibmacro*{cite:postnote}{\usebibmacro{postnote}}}

\def\cbx@opt@citepages@omit{%
\renewbibmacro*{cite:citepages}{}%
\renewbibmacro*{cite:full:citepages}{%
\ifboolexpr{
test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
and
test {\iffieldpages{postnote}}
}
{\clearfield{pages}%
\clearfield{pagetotal}}
{}}%
\renewbibmacro*{cite:postnote}{\usebibmacro{postnote}}}

\def\cbx@opt@citepages@separate{%
\providetoggle{cbx:fullcite}%
\renewbibmacro*{cite:citepages}{%
\global\togglefalse{cbx:fullcite}}%
\renewbibmacro*{cite:full:citepages}{%
\global\toggletrue{cbx:fullcite}}%
\renewbibmacro*{cite:postnote}{%
\ifboolexpr{
togl {cbx:fullcite}
and
test {\iffieldpages{postnote}}
and
test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
and
(
not test {\iffieldundef{pages}}
or
not test {\iffieldundef{pagetotal}}
)
}
{\usebibmacro{cite:postnote:pages}}
{\usebibmacro{postnote}}}
\providebibmacro*{cite:postnote:pages}{%
\setunit{\postnotedelim}%
\bibstring{thiscite}%
\printfield{postnote}}}

\ExecuteBibliographyOptions{citetracker=context,autocite=footnote,citepages=permit}

%\newbibmacro*{cite}{%
%  \usebibmacro{cite:citepages}%
%  \ifciteseen
%    {\iffieldundef{shorthand}
%       {\usebibmacro{cite:short}}
%       {\usebibmacro{cite:shorthand}}}
%    {\usebibmacro{cite:full}}}

%replaced the last section with the following section
%by asblom http://www.latex-community.org/forum/viewtopic.php?f=4&t=852

\newbibmacro*{cite}{%
\ifciteseen
{\iffieldundef{shorthand}
{\ifnameundef{author}{\usebibmacro{cite:title}}{\usebibmacro{cite:name}}%
\usebibmacro{cite:year}}
{\usebibmacro{cite:shorthand}}}
{\usebibmacro{cite:full}}}

\newbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}%
\usebibmacro{shorthandintro}}

\newbibmacro*{cite:short}{%
\printnames{labelname}%
\setunit*{\nametitledelim}%
\printfield[citetitle]{labeltitle}}}

\newbibmacro*{cite:shorthand}{%

\newbibmacro*{cite:year}{%
\printfield{year}%

\newbibmacro*{cite:name}{%
\printnames{labelname}%
\setunit*{\nametitledelim}}

\DeclareCiteCommand{\cite}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\parencite}[\mkbibparens]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}

\endinput


But as I wrote the following TeX document,

\documentclass{report}
\usepackage[dvips]{graphicx}
\usepackage[ngerman]{babel}
\usepackage[
style=verbose-authoryear,
]{biblatex}
\usepackage[babel,german=quotes]{csquotes}

\renewcommand\mkbibnamelast[1]{\textsc{#1}}
\renewcommand\mkbibnamefirst[1]{\textsc{#1}}

\begin{filecontents*}{biblatex-examples.bib}
@Book{kant:kpv,
shorthand   = {KpV},
hyphenation     = {german},
author      = {Kant, Immanuel},
bookauthor      = {Kant, Immanuel},
title       = {Kritik der praktischen Vernunft},
shorttitle      = {Kritik der praktischen Vernunft},
booktitle   = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
year        = {1788},
}

hyphenation     = {german},
title       = {Probleme der Moralphilosophie},
shorttitle      = {Probleme},
location    = {Frankfurt am Main},
year        = {1996},

\end{filecontents*}

\bibliography{biblatex-examples}

\begin{document}

Als Kant in der \cite{kant:kpv}, es geschrieben hat, war die Lage anders. Er schrieb,
"Handle so, dass die Maxime deines Willens..."'.\footnote{\cite{kant:kpv}, S.54.}
Theodor W.Adorno erkl"art diesen Satz so, dass diese kategorische Imperativ die moderne
Vernunft voraussetzt.\footnote{Vgl. \cite{adorno-probleme}, S.30ff. Er tat Vorlesung
nach Kant.}
Nach Adornos Ansicht ist die Trennung von Antik und Moderne ansichtig.
"In der modernen Zeit ist die Vernunft sowohl gemeinsam als auch pers"onlich"'

\printshorthands
\printbibliography
\end{document}


I found a problem. Full bibliography emerges two times, if I cited not only in the footnote but also in the body. I'd like to put in the full bibliography in the footnote, even if I cited firstly on the body. How can I solve?

P.S. This verbose-authoryear.cbx was made, as I've just started to learn LaTeX (one week ago). Now I'm informed that I should make new citation style with writing in preamble rather than making new cbx. file. I'm wondering I can do it.

-

Your desired citation style runs into a number of issues, many of which aren't addressed in the sample output you provided. Being new to biblatex, this is understandable. However it is difficult to provide a solution without knowing how you're wanting to handle each problem. I've made some guesses, summarized as follows.

Prenotes and postnotes

If the first citation is inline \cite[prenote][postnote]{key}, where should prenote and postnote go - inline or in the footnote? I've assumed in the footnote. Inline multi-citations

\cites(multiprenote)(multipostnote)[prenote1][postnote1]{key1}[prenote2][postnote2]{key2}


follow the same rule, but multiprenote and multipostnote are printed inline.

Disambiguation

The verbose styles are based on the author-title bibliography style. Different entries having the same author and year would have ambiguous author-year citations without use of the labelyear field. This field can be made available with the option settings style=verbose,labelyear=true or bibstyle=authoryear,citestyle=verbose. The example below takes the latter approach.

Verbose styles

There are a number of variants of the style verbose. The solution below should work with citestyle set to any of the standard verbose styles (verbose-ibid, verbose-trad1, etc).

Punctuation

In the example document the location of punctuation around some inline citations is less than ideal. For example in the first citation "KU.1" better than "KU 1." Trailing punctuation can be parsed by \autocite and low-level citation commands (as discussed in a previous question). This would require a different approach than the one shown below. It wouldn't readily extend to qualified citation lists, but hopefully this limitation will improve with upgrades to biblatex.

\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[american]{babel}
\usepackage[bibstyle=authoryear,citestyle=verbose]{biblatex}

% Set additional options for demonstration
\ExecuteBibliographyOptions{citetracker=true,citepages=omit,maxcitenames=1,dashed=false}

% Add comma between labelname and labelyear

% Hack to omit parentheses around year
\newbool{bbx:parens}
\global\booltrue{bbx:parens}
\renewbibmacro*{begentry}{\global\boolfalse{bbx:parens}}
\renewcommand*{\labelnamepunct}{\newunitpunct\global\booltrue{bbx:parens}}
\DeclareFieldFormat{parens}{\ifbool{bbx:parens}{\mkbibparens{#1}}{\newunitpunct#1}}

% Set shorthands in italics
\DeclareFieldFormat{shorthand}{\mkbibemph{#1}}

% Set labelname/author/editor in small capitals
\renewcommand*{\mkbibnamefirst}[1]{\ifmknamesc{\textsc{#1}}{#1}}
\renewcommand*{\mkbibnamelast}[1]{\ifmknamesc{\textsc{#1}}{#1}}
\renewcommand*{\mkbibnameprefix}[1]{\ifmknamesc{\textsc{#1}}{#1}}
\renewcommand*{\mkbibnameaffix}[1]{\ifmknamesc{\textsc{#1}}{#1}}
\def\ifmknamesc{%
\ifboolexpr{ ( test {\ifbibliography} or test {\ifbool{citetracker}} )
and ( test {\ifcurrentname{labelname}}
or test {\ifcurrentname{author}}
or ( test {\ifnameundef{author}}
and test {\ifcurrentname{editor}} ) ) }}

\makeatletter

% Omit inline prenote if citation issues \footcite
\renewbibmacro*{prenote}{%
\iffieldundef{prenote}
{\global\undef{\cbx@prenote}}
{\ifboolexpr{ not test{\ifciteseen} and not test {\iffootnote} }
{\savefield{prenote}{\cbx@prenote}%
\clearfield{prenote}}
{\printfield{prenote}%
\setunit{\prenotedelim}}}}

% On first citation print full entry if in footnote;
% if not in footnote, print label inline and issue \footcite
\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\iffootnote
{\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}%
\usebibmacro{shorthandintro}}
{\iffieldundef{shorthand}
{\usebibmacro{cite:short}}
{\usebibmacro{cite:shorthand}}%
\ifundef{\cbx@prenote}
{}
{\restorefield{prenote}{\cbx@prenote}}%
\footcite{\thefield{entrykey}}%
\clearfield{postnote}}}

\makeatother

\renewbibmacro*{cite:shorthand}{%
\printtext[bibhyperref]{\printfield{shorthand}}}

% Print labelyear instead of title
\renewbibmacro*{cite:short}{%
\printnames{labelname}%
\setunit{\nameyeardelim}%
\usebibmacro{cite:labelyear+extrayear}}

\providebibmacro*{cite:title}{}
\renewbibmacro*{cite:title}{%
\usebibmacro{cite:labelyear+extrayear}}

\newbibmacro*{cite:labelyear+extrayear}{% from authoryear.cbx
\iffieldundef{labelyear}
{}
{\printtext[bibhyperref]{\printfield{labelyear}\printfield{extrayear}}}}

\begin{document}
\null\vfill\noindent
Filler text \cite{kant:ku}.
Filler text \autocites[See][10--15]{kant:ku}[10--15]{bertram}.
Filler text \autocite{knuth:ct:c,companion}.
Filler text.\footcite[See][10--15]{knuth:ct:b}
Filler text \parencites(See)(for example)[10--15]{knuth:ct:b}[10--15]{knuth:ct:d}.
\printbibliography
\end{document}


-
Now I've tested in a shorter way. I think, it runs very good. (I must test again after sleeping.) I appreciated your kind communication and intensive and brilliant work. Good night... –  Akira Ueda Oct 23 '11 at 23:39
@AkiraUeda You're welcome. I omitted a few details - mainly around note fields. I'll make an edit to fix that. This solution does need more testing. You might also want take some time to consider whether or not you'd prefer an approach that will handle punctuation for you. (I know I probably would...) –  Audrey Oct 24 '11 at 0:07
OK, I don't proof more. A small question at the end. As you and P. Lehman exchanged [in the other question][1], I didn't understand the expression "\cbx@textcites performs the equivalent of \citeauthor", so that I couldn't trace your conversation. verbose.cbx has no definition of textcites. How can I know? In our case that means "cbx@prenote"? Sorry, beginners question. Thank you all at all! [1]:tex.stackexchange.com/questions/26401/… –  Akira Ueda Oct 24 '11 at 10:09
@AkiraUeda The verbose styles have no \textcite command, but this should change with version 1.7. \cbx@ is a prefix we assign to commands we don't intend the end-user to access. Prefixes like cbx or bbx are naming conventions used to avoid name conflicts. \cbx@textcites prints labelname inline and collects entry data into \cbx@savedkeys and \cbx@savedcites. These macros are expanded in the wrapper of \textcites. Philipp's improved solution is easier to follow. Neither one handles trailing punctuation, however. –  Audrey Oct 24 '11 at 13:42
Thank you so much!! –  Akira Ueda Oct 24 '11 at 17:38