Line break inside <mainbooktitle> element
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Line break inside <mainbooktitle> element
Post by BogdanM777 »
Hi Guys,
I would have a question regarding the <mainbooktitle> element.
Is it possible to have a line break inside this element? That means, if I would like to have the title on two lines, e.g.
<mainbooktitle>Line 1 Line 2</mainbooktitle>
what should I insert between the Line 1 & Line 2?
Till now I managed to do that using a blank image, however I imagine that this is not quite professional, right?
So, I was wondering if DITA has any solution to this type of situation.
Thank you very much,
Bogdan
I would have a question regarding the <mainbooktitle> element.
Is it possible to have a line break inside this element? That means, if I would like to have the title on two lines, e.g.
<mainbooktitle>Line 1 Line 2</mainbooktitle>
what should I insert between the Line 1 & Line 2?
Till now I managed to do that using a blank image, however I imagine that this is not quite professional, right?
So, I was wondering if DITA has any solution to this type of situation.
Thank you very much,
Bogdan
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Re: Line break inside <mainbooktitle> element
Post by BogdanM777 »
I tried to use the solution offered by you in this article:
https://www.oxygenxml.com/dita/stylegui ... itles.html
However the space between the lines is way too big, so I was wondering if there would be another solution.
Also, right now, in the title, using the 1 pixel/1 pixel image solution, the two lines are not aligned perfectly to the right hand side, so I was wondering what would be a solution to that as well.
Thank you very much
https://www.oxygenxml.com/dita/stylegui ... itles.html
However the space between the lines is way too big, so I was wondering if there would be another solution.
Also, right now, in the title, using the 1 pixel/1 pixel image solution, the two lines are not aligned perfectly to the right hand side, so I was wondering what would be a solution to that as well.
Thank you very much
-
- Posts: 222
- Joined: Tue Jul 01, 2014 11:48 am
Re: Line break inside <mainbooktitle> element
Post by bogdan_cercelaru »
Hello,
Unfortunately, DITA does not offer any solution to this type of situation. However, the following procedure offer you a workaround to obtain a line break using a customization directory for PDF transformation.
Regards,
Bogdan
Unfortunately, DITA does not offer any solution to this type of situation. However, the following procedure offer you a workaround to obtain a line break using a customization directory for PDF transformation.
- Copy the entire directory: DITA_OT_DIR\plugins\org.dita.pdf2\Customization to another location (for instance, C:\Customization).
- Rename C:\Customization\catalog.xml.orig to: C:\Customization\catalog.xml.
- Open the catalog.xml in Oxygen XML Editor and uncomment this line:
So now it looks like this:
Code: Select all
<!--uri name="cfg:fo/attrs/custom.xsl" uri="fo/xsl/custom.xsl"/-->
Code: Select all
<uri name="cfg:fo/attrs/custom.xsl" uri="fo/xsl/custom.xsl"/>
- Rename the file: C:\Customization\fo\xsl\custom.xsl.orig to: C:\Customization\fo\xsl\custom.xsl
- Open the custom.xsl file in Oxygen XML Editor and add the following template:. Now, custom.xsl has the following content:
Code: Select all
<xsl:template match="processing-instruction('linebreak')">
<fo:block/>
</xsl:template>Code: Select all
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="2.0">
<xsl:template match="processing-instruction('linebreak')">
<fo:block/>
</xsl:template>
</xsl:stylesheet> - Edit the DITA Map to PDF transformation scenario and in the Parameters tab, set the customization.dir parameter to C:\Customization.
- Now you can use the following PI to insert a new line
Code: Select all
<?linebreak?>
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Re: Line break inside <mainbooktitle> element
Post by BogdanM777 »
Hi Bogdan,
I followed your instructions and I inserted in the <mainbooktitle> something like:
<mainbooktitle>Title part 1<?linebreak?>part 2</mainbooktitle>
When I ran the custom PDF transformation, I got the error message:
Description: I/O error reported by XML parser processing file:/D:/Customization/fo/attrs/custom.xsl: D:\Customization\fo\attrs\custom.xsl (The system cannot find the file specified) Cause: java.io.FileNotFoundException: D:\Customization\fo\attrs\custom.xsl (The system cannot find the file specified)
So I went into the specified directory and changed the name of the file from custom.xml.orig to custom.xml, and I ran the transformation again, however the pdf I obtained did not have any line break between the Title part 1 and part 2.
Did I do something wrong?
Thank you
I followed your instructions and I inserted in the <mainbooktitle> something like:
<mainbooktitle>Title part 1<?linebreak?>part 2</mainbooktitle>
When I ran the custom PDF transformation, I got the error message:
Description: I/O error reported by XML parser processing file:/D:/Customization/fo/attrs/custom.xsl: D:\Customization\fo\attrs\custom.xsl (The system cannot find the file specified) Cause: java.io.FileNotFoundException: D:\Customization\fo\attrs\custom.xsl (The system cannot find the file specified)
So I went into the specified directory and changed the name of the file from custom.xml.orig to custom.xml, and I ran the transformation again, however the pdf I obtained did not have any line break between the Title part 1 and part 2.
Did I do something wrong?
Thank you
-
- Posts: 222
- Joined: Tue Jul 01, 2014 11:48 am
Re: Line break inside <mainbooktitle> element
Post by bogdan_cercelaru »
Hi,
Sorry, my mistake. Step 3 in my previous message should have been:
Bogdan
Sorry, my mistake. Step 3 in my previous message should have been:
- Open the catalog.xml in Oxygen XML Editor and uncomment this line:
So now it looks like this:
Code: Select all
<!--uri name="cfg:fo/xsl/custom.xsl" uri="fo/xsl/custom.xsl"/-->
Code: Select all
<uri name="cfg:fo/xsl/custom.xsl" uri="fo/xsl/custom.xsl"/>
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 68
- Joined: Tue Jun 09, 2015 6:26 pm
- Location: Canada
Re: Line break inside <mainbooktitle> element
Post by BogdanM777 »
Thank you Bogdan!
Now it works "licking the button"!
Have a great day!
Now it works "licking the button"!
Have a great day!
Re: Line break inside <mainbooktitle> element
I have something similar to that , but I am using ditamap.
I want to give line break in<map><title>something<sub>hello</sub></title></map>on <sub> element in frontmatter. How can I achieve this? Now it is showing in same line.
I want to give line break in<map><title>something<sub>hello</sub></title></map>on <sub> element in frontmatter. How can I achieve this? Now it is showing in same line.
Rohit Ghosh
Jr. Software Developer
Jr. Software Developer
Re: Line break inside <mainbooktitle> element
Hi,
An alternative to achieve this is to convert your DITA map to a bookmap.Then, for a bookmap you can insert a booktitle element. The booktitle element contains the title information such as <mainbooktitle> and <booktitlealt>. This way you can have the two titles each for them shown on a different line in the PDF output.
https://www.oxygenxml.com/dita/1.3/spec ... okmap.html
https://www.oxygenxml.com/dita/1.3/spec ... lealt.html
You can check this structure also in our sample project DITA>it-book>taskbook.ditamap.
I hope this helps.
Regards,
Ionela
An alternative to achieve this is to convert your DITA map to a bookmap.Then, for a bookmap you can insert a booktitle element. The booktitle element contains the title information such as <mainbooktitle> and <booktitlealt>. This way you can have the two titles each for them shown on a different line in the PDF output.
https://www.oxygenxml.com/dita/1.3/spec ... okmap.html
https://www.oxygenxml.com/dita/1.3/spec ... lealt.html
You can check this structure also in our sample project DITA>it-book>taskbook.ditamap.
I hope this helps.
Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service