Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to insert LF into bookmap/booktitle/mainbooktitle?


How to insert LF into bookmap/booktitle/mainbooktitle?

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.





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.


Toshihiko Makita


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.



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!


5-Regular Member


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


Actually I'm with you on this one Toshihiko

Whitespace in XML applications has always been a bit of a pain - if you google around you will see everyone gets bitten by XML whitespace at one point or another!

It looks like you have a number of options anyway, so trust you are now able to get your application working correctly.

Top Tags