# Tag Info

## New answers tagged highlighting

0

After some fiddling around, I found an easy solution: I updated the Kate syntax highlighting files via Kate's own configuration settings. To do this, I selected Settings -> Configure Kate -> Editor Component -> Open/Save -> Modes & Filetypes -> Download Highlighting Files -> Install in Kate. Since I had never updated any highlighting file before, ...

2

REVISION with general solution to problem of coloring all words beginning with a particular symbol, @. RE-EDITED to handle situation of lone @ character. It is done by making @ active, and then defining it to turn on red and print the saved copy of @. The key to this revision is the macro \tilblank that uses recursion to print out the next word (still in ...

1

The current title of your question is a bit ambiguous. Did you mean something like Can I get 'listings' to automatically highlight text before a given character? If so, how? ? The answer posted by hpesoj626 shows two approaches that produce the desired output; they are perfectly acceptable for a small number of lines. Unfortunately, those two ...

1

Based on your self-answer, it seems you're almost there. The last remaining problem is to highlight / and // differently and make sure // starts a comment. How to highlight / and // differently (without breaking comments) As you've noticed, any literate replacement of / will prevent you from using it in a comment delimiter; therefore, you have to resort to ...

0

Because the x86masm dialect of the Assembler language considers 0-9 as "digits", not as "letters", listings recognises the keyword dh in 0dh, which, as you pointed out, is undesirable. You can prevent that from happening by making 0-9 "letters". That way, dh will be highlighted as keyword, but 0dh won't. \documentclass[12pt]{article} \usepackage{courier, ...

3

The listings package doesn't directly provide the means of highlighting a compiler directive that is continued over multiple lines. If you think that's a desirable feature, you might want to get in touch with the maintainer. In the meantime, here is a possible implementation. It uses two switches with self-explanatory names to keep track of the context and ...

2

Here is a workaround that doesn't break one-line comments and only applies the desired style to operators outside comments and strings. Caveats: I've had to define all digits as "letters" to prevent my operator style from being applied to them; there may be side effects associated with that. Outside comments and strings, the operator style will be applied ...

2

I followed the same approach as in my answer to Can the listings package highlight by regexp?. \documentclass{article} \usepackage{xcolor} \usepackage{listings} \makeatletter % state variables'' \newif\ifincomment\incommentfalse \newif\ifinstring\instringfalse % language and style definition \lstdefinestyle{mybash} {% language = bash, basicstyle ...

2

This listings answer is about a year late, but I believe it covers all your requirements. Edit: fixed a bug related to prompt "keywords" occurring in the middle of a line. Desired output Output obtained Code \documentclass[a4paper]{article} \usepackage{xcolor} \usepackage{textcomp} \usepackage{listings} \makeatletter % switch to remember whether a ...

7

mdframed.sty has \ifnum\mdf@envdepth >\tw@\@toodeep\else in the definition of \mdf@preenvsetting and this prevents more than three levels of nesting. You can change this with a patch to the command: \documentclass{article} \usepackage{xcolor} \usepackage{xpatch} \usepackage{mdframed} \makeatletter \xpatchcmd{\mdf@preenvsetting} {\mdf@envdepth ...

3

The overlay specification for the frame is picked up both by columns and the itemize, so you get that extra slide. You can prevent this by subtracting 1 to the beamerpauses counter when the itemize begins: \documentclass[demo]{beamer} \begin{document} \begin{frame}[<+-| alert@+>]{H263 / MPEG-4 Teil 2} \begin{columns} \column{.55\textwidth} ...

Top 50 recent answers are included