Ask Your Question

How can I have a custom numbered field? [closed]

asked 2012-07-28 18:48:34 +0200

elehack gravatar image

In Writer, I would like a custom field, incrementing throughout the document, attached to my own counter. The end result should be somewhat like page number, but it displays instead its position within the document (so the Nth instance of this field says “N”).

The use case is numbering problems in an exam - I would like to be able to insert an automatic field in problem headings, so that the problem is labeled “Problem N”, with N auto-updating if I move problems around in the exam.

Is there a way to do this?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-10-17 14:58:08.576419

2 Answers

Sort by » oldest newest most voted

answered 2012-07-29 20:24:43 +0200

tohuwawohu gravatar image

updated 2012-07-29 20:28:44 +0200

You can do this by defining your own field of type "Number Range". Assuming you already have at least one heading that should contain the custom numbering, do the following:

  • Put the cursor to where the field should be inserted;

  • Open Menu "Insert" -> "Fields" -> "Other..." or hit "CTRL+F2"; the "Insert Fields" dialogue will appear.

  • Select tab "Variables":

    • in the left list box ("Type"), select "Number Range";
    • don't select an entry from "Selection";
    • enter a name at "Name" to create a new number range;
    • leave "Value" empty;
    • select "Format" as desired:

    Insert Fields - Variables - Custom Number Range

  • Hit "Insert" to insert a field for the new number range.

For further usage, the custom number range will be available in the "Insert Fields" dialogue, tab "Variables", list box "Selection". Just insert fields using that number range as desired. The fields will get updated if you move the headings around.

edit flag offensive delete link more


Perfect, thanks!

elehack gravatar imageelehack ( 2012-07-31 02:24:00 +0200 )edit

answered 2012-07-29 09:16:35 +0200

Monk gravatar image

I don't know a direct way, but perhaps this workaround is useful or at least usable for you:

Open Format->Styles and formatting rightclickand choose 'new' from Contextmenu Create a new Format for your 'Problem Headline' and adjust all your formating preferences you need. If there is already a style you use you may also use the button in the right top to create a 'New Style from selection' and after creating rightclick and choose modify.

Now switch to tab 'Outline and numbering' and choose Numbering 1.

Now slect all your 'Problem Headers' and they will be numbered automatically in the order they appear in the document. When you are ready with your exam you may manually insert the problem Number taking the number from the headline.

If you already use numbering for your chapters, then disable numbering temporarily in the headline-style.

Hope that helps


edit flag offensive delete link more

Question Tools


Asked: 2012-07-28 18:48:34 +0200

Seen: 4,557 times

Last updated: Jul 29 '12