0

I'm new here. I've used LaTeX for same of my articles and until now I was able to solve my problems on my own. But now I'm stuck.

I've to split my bibliography in reliable and non-reliable sources. The reliable sources should be cited with the alphabetic style inline. The non-reliable should be cited as footnote with verbose-note style. Both should also be printed in their own bibliography.

I've used this answere: Biblatex: Two bibliographies with different styles and sortings I manged to split the bibliography and use the given different styles.

I'm stuck on how to tell the scondary bibliography to use verbose-note for my footcite.

I hope someone can help me!

Many Thanks in advance. (My MWE is the answere of the given link)

2

A nice guy hinted me on using \footfullcite{}. That was exactly what I'm looking for!

  • Of course that is by no means an automatic solution - the one you linked to chooses the style automatically based on keywords. That is a whole lot more involved. Especially if you want some citations in footnotes and others not. (What do you do if you have \cite{foo,bar} where foo should get an alphabetic style and bar should go to the footnote.) Then things become a bit more intricate - even more than changing between numeric and alphabetic. – moewe Sep 14 '16 at 12:41
2

This is not a complete solution, but I hope it might be useful.

The main idea is to compose a list of "unreliable" sources

\gdef\unreliable{}
\listadd{\unreliable}{LinkD01}
\listadd{\unreliable}{LinkC04}

and then to use the following citation command, which has the usual format \mycite[prenote][postnote]{key}:

\usepackage{xparse}
\DeclareDocumentCommand{\mycite}{oom}{%
  \ifinlist{#3}{\unreliable} %in the list of 'reliables'?
    {\IfNoValueTF{#2}
      {\IfNoValueTF{#1}
        {\footfullcite{#3}}
        {\footfullcite[#1]{#3}}}
      {\footfullcite[#1][#2]{#3}}}
    {\IfNoValueTF{#2}
      {\IfNoValueTF{#1}
        {\cite{#3}}
        {\cite[#1]{#3}}}
      {\cite[#1][#2]{#3}}}}

As you see, \mycite doesn't fully support the citing of several keys.

If you add keys to the \unreliable list manually using \listadd, this is basically enough to solve the problem. But it's also possible to populate the list automatically. To do this we first define a special bibenvironment

\defbibenvironment{counting}
  {}
  {}
  {\listxadd{\unreliable}{\thefield{entrykey}}}

and then fill in the list in the beginning of the document:

\begingroup%
  \makeatletter%
  \def\blx@driver#1{}%
  \printbibliography[env=counting,heading=none,keyword=secondary]%
  \makeatother%
\endgroup%

The list will contain all sources with the keyword secondary.

For I don't know what reason the \ifinlist command didn't work for me in this automatic case. So in the MWE below I use instead the following command:

\newtoggle{tempa}
\newcommand{\ifunreliable}[3]{%
  \renewcommand*{\do}[1]{%
    \togglefalse{tempa}%
    \ifstrequal{#1}{##1}
      {\toggletrue{tempa}\listbreak}
      {}}%
  \dolistloop{\unreliable}%
  \iftoggle{tempa}{#2}{#3}%
  }

Full MWE with automatic list filling:

\documentclass{article}

\usepackage{filecontents}

\begin{filecontents}{biblatextest1.bib}
@BOOK{BookA03,
  author    = {Author Aaa},
  title     = {Some Title},
  publisher = {Some Publisher},
  year      = 2003,
}
@BOOK{BookB02,
  author    = {Author Bbb},
  title     = {Some Title},
  publisher = {Some Publisher},
  year      = 2002,
}
\end{filecontents}

\begin{filecontents}{biblatextest2.bib}
@MISC{LinkC04,
  author  = {Author Ccc},  
  title   = {Some Title},
  year    = 2004,
  url     = {www.test1.com/bild.jpg},
}
@MISC{LinkD01,
  author  = {Author Ddd},
  title   = {Some Title},
  year    = 2001,
  url     = {www.test2.com/bild.jpg},
}
\end{filecontents}

\usepackage[style = alphabetic, labelnumber, defernumbers = true,  backend = biber]{biblatex}
\addbibresource{biblatextest1.bib}
\addbibresource{biblatextest2.bib}

\usepackage{hyperref}

%Append keywords to identify different bibliography entries.
\DeclareSourcemap{
  \maps[datatype=bibtex, overwrite]{
    \map{
      \perdatasource{biblatextest1.bib}
      \step[fieldset=KEYWORDS, fieldvalue=primary, append]
    }
    \map{
      \perdatasource{biblatextest2.bib}
      \step[fieldset=KEYWORDS, fieldvalue=secondary, append]
    }
  }
}

\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}

\defbibenvironment{bibliographyNUM}
  {\list
     {\printtext[labelnumberwidth]{%
        \printfield{prefixnumber}%
        \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

\assignrefcontextkeyws[sorting=none]{secondary}

\gdef\unreliable{}
\defbibenvironment{counting}
  {}
  {}
  {\listxadd{\unreliable}{\thefield{entrykey}}}

\newtoggle{tempa}
\newcommand{\ifunreliable}[3]{%
  \renewcommand*{\do}[1]{%
    \togglefalse{tempa}%
    \ifstrequal{#1}{##1}
      {\toggletrue{tempa}\listbreak}
      {}}%
  \dolistloop{\unreliable}%
  \iftoggle{tempa}{#2}{#3}%
  }
\usepackage{xparse}
\DeclareDocumentCommand{\mycite}{oom}{%
  \ifunreliable{#3}
    {\IfNoValueTF{#2}
      {\IfNoValueTF{#1}
        {\footfullcite{#3}}
        {\footfullcite[#1]{#3}}}
      {\footfullcite[#1][#2]{#3}}}
    {\IfNoValueTF{#2}
      {\IfNoValueTF{#1}
        {\cite{#3}}
        {\cite[#1]{#3}}}
      {\cite[#1][#2]{#3}}}}

\begin{document}
\begingroup%
  \makeatletter%
  \def\blx@driver#1{}%
  \printbibliography[env=counting,heading=none,keyword=secondary]%
  \makeatother%
\endgroup%

The first two citations \mycite{LinkD01} and \mycite{BookB02}. 
The others are \mycite{LinkC04} and \mycite{BookA03}.

\printbibliography[title=Bibliography, keyword=primary]

\newrefcontext[sorting=none]
\printbibliography[env=bibliographyNUM,title=References, keyword=secondary, resetnumbers]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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