novoid / LaTeX-KOMA-template

Generic template for midsize and larger documents based on KOMA script classes.
Other
201 stars 65 forks source link

Using APA style citation #14

Closed domsl closed 8 years ago

domsl commented 8 years ago

First of all, thank you for this amazing template and the according webpage latex.tugraz.at. It is the best introduction around and I refer to it if somebody asks me about Latex.

I need to write some lab reports and they want me to use APA-citation. I am very new to Latex (except for writing half my bachelors thesis with it :) so please bear with me:

I installed https://www.ctan.org/pkg/biblatex-apa?lang=en by running tlmgr install biblatex-apa (I am on Ubuntu 15.10) and tried using it by changing \newcommand{\mybiblatexstyle}{apa} in main.tex.

As far as I understand this changes the relevant part in preamble.tex:

\usepackage[backend=biber, %% using "biber" to compile references (instead of "biblatex")
style=\mybiblatexstyle, %% see biblatex documentation
%style=alphabetic, %% see biblatex documentation
dashed=\mybiblatexdashed, %% do *not* replace recurring reference authors with a dash
backref=\mybiblatexbackref, %% create backlings from references to citations
natbib=true, %% offering natbib-compatible commands
hyperref=true, %% using hyperref-package references
]{biblatex}  %% remove, if using BibTeX instead of biblatex

\addbibresource{\mybiblatexfile} %% remove, if using BibTeX instead of biblatex

When I try to compile it to a pdf it always gives me the error:

LaTeX Warning: Marginpar on page 4 moved.

[4] [5 <./figures/measureprincible.pdf>] [6]
Overfull \hbox (11.49997pt too wide) in paragraph at lines 99--99
[] 
 []

) [7] [8

] [9] [10]
! Undefined control sequence.
<argument> \mkbibdateapalongextra 
                                  {year}{month}{day}\iffieldundef {endyear}{...
l.266 

? 
! Emergency stop.
<argument> \mkbibdateapalongextra 
                                  {year}{month}{day}\iffieldundef {endyear}{...
l.266 

End of file on the terminal!

Here is how much of TeX's memory you used:
 40699 strings out of 494907
 762730 string characters out of 6177793
 1229050 words of memory out of 5000000
 43106 multiletter control sequences out of 15000+600000
 55522 words of font info for 237 fonts, out of 8000000 for 9000
 38 hyphenation exceptions out of 8191
 75i,13n,80p,10391b,1587s stack positions out of 5000i,500n,10000p,200000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!

This is from main.log and I have no clue what went wrong and where it went wrong.

novoid commented 8 years ago

Does my original template compile with your setup?

novoid commented 8 years ago

This is not an issue with my template. You ran into following issue with babel and biblatex/apa:

http://tex.stackexchange.com/a/133982

So please add \DeclareLanguageMapping{american}{american-apa} (or british) after \usepackage[...]{biblatex} and you should be fine.

domsl commented 8 years ago

Thank you.

The template compiles fine, just as I was adding the APA-citation it started to create problems. I assumed that the template was fine, so thank you nevertheless for helping me.