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}
The code come from @moewe in this post
Issues :
- When I try to change
style=authoryearforstyle=apaI get this error :
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]
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]



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