Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 01-05-2008, 02:34 PM   #1
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
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
brewt is offline   Reply With Quote
Old 01-05-2008, 06:43 PM   #2
carld
Wizard
carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.carld ought to be getting tired of karma fortunes by now.
 
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.
carld is offline   Reply With Quote
Advert
Old 01-05-2008, 06:48 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,654
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by carld View Post
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.
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.
JSWolf is online now   Reply With Quote
Old 01-05-2008, 08:02 PM   #4
brewt
Boo-Frickety-Hoo-Erizer
brewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enoughbrewt will become famous soon enough
 
brewt's Avatar
 
Posts: 251
Karma: 686
Join Date: Oct 2007
Device: Kobo Glo HD!
Quote:
Originally Posted by JSWolf View Post
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.
I looked it up today, too. Chicago Style says that if the quote marks are used conversationally, a carriage return is another indicator that the speaker has stopped speaking, and is preferred.


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
brewt is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 03:14 PM.


MobileRead.com is a privately owned, operated and funded community.