News

October 2009 : a new release (bibus 1.5.0)

  • OOo3.1 compatibility
  • Infinite number of file/http links
  • Clever capitalization (lord of war => Lord of War ...)
  • Better handling of journal abbreviations
  • Import/Export filters can be added easily (plugin)
  • journal abbreviations and shortcuts can be easily edited (simple csv file that can be edited in OOo/excel or a text editor)
  • Lot of bug fixes
  • Requires python2.5 (not a problem anymore under Windows since OOo3.1 includes 2.6)
  • Requires wxpython-2.8

Italicize words using OpenOffice.org

From Bibus

Jump to: navigation, search

Currently, Bibus provides no way to italicize individual words in a field (such as may be needed for a scientifc species name in the title). Here is a workaround for users of OpenOffice.org.

1. Use the html tags <i> and </i> in Bibus to demarcate words to be italicized.

2. After finalizing, do the following two part search and replace operation in OpenOffice.org. Make sure to select the option for "Regular Expressions" available through the "More Options" feature!

Search: <i>[^><]*</i>
Replace: & (formatting = italic)

Search: <[/]*i>
Replace:

or ...

The following macros italicize the words automatically:

1: for openoffice (modified from different macros from http://www.pitonyak.org/AndrewMacro.odt , documentation under public license http://www.openoffice.org/licenses/pdl.pdf):


 Sub ItaliqueBibus
   Dim vOpenSearch, vCloseSearch 'Open and Close descriptors
   Dim vOpenFound, vCloseFound 'Open and Close find objects
   ' Create descriptors from the searchable document.
   vOpenSearch = ThisComponent.createSearchDescriptor()
   vCloseSearch = ThisComponent.createSearchDescriptor()
   ' Set the text for which to search and other
   vOpenSearch.SearchString = "<i>"
   vCloseSearch.SearchString = "</i>"
   ' Find the first open delimiter
   vOpenFound = ThisComponent.findFirst(vOpenSearch)
   Do While Not IsNull(vOpenFound)
     'Search for the closing delimiter starting from the open delimiter
     vCloseFound = ThisComponent.findNext( vOpenFound.End, vCloseSearch)
     If IsNull(vCloseFound) Then
       Print "Found an opening bracket but no closing bracket!"
       Exit Do
     Else
       ' Clear the open bracket, if I do not do this, then I end up
       ' with only the text inside the brackets
       vOpenFound.setString("")
       ' select the text inside the brackets
       vOpenFound.gotoRange(vCloseFound, True)
       ' Print "Found " & vOpenFound.getString()
       ' clear the text inside the brackets
       vOpenFound.CharPosture=com.sun.star.awt.FontSlant.ITALIC
       ' Clear the close bracket
       vCloseFound.setString("")
       ' Do you really want to delete ALL of the spaces?
       ' If so, then do it here!
       vOpenFound = ThisComponent.findNext( vOpenFound.End, vOpenSearch)
     End If
   Loop
 End Sub
 
 

2: for Microsoft Word:

 Sub bibus()
     ActiveDocument.Select
     Selection.Find.ClearFormatting
     With Selection.Find
         .Text = "<i>"
         .Replacement.Text = ""
         .Forward = True
         .Wrap = wdFindStop
         .Format = False
         .MatchCase = False
         .MatchWholeWord = False
         .MatchWildcards = False
         .MatchSoundsLike = False
         .MatchAllWordForms = False
     End With
     While Selection.Find.Execute = True
         With Selection
             .MoveEndUntil Cset:="</i>", Count:=wdForward
             .MoveRight Unit:=wdCharacter, Count:=4, Extend:=wdExtend
         End With
         Selection.Font.Italic = wdToggle
         With Selection
             .MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
         End With
     Wend
     Selection.Find.ClearFormatting
     Selection.Find.Replacement.ClearFormatting
     With Selection.Find
         .Text = "<i>"
         .Replacement.Text = ""
         .Forward = True
         .Wrap = wdFindContinue
         .Format = False
         .MatchCase = False
         .MatchWholeWord = False
         .MatchWildcards = False
         .MatchSoundsLike = False
         .MatchAllWordForms = False
     End With
     Selection.Find.Execute Replace:=wdReplaceAll
     With Selection.Find
         .Text = "</i>"
         .Replacement.Text = ""
         .Forward = True
         .Wrap = wdFindContinue
         .Format = False
         .MatchCase = False
         .MatchWholeWord = False
         .MatchWildcards = False
         .MatchSoundsLike = False
         .MatchAllWordForms = False
     End With
     Selection.Find.Execute Replace:=wdReplaceAll
 
 End Sub
Personal tools