Justification of text in TOC (multi-line)
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 23
- Joined: Wed Nov 18, 2015 6:43 pm
Justification of text in TOC (multi-line)
I have a problem I am not able to fix with the way the TOC entries are being justified when there is more than 1 line. Please see the graphics below. This is for PDF output, using a customized DITA-OT that I have develope based on the one that comes with Oxygen:


Any ideas on how I can fix this, so there is no "dead" space like the one in the 2 samples above?
Thanks,


Any ideas on how I can fix this, so there is no "dead" space like the one in the 2 samples above?
Thanks,
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Justification of text in TOC (multi-line)
Post by radu_pisoi »
Hi,
You can fix this problem by setting the 'text-align' XSL-FO property to 'start' for TOC entries.
So, you need a PDF customization where you can specify the next attribute set:
If you don't have a PDF customization, you can read the next topics as a starting point:
http://oxygenxml.com/doc/versions/18.0/ ... ation.html
http://www.dita-ot.org/1.8/readme/dita2 ... ation.html
You can fix this problem by setting the 'text-align' XSL-FO property to 'start' for TOC entries.
So, you need a PDF customization where you can specify the next attribute set:
Code: Select all
<xsl:attribute-set name="__toc__topic__content">
<xsl:attribute name="text-align">start</xsl:attribute>
</xsl:attribute-set>
http://oxygenxml.com/doc/versions/18.0/ ... ation.html
http://www.dita-ot.org/1.8/readme/dita2 ... ation.html
Radu Pisoi
<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: 23
- Joined: Wed Nov 18, 2015 6:43 pm
Re: Justification of text in TOC (multi-line)
I have "text-align" already as start. But I believe that the problem might be that "text-align-last" is justify. But I need it to be justify. Any other clues? Here is my __toc__topic__content section:
Code: Select all
<xsl:attribute-set name="__toc__topic__content">
<xsl:attribute name="last-line-end-indent">-22pt</xsl:attribute>
<xsl:attribute name="end-indent">22pt</xsl:attribute>
<xsl:attribute name="text-indent">-<xsl:value-of select="$toc.text-indent"/></xsl:attribute>
<xsl:attribute name="text-align">start</xsl:attribute>
<xsl:attribute name="text-align-last">justify</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:variable name="level" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])"/>
<xsl:choose>
<xsl:when test="$level = 2">14pt</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="font-weight">
<xsl:variable name="level" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])"/>
<xsl:choose>
<xsl:when test="($level = 2) or ($level = 3) or ($level = 4)">normal</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="color">
<xsl:variable name="level" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])"/>
<xsl:choose>
<xsl:when test="$level = 2">#094731</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="space-before">
<xsl:variable name="level" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])"/>
<xsl:choose>
<xsl:when test="$level = 2">10pt</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="keep-together.within-page">
<xsl:variable name="level" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])"/>
<xsl:choose>
<xsl:when test="($level = 4) or ($level = 5)">always</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="keep-with-next.within-page">
<xsl:variable name="level" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])"/>
<xsl:choose>
<xsl:when test="($level = 4) or ($level = 5)">always</xsl:when>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Justification of text in TOC (multi-line)
Post by radu_pisoi »
What DITA-OT you are using?
Did you modify the sources of DITA-OT to change the '__toc__topic__content' attribute set, or you use a PDF customization plugin or directory?
Did you modify the sources of DITA-OT to change the '__toc__topic__content' attribute set, or you use a PDF customization plugin or directory?
Radu Pisoi
<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: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Justification of text in TOC (multi-line)
Post by radu_pisoi »
Please note that some properties from '__toc__topic__content' attribute set are overridden by the processor specific settings.
For DITA-OT 2.x, open the file:
{oXygenInstallDir}/frameworks/dita/DITA-OT2.x/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl
For DITA-OT 1.8, open the file:
{oXygenInstallDir}/frameworks/dita/DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs/toc-attr_fop.xsl
If you don't have a customization folder, you have to modify these files too.
For DITA-OT 2.x, open the file:
{oXygenInstallDir}/frameworks/dita/DITA-OT2.x/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl
For DITA-OT 1.8, open the file:
{oXygenInstallDir}/frameworks/dita/DITA-OT/plugins/org.dita.pdf2/cfg/fo/attrs/toc-attr_fop.xsl
If you don't have a customization folder, you have to modify these files too.
Radu Pisoi
<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
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