tomduck / pandoc-eqnos

A pandoc filter for numbering equations and equation references.
GNU General Public License v3.0
221 stars 27 forks source link

Problems with Word for Mac #23

Closed jrennstich closed 7 years ago

jrennstich commented 7 years ago

When I try to create a Word document, I get the following error message:

The Open XML file Test.docx cannot be opened because there are problems with the contents or the file name might contain invalid characters (for example, \/) Details: unspecified error Location: 2

I would like to use all three versions Eqnos/Fignos/Tablenos within the same document (which works fine in html and PDF) but need to export the document eventually to Word. Both, tablenos and fignos work exporting to Word, also in combination, but eqnos won't work, either on its own or with the others.

Using RStudio Version 1.0.153 – Macintosh; Intel Mac OS X 10_12_6, pandoc-eqnos 0.16, pandoc-tablenos 0.16, pandoc-fignos 0.20, MS Word for Mac v. 15.38

tomduck commented 7 years ago

Thanks for this report, @jrennstich. I just pushed out a new version of pandoc-eqnos with a fix from @awbirdsall posted to Issue #16. Could you please test it to see if it solves the problem?

jrennstich commented 7 years ago

Thanks for the quick update, @tomduck! It works fine with html and PDF. With Word, I get a different error message

Unspecified error. Location 2

From the preview I can see that the reference @fig:id did indeed work. But the equation itself is not visible (nor numbered).

tomduck commented 7 years ago

Thanks, @jrennstich. Can you please confirm that you are using pandoc-eqnos 0.17? This can be checked using the following bash command: pip show pandoc-eqnos.

If it is the latest version, then could you post some minimal markdown text (no files, please) that exposes the error?

jrennstich commented 7 years ago

You're right, when checking, it still says Version: 0.16. I've used all the update and install commands (MacOS). Can you help me updating to the new version? I tried the pip install --upgrade git+https://github.com/tomduck/pandoc-eqnos.git@nextrelease command on the Terminal, but that didn't work. Do I need to add sudo at the beginning?

tomduck commented 7 years ago

Try pip install --upgrade git+https://github.com/tomduck/pandoc-eqnos.git. The nextrelease branch that you were trying to install is what I am working on for the next release.

jrennstich commented 7 years ago

Still get the same error msg: OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pandoc_eqnos-0.16-py2.7.egg-info/dependency_links.txt' :-(

tomduck commented 7 years ago

Did this error occur during the install process? If so, then you probably used sudo last time. You would need to do it again.

Note that I just pushed out a new version of pandoc-eqnos (0.18) to address other (unrelated) issues.

jrennstich commented 7 years ago

Then I get Requirement already up-to-date: pandoc-eqnos in /Library/Python/2.7/site-packages Requirement already up-to-date: pandoc-xnos>=0.8.2 in /Library/Python/2.7/site-packages (from pandoc-eqnos) Requirement already up-to-date: pandocfilters in /Library/Python/2.7/site-packages (from pandoc-eqnos) Requirement already up-to-date: pandoc-attributes in /Library/Python/2.7/site-packages (from pandoc-eqnos) Requirement already up-to-date: psutil>=4.1.0 in /Library/Python/2.7/site-packages (from pandoc-xnos>=0.8.2->pandoc-eqnos)

But when I check the version I get Version: 0.16

jrennstich commented 7 years ago

Do I need to reboot?

tomduck commented 7 years ago

You shouldn't need to reboot. The command I use on my mac is

sudo pip install --upgrade pandoc-eqnos

I then run

 pip show pandoc-eqnos

and get the following output

Name: pandoc-eqnos
Version: 0.18
Summary: Equation number filter for pandoc
Home-page: https://github.com/tomduck/pandoc-eqnos
Author: Thomas J. Duck
Author-email: tomduck@tomduck.ca
License: GPL
Location: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pandoc_eqnos-0.18-py3.4.egg
Requires: pandoc-xnos, pandocfilters, pandoc-attributes

Note that it says Version: 0.18.

jrennstich commented 7 years ago

Did the exact same thing and:

Version: 0.16
Summary: Equation number filter for pandoc
Home-page: https://github.com/tomduck/pandoc-eqnos
Author: Thomas J. Duck
Author-email: tomduck@tomduck.ca
License: GPL
Location: /Library/Python/2.7/site-packages
Requires: pandoc-xnos, pandocfilters, pandoc-attributes

With prior messages (as above)

Requirement already up-to-date: pandoc-xnos>=0.8.2 in /Library/Python/2.7/site-packages (from pandoc-eqnos)
Requirement already up-to-date: pandocfilters in /Library/Python/2.7/site-packages (from pandoc-eqnos)
Requirement already up-to-date: pandoc-attributes in /Library/Python/2.7/site-packages (from pandoc-eqnos)
Requirement already up-to-date: psutil>=4.1.0 in /Library/Python/2.7/site-packages (from pandoc-xnos>=0.8.2->pandoc-eqnos)

Could it be because of the different Python version? I only noticed a difference in our installations. Yours: Location: /Library/Frameworks/Python.framework/ ... Mine: Location: /Library/Python/2.7/

tomduck commented 7 years ago

Oof. Try

 sudo pip uninstall pandoc-eqnos

then reinstall it.

This appears to be some kind of permissions error.

jrennstich commented 7 years ago

Successfully uninstalled. Then reinstalled using

sudo pip install pandoc-eqnos

and got the following result:

Collecting pandoc-eqnos
  Downloading pandoc-eqnos-0.16.tar.gz
Requirement already satisfied: pandoc-xnos>=0.8.2 in /Library/Python/2.7/site-packages (from pandoc-eqnos)
Requirement already satisfied: pandocfilters in /Library/Python/2.7/site-packages (from pandoc-eqnos)
Requirement already satisfied: pandoc-attributes in /Library/Python/2.7/site-packages (from pandoc-eqnos)
Requirement already satisfied: psutil>=4.1.0 in /Library/Python/2.7/site-packages (from pandoc-xnos>=0.8.2->pandoc-eqnos)
Installing collected packages: pandoc-eqnos
  Running setup.py install for pandoc-eqnos ... done
Successfully installed pandoc-eqnos-0.16

Weird. I have no clue why it would download version 0.16 when running this command.

tomduck commented 7 years ago

I uninstall then reinstalled, and am seeing the same behaviour. I'm looking into it. Stay tuned.

tomduck commented 7 years ago

OK, I think I solved the problem. Please try installing using the following again:

 sudo pip install --upgrade pandoc-eqnos

Then check with:

pip show pandoc-eqnos
jrennstich commented 7 years ago

Perfect. Everything works like a charm now. Installation and most importantly, the Word functionality of Pandoc-Eqnos! AWESOME - thanks so much for this incredible code and software and all your help!

tomduck commented 7 years ago

Hurray! Thanks, @jrennstich. You actually uncovered an error in how the most recent versions were being posted to pypi. A forced migration to new tools created some issues. Your feedback is much appreciated. Cheers. :o)