inukshuk / citeproc-ruby

A Citation Style Language (CSL) Cite Processor
101 stars 22 forks source link

How do I create Author (Year) citations #15

Closed retorquere closed 11 years ago

retorquere commented 11 years ago

I see how I can create (Author, Year) citations, but how can I make Author (Year) citations?

inukshuk commented 11 years ago

You need to either select a CSL style that uses this format or adapt the CSL style yourself.

For example, take a look at the current APA style https://github.com/citation-style-language/styles/blob/master/apa.csl#L408 – you could just move the parentheses from the layout to the year part:

<layout delimiter="; ">
  <group delimiter=", ">
    <text macro="author-short"/>
    <text prefix="(" suffix=")" macro="issued-year"/>
    <text macro="citation-locator"/>
  </group>
</layout>
retorquere commented 11 years ago

Ow -- that's a different CSL style? The APA style guide covers both types of citations. So one style per "substyle" then?

On Fri, Jun 14, 2013 at 4:44 PM, Sylvester Keil notifications@github.comwrote:

You need to either select a CSL style that uses this format or adapt the CSL style yourself.

For example, take a look at the current APA style https://github.com/citation-style-language/styles/blob/master/apa.csl#L408– you could just move the parentheses from the layout to the year part:

— Reply to this email directly or view it on GitHubhttps://github.com/inukshuk/citeproc-ruby/issues/15#issuecomment-19461029 .

inukshuk commented 11 years ago

Hmm, sorry, I don't know either. There are a couple of APA styles in the repository though: https://github.com/citation-style-language/styles – maybe one of those already covers this variant?

retorquere commented 11 years ago

No problem, but what are the possible values for :mode then?

On Fri, Jun 14, 2013 at 4:49 PM, Sylvester Keil notifications@github.comwrote:

Hmm, sorry, I don't know either. There are a couple of APA styles in the repository though: https://github.com/citation-style-language/styles – maybe one of those already covers this variant?

— Reply to this email directly or view it on GitHubhttps://github.com/inukshuk/citeproc-ruby/issues/15#issuecomment-19461314 .

inukshuk commented 11 years ago

'citation' or 'bibliography'

retorquere commented 11 years ago

OK, than you can close this issue. Thank you for your help; I will have to use two styles.

On Fri, Jun 14, 2013 at 4:52 PM, Sylvester Keil notifications@github.comwrote:

'citation' or 'bibliography'

— Reply to this email directly or view it on GitHubhttps://github.com/inukshuk/citeproc-ruby/issues/15#issuecomment-19461511 .

rmzelle commented 11 years ago

(Zotero solves this with a "suppress author" setting, which removes the name(s) from the citation field; see http://www.zotero.org/support/word_processor_plugin_usage#quick_format_citation_dialog )

retorquere commented 11 years ago

It doesn't really solve it at all; that way, you have to remember (and update) exactly what the author name looks like. I was looking for a \citet / \citep equivalent.

On Fri, Jun 14, 2013 at 5:27 PM, Rintze M. Zelle notifications@github.comwrote:

(Zotero solves this with a "suppress author" setting, which removes the name(s) from the citation field; see http://www.zotero.org/support/word_processor_plugin_usage#quick_format_citation_dialog)

— Reply to this email directly or view it on GitHubhttps://github.com/inukshuk/citeproc-ruby/issues/15#issuecomment-19463771 .

inukshuk commented 11 years ago

Yes, I was wondering about that – the suppress author approach works fine when you actually write the author name yourself. But if you want different citation variants, is there any way around multiple styles @rmzelle ?

retorquere commented 11 years ago

I don't think CSL supports it. You could hack around that limitation (which is what I have now done) by auto-selecting between apa.csl and apa-author.csl, based on a mode differentiator. Seems like a pretty huge oversight in CSL to have this not be supported -- it has been a standard feature for decades in LaTeX.

On Fri, Jun 14, 2013 at 5:31 PM, Sylvester Keil notifications@github.comwrote:

Yes, I was wondering about that – the suppress author approach works fine when you actually write the author name yourself. But if you want different citation variants, is there any way around multiple styles @rmzellehttps://github.com/rmzelle?

— Reply to this email directly or view it on GitHubhttps://github.com/inukshuk/citeproc-ruby/issues/15#issuecomment-19464055 .

retorquere commented 11 years ago

Now that I am abusing your knowledge anyhow -- the change above to apa.csl gives me citations like Author (Year), page X instead of Author (Year, page X). Any idea how to fix that? I see the 'citation-locator' entry, but sometimes there are also entries that don't have a year, which would render as Author (page X), but merely as Author when neither year or locator is present.

On Fri, Jun 14, 2013 at 5:35 PM, Emiliano Heyns < Emiliano.Heyns@iris-advies.nl> wrote:

I don't think CSL supports it. You could hack around that limitation (which is what I have now done) by auto-selecting between apa.csl and apa-author.csl, based on a mode differentiator. Seems like a pretty huge oversight in CSL to have this not be supported -- it has been a standard feature for decades in LaTeX.

On Fri, Jun 14, 2013 at 5:31 PM, Sylvester Keil notifications@github.comwrote:

Yes, I was wondering about that – the suppress author approach works fine when you actually write the author name yourself. But if you want different citation variants, is there any way around multiple styles @rmzellehttps://github.com/rmzelle?

— Reply to this email directly or view it on GitHubhttps://github.com/inukshuk/citeproc-ruby/issues/15#issuecomment-19464055 .

inukshuk commented 11 years ago

I guess you could add another 'group' element around the issued-year and citation-locator nodes. Then move the parens prefix/suffix to that group. Also in that case you'd remove the comma from the outer group's delimiter.

rmzelle commented 11 years ago

There is a related Zotero thread at https://forums.zotero.org/discussion/20374/field-level-prefix-and-suffix/