jgm/skylighting

Inline syntax highlighting background (LaTeX)

Opened this issue · 2 comments

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 commented

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 commented

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...