2


My problem is that I am trying to merge multiple occurances of a footcite on a page. It is the same situation as discribed in: https://tex.stackexchange.com/questions/126981/merging-duplicate-footcites. Unfortnatly the example does not work for me, which may be caused through the use of the following header:

\documentclass[a4paper,fontsize=12pt,headings=big,chapterprefix,bibliography=totoc,listof=totoc]{scrbook}

\usepackage[automark]{scrpage2}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{color} 
\usepackage{units}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
\usepackage{listings} 
\usepackage[style=authortitle-comp,backref=true,backend=biber,citetracker,pagetracker=page]{biblatex}
\usepackage[babel,german=quotes]{csquotes}
\usepackage[ngerman]{babel} 
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[rightcaption]{sidecap} 
\usepackage{float}
\usepackage{microtype}
\usepackage{titlesec} 
\usepackage[hang,labelfont=bf,font=it]{caption}
\usepackage{subcaption}
\usepackage[section]{placeins}
\usepackage[nottoc]{tocbibind}
\usepackage[nonumberlist,acronym,toc,section]{glossaries} 
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{berasans}
\usepackage[onehalfspacing]{setspace}
\usepackage{tocloft}
\usepackage[a4paper,head=3cm,bottom=25mm,left=3cm,right=2cm]{geometry}
\pagestyle{scrheadings}\pagestyle{plain}
\clearscrheadfoot
\ihead{\headmark}
\ofoot[\pagemark]{\pagemark}

\usepackage[pdftex,bookmarksopen]{hyperref}%,pagebackref


\newcommand{\TODO}[1]{{\color{red}\Large\MakeUppercase{#1}}\newline}
\newcommand{\todo}[1]{\TODO{#1}}


\definecolor{ownblue}{rgb}{0.015686 ,0.25882,0.54901}

\addto\captionsngerman{%
  \renewcommand{\figurename}{Abb.}%
  \renewcommand{\tablename}{Tab.}%
} 

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}

\graphicspath{{Bilder/}}

\setlength{\captionmargin}{20pt}
\pagestyle{scrheadings}

\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}

\renewcommand{\chaptermark}[1]{\markboth{\chapapp\;\thechapter: #1}{}}
\setkomafont{pageheadfoot}{\normalfont\sffamily\bfseries\color{ownblue}}
\setkomafont{pagenumber}{\normalfont\sffamily\bfseries}
\setheadsepline{0.2pt}
\typearea[10mm]{11}

\setkomafont{sectioning}{\sffamily\color{ownblue}}
\setheadwidth{textwithmarginpar}
\renewcommand{\thechapter}{\arabic{chapter}}
\titleformat{\chapter}[display]
{\sffamily\bfseries\color{ownblue}\fontsize{22}{22}\selectfont}
{\filleft\MakeUppercase{\chaptertitlename} \sffamily\fontsize{44}{44}\thechapter}
{2ex}
{\titlerule
\vspace{3ex}
\filright}\renewcommand*\chapterheadstartvskip{\vspace*{2cm}}
\renewcommand{\chaptermark}[1]{\markboth{\chapapp\;\thechapter: #1}{}}

\hypersetup{colorlinks=true, linkcolor=ownblue, filecolor=ownblue, urlcolor=ownblue, citecolor=ownblue, bookmarksnumbered=true}

\newglossary[slg]{symbolslist}{syi}{syg}{Symbolverzeichnis}
\renewcommand*{\glspostdescription}{}
\makeglossaries 

\bibliography{Bericht}

Edit: The minimal example would be:

\documentclass[a4paper,fontsize=12pt,headings=big,chapterprefix,bibliography=totoc,listof=totoc]{scrbook}

\usepackage[automark]{scrpage2}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{color} 
\usepackage{units}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
\usepackage{listings} 
\usepackage[style=authortitle-comp,backref=true,backend=biber,citetracker,pagetracker=page]{biblatex}
\usepackage[babel,german=quotes]{csquotes}
\usepackage[ngerman]{babel} 
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[rightcaption]{sidecap} 
\usepackage{float}
\usepackage{microtype}
\usepackage{titlesec} 
\usepackage[hang,labelfont=bf,font=it]{caption}
\usepackage{subcaption}
\usepackage[section]{placeins}
\usepackage[nottoc]{tocbibind}
\usepackage[nonumberlist,acronym,toc,section]{glossaries} 
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{berasans}
\usepackage[onehalfspacing]{setspace}
\usepackage{tocloft}
\usepackage[a4paper,head=3cm,bottom=25mm,left=3cm,right=2cm]{geometry}
\pagestyle{scrheadings}\pagestyle{plain}
\clearscrheadfoot
\ihead{\headmark}
\ofoot[\pagemark]{\pagemark}

\usepackage[pdftex,bookmarksopen]{hyperref}%,pagebackref


\newcommand{\TODO}[1]{{\color{red}\Large\MakeUppercase{#1}}\newline}
\newcommand{\todo}[1]{\TODO{#1}}


\definecolor{ownblue}{rgb}{0.015686 ,0.25882,0.54901}

\addto\captionsngerman{%
  \renewcommand{\figurename}{Abb.}%
  \renewcommand{\tablename}{Tab.}%
} 

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}

\graphicspath{{Bilder/}}

\setlength{\captionmargin}{20pt}
\pagestyle{scrheadings}

\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}

\renewcommand{\chaptermark}[1]{\markboth{\chapapp\;\thechapter: #1}{}}
\setkomafont{pageheadfoot}{\normalfont\sffamily\bfseries\color{ownblue}}
\setkomafont{pagenumber}{\normalfont\sffamily\bfseries}
\setheadsepline{0.2pt}
\typearea[10mm]{11}

\setkomafont{sectioning}{\sffamily\color{ownblue}}
\setheadwidth{textwithmarginpar}
\renewcommand{\thechapter}{\arabic{chapter}}
\titleformat{\chapter}[display]
{\sffamily\bfseries\color{ownblue}\fontsize{22}{22}\selectfont}
{\filleft\MakeUppercase{\chaptertitlename} \sffamily\fontsize{44}{44}\thechapter}
{2ex}
{\titlerule
\vspace{3ex}
\filright}\renewcommand*\chapterheadstartvskip{\vspace*{2cm}}
\renewcommand{\chaptermark}[1]{\markboth{\chapapp\;\thechapter: #1}{}}

\hypersetup{colorlinks=true, linkcolor=ownblue, filecolor=ownblue, urlcolor=ownblue, citecolor=ownblue, bookmarksnumbered=true}

\newglossary[slg]{symbolslist}{syi}{syg}{Symbolverzeichnis}
\renewcommand*{\glspostdescription}{}
\makeglossaries 

\bibliography{Bericht}

\begin{document}

\thispagestyle{empty}

\pagenumbering{arabic}


this\footcite{b1} is\footcite{b2} not\footcite{b1} merged\footcite{b1}

\end{document}

for the Bericht.tex file and for the Bericht.bib file:

@Article{b1,

  Title                    = {text},

  Author                   = {name1 and name2},

  Journal                  = {paper},

  Year                     = {2014}

}


@Article{b2,

  Title                    = {text2},

  Author                   = {author1 and author2},

  Journal                  = {paper},

  Year                     = {2014}

}

both are stored in UTF-8. I am "compiling" through cygwin and mingw on a windows with:

pdflatex Bericht
biber Bericht
pdflatex Bericht
pdflatex Bericht

Edit2: The minimal not working example would be

\documentclass[a4paper,fontsize=12pt,headings=big,chapterprefix,bibliography=totoc,listof=totoc]{scrbook}

\usepackage[automark]{scrpage2}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{color} 
\usepackage{units}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
\usepackage{listings} 
\usepackage[style=authortitle-comp,backref=true,backend=biber,citetracker,pagetracker=page]{biblatex}
\usepackage[babel,german=quotes]{csquotes}
\usepackage[ngerman]{babel} 
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[rightcaption]{sidecap} 
\usepackage{float}
\usepackage{microtype}
\usepackage{titlesec} 
\usepackage[hang,labelfont=bf,font=it]{caption}
\usepackage{subcaption}
\usepackage[section]{placeins}
\usepackage[nottoc]{tocbibind}
\usepackage[nonumberlist,acronym,toc,section]{glossaries} 
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{berasans}
\usepackage[onehalfspacing]{setspace}
\usepackage{tocloft}
\usepackage[a4paper,head=3cm,bottom=25mm,left=3cm,right=2cm]{geometry}
\pagestyle{scrheadings}\pagestyle{plain}
\clearscrheadfoot
\ihead{\headmark}
\ofoot[\pagemark]{\pagemark}

\usepackage[pdftex,bookmarksopen]{hyperref}%,pagebackref


\newcommand{\TODO}[1]{{\color{red}\Large\MakeUppercase{#1}}\newline}
\newcommand{\todo}[1]{\TODO{#1}}


\definecolor{ownblue}{rgb}{0.015686 ,0.25882,0.54901}

\addto\captionsngerman{%
  \renewcommand{\figurename}{Abb.}%
  \renewcommand{\tablename}{Tab.}%
} 

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}

\graphicspath{{Bilder/}}

\setlength{\captionmargin}{20pt}
\pagestyle{scrheadings}

\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}

\renewcommand{\chaptermark}[1]{\markboth{\chapapp\;\thechapter: #1}{}}
\setkomafont{pageheadfoot}{\normalfont\sffamily\bfseries\color{ownblue}}
\setkomafont{pagenumber}{\normalfont\sffamily\bfseries}
\setheadsepline{0.2pt}
\typearea[10mm]{11}

\setkomafont{sectioning}{\sffamily\color{ownblue}}
\setheadwidth{textwithmarginpar}
\renewcommand{\thechapter}{\arabic{chapter}}
\titleformat{\chapter}[display]
{\sffamily\bfseries\color{ownblue}\fontsize{22}{22}\selectfont}
{\filleft\MakeUppercase{\chaptertitlename} \sffamily\fontsize{44}{44}\thechapter}
{2ex}
{\titlerule
\vspace{3ex}
\filright}\renewcommand*\chapterheadstartvskip{\vspace*{2cm}}
\renewcommand{\chaptermark}[1]{\markboth{\chapapp\;\thechapter: #1}{}}

\hypersetup{colorlinks=true, linkcolor=ownblue, filecolor=ownblue, urlcolor=ownblue, citecolor=ownblue, bookmarksnumbered=true}

\newglossary[slg]{symbolslist}{syi}{syg}{Symbolverzeichnis}
\renewcommand*{\glspostdescription}{}
\makeglossaries 

\bibliography{Bericht}

\DeclareCiteCommand{\superfootcite}[\cbx@wrap]
  {\gdef\cbx@keys{}}
  {\xappto\cbx@keys{\thefield{entrykey},}}
  {}
  {\ifcsundef{cbx@lastin@\cbx@keys @\strfield{postnote}}
     {\csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{-1}}{}%
   \ifsamepage{\value{instcount}}{\csuse{cbx@lastin@\cbx@keys @\strfield{postnote}}}
     {\footnotemark[\csuse{cbx@lastfn@\cbx@keys @\strfield{postnote}}]}
     {\xappto\cbx@cite{\noexpand\footcite%
        [\thefield{prenote}][\thefield{postnote}]{\cbx@keys}%
        \csnumgdef{cbx@lastfn@\cbx@keys @\strfield{postnote}}{\value{\@mpfn}}%
        \csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{\value{instcount}}}}}
%removing the next 3 lines leads to the point that it only does not know the superfootcite command
\newrobustcmd{\cbx@wrap}[1]{#1\cbx@cite\gdef\cbx@cite{}}
\def\cbx@cite{}
\makeatother

\begin{document}

\thispagestyle{empty}

\pagenumbering{arabic}


this\superfootcite[]{b1} is\superfootcite[]{b2} not\superfootcite[]{b1} working\superfootcite[]{b1}

\end{document}
3
  • As requested, I added a minmal example.
    – betlor5
    Dec 1, 2014 at 17:51
  • Your MWE does not include the \superfootcite code from the linked answer. Dec 1, 2014 at 17:53
  • As I have stated before: it did not work, therefore i did not include it.
    – betlor5
    Dec 1, 2014 at 17:55

1 Answer 1

1

Using the code from the linked question does work:

Text sample

Foot sample

Note that I use \superfootcite rather than \footcite. Also I changed your \bibliography command to \addbibresource.

\documentclass[a4paper,fontsize=12pt,headings=big,chapterprefix,bibliography=totoc,listof=totoc]{scrbook}

\usepackage[automark]{scrpage2}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{color} 
\usepackage{units}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
\usepackage{listings} 
\usepackage[style=authortitle-comp,backref=true,backend=biber,citetracker,pagetracker=page]{biblatex}
\usepackage[babel,german=quotes]{csquotes}
\usepackage[ngerman]{babel} 
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[rightcaption]{sidecap} 
\usepackage{float}
\usepackage{microtype}
\usepackage{titlesec} 
\usepackage[hang,labelfont=bf,font=it]{caption}
\usepackage{subcaption}
\usepackage[section]{placeins}
\usepackage[nottoc]{tocbibind}
\usepackage[nonumberlist,acronym,toc,section]{glossaries} 
\usepackage[T1]{fontenc}
\usepackage{mathptmx}
\usepackage{berasans}
\usepackage[onehalfspacing]{setspace}
\usepackage{tocloft}
\usepackage[a4paper,head=3cm,bottom=25mm,left=3cm,right=2cm]{geometry}
\pagestyle{scrheadings}\pagestyle{plain}
\clearscrheadfoot
\ihead{\headmark}
\ofoot[\pagemark]{\pagemark}

\usepackage[pdftex,bookmarksopen]{hyperref}%,pagebackref


\newcommand{\TODO}[1]{{\color{red}\Large\MakeUppercase{#1}}\newline}
\newcommand{\todo}[1]{\TODO{#1}}


\definecolor{ownblue}{rgb}{0.015686 ,0.25882,0.54901}

\addto\captionsngerman{%
  \renewcommand{\figurename}{Abb.}%
  \renewcommand{\tablename}{Tab.}%
} 

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}

\graphicspath{{Bilder/}}

\setlength{\captionmargin}{20pt}
\pagestyle{scrheadings}

\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}

\renewcommand{\chaptermark}[1]{\markboth{\chapapp\;\thechapter: #1}{}}
\setkomafont{pageheadfoot}{\normalfont\sffamily\bfseries\color{ownblue}}
\setkomafont{pagenumber}{\normalfont\sffamily\bfseries}
\setheadsepline{0.2pt}
\typearea[10mm]{11}

\setkomafont{sectioning}{\sffamily\color{ownblue}}
\setheadwidth{textwithmarginpar}
\renewcommand{\thechapter}{\arabic{chapter}}
\titleformat{\chapter}[display]
{\sffamily\bfseries\color{ownblue}\fontsize{22}{22}\selectfont}
{\filleft\MakeUppercase{\chaptertitlename} \sffamily\fontsize{44}{44}\thechapter}
{2ex}
{\titlerule
\vspace{3ex}
\filright}\renewcommand*\chapterheadstartvskip{\vspace*{2cm}}
\renewcommand{\chaptermark}[1]{\markboth{\chapapp\;\thechapter: #1}{}}

\hypersetup{colorlinks=true, linkcolor=ownblue, filecolor=ownblue, urlcolor=ownblue, citecolor=ownblue, bookmarksnumbered=true}

\newglossary[slg]{symbolslist}{syi}{syg}{Symbolverzeichnis}
\renewcommand*{\glspostdescription}{}
\makeglossaries 

\addbibresource{Bericht.bib}

\makeatletter
\DeclareCiteCommand{\superfootcite}[\cbx@wrap]
  {\gdef\cbx@keys{}}
  {\xappto\cbx@keys{\thefield{entrykey},}}
  {}
  {\ifcsundef{cbx@lastin@\cbx@keys @\strfield{postnote}}
     {\csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{-1}}{}%
   \ifsamepage{\value{instcount}}{\csuse{cbx@lastin@\cbx@keys @\strfield{postnote}}}
     {\footnotemark[\csuse{cbx@lastfn@\cbx@keys @\strfield{postnote}}]}
     {\xappto\cbx@cite{\noexpand\footcite%
        [\thefield{prenote}][\thefield{postnote}]{\cbx@keys}%
        \csnumgdef{cbx@lastfn@\cbx@keys @\strfield{postnote}}{\value{\@mpfn}}%
        \csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{\value{instcount}}}}}

\newrobustcmd{\cbx@wrap}[1]{#1\cbx@cite\gdef\cbx@cite{}}
\def\cbx@cite{}

\makeatother

\begin{document}

\thispagestyle{empty}

\pagenumbering{arabic}


This\superfootcite{b1} is\superfootcite{b2} really\superfootcite{b1} merged\superfootcite{b1}.

\end{document}

You must log in to answer this question.

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