Render alternate checkboxes into PDF print with Minimal theme

Hi :slight_smile:

I’m using Obsidian since a while now but I’m just discovering themes. After some testing, I chose Minimal…

What I’m trying to do

I’m searching for a way to pdf-export those nice alternate checkboxes.

Things I have tried

I found two interesting trails to follow but my knowledge in CSS is not sufficient to distinguish what’s not working exactly :

  • there is academic-pdf-export which takes the right direction I want to follow, but which is replacing checkboxes by “•”
  • there is print.css which works nicely too but the output is not what I’m looking for

→ Hence I experimented on the basis of academic-pdf-export but I can’t seem to find what’s not allowing me to print alternate checkboxes.

Here is the ouput with minimal theme and no custom CSS :

And here it is with my custom css

→ I tweaked acamedic-pdf-export to my liking and tried to find a way to render the alternate checkboxes

→ I managed to give the feeling I was searching for the rest of the document, but those coloured squares are tickeling my nerves ^^

The custom css file I’m using for now

/*
Desc: Style obsidian-notes to look like academic papers when exported as pdf.
      Include this file in your obsidian snippets folder and activate within obsidian.

Auth: Nicklas Vraa
*/

@media print {

    :root {
        --body-font-family: "Latin Modern Roman","Newsreader Text", TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif;
        --header-font-family: "Latin Modern Roman";
        --code-font-family: Consolas, "Roboto Mono", monospace;
        --code-inline-bg-color: #d7dae6;
        --code-block-bg-color: #232634;
        --code-block-border-color: #232634;
        --code-block-font-color: #9396a5;
        --link-color: rgb(71, 37, 150);

        --body-font-size: 12pt;
      }

    /* Document-wide. ---------------------------------------------------------------------- */
    @page { /* Page structure. */
        margin-top: 4cm !important;
        margin-bottom: 4cm !important;
        margin-right: 2cm !important;
        margin-left: 2cm !important;
    }
    a:link, a:visited, a { /* Links. */
        color: rgb(80, 25, 183) !important;
        text-decoration: none !important;
    }
    a[aria-label]::after {
        display: inline !important;
        content: " (" attr(aria-label) ")" !important;
        color: slategray !important;
        font-size: 80% !important;
        font-family: var(--code-font-family);
    }

    /* Main body of text. ------------------------------------------------------------------ */
    body {
        tab-size: 4 !important;
        --code-background: white !important;
        --code-normal: black !important;
    }
    p {
        font-family: "Latin Modern Roman" !important;
        font-size: var(--body-font-size) !important;
        text-align: justify !important;
        line-height: 1.2 !important;
        margin-top: 5px !important;
    }
    strong {
        font-weight: bold !important;
    }

    /* Header styling and automatic numbering. --------------------------------------------- */
    h1, h2, h3, h4, h5, h6 {
        font-family: var(--header-font-family) !important;
        color: black !important;
        page-break-after:avoid;
        page-break-inside:avoid;
        margin-bottom: 0 !important;
    }
    h1 { /* Title. */
        text-align: center !important;
        font-size: 200% !important;
        font-weight: bold !important;
        margin-bottom: 20pt !important;
        counter-reset: H2;
    }
    h2:before {
        counter-increment: H2;
        content: counter(H2) ". \0000a0";
    }
    h2 {counter-reset: H3;}
    h3:before {
        counter-increment: H3;
        content: counter(H2) "." counter(H3) ". \0000a0";
    }
    h3 {counter-reset: H4;}
    h4:before {
        counter-increment: H4;
        content: counter(H2) "." counter(H3) "." counter(H4) ". \0000a0";
    }

    /* Credits. ---------------------------------------------------- */

    del { /* Credits, i.e. author information. */
        font-family: var(--body-font-family) !important;
        display: block !important;
        text-align: center !important;
        font-size: 80% !important;
        text-decoration: none;
        margin-top: 8px !important;
        padding-bottom: 10px !important;
    }

    /* Code and math blocks. --------------------------------------------------------------- */
    pre { /* background and border of block. */
        background-color: #fff !important;
        border-style: solid !important;
        border-radius: 8px !important;
        border-width: 1px 1px !important;
        border-color: lightgray !important;
        line-height: 1 !important;
    }
    code {
        font-family: var(--code-font-family)!important;
        font-size: 90% !important;
        color: #292929 !important;
    }
    mjx-math {
        font-size: 90% !important;
    }
    math-block {
        page-break-before: avoid !important;
    }

    /* Figures. ---------------------------------------------------------------------------- */
    svg, img {
        display: block !important;
        /* filter: invert(100%) !important; */
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        margin: 10px auto 5px !important;
    }
    figcaption {
        font-family: "Latin Modern Roman" !important;
        text-align: center !important;
        margin-bottom: 16px !important;
        font-size: 80% !important;
    }

    /* Tables. ----------------------------------------------------------------------------- */
    table, pre {
        page-break-inside: avoid !important;
    }
    table {
        font-family: Times !important;
        font-size: 80% !important;
        text-align: center !important;
        margin: 10px auto 5px !important;
        border-top: 1px solid #292929 !important;
        border-bottom: 1px solid #292929 !important;
    }
    th { /* Table headers. */
        color: black !important;
        font-weight: normal !important;
        border: none !important;
        border-bottom: 1px solid darkgray !important;
        padding: 2px 5px !important;
    }
    td {
        border: none !important;
        padding: 2px 5px !important;
    }

    /* Lists ------------------------------------------------------------------------------- */
    /*TODO Trouver comment remettre les icônes*/



    /* Horizontal separator. --------------------------------------------------------------- */
    hr { /* Manual page-break using "---". */
        border: none !important;
        border-top: 0px solid lightgray !important;
        page-break-after: always !important;
    }

    /* Additional settings. ---------------------------------------------------------------- */
    blockquote {
        display: block !important;
        text-align: center !important;
        font-size: var(--body-font-size) !important;
        color: black !important;
        border: none !important;
        padding: 0px !important;
        margin: 5px auto !important;
    }
    .mermaid { /* Inline diagrams. */
        color: black !important;
    }

}