Documentation/How Tos/Selecting all Footnotes in a Document

From Apache OpenOffice Wiki
< Documentation‎ | How Tos
Revision as of 21:26, 20 September 2008 by Vlastimil Pis (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Selecting all Footnotes in a Document

Selecting all footnotes in a Document at once, in Open Office Writer < 2.4 (via Shift key or sim.) remains an issue.

Though it is not directly supported, there is a couple of workarounds, depending on the goal you want to accomplish.

There are 2 main reasons to select all Footnotes:

  1. To change their properties (Font, Style etc.)
  1. To export them, possibly to create a list or bibliography.


(*Make backup of your original document, before performing changes you are not familiar with.)


To change Footnote properties (Font, Style etc.)

It is fairly easy to accomplish, by changing the global properties of the style your Footnotes have (by default it should be Style: Footnote). There is no need to expressly select all the Footnotes for that.

  • Type F11, or Format - Styles and Formatting
  • Right click your Style (Footnote) - Change.

The changes in the properties will have a global effect.

For more details, see the Assigning Styles With the Keyboard Wiki entry.

In case your footnotes do not have a common Style, look at the next section and possibilities offered by Regexp.


To Export all Footnotes (possibly into a list/bibliography)

There are 2 workarounds how to extract all Footnotes from a Document into a list.

The first is actually again a cheat, since it does not Select All Footnotes, in order to obtain the result. It is however listed first, because it is easier and provides usually good results, i.e. does not mess up the formatting in the process.

The second method allows you to actually select/highlight all Footnotes.

By Changing the File Format of the Document

The basic idea is to Save as the document containing the Footnotes, in some other format (f.e. txt) and then retrieve them with a simple text editor, and copy and paste them back into the Open Office document.

Before doing it, you should group all your footnotes at the end of the document.

  • Tools - Footnotes
  • Footnotes tab - Position > End of document

It looks already perfect, unfortunately you still can't select all of them.

Therefore

  • Save as - Your preferred File Format

Often, the smart choice to do this is to save to .html and not to .txt, since the .html (and .rtf) keeps the formatting such as Italics etc.

The .html file can be opened with any web browser and copy&pasted back into your original document, after which you can select all of your footnotes, as any simple text. This is probably the default way you want to export your footnotes, and use the following method only if you need something more specific.

By Selecting all Footnotes in a Document

To actually select all Footnotes at once, the Find and Replace Dialog offers you an elegant workaround

  • (Ctrl-F), or Edit - Find and Replace
  • Expand the More Options Menu in the dialog and check the Search for Styles.
  • Select the Style(Footnote) you are looking for in Search for.
  • Find All and Writer selects all instances of the Text having the specified Style.

By Copy and Pasting the highlighted text you can extract all the Footnotes at once, with the obvious loss of new paragraphs. (The Paste will be a continuous text block, but will keep the respective Formatting - unfortunately there is not a Paste special...)

You can however, clear out the new lines issue and obtain an impeccable list in a matter of seconds, by using the power of REGEXP :)


To Insert lines/delimiters between Footnotes with Regexp

If you are new to Regexp, skim over the following examples, then get back and spend 15 minutes reading some intro on REGEXP.

Even with a few basics, you can already do a lot. See Regular Expressions in Writer

(*15 minutes reading, to get an introductory idea about Regexp and you will be rewarded with a lifetime of luxury and professionalism in text searching)

  • Highlight your new (continuous) list
  • Edit - Find and Replace Dialog
  • Expand the More Options and check Current Selection Only & Regular Expressions

Carefully look at your footnotes and try to find some sort of pattern in the Text, that identifies the beginning of a Footnote.

Example:
Given in the Document is a specific format to provide sources for citations in Footnotes:
SURNAME, Name: Title..., Year.

The beginning of such a Footnote can by found by looking for a pattern 
".SURNAME" that equals "(a dot)(Capital letter)(more Capital letters)"
which equals further to the Regexp "\.[A-Z][A-Z]"
  1. Type the needed Regexp into the Search for field and Find All should highlight all the instances.
  2. In the Replace with box you can enter the string you want the highlighted text to be changed for

The trick is to manage to insert a new paragraph between two characters (i.e. an addition, not a replacement). To perform this task in the above example, after highlighting the above mentioned parts in the text,

  • You would check again Current Selection only and Search for "\."

which would be Replaced all with the expression ".\n" (replacing all the dots, in the previous selection, for a dot AND a new paragraph)

The example is meant to give you an idea on how the proceed. The actuall possibilities of Regexp are limited only by your imagination. (and by the fact that Writer does not yet support Regexp in the Replace with field)

If the Footnotes show the slightest sign of regularity, there is a way to exploit it with Regexp and save yourself some work.

By using the same principle you can extract your Footnotes independently of their Style, i.e identifying them with a Regexp.

Example:
Footnotes like: "This is a very interesting source. <www.openoffice.org>"
Can be summarized as 
"(Capital letter)(possibly more letters)(dot)(<)(letters)(>)"
(Ideally your Regexp identifies all of your needed expressions, but not any other expressions.)

Therefore by searching for all "^[A-Z].*\. <.*>$" in Find and Replace would be a good beginning how to highlight all of these terms at once.
Personal tools