01-05-2008, 02:34 PM | #1 |
Boo-Frickety-Hoo-Erizer
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
Quote Hunter
I have been formatting some particularly bad files, and found something that just bugs me that I couldn't find another solution for. I would come across parts like this:
"She said, "All this Stuff." or She said, "All This Stuff. Finishing her sentence on another line." Quote marks were wrong. Word grammar checker couldn't spot it, Whitesmoke couldn't spot it, TextSpresso couldn't spot it. Guiguts could indicate quote mark problems, but it does it with line numbers - yuck. And it is darn tedious to have to actually read and proof for that on lots and lots of badly formatted files. So it took me a while, but I managed to come up with a Word Visual Basic macro that would look for odd numbers of quote marks in a paragraph. It goes through the file from where you put the cursor, and stops on a paragraph with an odd number of double-quote marks. Solves a good percentage of the problem. 3 gotchas: It needs real [ ^p ] paragraphs (not [ ^l ]), I haven't hammered out the goofs caused by blank lines yet, and the end of the file puts it into a loop that one has to Ctrl-Break to get out of. If anyone cares to modify it, feel free. I claim no responsibility for how it breaks things in your files. And there are other threads to show you how to import it into Word if you haven't done it before. ######################## Sub QuoteHunter() ' ' QuoteHunter Macro ' Macro recorded 12/26/2007 by bjc ' 'To find tedious formatting problems with quote marks. ' ActiveDocument.UndoClear Dim NumCharsBefore As Long, NumCharsAfter As Long, CountNoOfReplaces As Long Top: ActiveDocument.UndoClear CountNoOfReplaces = 0 NumCharsBefore = 0 NumCharsAfter = 0 CountSelectionBefore = 0 CountSelectionAfter = 0 Selection.HomeKey Unit:=wdLine Selection.GoTo What:=wdGoToBookmark, Name:="\Para" Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.Extend Selection.Find.ClearFormatting CountSelectionBefore = Len(Selection) With Selection.Find .ClearFormatting .Text = """" .Replacement.ClearFormatting .Replacement.Text = "~~" ' .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.MoveRight Unit:=wdCharacter, Count:=1 'Get the number of chars AFTER doing Find & Replace Selection.HomeKey Unit:=wdLine Selection.GoTo What:=wdGoToBookmark, Name:="\Para" Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend CountSelectionAfter = Len(Selection) 'Calculate of the number of replacements, CountNoOfReplaces = CountSelectionAfter - CountSelectionBefore 'Undo the replace ActiveDocument.Undo ActiveDocument.UndoClear 'Determine if the number of quotes is appropriate If ((CountNoOfReplaces Mod 2) = 0) Then ' is even Selection.EndKey Unit:=wdLine Selection.Find.ClearFormatting Selection.MoveRight Unit:=wdCharacter, Count:=1 GoTo Top Else ' is odd Response = MsgBox("Odd Number of Quotes in This Paragraph:" & Str$(CountNoOfReplaces) & " of them.", vbOKOnly) End If End Sub ######################## Enjoy. -bjc |
01-05-2008, 06:43 PM | #2 |
Wizard
Posts: 2,698
Karma: 4748723
Join Date: Dec 2007
Device: Kindle Paperwhite
|
I can't tell for certain without seeing the original text but if a speaker's dialogue continues for more than one paragraph then a single quote is appropriate. The closing quote isn't included until the speaker is finished.
|
Advert | |
|
01-05-2008, 06:48 PM | #3 |
Resident Curmudgeon
Posts: 75,821
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I've recently started seeing that, And while I thought it might have been an error, I did look it up to find it's actually correct.
|
01-05-2008, 08:02 PM | #4 | |
Boo-Frickety-Hoo-Erizer
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
|
Quote:
By Example: John said, "I have a lot of stuff that to say. I have even more stuff to say." Mary replied, "Oh, John, you talk too much". is not as good as John said, "I have a lot of stuff that to say. I have even more stuff to say." Mary replied, "Oh, John, you talk too much". The 2nd is preferred for short quippy conversations. Sure, if the speaker carries on a great length, one can justify fewer quote marks, but it is preferred to keep the paragraphs of the speech in quotes, if possible. It is technically correct if an author is quoting someone else at length to have paragraph breaks, within the quote marks - still need one at the beginning of each paragraph. But if it is conversational, QuoteMark + speech + QuoteMark + Paragraph is correct. Besides, it is for mostly mine own good use, and if anyone doesn't want to be troubled with it, they don't have to be. I'm just trying to correct someone else's lousy formatting to suit myself. -bjc |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Quote marks not formatting in .TXT to .EPUB? | Sassyinkpen | Calibre | 11 | 10-07-2009 09:27 PM |
Unutterably Silly Fave Quote from the Weekend | nomesque | Lounge | 12 | 08-09-2009 08:22 PM |
multi-quote ??? (please explain) | zelda_pinwheel | Feedback | 2 | 04-24-2008 12:12 PM |
cannot post or quote | Aprilbeginnings | Sony Reader | 21 | 07-23-2007 06:15 PM |