Skip to content
Discussion options

You must be logged in to vote

Would this do?

---
title: "TOC stuff"
format:
  html:
    toc: true
    include-in-header:
      - text: |
          <style type="text/css">
          h2.hide {
            display: none;
          }
          </style>
  pdf: default
---

:::{.content-visible when-format="html"}
## Introduction {.hide}
:::

The document just starts here immediately.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 
incididunt ut labore et dolore magna aliqua.

## Data and methods

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut 
aliquip ex ea commodo consequat. 

## Results

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dol…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@andrewheiss
Comment options

@cscheid
Comment options

@andrewheiss
Comment options

Answer selected by andrewheiss
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
html Issues with HTML and related web technology (html/css/scss/js) themes Related to HTML theming or any other style related issue (like highlight-style)
3 participants