I am using the TeXnicenter application running on windows generating .pdf output and a couple months experience with latex. I am using the ifthen package to set boolean values that control the type of output I generate.
One of the parameters I set allows me to cut&paste from the pdf file into Word to do grammar&spelling checks. It disables ligatures and hyphenations and gets rid of page numbering.
What I have right now:
\newboolean{ForGrammarCheck}
\setboolean{ForGrammarCheck}{true}
\ifthenelse{\boolean{ForGrammarCheck}}{
\DisableLigatures{encoding = *, family = * } % to disable ligatures
\usepackage[none]{hyphenat} % disable hyphenations
}{}
<then down after the begin document>
\ifthenelse{\boolean{ForGrammarCheck}}{
\pagestyle{empty} % disable page numbering
}{}
There are a couple of problems that I have. The first one is that any open quotation mark gets pasted in as two accent characters. To the eye, it's okay, but it end up confusing Word's grammar checker as it doesn't recognize it as a quotation mark.
The second problem that I have is that each line gets pasted in as its own paragraph.
Right now, I go through and do a global replace of `` to " and paragraph marks to spaces. This seems to do the trick, but ends up being extra steps that I'd rather not have to do every time I want to do a grammar check.
Does anyone know how I can better streamline this process?
General ⇒ seeking tips for pasting into Word
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
seeking tips for pasting into Word
Why do you need Word for spell checking? Common LaTeX editors like TeXnicCenter (TXC) offer this feature for direct check of the sources. Necessary dictionaries can be downloaded within TXC.novicedude wrote:[...] One of the parameters I set allows me to cut&paste from the pdf file into Word to do grammar&spelling checks. [...]
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 16
- Joined: Tue May 25, 2010 10:38 pm
Re: seeking tips for pasting into Word
The content that I write is for both US english and Britain's english. So, within the text, I have stuff like "The theat\er\ is showing a movie." where I define the macro \er to be either 'er' or 're' depending on which version of english I'm making.
As a result, a TeX based spelling checker is going to spend a lot of time flagging words with embedded commands.
Those also only check spelling. My grammar and writing style are sucks. I need something that also checks it.
As a result, a TeX based spelling checker is going to spend a lot of time flagging words with embedded commands.
Those also only check spelling. My grammar and writing style are sucks. I need something that also checks it.
-
- Posts: 16
- Joined: Tue May 25, 2010 10:38 pm
Re: seeking tips for pasting into Word
I found part of my solution. I added the lines
\textwidth=85.0in
\paperwidth 87.75in
inside the CheckForGrammar if/then part. This makes the page width humongous so a whole paragraph fits on a single line and cutting and pasting into Word wont get all the extra paragraph markers.
But I'm kind of clueless on what to do about the quotation marks.
\textwidth=85.0in
\paperwidth 87.75in
inside the CheckForGrammar if/then part. This makes the page width humongous so a whole paragraph fits on a single line and cutting and pasting into Word wont get all the extra paragraph markers.
But I'm kind of clueless on what to do about the quotation marks.
seeking tips for pasting into Word
Quite frankly, I wouldn't really rely on a PC program's grammar check, but alas, go ahead. Maybe it works fine nowadays? 
About copyping the quotation marks, I'd say they would have to be properly masked first and then marked and copied. You could try a start with using the filevia, but of course you'd have to add a certain line (I don't know which) for the quotation marks. But maybe this file gives you an idea?
(you'll find the file in the TeXLive distribution)

About copyping the quotation marks, I'd say they would have to be properly masked first and then marked and copied. You could try a start with using the file
Code: Select all
glyphtounicode.tex
Code: Select all
\input{glyphtounicode}
(you'll find the file in the TeXLive distribution)
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
-
- Posts: 16
- Joined: Tue May 25, 2010 10:38 pm
seeking tips for pasting into Word
That did the trick. I included that file, then added the following
and then could copy and paste from the pdf file into Word. It also had the added benefit of handling the ligatures as well, so I don't have to disable them. So, the pdf files that I make have the glyph for the ligature, but when I copy & paste, it changes it to the letters -- very nice.
Thank you
Code: Select all
\pdfglyphtounicode{quoteleft}{0027}
\pdfglyphtounicode{quotedblleft}{0022}
Thank you