-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
LaTeX writer: figure label #2637
Conversation
Hi there. I'm the author of the pandoc-fignos filter. I think that this is going to cause a bit of a problem for me. Pandoc-fignos reads figure attributes and injects a LaTeX \label{} into the json abstract syntax tree when the LaTeX format is being used. With your new patch, I will need to stop doing that beginning with pandoc 1.17 (I presume). A way for filters to detect the pandoc version is going to be needed if backward-compatibility is to be maintained. Thanks. |
However, this requires pandoc, not just pandoc-types. +++ Thomas J. Duck [Jan 10 16 07:40 ]:
|
Thanks, @jgm. My filter is written in python, so I don't think that I have access to |
+++ Thomas J. Duck [Jan 10 16 13:55 ]:
If you're consuming json produced by the pandoc on your |
This might not work if one has multiple pandoc versions on the same machine. For example, I have /usr/local/bin/pandoc-1.5.2, /usr/local/bin/pandoc-1.6-1 and more, all for compatibility testing. Passing version information along in the JSON would be more reliable. |
@tomduck is this really a problem? Can't pandoc-fignos simply change the attribute identifier to "" after it injects the label? And then, even with pandoc 1.17 (assuming this is merged), you won't get an extra label. mb21's code only has an effect (as far as I can see) if the attribute identifier is non-null. |
@jgm Yes, I could do that. But I think it would be better if filters let pandoc do the processing wherever possible. In this case pandoc-fignos provides functionality that I expect pandoc is going to gradually replace. It turns out this replacement is not happening all at once — see mb21’s patch. If there was a way to detect new behaviours (e.g., by retrieving version information) then pandoc-fignos could stay out of the way where appropriate. I could use your trick of calling pandoc and asking for the pandoc version, but it seems to me this would be rather fragile. It would likely break for any pandoc fork. Having some mechanism to pass version information along solves this problem. If it can’t be done, no biggie. But I think that having version information available in the json representation would be an asset to filter writers. —
|
No description provided.