Skip to content
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

Inline syntax highlighting background (LaTeX) #122

Open
Kangie opened this issue Mar 30, 2021 · 2 comments
Open

Inline syntax highlighting background (LaTeX) #122

Kangie opened this issue Mar 30, 2021 · 2 comments

Comments

@Kangie
Copy link

Kangie commented Mar 30, 2021

The \VERB environment as implemented in the pandoc defaults template does not apply the background specified in the skylighting theme, resulting in potentially unreadable code if syntax highlighting is enabled on inline code and a dark theme is in use (e.g. breezedark).

Example:

A line with `function update_post_thumbnail_cache( $wp_query = null )`{.php} inline code and syntax highlighting.
A line with `function update_post_thumbnail_cache( $wp_query = null )` inline code.

An effective workaround in the short term is to not use fenced code attributes on inline code, which has pandoc use \texttt rather than \VERB.

@jgm
Copy link
Owner

jgm commented Apr 5, 2021

It is reported on pandoc-discuss that surrounding the \VERB with \colorbox can work.
That's something I want to try when I have a chance.

@jgm
Copy link
Owner

jgm commented Apr 5, 2021

This would need to be done (if it is done) for all formats, not just LaTeX.

In HTML, this would require putting the color and background-color attributes on .sourceCode rather than div.sourceCode in the CSS.

In LaTeX, it's not so easy. \colorbox works but doesn't wrap, which is a problem. See
https://tex.stackexchange.com/questions/5959/cool-text-highlighting-in-latex
for some overly complex solutions (wouldn't want to go there).

in Word, TODO...

In MS, TODO...

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

No branches or pull requests

2 participants