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

Spell check not run on output .docx files #1209

Closed
pjking07 opened this issue Mar 28, 2014 · 10 comments
Closed

Spell check not run on output .docx files #1209

pjking07 opened this issue Mar 28, 2014 · 10 comments

Comments

@pjking07
Copy link

Problem

When converting a .md file to .docx, Word does not automatically run spell check on the document.

Environment

Mac OSX 10.9.2
pandoc 1.11.1
Word for Mac 2011

Reproduction

echo "I don't need no spell chek" > check.md && pandoc -S check.md -o check.docx && open check.docx

In the created document, the obvious spelling and grammar mistakes are not identified.

Workaround

One can force Word to recheck the spelling by (on a Mac) going to Preferences -> Spelling and Grammar and clicking the button labeled Recheck Document.

According the the option, this button:

Checks the spelling and grammar again after you change spelling and grammar options or open a custom or special dictionary. When you click this button, Word resets the internal Ignore All list so that Word will check all words for which you previously clicked Ignore All.

Question

Does Pandoc already deal with this Ignore All flag somehow? Is it even possible to fix this from pandoc's end or is this merely an undesirable side effect of importing documents into Word?

@jgm
Copy link
Owner

jgm commented Mar 31, 2014

I see that word/settings.xml in reference.docx contains the line

  <w:proofState w:spelling="clean" w:grammar="clean" />

which is the reason spellcheck isn't run. Using a reference.docx in which clean here is replaced by dirty causes the spellcheck and grammar check to be run.

I could change the default reference.docx, but honestly I have mixed feelings about whether it should be the default. I'd be curious what others think.

@jgm
Copy link
Owner

jgm commented Apr 5, 2014

I've thought about this and gotten some feedback on pandoc-discuss, and I'm going to keep things as they are. If you want the spell check to run, simply change your reference.docx as recommended above.

pandoc --print-default-data-file reference.docx > reference.docx
unzip -d reference_docx reference.docx
cd reference_docx
edit word/settings.xml # as above
zip -r ../reference.docx word/settings.xml
cd ..
mkdir ~/.pandoc
cp reference.docx ~/.pandoc/

@jgm jgm closed this as completed Apr 5, 2014
@krystofbe
Copy link
Contributor

Sorry, to respond five years later. But even after following the instructions, I'm still not getting Word to perform a spell check. Although my reference docx is contains dirty for spell check and grammar check the created docx file still has

  <w:proofState w:spelling="clean" w:grammar="clean" />

Any ideas?

@jgm
Copy link
Owner

jgm commented Aug 22, 2019

We've changed things a bit since that last comment, so that not everything in settings.xml gets copied over (to avoid corruption).
I think we could safely add w:proofState to the list of things copied, though.
Why don't you add a new issue requesting this, so we don't lose track of it.
This relates to settingsList in Text.Pandoc.Writers.Docx.hs.

@krystofbe
Copy link
Contributor

Hi @jgm! Thanks for the quick reply.

Although I know nothing about Haskell, is this the change you would be doing?
#5703

@detoxhby
Copy link

Using v2.13 it is still not possible to set dirty values in reference doc. The element is copied over but the property values pick up default openxml enum value (which is clean). The process of forcing word to properly re-analyize the document by default is cumbersome and verbose, which is almost unmanagable after the 20th open a day.

Any workaround is appreciated!

Thank you.

@jgm
Copy link
Owner

jgm commented May 11, 2021

OK, I'll reopen this.... It looks like we're getting two proofState elements in settings.xml.

@jgm jgm reopened this May 11, 2021
@detoxhby
Copy link

OK, I'll reopen this.... It looks like we're getting two proofState elements in settings.xml.

I've made sure there is no w:proofState anywhere else in the decompressed reference file contents. Also, the reference docx was generated by pandoc as stated in the documentation.

If I can provide any other info to help you with, let me know!

@jgm jgm closed this as completed in 5eb7ad7 May 12, 2021
@detoxhby
Copy link

✅ Compiled master version, works fine with previous reference doc.

Thank you for the fast reaction! ✋🏻

p.s. Is there any estimate for release date of v2.14?
(asking this only, because distributing pandoc to end-user machines is problematic without an installer)

@jgm
Copy link
Owner

jgm commented May 12, 2021

Not really sure about release date. I'll probably try to release something in the next couple of weeks.

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