CSS-based DITA to PDF problem with columns

Post here questions and problems related to editing and publishing DITA content.
Ecumaster
Posts: 11
Joined: Thu Jul 06, 2023 5:31 pm

CSS-based DITA to PDF problem with columns

Post by Ecumaster »

Hello everyone,

I created a document with a two-column attribute set like this:

Code: Select all

*[class ~= "topic/topic"][outputclass ~= "two-columns"] {
    page: two-columns
} 
@page two-columns{
    font-size: 10pt;
    column-count: 2; 
    column-gap: 0.1in;
    line-height: 1em; 
}
Everything works fine, except the fact that when I use column-span: all for h1 (topic title) the first column starts much lower than expected. Any idea what could be wrong? I can't figure out what is the problem. Thanks.
pic.png
pic.png (246.86 KiB) Viewed 454 times
/Wojtek
Wojtek
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: CSS-based DITA to PDF problem with columns

Post by julien_lacour »

Hello Wojtek,

You can add the vertical-align property in the topic rule to fix the display:

Code: Select all

*[class ~= "topic/topic"][outputclass ~= "two-columns"] {
  page: two-columns;
  vertical-align: top;
}
@page two-columns {
  font-size: 10pt;
  column-count: 2;
  column-gap: 0.1in;
  line-height: 1em;
}
Regards,
Julien
Ecumaster
Posts: 11
Joined: Thu Jul 06, 2023 5:31 pm

Re: CSS-based DITA to PDF problem with columns

Post by Ecumaster »

Thank you for the replay.
there is still a problem, but I found out that h1 paragraph spacing is huge, so I guess I need to make it smaller.
Wojtek
Post Reply