User:Cthaeh: Difference between revisions

From Baka-Tsuki
Jump to navigation Jump to search
Cthaeh (talk | contribs)
m updating italics macro
Cthaeh (talk | contribs)
m reorganizing
Line 2: Line 2:




I'm really thankful for the work the translators (and editors) have done so that I am able to read these light novels; so I figured the best way to show my appreciation would be to do edits. I'm currently slowly reading and editing Toaru Majustu no Index to convert the older chapters to the past tense. I also try to help out with some of the new and ongoing translations.
I'm really thankful for the work the translators (and editors) have done so that I am able to read these light novels; so I figured the best way to show my appreciation would be to do edits. I'm currently slowly reading and editing Toaru Majustu no Index to convert the older chapters to the past tense. I plan to do a consistency edit through all of the Index volumes once I've finished reading the main series and the extra stories. I also try to help out a little with some of the other new and ongoing translations.






==Italics Macro==
==Italics Macro==
Converting Microsoft Word text formatted as italics into the wiki format came up in a discussion.  So I copied this (http://www.wordbanter.com/showthread.php?t=72202) visual basic macro and modified it to add the two single quotes around text that is italicized in Microsoft Word. '''The wiki formatting messes up the syntax of the copy and pasted code, so I suggest copying the macro from the edit version of this page if you're going to use it.'''
Converting Microsoft Word text formatted as italics into the wiki format came up in a discussion.  So I copied a visual basic macro from the internet and modified it to add the two single quotes around text that is italicized in Microsoft Word. Just go to Tools -> Macros -> Create New Macro, then paste the following code into visual basic window that pops up, and then save. Go back to Word, open macros again, and hit run on the new macro.
 
Updated macro to better deal with italics that go to the end of a line (previously would put the closing single quotes on the next line), or italics that contain blank lines. The older version should work for most cases. Hopefully there aren't any other edge cases / bugs I'm missing.


(Nov 25, 2012) Updated macro to better deal with italics that go to the end of a line (previously would put the closing single quotes on the next line), or italics that contain blank lines. Hopefully there aren't any other edge cases / bugs I'm missing.


<pre>
Sub convert_italics()
Sub convert_italics()


Dim oRange As Range
Dim oRange As Range


With Selection
With Selection
Line 52: Line 51:


End Sub
End Sub
</pre>

Revision as of 00:21, 22 May 2013

I guess I'll create this page so the link to my name isn't red anymore...


I'm really thankful for the work the translators (and editors) have done so that I am able to read these light novels; so I figured the best way to show my appreciation would be to do edits. I'm currently slowly reading and editing Toaru Majustu no Index to convert the older chapters to the past tense. I plan to do a consistency edit through all of the Index volumes once I've finished reading the main series and the extra stories. I also try to help out a little with some of the other new and ongoing translations.


Italics Macro

Converting Microsoft Word text formatted as italics into the wiki format came up in a discussion. So I copied a visual basic macro from the internet and modified it to add the two single quotes around text that is italicized in Microsoft Word. Just go to Tools -> Macros -> Create New Macro, then paste the following code into visual basic window that pops up, and then save. Go back to Word, open macros again, and hit run on the new macro.

(Nov 25, 2012) Updated macro to better deal with italics that go to the end of a line (previously would put the closing single quotes on the next line), or italics that contain blank lines. Hopefully there aren't any other edge cases / bugs I'm missing.

Sub convert_italics()

Dim oRange As Range

With Selection
.HomeKey (wdStory)
.Find.ClearFormatting
End With
With Selection.Find
.Text = ""
.Font.Italic = True
.Forward = True
.Wrap = wdFindStop
Do While .Execute
Set oRange = Selection.Range
With oRange
'remove the italic
.Font.Italic = False

If Len(.Text) > 1 Then
If Right(.Text, 1) = vbCr Then
.Text = "''" & Left(.Text, Len(.Text) - 1) & "''" & Right(.Text, 1)
Else
.Text = "''" & .Text & "''"
End If
Else
.Text = .Text & ""
End If

End With
Loop
End With

Set oRange = Nothing
Selection.Find.ClearFormatting
Selection.HomeKey (wdStory)
MsgBox "Finished."

End Sub