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

Minus sign prefix stripped from citation and does not appear in json #2901

Closed
tomduck opened this issue May 6, 2016 · 6 comments
Closed

Comments

@tomduck
Copy link

tomduck commented May 6, 2016

Consider the following test.md:

 -@foo

Processing with pandoc test.md -t json gives

[{"unMeta":{}},[{"t":"Para","c":[{"t":"Cite","c":[[{"citationSuffix":[],"citationNoteNum":0,"citationMode":{"t":"AuthorInText","c":[]},"citationPrefix":[],"citationId":"foo","citationHash":0}],[{"t":"Str","c":"@foo"}]]}]}]]

Now, consider the following test.md with the minus sign having been dropped:

 @foo

Processing with pandoc test.md -t json gives exactly the same json as above.

It seems to me that since the files are different, the json should also be different.

This Issue is of interest for my pandoc-fignos/eqnos/tablenos filters. I would like to use the minus sign to modify the referencing behaviour for figures/equations/tables. I can (and will) use other characters, but the semantic meaning of the minus sign is clearer.

@jgm
Copy link
Owner

jgm commented May 8, 2016

The citationMode field in Citation can be either NormalCitation, SuppressAuthor, or AuthorInText (exclusive and exhaustive alternatives). When you have an unbracketed citation like @foo, that sets AuthorInText, so there's no way to set SuppressAuthor in addition. And indeed, SuppressAuthor and AuthorInText would seem to be incompatible. So the - is just ignored when you have an author in text citation.

@jgm jgm closed this as completed May 8, 2016
@tomduck
Copy link
Author

tomduck commented May 8, 2016

OK, thanks. But it doesn't make sense to me that the - should be ignored. Why not include it as a Str element right before the Cite in the value list?

@tomduck
Copy link
Author

tomduck commented May 8, 2016

... or, alternatively, put it in the "citationPrefix" field?

@jgm
Copy link
Owner

jgm commented May 8, 2016

Given that the combination of - with an author-in-text
citation doesn't make sense anyway, I'm not sure either
behavior "makes sense" more than the other. It would be
confusing to some to see the - appear as literal in some
contexts and be interpreted as a syntactic marker in others.

I know you want to use this syntactic construct for other
purposes, for which it would be useful if pandoc made a
distinction here, but I can't let that guide the choice
here.

+++ Thomas J. Duck [May 07 16 20:27 ]:

OK, thanks. But it doesn't make sense to me that the - should be
ignored. Why not include it as a Str element right before the Cite in
the value list?


You are receiving this because you modified the open/close state.
Reply to this email directly or [1]view it on GitHub

References

  1. Minus sign prefix stripped from citation and does not appear in json #2901 (comment)

@tomduck
Copy link
Author

tomduck commented May 8, 2016

Thanks for the explanation, John. An Ignored element might be useful here.

@tomduck
Copy link
Author

tomduck commented May 8, 2016

Note that an Ignored element could be filtered out before it reaches the writers. This would limit the required changes.

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

2 participants