BibTeX, biblatex and biber ⇒ long citations for multiple formats
-
- Posts: 94
- Joined: Wed Sep 07, 2011 3:14 pm
long citations for multiple formats
Cheers,
EE
- Attachments
-
- ibid tester.tex
- (1.68 KiB) Downloaded 306 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
long citations for multiple formats
Sourcemoewe wrote:Oh crikey, that is a complicated one. The code in biblatex-chicago is really complicated and lengthy and can be a pain to modify. There is \ifuniquework to check for situations where one labelname-labeltitle combination occurs more than once, one could use that to add additional information. It is not clear to me, however, what the expected behaviour would be in that case. What would one add? Can we make sure that by adding that bit we get a unique citations? Etc.?
Not really keen on signing up for another forum, but a first suggestion can be found at gist.github.com/moewew/9805f72a43ca2cc56ee6e4c3819a2354 This will issue a full citation if the short 'name-title' is not unique. For LyX users note that I had to add the loading option uniquework=true to biblatex-chicago (this is crucial), the other interesting bit is between the redefinition of cite.
Code: Select all
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\setotherlanguage[variant=german,spelling=new,babelshorthands=true]{german}
\newenvironment{ngerman}{\begin{german}}{\end{german}}
\usepackage[notes, natbib, backend=biber, alldates=edtf, idemtracker=context, ibidtracker=context, dateabbrev=false, language=american, autocite=footnote, uniquework=true]{biblatex-chicago}
\renewcommand{\citet}[1]{\autocite{#1}}
\defaultfontfeatures{Ligatures=TeX,Numbers=OldStyle}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
% Encoding: UTF-8
@Audio{logothetis1970anastaseis,
author = {{A}nestis {L}ogothetis},
title = {Άναστάσεις},
year = {1971},
note = {{S}y. 2210},
organization = {{G}. {R}icordi und {C}o. {B}{\"u}hnen- und {M}usikverlag, {G}mb{H}},
location = {{M}{\"u}nchen},
}
@Video{logothetis1970anastasisvideo,
author = {{A}nestis {L}ogothetis},
editor = {{S}iegfried {B}ehrend},
title = {Άναστάσεις},
year = {1970},
date = {1970-06-24},
organization = {{S}aarl{\"a}ndischer {R}undfunk},
location = {Saarbr{\"u}cken},
url = {https://www.youtube.com/watch?v=yzdC56ByWqU},
urldate = {2017-06-28},
editora = {{C}laudia {B}rodzinska-{B}ehrend},
editoratype = {none},
editortype = {director},
}
@Music{logothetis1985anastaseis,
author = {{A}nestis {L}ogothetis},
editor = {{S}iegfried {B}ehrend},
title = {Άναστάσεις},
year = {1985},
type = {LP},
editortype = {director},
publisher = {{A}madeo},
series = {{\"O}sterreichische {M}usik der {G}egenwart},
}
@Misc{logothetis1970anastasissendung,
author = {{A}nestis {L}ogothetis},
editor = {{S}iegfriend {B}ehrend},
title = {Άναστάσεις},
year = {1970},
date = {1970-06-24},
type = {radio broadcast},
location = {{S}aarbr{\"u}cken},
editora = {{C}laudia {P}rodzinska-{B}ehrend},
editoratype = {none},
editorb = {{E}wald {L}iska},
editorbtype = {none},
editortype = {director},
publisher = {{S}aarl{\"a}ndischer {R}undfunk},
series = {{H}{\"o}rspielabend},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\makeatletter
\newbibmacro*{cite}{%
\ifciteseen%
{\ifboolexpr{%
test {\iffieldundef{shorthand}}%
or
(
togl {blx@skipbiblist}%
and
togl {cms@inheritshhand}%
and
not test {\iffieldundef{crossref}}%
)
}%
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}%
{\usebibmacro{cite:ibid}%
\usebibmacro{cite:save}}%
{\ifuniquework
{\global\toggletrue{cms@shortnote}%
\global\togglefalse{cms@fullnote}%
\usebibmacro{cite:short}}%
{\global\toggletrue{cms@fullnote}%
\global\togglefalse{cms@shortnote}%
\usebibmacro{cite:full}}%
\usebibmacro{cite:save}}}%
{\iftoggle{cms@shorthandibid}%
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}%
{\usebibmacro{cite:ibid}%
\usebibmacro{cite:save}}%
{\usebibmacro{cite:shorthand}%
\usebibmacro{cite:save}%
\global\toggletrue{cms@noidem}}}%
{\usebibmacro{cite:shorthand}%
\usebibmacro{cite:save}%
\global\toggletrue{cms@noidem}}}}%
{\ifboolexpr{%
togl{cms@firstshort}%
and
not test {\iffieldundef{shorthand}}%
}%
{\usebibmacro{cite:shorthand}%
\usebibmacro{cite:save}%
\global\toggletrue{cms@noidem}}%
{\ifboolexpr{togl {cms@allshort} and test {\ifuniquework}}
{\global\toggletrue{cms@shortnote}%
\global\togglefalse{cms@fullnote}%
\global\toggletrue{cms@printshhand}%
\usebibmacro{cite:short}%
\usebibmacro{cite:save}}%
{\global\toggletrue{cms@fullnote}%
\global\togglefalse{cms@shortnote}%
\usebibmacro{cite:full}%
\usebibmacro{cite:save}}}}}%
\makeatother
\begin{document}
Lorem\autocite{logothetis1970anastaseis}
ipsum\autocite{logothetis1970anastasisvideo}
dolor\autocite{logothetis1970anastaseis}
amet\autocite{sigfridsson}
sit\autocite{logothetis1970anastasissendung}
amet\autocite{logothetis1985anastaseis}
Lorem\autocite{logothetis1970anastaseis}
amet\autocite{sigfridsson}
ipsum\autocite{logothetis1970anastasisvideo}
dolor\autocite{logothetis1970anastaseis}
sit\autocite{logothetis1970anastasissendung}
amet\autocite{logothetis1985anastaseis}
\printbibliography
\end{document}
- Attachments
-
- moeweChicago.pdf
- (27.09 KiB) Downloaded 217 times