Ask Your Question
1

How can I have a custom numbered field?

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

elehack gravatar image elehack
13 3

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?

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
1

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

tohuwawohu gravatar image tohuwawohu flag of Germany
1812 13 40

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.

link delete flag offensive edit

Comments

Perfect, thanks!

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

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

Monk gravatar image Monk
11 1 3

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

Stefan

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

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

Seen: 339 times

Last updated: Jul 29 '12