Simple two column document #588
Replies: 6 comments
-
Hi @mbrannstrom Something like this sample.pdf? Here's the CSS: @page {
size: A4; /* ; was missing */
margin: 15mm 10mm 15mm 10mm;
}
div#content.content {
/* removed margin */
padding: 0;
height: calc(100vh - 50mm);
display: flex;
flex-direction: column;
flex-wrap: wrap;
}
.sect1, #preamble {
column-count: 2; /* 2 columns */
margin-right: 0.6cm;
margin-left: 0.6cm;
text-align-last: start; /* workaround a bug in Paged.js */
}
/* Some rules to make it look better */
h2 {
margin-top: 0;
break-before: always;
}
.sect1+.sect1 {
border-top: none;
}
.sect2 {
break-inside: avoid;
} |
Beta Was this translation helpful? Give feedback.
-
Please keep in mind that the default stylesheet will be replaced by the custom stylesheet in the next version. If you want to keep using the default stylesheet and override only a few rules, you will need to update the
Alternatively, you can copy-paste the content of |
Beta Was this translation helpful? Give feedback.
-
Yes, now it looks much better. Thanks! Still some odd behavior, like the last page which has wrapped into two columns when it should fit into the first one. |
Beta Was this translation helpful? Give feedback.
-
👍
Yes, I'm not sure what's the best way to solve this behavior.... as far as I know, .paragraph {
break-inside: avoid-column;
} |
Beta Was this translation helpful? Give feedback.
-
Feel free to add an example in |
Beta Was this translation helpful? Give feedback.
-
The normal way to fix this issue is to use I'm still a bit confused regarding the best value to use for #content {
column-count: 2;
column-gap: 0.25in;
column-fill: auto;
height: 10in;
} My apologies for using imperial units 😄. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I tried to create a simple two-column document with multiple pages, but I cannot make it work (using 1.0.0-alpha.3). The text does not flow as I want, see attached files.
Input:
Output (which does not look that nice):
Is two-column mode possible? If so, how?
It would be nice with a two column document example or pre-made styles/templates (#43) with multiple levels of sections and long paragraphs. The cheat-sheet example is close, but not simple to generalize.
Regards,
Mikael Brännström
Beta Was this translation helpful? Give feedback.
All reactions