TOC header not displayed correctly
Posted: Sat Dec 07, 2024 9:59 am
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:
![Image]()
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;
}
}