Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-@Citekey outside square brackets not working #7219

Closed
bcdavasconcelos opened this issue Apr 9, 2021 · 10 comments
Closed

-@Citekey outside square brackets not working #7219

bcdavasconcelos opened this issue Apr 9, 2021 · 10 comments

Comments

@bcdavasconcelos
Copy link

Hello John,

I noticed that sometime in the past month or so -@Citekey stopped working (meaning that it will display both author and date) and that one now has to add square brackets to get just the year of the publication [-@Citekey]. I wonder if it would be possible to revert to the old behavior and allow it to be typed outside of square brackets.

Thank you for maintaining and developing this wonderfully useful tool.

@jgm
Copy link
Owner

jgm commented Apr 9, 2021

The following diff will restore the old behavior. But I'm wondering whether we should. I actually hadn't intended for -@citekey to work in the first place -- the "bare" form is for an author-in-text citation, and if you're suppressing the author it doesn't make much sense!

diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 6c3947a81..ceb2f48d0 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1500,7 +1500,7 @@ inline = do
      '\145'  -> smart
      '\8220' -> smart
      '\147'  -> smart
-     '-'     -> smart
+     '-'     -> cite <|> smart
      '.'     -> smart
      '&'     -> return . B.singleton <$> charRef
      ':'     -> emoji

@bcdavasconcelos
Copy link
Author

My CSL file does not add the parenthesis automatically. This allows me to use Citeproc for citing reference works and ancient sources that come frequently outside of the parenthesis. E.g. @KrRV, @EN, @APo and so on.

This means that, for other works of the secondary literature, I cite using normal parenthesis (@citekey) and not square brackets [@citekey]. With the old behavior, I could write (@Frede2012, -@Frede2013), but now it would have to be (@Frede2012, [-@Frede2013]). This is very minor, of course. It would simply mean less clutter. Should it be the cause of other issues, please leave it aside. But if this proves to be harmless, I would appreciate the flexibility.

@bcdavasconcelos
Copy link
Author

Should we close this?

@jgm
Copy link
Owner

jgm commented Jun 2, 2021

I still want to think about it, so we can keep it open

@jgm
Copy link
Owner

jgm commented Dec 16, 2021

@bcdavasconcelos Regarding:

(@Frede2012, [-@Frede2013])

Here I think you're trying to do something manually that should be controlled by the style.
Some CSL styles do "citation collapsing", e.g. "(Frede 2012, Frede 2013)" -> "(Frede 2012, 2013)".
So you should be using a style with this feature.

@bcdavasconcelos
Copy link
Author

Agreed, @jgm. Thanks for bringing this to my attention.

This remains the case, however, in different circumstances, such as:

According to Frede, lorem ipsum dolor sit amet, consectetur adipisicing elit ([-@Frede2012], cf. @Nails2002).

But, as I said, this is minor. If the brackets are actually doing important work there, I am happy to keep coping with them. (I actually made a filter to add them before processing the text).

@Ratramnus
Copy link

Ratramnus commented May 18, 2022

On this issue, @jgm would it be possible to have the syntax of -@citekey in a footnote itself so as to suppress an author? This is helpful when citing an ancient primary source, followed by a modern translation where with the modern translation one does not want the author repeated, e.g.:

[^1]: Augustine, _Confessiones_ 10.12, -@Augustine2006, 78.

At the moment this will not work, and I have to have the following:

[^1]: Augustine, _Confessiones_ 10.12, [-@Augustine2006, 78].

This leaves a messy looking footnote with the modern translation surrounded by parentheses.

@jgm
Copy link
Owner

jgm commented May 18, 2024

Regarding my comment above:

the "bare" form is for an author-in-text citation, and if you're suppressing the author it doesn't make much sense!

It does make sense in footnotes with certain citation styles, as noted in the last comment.

So that is probably a reason to revert to the old behavior.

@dstark
Copy link

dstark commented Sep 10, 2024

@jgm, in Pandoc 3.4, I'm still getting parentheses added as described here when trying to omit an author's name---this happens whether a bracketed page number is supplied as in the example screenshot or whether the work only is cited with no locators.

Is there a syntax issue on my part with the input? Or is the omission within footnotes without the additional parentheses still something that needs further tweaking within Pandoc to achieve?

Thanks so much!

@jgm
Copy link
Owner

jgm commented Sep 10, 2024

Or is the omission within footnotes without the additional parentheses still something that needs further tweaking within Pandoc to achieve?

Yes, there's some special treatment for citations inside footnotes that may need adjusting. Please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants