BibTeX, biblatex and biberChange citation style to specific type (AJBA)

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
Flor
Posts: 2
Joined: Thu Jul 21, 2022 11:11 pm

Change citation style to specific type (AJBA)

Post by Flor »

Hello,

[Edit] I noticed that I made a mistake in how I asked my previous question. I accidentally posted the wrong link and did not explain the errors I got well. I apologise. I am new to this forums and using latex in general.

I am working with this preamble. I need to change the citation style to Publication Manual of the American Psychological Association (APA) (6th edition). This is a link to the package (http://www.ctan.org/pkg/apa6). When I try to use it, it seems that it is in conflict with packages like titlesec and amsmath,mathabx.
I get errors like:

...ex/titlesec/titlesec.sty, 1642. Argument of \subparagraph has an extra }. or Runaway argument?

eric/mathabx/mathabx.sty, 67. Latex Error: Too many symbol fonts declared.

I don't know how to change the citation style I am using now.

What can I do?

Preamble:

Code: Select all

\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{helvet}
\usepackage{xspace}
\usepackage{subcaption}
\usepackage{placeins}
\usepackage{wrapfig}
\usepackage{multirow}
\usepackage[table,xcdraw]{xcolor}
\usepackage{adjustbox} 
\usepackage{booktabs,caption} 
\usepackage[flushleft]{threeparttable}
\usepackage{ragged2e}
\usepackage{floatrow}
\usepackage{graphicx,wrapfig,lipsum}
\graphicspath{{../figs/}}
\usepackage{pdfcomment}
\usepackage{geometry}
\newgeometry{left=2.5cm,right=2.5cm,bottom=2.5cm}
\usepackage[english]{babel}
\usepackage{CJKutf8}
\pagestyle{headings}
\usepackage{blindtext}
\usepackage{csquotes}
\setcounter{secnumdepth}{4}
\usepackage{titlesec}
\usepackage[T1]{fontenc}
\usepackage{imakeidx}
\makeindex[columns=3, title=Alphabetical Index]
\usepackage{array}
\usepackage{tikzpagenodes}
\usepackage[format=plain, labelfont={bf,it}, textfont=it]{caption}
\usepackage{fancyhdr}
\usepackage[toc,nopostdot, nonumberlist,style=long,automake,acronym]{glossaries}
\usepackage{subfiles}
\usepackage{nicematrix}
\usepackage{amsmath,mathabx}
\usepackage{hyperref}
\usepackage{lscape}

\newcommand{\sectionbreak}{\phantomsection}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=black,      
    urlcolor=black,
    citecolor=olive,
    pdftitle={PhD Dissertation},
    pdfpagemode=FullScreen,
    }

\urlstyle{same}

\bibliographystyle{abbrvnat}
\usepackage[authoryear]{natbib}%/bibliography apa
\setcitestyle{authoryear,open={(},close={)}} %Citation-related commands

This is an example of the bib.bib document:

Code: Select all

@article{newman_Gowland_2015,
    title = {The use of non-adult vertebral dimensions as indicators of growth disruption and non-specific health stress in skeletal populations},
    volume = {158},
    doi = {10.1002/ajpa.22770},
    number = {1},
    journal = {American journal of physical anthropology},
    author = {Newman, Sophie L. and Gowland, Rebecca L.},
    year = {2015},
    pages = {155--164},
    file = {Full Text:C\:\\Users\\xello\\Zotero\\storage\\23NM8MKE\\Newman and Gowland - 2015 - The use of non-adult vertebral dimensions as indic.pdf:application/pdf;Snapshot:C\:\\Users\\xello\\Zotero\\storage\\9YJ93WRC\\ajpa.html:text/html},
}
Thank you,
Last edited by Flor on Sat Jul 23, 2022 12:38 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Change citation style to specific type (AJBA)

Post by rais »

I'm confused...
If the link you've given is about AJBA, then your answer is right there:
from your link wrote: References should be prepared according to the Publication Manual of the American Psychological Association (7th edition).
in which case you might want to have a look at the biblatex-apa package.

OTOH, if the link you've provided isn't about AJBA, you'll have to clarify what your references should look like. And why you provided that link in the first place :roll:

KR
Rainer
Flor
Posts: 2
Joined: Thu Jul 21, 2022 11:11 pm

Change citation style to specific type (AJBA)

Post by Flor »

Thank you for your answer. I have just realised they changed the style they used to use to APA 6th edition. They used to use a completely different one. I posted the wrong link accidentally.
It was a mistake.

I still have issues using the apa6 package as it seems to conflict with other packages I need for my document :roll:
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Change citation style to specific type (AJBA)

Post by rais »

I don't know about the errors you got, but to me it looks a little like overkill, loading a class like apa6 that also implements the rules for text layout according to APA, when you have your own layout in mind.
I'd rather switch to biblatex with biber and use biblatex-apa6, which, according to the author of the apa6 class produces the closest thing to APA6 style:

Code: Select all

\documentclass[11pt]{report}
\begin{filecontents*}{\jobname.bib}
@article{newman_Gowland_2015,
    title = {The use of non-adult vertebral dimensions as indicators of growth disruption and non-specific health stress in skeletal populations},
    volume = {158},
    doi = {10.1002/ajpa.22770},
    number = {1},
    journal = {American journal of physical anthropology},
    author = {Newman, Sophie L. and Gowland, Rebecca L.},
    year = {2015},
    pages = {155--164},
    file = {Full Text:C\:\\Users\\xello\\Zotero\\storage\\23NM8MKE\\Newman and Gowland - 2015 - The use of non-adult vertebral dimensions as indic.pdf:application/pdf;Snapshot:C\:\\Users\\xello\\Zotero\\storage\\9YJ93WRC\\ajpa.html:text/html},
}
\end{filecontents*}

\usepackage[utf8]{inputenc}
\usepackage{helvet}
\usepackage{xspace}
\usepackage{subcaption}
\usepackage{placeins}
\usepackage{wrapfig}
\usepackage{multirow}
\usepackage[table,xcdraw]{xcolor}
\usepackage{adjustbox} 
\usepackage{booktabs,caption} 
\usepackage[flushleft]{threeparttable}
\usepackage{ragged2e}
\usepackage{floatrow}
\usepackage{graphicx,wrapfig,lipsum}
\graphicspath{{../figs/}}
\usepackage{pdfcomment}
\usepackage{geometry}
\newgeometry{left=2.5cm,right=2.5cm,bottom=2.5cm}
\usepackage[english]{babel}
\usepackage{CJKutf8}
\pagestyle{headings}
\usepackage{blindtext}
\usepackage{csquotes}
\setcounter{secnumdepth}{4}
\usepackage{titlesec}
\usepackage[T1]{fontenc}
\usepackage{imakeidx}
\makeindex[columns=3, title=Alphabetical Index]
\usepackage{array}
\usepackage{tikzpagenodes}
\usepackage[format=plain, labelfont={bf,it}, textfont=it]{caption}
\usepackage{fancyhdr}
\usepackage{subfiles}
\usepackage{nicematrix}
\usepackage{amsmath,mathabx}
\usepackage{lscape}

\usepackage[backend=biber,%<- though this is the default, I mention it here because you'll have to switch your compilation from bibtex to biber
  style=apa6]{biblatex}
% and this is how the bibliography file is loaded with biblatex:
\addbibresource{\jobname.bib}

\usepackage{hyperref}
%\usepackage[toc,nopostdot, nonumberlist,style=long,automake,acronym]{glossaries}


\newcommand{\sectionbreak}{\phantomsection}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=black,      
    urlcolor=black,
    citecolor=olive,
    pdftitle={PhD Dissertation},
    pdfpagemode=FullScreen,
    }

\urlstyle{same}

%\bibliographystyle{abbrvnat}
%\usepackage[authoryear]{natbib}%/bibliography apa
%\setcitestyle{authoryear,open={(},close={)}} %Citation-related commands

\begin{document}
\cite{newman_Gowland_2015}

\printbibliography
\end{document}
Note that I've suppressed the loading of the glossaries package only because of this error

Code: Select all

! Package glossaries Error: You must use \makeglossaries with automake=true.
I saw no sense in correcting that without any code for a glossary to begin with.
However, I did move it to the proper place in the preamble. Other than most packages, this one should be loaded after hyperref.

BTW: you're trying to load the caption package 2 times, but it got loaded by the subcaption package, already. If you want to load the caption package with options do so before loading the subcaption package. Or just use its \captionsetup command.

And I doubt very much you'd need packages like blindtext or lipsum for your document.

If that code really produces the right thing or if you need some other options I can't say, but I've linked all necessary docs above.

KR
Rainer
Post Reply