Page 1 of 1

CSS-based DITA to PDF problem with columns

Posted: Thu Jul 06, 2023 5:44 pm
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
/Wojtek

Re: CSS-based DITA to PDF problem with columns

Posted: Fri Jul 07, 2023 11:13 am
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

Re: CSS-based DITA to PDF problem with columns

Posted: Fri Jul 07, 2023 3:01 pm
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.