Skip to main content
1-Visitor
November 13, 2012
Question

How to insert LF into bookmap/booktitle/mainbooktitle?

  • November 13, 2012
  • 1 reply
  • 2532 views

Dear Experts,

I'm a stylesheet programmer.

One of my customers is now moving to DITA and they author DITA bookmap/topic using Arbortext editor.

They author DITA instances and they want to format them using DITA Open Toolkit.

Here is my question.

They need the following mainbooktitle element for output it to the book cover.

<mainbooktitle>Maintenance

Manual</mainbooktitle>

or

<mainbooktitle>Maintenance&#x0A;Manual</mainbooktitle>

However they say that Arbortext editor does not allow inserting LF codes into element text.

Is there any way to insert LF codes into the text node via Arbortext Editor?

Any suggestions are welcome.

Regards,

Toshihiko Makita

1 reply

16-Pearl
November 13, 2012

Hi there,

This sort of formatting control is entirely against the DITA paradigm, if you google for "DITA <br>" you will see all sorts of people strenuously defending the DITA ideals.

For those of us who just have to "make it work", I think the easy answer will be one of two approaches:

1. Add a DITA specialization to allow a <br/> element, then customise your stylesheets to apply the <br/> as required.

2. Use a Processing Instruction such as <?Pub _newline?> to force the linebreak. Again, your stylesheet will need to interpret this accordingly.

Hope that helps.

Cheers,

Gareth

1-Visitor
November 14, 2012

Dear Gareth,

Thank you for your suggestion. It is very helpful.

This sort of formatting control is entirely against the DITA paradigm

However I cannot agree your opnion. DITA specification does not inhibit inputting white spaces as text node. Other XML editors such as XMetaL, oXygen can input character reference &#x0A; in any text of element.

I think interpreting white spaces as useful or not belongs users decision.

So I have a question. Why Arbortext editor inhibit inputting LF character even it is expressed as character reference?

Introducing specialization or expressing LF as processing instruction is very much troublesome job. If the editor allows inputting &#x0A;, all problem will be solved suddenly!

Regards,

5-Regular Member
November 14, 2012

Hi,

Generally I agree with the point Gareth made. In DITA (or any other publishing paradigm where content authoring and layout are strictly separated) the authors never should care about where a line break is made in the final output. So even though I don't know why your customer requires the line break in this position on the book cover I would assume that it has to do either with available space on the cover or with aesthetical reasons.

One possible solution could be to use another DITA element for the second title line, e.g. using the booktitlealt element for that purpose. Another option might be to force the line break by limiting the "available" space for the mainbooktitle element on the cover page in the style sheet.

I hope that helps.

Kind regards

Sirko