tomduck / pandoc-tablenos

A pandoc filter for numbering tables and table references.
GNU General Public License v3.0
108 stars 8 forks source link

Error when processing TeX document #4

Closed vikasrawal closed 7 years ago

vikasrawal commented 7 years ago

I installed pandoc-tablenos using pip3 install pandoc-tablenos on osx. But I get the following error when I tried to use it.

pandoc --filter=pandoc-tablenos outline.tex -o outline.docx Traceback (most recent call last): File "/usr/local/bin/pandoc-tablenos", line 11, in sys.exit(main()) File "/usr/local/lib/python3.5/site-packages/pandoc_tablenos.py", line 356, in main altered) File "/usr/local/lib/python3.5/site-packages/pandoc_tablenos.py", line 354, in altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta), File "/usr/local/lib/python3.5/site-packages/pandocfilters.py", line 111, in walk item['c'] if 'c' in item else None, format, meta) File "/usr/local/lib/python3.5/site-packages/pandocxnos/core.py", line 615, in process_refs _process_refs(value, labels) File "/usr/local/lib/python3.5/site-packages/pandocxnos/core.py", line 119, in wrapper ret = func(*args, **kwargs) File "/usr/local/lib/python3.5/site-packages/pandocxnos/core.py", line 570, in _process_refs _get_label(v['t'], v['c']) in labels: TypeError: unhashable type: 'list' pandoc: Error running filter pandoc-tablenos Filter returned error status 1

tomduck commented 7 years ago

Thanks for your feedback, @vikasrawal. It looks like you are trying to process a TeX document. Pandoc-tablenos and friends are actually meant to process specially-formatted markdown documents. I don't currently check the input format, but should probably be doing so.

Cheers, Tom.

vikasrawal commented 7 years ago

Oh! Didn’t realise that it is meant to work only with markdown. Thanks for explaining.

It may be too much to ask, but just in case, if you know a filter that would work with a TeX document?

Vikas

On 15-Nov-2016, at 8:36 am, Thomas J. Duck notifications@github.com wrote:

Thanks for your feedback, @vikasrawal https://github.com/vikasrawal. It looks like you are trying to process a TeX document. Pandoc-tablenos and friends are actually meant to process specially-formatted markdown documents. I don't currently check the input format, but should probably be doing so.

Cheers, Tom.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomduck/pandoc-tablenos/issues/4#issuecomment-260534583, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdRzI-fsCcwErjm8i41PcUwiOJoGU1Oks5q-SGtgaJpZM4KyEep.

tomduck commented 7 years ago

Not that I am aware of. You may want to ask for help on the pandoc mailing list about converting from LaTeX to docx.

Let's keep this Issue open, please. I want to be sure to catch this problem in the future.

tomduck commented 7 years ago

I have not yet been able to reproduce this error. @vikasrawal, could you possibly post a minimal TeX file that exposes the error?

Here is what I tried. I first created a markdown file called demo.md.

---
cleveref: On
...

T F
- -
1 0

Table: Truth. {#tbl:1}

Reference to @tbl:1.

I converted this to demo.tex using pandoc:

pandoc demo.md --standalone --filter pandoc-tablenos  -o demo.tex

I then processed the TeX using pandoc-tablenos:

pandoc demo.tex --standalone --filter=pandoc-tablenos -o demo.html

Pandoc-fignos had no effect, as expected. But it also did not crash.

tomduck commented 7 years ago

@vikasrawal, could you post a TeX file that exposes this error? I have not been able to reproduce it. Thanks, Tom.

tomduck commented 7 years ago

I'm still interested in feedback on this Issue, @vikasrawal. Please post it if you can.

vikasrawal commented 7 years ago

Sorry for not having been able to follow up. Very busy at the moment. Will try my best to deal with it in a couple of days.

Apologies.

Vikas

On 05-Dec-2016, at 10:01 am, Thomas J. Duck notifications@github.com wrote:

I'm still interested in feedback on this Issue, @vikasrawal https://github.com/vikasrawal. Please post it if you can.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomduck/pandoc-tablenos/issues/4#issuecomment-264765932, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdRzG5ksVYfdShhqE-XsM0H4-h_d-e6ks5rE5O4gaJpZM4KyEep.

tomduck commented 7 years ago

Sounds good! Please do re-open the Issue at that time.

Cheers, Tom