1

[EDIT]

I am not sure how to post the entire code. This is a 272 page document with a different subfile for each chapter. I was trying to post the most relevant bits. Please let me know exactly what to post.

\begin{CJK*}{UTF8}{min} \end{CJK*} is necessary because the document has Japanese characters that were unreadable before I added this.

The \DeclareLanguageMapping{american}{american-apa} and sortcites=true,sorting=nyt were copied from the package's intructions. I admit I had no idea what I was doing, but they did seem unnecessary. I remove them but it did not change anything.

The errors that I got were:

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

When I click on this error, I cannot see exactly what part of the code it refers. Googling said it was related to the titlesec package.

I removed the titlesec package and the error changed to:

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

I removed the amsmath,mathabx package and it compiled.

However, all the section numbering and lot of the formatting was lost (probably because it was related to the titlesec package). Citation in the text worked, but the bibliography was not printed. I also got an error message that apacite was not compatible with Biblatex. (Package biblatex Error: Incompatible package 'apacite'.) I am not sure where apacite is in my preamble. I removed natbib just to try and it compiled only half of the document.


In summary, what I want to do is just add apa6 to the current file I have. I had a working file before. I was told that the citation style I was using was not correct. I tried changing it to apa6, but I don't know how to do it.

I am sorry, I am not trying to be difficult, please let me know what other information I need to post.

Thank you, [EDIT]

I am trying to add the APA 6th edition citation style. I have found instructions for the package and tried to add them to my project, but I was unable to make it work.

I tried several instances. I tried the package's instructions and the code in Overleaf's apa6 example. They were both slightly different (see below). I tried them both and they all resulted in the same errors. It did not compile at all.

This is the code I used:

Preamble:

\documentclass[11pt,report,natbib]{apa6}
\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} 

The package's instructions also called for adding:

\usepackage[style=apa6,sortcites=true,sorting=nyt,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{bib.bib}

I tried with and without, changing how I cite to \parentcite instead of \citep when the instructions called for it with no success.

The bibliography file called bib.bib Example:

@article{henriquez_alternative_2017,
    title = {An alternative objective microscopic method for the identification of linear enamel hypoplasia ({LEH}) in the absence of visible perikymata},
    volume = {14},
    doi = {10.1016/j.jasrep.2017.05.040},
    journal = {Journal of Archaeological Science: Reports},
    author = {Henriquez, Alejandra Cares and Oxenham, Marc F.},
    year = {2017},
    pages = {76--84},
    file = {Full Text:C\:\\Users\\xello\\Zotero\\storage\\MV7QMSWQ\\Henriquez and Oxenham - 2017 - An alternative objective microscopic method for th.pdf:application/pdf},
}

Example of text citing something

\begin{document}
\begin{CJK*}{UTF8}{min}

\citep{henriquez_alternative_2017}, \citet{henriquez_alternative_2017}.

\end{CJK*}
\end{document}

I am not sure how to correct this. It used several options, but all of them end up with a fatal error that doesn't allow compilation. I think there is a compatibility problem with other packages, but I am not sure what. I only get general errors and when I click on them, I can't see them on the code.

9
  • You haven't posted a compilable example document that we can run (we don't know how the code snippets you have shown fit together) and you haven't told us what kind of error you get.
    – moewe
    Commented Jul 22, 2022 at 15:21
  • If your system finds style=apa6, it is new enough that you should drop the \DeclareLanguageMapping{american}{american-apa}. Additionally the options sortcites=true,sorting=nyt, are either counter-productive or redundant, so you should drop them as well. (This does not solve your problem, but is a general fact about biblatex-apa6/biblatex-apa.)
    – moewe
    Commented Jul 22, 2022 at 15:25
  • Also I'm not sure if biblatex picks up the natbib option from the class, so better use \parencite instead of \citep and \textcite instead of \citet.
    – moewe
    Commented Jul 22, 2022 at 15:27
  • It is not clear to me why you load the apa6 class (which sets up a particular document style) in the first place if you then want to modify its formatting with (apparently) incompatible packages like titlesec. Either stick with apa6 and accept its output, or go for a more flexible base class and modify that with titlesec.
    – moewe
    Commented Jul 23, 2022 at 4:24
  • I cannot reproduce this apacite error, but as I showed in my answer, you must not pass the option natbib, apacite or biblatex to the apa6 class. Do not use any of these options. Then load biblatex manually as shown in my answer.
    – moewe
    Commented Jul 23, 2022 at 4:25

1 Answer 1

1

If you want to use biblatex you should not pass the natbib option to apa6. With that option, apa6 will load natbib (and apacite) which is completely incompatible with biblatex.

You should also load biblatex as

\usepackage[style=apa6, backend=biber]{biblatex}

There is no need for sortcites=true,sorting=nyt, (the former is redundant, the latter actively harmful because it switches from APA-compatible author-year-title sorting to the generic nyt sorting scheme). \DeclareLanguageMapping{american}{american-apa} should also be dropped.

Then you should use \parencite (not \parentcite) and \textcite instead of \citep and \citet.

Furthermore, you should really look into reducing the number of packages you load in your preamble. I can hardly believe that you need all of them.

Some packages actively work against what apa6 does and cause errors (\usepackage{titlesec}). Other packages bring trouble because you use up too many fonts (\usepackage{amsmath,mathabx}).

Try to get rid of as many packages as possible. Only load packages when you know why you need them.

I also cannot see a need for \begin{CJK*}{UTF8}{min}...\end{CJK*} in the example, but of course that may be different in your real-life document. I left it in to show that the CJK* environment is no problem for biblatex.

Note that in the example I still get an error about

! LaTeX Error: Unknown option `keeplastbox' for package `flushend'.

but that seems to be unavoidable because apa6 assumes an older version of flushend. This error does not occur on Overleaf with their TeX Live 2021 image, since the version of flushend there still has that option.

The following example document compiles fine on Overleaf

\documentclass[11pt,report]{apa6}
\usepackage[utf8]{inputenc}
\usepackage{helvet}
\usepackage[english]{babel}
\usepackage{CJKutf8}
\usepackage[style=apa6, backend=biber]{biblatex}
\usepackage{hyperref}

\begin{filecontents}{\jobname.bib}
@article{henriquez_alternative_2017,
  title   = {An Alternative Objective Microscopic Method
             for the Identification of Linear Enamel Hypoplasia ({LEH})
             in the Absence of Visible Perikymata},
  volume  = {14},
  doi     = {10.1016/j.jasrep.2017.05.040},
  journal = {Journal of Archaeological Science: Reports},
  author  = {Henriquez, Alejandra Cares and Oxenham, Marc F.},
  year    = {2017},
  pages   = {76--84},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\begin{CJK*}{UTF8}{min}

\parencite{henriquez_alternative_2017} \textcite{henriquez_alternative_2017}.

\printbibliography
\end{CJK*}
\end{document}

Working citations

Read-only Overleaf: link https://www.overleaf.com/read/cpzkcdqfdnms.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .