TOC header not displayed correctly
Post here questions and problems related to editing and publishing DITA content.
TOC header not displayed correctly
Hi we have a CSS stylesheet for publishing PDFs in Chinese. The CSS stylesheet specifies that TOC header is Chinese "目录“,but the actual output is English "Contents". I tried several times but couldn't find the root cause.
The CSS stylesheet:
The actual output:
The CSS stylesheet:
Code: Select all
/* TOC header */
*[class ~= "map/map"]{
string-set: toc-header "目 录";
}
/* position of the first page of TOC */
@page table-of-contents:first:left{
margin-top: 6cm;
@top-right {
content: string(toc-header);
font-weight:bold;
font-size:24pt;
border-bottom: 1pt solid black;
vertical-align: bottom;
font-family: Arial, 汉仪旗黑-65S, "Arial Unicode MS",SansSerif,Serif,Monospace,Symbol;
line-height:1.5;
}
@top-center{
content:" ";
border-bottom: 1pt solid black;
vertical-align: bottom;
}
@top-left{
content:" ";
border-bottom: 1pt solid black;
vertical-align: bottom;
}
}
/* position of the first page of TOC */
@page table-of-contents:first:right{
margin-top: 6cm;
@top-left {
content:" ";
border-bottom: 1pt solid black;
vertical-align: bottom;
}
@top-center{
content:" ";
border-bottom: 1pt solid black;
vertical-align: bottom;
}
@top-right{
content: string(toc-header);
font-weight:bold;
font-size:24pt;
border-bottom: 1pt solid black;
vertical-align: bottom;
font-family: Arial, 汉仪旗黑-65S, "Arial Unicode MS",SansSerif,Serif,Monospace,Symbol;
line-height:1.5;
}
}
- capture 2.png (48.56 KiB) Viewed 393 times
-
- Posts: 613
- Joined: Wed Oct 16, 2019 3:47 pm
Re: TOC header not displayed correctly
Post by julien_lacour »
Hello,
I tried using <oXygen/> XML Editor 27.0, build 2024112212 with your CSS fragment in the DITA Map PDF - based on HTML5 & CSS scenario.
I did get the toc-header string displayed in the TOC:
Could you indicate which version of Oxygen you are using?
Regards,
Julien
I tried using <oXygen/> XML Editor 27.0, build 2024112212 with your CSS fragment in the DITA Map PDF - based on HTML5 & CSS scenario.
I did get the toc-header string displayed in the TOC:
- image.png (7.44 KiB) Viewed 355 times
Regards,
Julien
-
- Posts: 613
- Joined: Wed Oct 16, 2019 3:47 pm
Re: TOC header not displayed correctly
Post by julien_lacour »
Hello,
I tested using both <oXygen/> XML Editor 23.1, build 2021121415 (which BTW has reached its end of support period) and <oXygen/> XML Editor 26.1, build 2024091606 and I cannot reproduce the problem.
My custom CSS stylesheets contains the following rules:
I commented the font-family properties because I don't have the 汉仪旗黑-65S font available, I used the default fallback font which is Microsoft YaHei.
You should check in your CSS stylesheet(s) if maybe another selector overrides the toc-header string set in *[class ~= "map/map"].
Regards,
Julien
I tested using both <oXygen/> XML Editor 23.1, build 2021121415 (which BTW has reached its end of support period) and <oXygen/> XML Editor 26.1, build 2024091606 and I cannot reproduce the problem.
My custom CSS stylesheets contains the following rules:
Code: Select all
/* TOC header */
*[class ~= "map/map"]{
string-set: toc-header "目 录";
}
/* position of the first page of TOC */
@page table-of-contents:first:left{
margin-top: 6cm;
@top-right {
content: string(toc-header);
font-weight:bold;
font-size:24pt;
border-bottom: 1pt solid black;
vertical-align: bottom;
/*font-family: Arial, 汉仪旗黑-65S, "Arial Unicode MS",SansSerif,Serif,Monospace,Symbol;*/
line-height:1.5;
}
@top-center{
content:" ";
border-bottom: 1pt solid black;
vertical-align: bottom;
}
@top-left{
content:" ";
border-bottom: 1pt solid black;
vertical-align: bottom;
}
}
/* position of the first page of TOC */
@page table-of-contents:first:right{
margin-top: 6cm;
@top-left {
content:" ";
border-bottom: 1pt solid black;
vertical-align: bottom;
}
@top-center{
content:" ";
border-bottom: 1pt solid black;
vertical-align: bottom;
}
@top-right{
content: string(toc-header);
font-weight:bold;
font-size:24pt;
border-bottom: 1pt solid black;
vertical-align: bottom;
/*font-family: Arial, 汉仪旗黑-65S, "Arial Unicode MS",SansSerif,Serif,Monospace,Symbol;*/
line-height:1.5;
}
}
You should check in your CSS stylesheet(s) if maybe another selector overrides the toc-header string set in *[class ~= "map/map"].
Regards,
Julien
Re: TOC header not displayed correctly
Hi Julien,
I used the Dev Tools of Google and found that the CSS rule does not take effect, therefore it used the default rule p-i18n.css.
I am not an expert in CSS. Do you know how to make this rule take effect? By adding Important! ?
I used the Dev Tools of Google and found that the CSS rule does not take effect, therefore it used the default rule p-i18n.css.
I am not an expert in CSS. Do you know how to make this rule take effect? By adding Important! ?
- Attachments
-
- capture.png (269.25 KiB) Viewed 289 times
-
- Posts: 613
- Joined: Wed Oct 16, 2019 3:47 pm
Re: TOC header not displayed correctly
Post by julien_lacour »
Hello,
From you screenshot it seems another rule is applied on the *[class ~= "map/map"] element, as you can see both string-set properties (from lang-cn.css and content-zh.css) are crossed out which means another string-set is applied but it doesn't appear in the screenshot (the rule should be lower).
You can use the filter to get all the string-sets and see which one is applied then override it with your custom rules.
Regards,
Julien
From you screenshot it seems another rule is applied on the *[class ~= "map/map"] element, as you can see both string-set properties (from lang-cn.css and content-zh.css) are crossed out which means another string-set is applied but it doesn't appear in the screenshot (the rule should be lower).
You can use the filter to get all the string-sets and see which one is applied then override it with your custom rules.
Regards,
Julien
Return to “DITA (Editing and Publishing DITA Content)”
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