pygments

Source code highlighting in LaTeX

て烟熏妆下的殇ゞ 提交于 2019-11-28 14:54:20
I need to highlight source code in LaTeX. The package listings seems to be the best choice for most use-cases and for me it was, until now. However, now I need more flexibility. Generally, what I’m looking for is a real lexer. In particular, I need (for an own language definition) to define (and highlight!) own number styles. listings does not allow highlighting numbers in code. However, I need to produce something like this: listings also cannot cope with arbitrary delimiters for strings. Consider the following valid Ruby code: s = %q!this is a string.! Here, ! can be replaced by almost any

Github flavored Markdown and pygments highlighting in Jekyll

霸气de小男生 提交于 2019-11-27 10:09:42
问题 I've deployed my Jekyll blog on a VPS. I would now like to add Github-flavored Markdown to it, using Pygments highlighting, but I don't know which files do I have to edit and how. So far, the only file I've configured is _config.yml wich looks like this: 1 safe: false 2 auto: false 3 server: false 4 server_port: 4000 5 baseurl: / 6 url: http://localhost:4000 7 8 source: . 9 destination: ./_site 10 plugins: ./_plugins 11 12 future: true 13 lsi: false 14 pygments: false 15 markdown: maruku 16

lexers vs parsers

扶醉桌前 提交于 2019-11-26 02:39:07
问题 Are lexers and parsers really that different in theory? It seems fashionable to hate regular expressions: coding horror, another blog post. However, popular lexing based tools: pygments, geshi, or prettify, all use regular expressions. They seem to lex anything... When is lexing enough, when do you need EBNF? Has anyone used the tokens produced by these lexers with bison or antlr parser generators? 回答1: What parsers and lexers have in common: They read symbols of some alphabet from their