1

EDIT

At the end of my document I use two bibliographies:

A main bibliography which is divided into several sub-categories:

  • Article
  • Book
  • Dictionary
  • Text of laws
  • Etc

A second bibliography called "reference" which includes press articles, podcasts, videos, etc.

The main bibliography must have the APA 7 style. The second bibliography must have the numeric style.

Finally, whatever the bibliography cited, I would like the citations to respect the following format:

(Author last name, year, pages)

This a minimal working example :

\documentclass{article}
\usepackage[style = authoryear, labelnumber, defernumbers = true, backend = biber, autocite=inline]{biblatex}
\usepackage{hyperref}

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

\renewbibmacro*{cite}{% \iffieldundef{shorthand} {\ifkeyword{ref} {\printtext[bibhyperref]{% \printfield{labelprefix}% \printfield{labelnumber}}} {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} {\usebibmacro{cite:label}% \setunit{\printdelim{nonameyeardelim}}} {\printnames{labelname}% \setunit{\printdelim{nameyeardelim}}}% \usebibmacro{cite:labeldate+extradate}}} {\usebibmacro{cite:shorthand}}}

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

\DeclareCiteCommand*{\parencite}[\mkbibbrackets] {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{citeyear}} {\multicitedelim} {\usebibmacro{postnote}}

\defbibenvironment{bibliographyNUM} {\list {\printtext[labelnumberwidth]{% \printfield{labelprefix}% \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]{ref}

\usepackage{filecontents} \begin{filecontents}{\jobname.bib} @BOOK{BookA, author = {Author Aaa}, title = {Some Title}, publisher = {Some Publisher}, year = 2003, page = {42--81}, keywords = {rapport}, } @BOOK{BookB, author = {Author Bbb}, title = {Some Title}, publisher = {Some Publisher}, year = 2002, page = {34--138}, keywords = {rapport}, } @MISC{LinkC, author = {Author Ccc},
title = {Some Title}, year = 2004, url = {www.test1.com}, keywords = {ref}, } @MISC{LinkD, author = {Author Ddd}, title = {Some Title}, year = 2001, url = {www.test2.com}, keywords = {ref}, } @BOOK{LinkE, author = {Author Eee}, title = {Some Title}, publisher = {Some Publisher}, year = 2003, page = {4--11}, keywords = {livre}, } @BOOK{BookF, author = {Author Fff}, title = {Some Title}, publisher = {Some Publisher}, year = 2002, page = {4--18}, keywords = {livre}, } @BOOK{LinkG, author = {Author Ggg}, title = {Some Title}, publisher = {Some Publisher}, year = 2003, page = {4--13}, keywords = {manuel}, } @BOOK{BookH, author = {Author Hhh}, title = {Some Title}, publisher = {Some Publisher}, year = 2002, page = {1--23}, keywords = {manuel}, } @BOOK{LinkI, author = {Author Iii}, title = {Some Title}, publisher = {Some Publisher}, year = 2003, page = {12--13}, keywords = {article}, } @BOOK{BookJ, author = {Author Jjj}, title = {Some Title}, publisher = {Some Publisher}, year = 2002, page = {1--13}, keywords = {article}, } @MISC{LinkK, author = {Author Kkk}, title = {Some Title}, year = 2001, url = {www.test3.com}, keywords = {ref}, } @MISC{LinkL, author = {Author Lll}, title = {Some Title}, year = 2001, url = {www.test4.com}, keywords = {ref}, } \end{filecontents} \addbibresource{\jobname.bib}

\begin{document}

\par{Some text \autocite{LinkD} test \autocite{BookB}.} \par{Some text \autocite{LinkC} test \autocite{BookA}. \par{Some text \autocite{LinkE} test \autocite{BookF} test \autocite{LinkK}. \par{Some text \autocite{LinkG} test \autocite{BookH} test \autocite{LinkL}. \par{Some text \autocite{LinkI} test \autocite{BookJ}.

\section*{Bibliographie}

\printbibliography[heading=subbibintoc,title=Livre, keyword=livre] \printbibliography[heading=subbibintoc,title=Manuel, keyword=manuel] \printbibliography[heading=subbibintoc,title=Article, keyword=article] \printbibliography[heading=subbibintoc,title=Rapport d'enquête, keyword=rapport]

\newrefcontext[sorting=none] \printbibliography[env=bibliographyNUM,title=Référence, keyword=ref, resetnumbers] \end{document}

MWE

The code come from @moewe in this post

Issues :

  • When I try to change style=authoryear for style=apa I get this error :

enter image description here

  • When I cite the main bibliography it is like this :

    [Author Last Name, Year]

  • When I cite the second bibliography (Reference) it is like this :

    [citations number]

enter image description here

Question

Since I do not fully understand the code provide by @moewe I can not fix these issues by my own. Why it is so complicated to get several bibliographies with different style ?

Can't we imagine setting the style in the command \printbibliography like this :

\printbibliography[style=apa, citationstyle=something, heading=bibintoc, title=Livre, keyword=livre]
  • Welcome to SE. Could you clarify what you want? It isn't obvious what is different between both images, and what exactly you don't like. – Miyase Jun 22 '22 at 21:28
  • Hi, thanks for answering. I would like to split my bibliography in two parts. That is why I use biblatex package. What I can not do is to apply a different bibliography style to each part – Meije3984 Jun 23 '22 at 05:49
  • The style is define in the preamble when I call the biblatex package with this command ‘\ usepackage[backend=biber,style=authoryear]{biblatex}’. I expect something like this ‘\bibliograpgystyle{numeric}’ right before printing a second bibliography to change the default style for the second bibliography – Meije3984 Jun 23 '22 at 05:53
  • Will both lists contains the same entries also in your real-world document? How do you want to cite those entries? (Numerically or author-year?) If you have disjoint bibliographies in your real-world document, how do you get that (how do you filter)? – moewe Jun 23 '22 at 06:04
  • In general multiple styles in the same document are not supported. But often there are ways around that. If and how that is possible depends on what you want and your setup, though. One example is at https://tex.stackexchange.com/q/452170/35864. – moewe Jun 23 '22 at 06:13
  • Thanks for answering

    I am not to sure that have fully understand the question.

    All my bibliography are in one .bib file.

    The first bibliography (call bibliography) would be in the authoryear style and it will results of text quotes

    The second bibliography (scientific article) would be in numeric style and it will be print without being quotes

    I plan to edit my .bib file. I will add the line ‘keyword=scientific_article’ or ‘keyword=bibliography’ to filter them.

    I hope I answer some of your interrogation.

    What do you mean by « the real world document »

    – Meije3984 Jun 23 '22 at 06:13
  • In this post : https://tex.stackexchange.com/questions/13573/biblatex-style-with-multiple-bibliographies-in-one-document this comment can be read : « Regarding the different style/sorting: the functionality for this is in biber now and will be enabled in biblatex in the not too distant future. It's likely that this will be biblatex 2.0 which will drop bibtex (program, not format) support. » It was in 2011. Eleven years after I was hoping for this to exist – Meije3984 Jun 23 '22 at 06:18
  • Would it be possible to bring your example document in the question slightly closer to what you do in your actual document? (I.e. actually filter the different bibliographies by some keyword. And cite the entries you want to cite in the way you would do it in reality as well.) – moewe Jun 23 '22 at 06:32
  • Hi @moewe ! Sorry for the delay. I edit the question, I hope it is clearer now :) – Meije3984 Jun 24 '22 at 06:33
  • Oh well, APA is a very special style, it might be rather had to get it to cooperate with other styles. For starters getting the brackets right is going to be extremely hard, because you could in theory cite a numeric and an author-year reference together. – moewe Jun 24 '22 at 13:09

0 Answers0