I'm using marp/marpit to create slides. My goal is to create slide with three vertical columns. I have one CSS file which I use on HTML page and also in marp. In web browser the HTML page it is widen to whole page. But in PDF viewer (file generated by marp) slide has some borders from left/right top/bottom.
Files that I'm using:
page.html
<!DOCTYPE html>
<html>
<!-- page.html -->
<head>
<!-- <link rel="stylesheet" href="css.css"> -->
<link rel="stylesheet" href="custom-theme.css">
</head>
<body>
<div class="container">
<!-- <div class="toppane">Test Page</div> -->
<div class="leftpane">
<h1>Left column</h1>
</div>
<div class="middlepane">
<h1>Middle column</h1>
</div>
<div class="rightpane">
<h1>Right column</h1>
</div>
</div>
</body>
</html>
custom-theme.css
/* custom-theme.css */
/* @theme custom-theme */
@import 'default';
body, html {
width: 100%;
height: 100%;
margin: 0;
}
.container {
width: 100%;
height: 100%;
}
.leftpane {
width: 33%;
height: 100%;
float: left;
background-color: rosybrown;
border-collapse: collapse;
}
.middlepane {
width: 34%;
height: 100%;
float: left;
background-color: royalblue;
border-collapse: collapse;
}
.rightpane {
width: 33%;
height: 100%;
position: relative;
float: right;
background-color: yellow;
border-collapse: collapse;
}
/* .toppane {
width: 100%;
height: 100px;
border-collapse: collapse;
background-color: #4da6ff;
} */
---
marp: true
theme: custom-theme
---
**slide.md**
<!-- slide.md -->
<div class="container">
<!-- <div class="toppane">Test Page</div> -->
<div class="leftpane">
<h1>Left column</h1>
</div>
<div class="middlepane">
<h1>Middle column</h1>
</div>
<div class="rightpane">
<h1>Right column</h1>
</div>
</div>
<!-- https://stackoverflow.com/questions/36662712/how-do-i-divide-a-page-in-three-vertical-sections/36662828 -->
Code that I'm using to generate PDF:
marp --html --bespoke.progress --allow-local-files --theme-set custom-theme.css --pdf -- slide.md -o slide.pdf
CSS used in HTML and displayed in browser
PDF file generated by marp
How can I stretch columns to full slide size in PDF? PS: why font has different size & color?
Thanks
Use this solution instead: https://github.com/orgs/marp-team/discussions/192
You should be able to change grid-cols-2 to grid-cols-3.