Skip to content

Enable (and fix) Pandoc syntax highlighting #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025
Merged

Conversation

chrisfenner
Copy link
Member

@chrisfenner chrisfenner commented May 14, 2025

This change removes the --no-highlight flag from the pandoc invocation. It fixes the issue with the template that that revealed (which is that the $highlighting-styles$ magic was missing). If you are using this project with a custom LaTeX template and this change breaks with an error like "Environment Shaded undefied", then it's because your template needs this magic as well. See
jgm/pandoc#7923 for more information on that.

This change re-styles code blocks to use a white background instead of the light blue one, so that the kate-styled syntax highlighting looks good. Since the background is white, but the code block still needs to be a block, this change adds a 1pt black line around the code.

This change also fixes a minor bug where the font size class wasn't detected if it wasn't the first class. So

``` {.small}
...
```

worked, but

```md {.small}
...
```

did not.

This change updates a few code blocks in the examples to make use of the size class, so that none of the examples run off the page.

Before:

image

After:

image

This change removes the --no-highlight flag from the pandoc invocation.
It fixes the issue with the template that that revealed (which is that
the $highlighting-styles$ magic was missing). If you are using this
project with a custom LaTeX template and this change breaks with an
error like "Environment Shaded undefied", then it's because your
template needs this magic as well. See
jgm/pandoc#7923 for more information on that.

This change re-styles code blocks to use a white background instead of
the light blue one, so that the kate-styled syntax highlighting looks
good. Since the background is white, but the code block still needs to
be a block, this change adds a 1pt black line around the code.
@chrisfenner chrisfenner merged commit e8d41fe into main May 14, 2025
2 checks passed
@chrisfenner chrisfenner deleted the fix-code-highlighting branch May 14, 2025 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant