# Different citation styles for the same bibliography

I’m trying to create a bibliography with biblatex with two different styles. This means author, year citation for papers and books, and for online citations a numeric style. Is it possible?

\documentclass{article}

\usepackage[sorting=nyt,style=authoryear, backend=bibtex8]{biblatex}

\DeclareCiteCommand{\parencite}
{\ifentrytype{online}{\bibopenbracket}{\bibopenparen}%
\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}%
\ifentrytype{online}{\bibclosebracket}{\bibcloseparen}}
\begin{document}

\parencite{Rouhiainen.2004}
\parencite{Wikipedia.27.02.2017}

\end{document}


The conteste of the .bib file are:

@online{Wikipedia.27.02.2017,
author = {Wikipedia, the free encyclopedia},
year = {2017},
title = {MALDI-TOF},
url = {https://de.wikipedia.org/wiki/MALDI-TOF},
urldate = {02.06.2017}
}
@article{Rouhiainen.2004,
author = {Rouhiainen, Leo and Vakkilainen, Tanja and Siemer, Berit Lumbye and Buikema, William and Haselkorn, Robert and Sivonen, Kaarina},
year = {2004},
title = {Genes coding for hepatotoxic heptapeptides (microcystins) in the cyanobacterium Anabaena strain 90},
pages = {686--692},
volume = {70},
number = {2},
issn = {0099-2240},
journal = {Applied and environmental microbiology}
}

• have you tried this way? tex.stackexchange.com/questions/202281/…... Not tested but I think it can work... Probably you want in the same section different styles... So ... sorry... ignore my comment Jun 29, 2017 at 11:44

In general it is not possible to mix or switch between different styles in one document out of the box. That is because some of the relevant options have to be set at loading time and some settings might conflict - which is a definite problem if options have to be passed to Biber.

It is, however, in many special cases possible to cook up a solution that works. As in this case.

MWE

\documentclass{article}

\usepackage[sorting=nyt,style=authoryear, backend=bibtex8, defernumbers]{biblatex}

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

% bib environment for numeric citations (@online) from numeric.bbx
\defbibenvironment{onlinebib}
{\list
{\printtext[labelnumberwidth]{%
\printfield{labelprefix}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}

% taken from numeric.cbx
\providebool{bbx:subentry}
\newbibmacro*{cite:num}{%
\printtext[bibhyperref]{%
\printfield{labelprefix}%
\printfield{labelnumber}%
\ifbool{bbx:subentry}
{\printfield{entrysetcount}}
{}}}

% switch citation style based on entry type
\DeclareCiteCommand{\parencite}
{\ifentrytype{online}{\bibopenbracket}{\bibopenparen}%
\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\ifentrytype{online}{\usebibmacro{cite:num}}{\usebibmacro{cite}}}
{\multicitedelim}
{\usebibmacro{postnote}%
\ifentrytype{online}{\bibclosebracket}{\bibcloseparen}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{Wikipedia.27.02.2017,
author  = {Wikipedia, the free encyclopedia},
year    = {2017},
title   = {MALDI-TOF},
url     = {https://de.wikipedia.org/wiki/MALDI-TOF},
urldate = {2017-06-02},
}
@article{Rouhiainen.2004,
author  = {Rouhiainen, Leo and Vakkilainen, Tanja and Siemer, Berit Lumbye and Buikema, William and Haselkorn, Robert and Sivonen, Kaarina},
year    = {2004},
title   = {Genes coding for hepatotoxic heptapeptides (microcystins) in the cyanobacterium Anabaena strain 90},
pages   = {686--692},
volume  = {70},
number  = {2},
issn    = {0099-2240},
journal = {Applied and environmental microbiology},
}
\end{filecontents}