Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TorgoX (1933)

TorgoX
  sburkeNO@SPAMcpan.org
http://search.cpan.org/~sburke/

"Il est beau comme la retractilité des serres des oiseaux rapaces [...] et surtout, comme la rencontre fortuite sur une table de dissection d'une machine à coudre et d'un parapluie !" -- Lautréamont

Journal of TorgoX (1933)

Tuesday February 26, 2002
03:25 PM

Working around "Smart" quotes in MSWord

[ #3140 ]
Dear Log,

"Smart quotes" is the name of the feature in MSWord (and, equally annoyingly, other word processors) that turns the straight-up-and-down ' and " into little 6 66 and 99 9. That's fine for normal English prose, but it's often bad and wrong when you're dealing with Perl code, where $x = '123' is NOT $x = `123'. Here's how to turn that feature off in MSWord 2000:

To turn off automatic smart quotes altogether:

Uncheck these boxes:

Tools : Autocorrect : Autoformat as you type : Smart quotes...
and
Tools : Autocorrect : Autoformat : Smart quotes...

To just make there be a way to type ' and " without them getting made into their "smart" versions:

Tools : Macro : Record New Macro
then type "apostrophe" and hit Keyboard,
then type alt-' and hit Assign then Close, and then it'll bring up a macro-recording window. Just type a ' and press the Stop Recording button on the macro bar (it'll look like a square).

Then do the same for "quote" and shift-alt-'

Then if you go back and edit the macros, they should look like this:

Sub quote()
  Selection.TypeText Text=""""
End Sub

Sub apostrophe()
  Selection.TypeText Text="'"
End Sub

For extra slack, assign « and » to alt-< and alt-> !

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • When it smartquotes a quote for you that you want to be dumbed back down, hit Ctrl-Z. It undo's the magic. (undoes?)

    This also works when it turns configure --prefix into configure (onebiglongdash) prefix. As soon as it tries to be helpful, Ctrl-Z tells it to back the fuck off.

    --Nat

    • You should tell that to magazine editors... especially PC Professionell (Germany's version of ZD^H^HVNU's PC Magazine) are guilty of this. Both the "smart quote" thing (which is even uglier in German since it implies that C can handle ,,German`` type quotes where the opening quotes are on the baseline) and the "two hypens make an em dash" thing. Stupid stupid stupid incompetent.
      --

      -- 
      Esli epei eto cumprenan, shris soa Sfaha.
      Aettot ibrec epesecoth, spakhea scrifeteis.

  • Writing a book in Word? What's next, writing e-mail in PowerPoint?

    Oh wait. I've seen that. There's a reason I'm not in IT anymore.

    • Some publishers really want things in MSWord. It "simplifies" things.

      I miss the good old days of WordPerfect 5.1-- altho it's i18n capabilities were, shall we say, lacking.

      • Can you turn off automagic on a 'per style' basis? And if you can't do that out of the box how hard could it be to write a perlscript macro to do it for you?;
        • It seems possible to turn off all automagic on a per-style basis in WordPerfect; but I can't seem to get the corresponding things to work in MSWord. I tell ya, if it's not one thing, it's another.

          I swear, some days I think that if WordPad did typo-underlining, I'd never use a "real" word processor again.

      • ORA takes Word, RTF, XML, SGML (a DocBook variant for the last two), Frame Maker, LaTeX, and POD (reluctantly for the last two).

        Personally, I fucking hate working with (X|SG)ML--the extra step to make something readable is like a compile step in programming, and slows down my editing. FrameMaker is too low-level (exposes too many things like kerning that I don't give a rat's arse about). LaTeX is, well, an abomination masquerading as a monstrosity, and POD has the advantage of being human readable, even

  • Smart quotes cause me problems in lots of other ways - for example if you copy text from a Word document into non-MS apps then the spell/syntax checker doesn't recognise the ASCII characters used and flags them as errors. Of course when you look at it on the screen it doesn't look wrong...

    Yet another example of MS making MS products compatible with MS products only.... or am I being paranoid?