OOo Off the Wall: Fielding Questions, Part 2 - Cross References and User-Defined Fields

Tips and workarounds to get you through the sometimes frustrating process of creating cross-references in Writer documents.

Frankly, cross-references are a disappointment in Writer. Several posters to the mailing lists have referred to them as glorified bookmarks, and they're not far off. Compared to other software designed for writing long documents, Writer's cross-referencing tools are lacking. To start with, Writer does not give you the option of creating cross-references from headings. Instead, you have to add the sources manually--exactly as you would a bookmark. To make matters worse, cross-references between documents require kludges. And, if that was not enough, Writer also lacks the building blocks used by FrameMaker to create standard sentences and sentence fragments that lead to cross-references.

Unfortunately, nothing can be done about the inability to cross-reference headings automatically. However, a little ingenuity allows references between documents, and designing a few user-defined fields solves the lack of lead-ins.

Using Cross-References

Cross-references are used in academic and technical documents to refer to related material. In Writer, cross-references have three main purposes:

  • They reduce repetition in a document. Instead of repeating information already given, you can give it once and reference it in other places.

  • They help readers quickly find information in which they might be interested.

  • When writing a document, they provide a hyperlink that you can select to change the position of the mouse cursor in the document.

Once cross-references are made, they are listed in the Navigator under References, so that you easily can find them.

Cross-references are placed in fields because they are likely to change frequently. While you are writing, the wording of a cross-reference is likely to change as well as the page on which it appears. You could change them all manually, but because they are in fields, you only have to select Tools > Updates > Fields to have all cross-references immediately updated.

Creating a cross-reference within a document is done in two steps:

  1. Create the cross-reference source. The cross-reference source is the text to which the cross-reference directs users.

  2. Create the cross-reference. The cross-reference is the field that points to a source.

Cross-references can be used only in paper documents or within on-line Writer documents. If you are writing an HTML document, use a bookmark instead.

Adding a Cross-Reference Source

By convention, a cross-reference source usually is a heading or title. You can use any text as a cross-reference source. The advantage of using a heading or title is that when a reader follows the cross-reference, the source can be seen quickly because it is formatted differently from the body text.

To add a cross-reference source:

  1. In the document, select the text for the cross-reference source. To help readers find it as quickly as possible, in most cases the text should be a non-text body style that is formatted to stand out. Headings are used most often reference sources, but captions are almost as common.

  2. Select one of the following:

    • Insert > Cross reference.

    • Insert > Field > Other > References.

    In both cases, the Fields window opens. The References tab is active.

  3. Select Set Reference as the field type. The selected text appears in the Value field on the tab. Because you cannot edit the selected text from the tab, it is grayed out.

  4. Enter a name for the cross-reference source. This is the name listed in the Selection pane of the References tab. Even though the Value field is available when you select the name, the most useful name for a reference source usually is its actual text or perhaps an abbreviation of it. With this choice, you immediately can identify the reference source later. The main reason for not making the Name and Value field identical is if the text of the reference source is not unique in the document.

  5. Select the Insert button. The content of the Name field now is listed alphabetically in the Selection pane. It now is ready to be used in a cross-reference. In the document, the selected text is no longer highlighted. Instead, it has the gray background of a field. You can get much the same effect by adding a bookmark using Insert > Bookmarks and then typing in the text for it. The only difference is a bookmark is invisible in a document, while a cross-reference source has a field's characteristic gray background.


-- Bruce Byfield (nanday)


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

open office

decorative wall paneling's picture

wow this is a blast from the past!

seo reseller plans

jenny07's picture

Brilliant post..I always visit your site and found lots of beautiful work. Thanks for your all efforts that you do for it. Thanks a lot..
seo reseller plans

Your post really cool. I glad

Marcus Everding's picture

Your post really cool. I glad to be here. I enjoyed reading your articles and if allowed I want to bookmark your posts....

copy wii games|copy xbox 360 games

Future Technology

Jhon Terry's picture

Very well article! I’m simply in love with it and if you ask me to describe it in a word. Anyone can to know by it effective information on linux journal very fantastic.Software design is suitable glorified bookmark.

Future Technology.

Future Technology

sojib's picture

Personally, I allow open commenting on my website. I might turn on moderation if I find I am getting destructive or hateful posts, we'll see.This is very nice post.
Future Technology.

Future Technology

Jhon Terry's picture

Personally, I allow open commenting on my website. I might turn on moderation if I find I am getting destructive or hateful posts, we'll see.This is very nice post.
Future Technology.

Future Technology

tomperling09's picture

I am hoping the same best work from you in the future as well. In fact your creative writing ability has inspired is nice article.
car insurance quotes.

Future Technology

tomperling09's picture

I am hoping the same best work from you in the future as well. In fact your creative writing ability has inspired is best article.i will performers in world this article.
car insurance quotes.

investing in halton

parlingtom's picture

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities have inspired me to start my own wordpress blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it. It's treuly about Cross References and User-Defined Fields.investing in halton.

invest in halton

parlingtom's picture

It is qualify anyone about this topic. It’s always better to take the best original subject. This article have been enjoyed me very much, Here has some effective and valuable information about OpenOffice. This is very nice post! I will bookmark this blog.invest in halton.

Deleting/Modifying References?

Anonymous's picture

I can't find a way to edit to delete cross references from the "Set References" section of the "References" tab in "Fields." This seems too crazy to be true so I must be missing something. How does one do this?

Thanks much!


Derek's picture

I hate all these damn Win[bl]ows systems! AAAArgh. TUX! Save our souls please!

Cross referencing headings and linking to sections in other docs

Ian laurenson's picture

There is a macro for cross referencing headings. It is available from: in a document called OutlineCrossRef3.sxw. I am surprsed that Bruce didn't mention it as he has given it a positive review in the past.

I also think that mention of inserting sections of other documents should have been included in this article.
Insert > Sections > Link

can't reference numbering in OOo

Leston Buell's picture

A major drawback in OOo is the inability to reference numbers for a numbered paragraph style. Latex, Word, and (i think) WordPerfect allow you to do this. This makes it impractical to author large OOo documents in my field, theoretical linguistics. For example, i have around 380 examples in my dissertation, all of them numbered. While i can create a cross-reference to a page (like "see example on page 47"), there's no way to reference the number (like "see example (97)"). There is a spec to fix this bug approved in OOo issue 25072, but it's not getting into OOo 2.0. (This particular bug addressed in the spec is described in the duped bug 2204.)

The only workaround for people like me is to make numbered paragraphs behave as section numbers and then do all of the section numbering manually. So i tell OOo to put in a reference to chapter 97, when it should really just be a numbered paragraph.

With this situation, i only use OOo for shorter things like short articles and handouts. It's impractical for longer things, for which i use Latex.

This bug is not only in the GUI. OOo will also incorrectly documents in other formats (like Word) that reference the number of a numbered paragraph.

Cross referencing to variables

Ian laurenson's picture

It is possible to create cross references to variables. The most common example being for equations. In there is a standard autotext "fn". Type fn and and press F3 and an equation and number is put into the document.
In the same way you could create an autotext entry for your examples.
To insert the number:

Insert > Fields > Other... (or Control + F2)
Variables tab.
Select set variable
Give the variable a name e.g. Example
For the value Example+1
Click insert

Have a dummy example formatted in the way you would like and then create an autotext entry:

Select the desired text
Edit > Autotext (or Control+F3)
Give it a name and a shortcut
AutoText button > New

Test it
Type in the shortcut and press F3.

Cross-referencing examples for linguistic papers and books

Damir Cavar's picture

It is absolutely simple to actually perform the task of automatically enumerating examples and then referencing them, simpler than the suggestion above:

Create a counter via:

Insert > Fields > Other... (or Control + F2)

Choose the Variables tab.

Select "Number range" and for Name type in for example "Example", start with the initial value of 1, if you want, select Insert and close the dialog, and return to the text. If you want to insert a cross-reference to the example in the form of e.g. (1a), type ( and choose:

Insert > Cross-reference

Select the tab Reference and the variable Example. You have the numbers listed in the middle list, select one, choose Numbering in the right list, and say insert, thats it!

In particular for linguistic papers there are many many good things that make life easy in OO, and if you want to format in Latex later on, once it is done, export the file to Latex and make your adaptations and compile.


Daniel R. Franklin's picture


In Section \ref{sec:foo}, I demonstrate why LaTeX is good and OO is not a suitable tool for any sort of scientific document. Don't even get me started on $equations$.

- Daniel


Adam P's picture

You've just demonstrated that LaTeX is at least as bad as OOo at cross-references, since there are no auto-labels for headings in LaTeX either (you had to put the \label{} in there by hand), and considerably less flexibility in formatting references. Speaking of flexibility, how can LaTeX claim to be taken seriously with its one true outline numbering scheme (in the enumerate environment), which has a maximum of four levels deep? Puh-leeze!

But I do agree with you on equations. :-)

[q->t to email]

Since the

Jcbeown's picture

Since the Writer lacks the tools required for cross-reference which puts us into a lot of difficulties and a waste of precious time! That is where article is comes as such a breath of fresh air! Though nothing can be done about the inability to cross-reference headings automatically, with a little innovation, it is possible to refer between documents and designing a few user-defined fields which solves the lack of lead-ins! Helps you to get stared and how it really works with explanations which are quite easy to follow and make your work a lot easier!Mobile Analytics

It's TRIVIAL to add auto-labe

Khim's picture

It's TRIVIAL to add auto-labels to LaTeX (unlike OOo) yet noone bothered to actually include this in standard package. For more then 10 years. Why is this ? Think about it.

And the same goes for four levels limit: if you actually need more then THREE then it's time to examine your writing style (fourth level is actually safety measure - it should not be needed at all). Of course if we really need more you can find package to raise that limit.

The truth of the matter is that LaTeX CAN be adopted to work in the way YOU want while OOo CAN NOT. Not 100% true, of course, but close enough: you can extend both LaTeX and OOo (both are open-source) but in LaTeX it's matter of some macrodefinitions (usually quite small and manageable) while in OOo you'll be forced to study C++ and a lot of OOo components internals - big difference.

Modifying OOo

Anonymous's picture

Actually, you might only need to study OOoBasic.

Ian Laurenson has written a macro called ReferenceManager that vastly improves cross-referencing in OOo.

I should have including ReferenceManager when I wrote the article, but I just remembered it now.

- Bruce Byfield