How to set language in APACITE ?

898 views
Skip to first unread message

KVork

unread,
Oct 9, 2008, 8:28:08 AM10/9/08
to LaTeX Users Group
I would like to have support for Danish in apacite. I use the Miktex
2.7 and I have copied the apacite.sty into the relevant directory.

As the apacite.sty file does not use Danish (yet), I have inserted
this line into the apacite.sty:
\APAC@iflang{dansk}{\gdef\APAC@apcfile{dansk.apc}}%

and I have copied a damsk.apc file into the same dictionary as the
apacite.sty file.

However I get this error:
! LaTeX Error: Unknown option `dansk' for package `apacite'.

My header looks like this:

\documentclass[a4paper,12pt]{article}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[danish,english]{babel}
\usepackage[dansk]{apacite}

Does anybody know how to tell apacite to use Danish???

If I remove the [dansk]-option in the usepackage{apacite} line, it
compiles without any error nor warnings.

Luis Rivera

unread,
Oct 9, 2008, 11:17:32 AM10/9/08
to LaTeX Users Group

On Oct 9, 7:28 am, KVork <kas...@walkon.dk> wrote:
> I would like to have support for Danish in apacite. I use the Miktex
> 2.7 and I have copied the apacite.sty into the relevant directory.
>
> As the apacite.sty file does not use Danish (yet), I have inserted
> this line into the apacite.sty:
> \APAC@iflang{dansk}{\gdef\APAC@apcfile{dansk.apc}}%
>
> [...]
>
> However I get this error:
> ! LaTeX Error: Unknown option `dansk' for package `apacite'.
>
> [...]
>
> Does anybody know how to tell apacite to use Danish???
>

You must add a declaration of the option in your hacked apacite.sty,
and include there the code for the option:

\DeclareOption{dansk}{\APAC@iflang{dansk}{\gdef
\APAC@apcfile{dansk.apc}}}

See the paper "LaTeX for Package Writers", in the section "Declaring
Options" in your local base documentation.

Good luck!

Luis.

KVork

unread,
Oct 10, 2008, 6:01:28 AM10/10/08
to LaTeX Users Group
Thanks for the reply. It didn't work (well, I couldn't make it work)

However, I found another solution which works.

From the source code of apacite.sty I got the idea that apacite must
read a "global" langauge parameter. It shouldn't be parsed via the
usepackage call.

So, first of all, there is no need to hack the apacite.sty with this
line:\APAC@iflang{danish}{\gdef\APAC@apcfile{danish.apc}}
as it is only used (as far as I can see) if no language is set at all.

Secondly, the .apc-file must have the same name as the "global"
language, that is danish.apc (and not dansk.apc)!!

Thirdly, in order to work, the call to babel must be with just one
language option. That is, \usepackage[danish,english]{babel} doens't
work, however, \usepackage[danish]{babel} does.

Thus, the preamble looks like this:
\documentclass[a4paper,12pt]{article}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[danish]{babel}
\usepackage{apacite}
> Luis.- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -

vvvv

unread,
Nov 9, 2008, 10:17:56 AM11/9/08
to LaTeX Users Group


On Oct 9, 7:28 am, KVork <kas...@walkon.dk> wrote:
> I would like to have support for Danish inapacite. I use the Miktex
> 2.7 and I have copied theapacite.sty into the relevant directory.
>
> As theapacite.sty file does not use Danish (yet), I have inserted
> this line into theapacite.sty:
> \APAC@iflang{dansk}{\gdef\APAC@apcfile{dansk.apc}}%
>

I don't see any option for "dansk" in my copy of apacite. I don't
know how the Danish version would be different, but you could look
inside apacite.sty to find "BOthers" and at that point you can find
some macros that are used to redefine text that appears to be language
specific. For example you might want to use the \renewcommand in your
document to change the settings for \BOthers (et al.), \BIP (in
press), \BVOL (Vol.) and others defined in that section. You could
probably do that quickly and then post it here.
Reply all
Reply to author
Forward
0 new messages