Closed oliviercailloux closed 6 years ago
@oliviercailloux thank you for letting us know!
@paolobrasolin could you help check -- thanks!
Thanks for the accurate report, @oliviercailloux!
The behaviour you are seeing is expected.
You can achieve the output you desire by using cite
instead of citep
.
The cite
macro renders citations using the style set by the bibliography-style
option.
The citep
macro and its siblings are meant for rendering citations in the traditional LaTeX fashion using the style set by bibliography-tex-style
(allowed values are authoryear
and numeric
).
Does that solve your issue? If you found the manual hazy I'll try to clarify that.
I am quite sure that \citep in LaTeX would produce the thing I expect: A test (Editor, 2010), rather than the thing I got: A test (2010). (I didn’t check to be honest, but I use LaTeX with zotero since a long time so I would have noticed such an odd behavior.)
@paolobrasolin perhaps @oliviercailloux is correct here?
Natbib: http://merkel.texture.rocks/Latex/natbib.php
\citet{jon90}
=> Jones et al. (1990)
\citep{jon90}
=> (Jones et al., 1990)
In any case, @paolobrasolin could you help update the README so we show the output of the \cite
commands for clarity? Thanks.
I think I get what @oliviercailloux means, now. He is right.
There are many ways to format APA citations in LaTeX: Alan Munn wrote an excellent writeup about that. The essence is that the family of macros including \citep
are defined by natbib
and depend on its bst
styles.
Usually in LaTeX one is used to staying away from \cite
because of its inconsistent behaviour no naturally he's trying to use citep
.
In asciidoctor-bibliography
we have two separated formatting mechanisms:
cite
and uses CSL styles. This offers a large choice of styles;cite...
family and uses a custom reimplementation of natbib
's authoryear
(i.e. plainnat
) and numeric
. However, the choice is limited to those two styles at the moment.While the output he expects can be obtained by simply using cite
, the reason must be made clearer in the manual.
He also raises a fair point: one might desire a larger choice of styles for the TeX
-like macros.
I can think of some ways to go about that @ronaldtse:
\bibpunct
for natbib
(easy but pretty limited)bst
parser/renderer (complex)But, when I change the :bibliography-style:
in my document (where I use exclusively citep and citet), the style changes.
See this source and the resulting pdf. Look at for example the ref to Lipton (last page), you can see the note (“Presented at”, etc.). This is thanks to my custom style apa-note.csl
. Whereas if you change the bibliography-style
to simply apa
, the note disappears. (This is with asciidoctor-pdf
but the same thing happens when converting adoc to html.)
Furthermore, I believe that with LaTeX, nat and plainnat, the behavior I am talking about here (the missing editor name) would not happen. (Again, I didn’t check so I might be wrong.)
Thanks for the suggestion: replacing with cite: works around the problem.
Thanks for this great extension. Very easy to use and useful. When using a reference to an edited book and apa style, the reference shows up incorrectly. Not sure if asciidoctor-bibliography is responsible for this or if there’s a bug in apa style (unlikely) or in zotero export to bibtex (unlikely) or if I’m doing something incorrect (likely).
cite.bib
cite.adoc
$
asciidoctor -r asciidoctor-bibliography cite.adoc
produces:but I expected: