vscode-markdown-pdf icon indicating copy to clipboard operation
vscode-markdown-pdf copied to clipboard

Print Two-Columns Document to PDF

Open YoshiRi opened this issue 6 years ago • 4 comments

Thank you for your great package.

I want to print two-columns document to PDF.

Though it can be properly shown in Markdown preview and html conversion, pdf conversion seems to be not supporting two column printing. Do you have any plan to support this in the future?

<style>
.column-left{
  float: left;
  width: 47.5%;
  text-align: left;
}
.column-right{
  float: right;
  width: 47.5%;
  text-align: left;
}
</style>

<div class="column-left">

# text A
</div>
<div class="column-right">

# text B
</div>

YoshiRi avatar Nov 07 '19 07:11 YoshiRi

If you use a css file when saving you can simple add

body{ column-count: 2; }

hackslashdave avatar Apr 03 '22 17:04 hackslashdave

Although I occured same issue, I found the essential problem is corruption of html block written in the markdown file in converting #119. I resolved using block of markdown-it-container.

<style>
  .column-left{
    float: left;
    width: 50%;
    text-align: left;
  }
  .column-right{
    float: right;
    width: 50%;
    text-align: left;
  }
</style>

::: column-left
# text A
:::

::: column-right
# text B
:::

habakan avatar Feb 18 '23 06:02 habakan

If you use a css file when saving you can simple add

body{ column-count: 2; }

Thanks @hackslashdave. This solution works, but content is evenly distributed. Can it be modified so that leftmost columns are filled first?

Screenshot 2023-04-13 at 9 40 49 PM

hanggrian avatar Apr 14 '23 02:04 hanggrian