Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible to get syntax highlighting for LaTeX code blocks in ikiwiki (just something like it is automatically done in tex.sx)?

To avoid misunderstandings: I don't mean math output produced for example by mathjax. I want to document latex-tricks in my wiki, so I have to put some snippets of latex source code in it to show how something is done in latex. For example:

"Here is an example how to use tikz:

\begin{document}{article}

\usepackage{amsmath}
\usepackage{tikz}

\begin{document}
   \begin{tikzpicture}
   \draw (0,0) --node[sloped,above]{$x$} (1,1);
   \end{tikzpicture}
\end{document}

"

Here the code block above just appears with a grey background but without syntax highlighting of the source code. If I would put the same snipped on tex.sx there would be a syntax highlighting of the code.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

For syntaxhighlighting in Ikiwiki there is a plugin called highlight. You can use it like

[[!format tex """
\documentclass{scrartcl}
…
"""]]

This will give you nice syntax highlighting. It uses Perl bindings. The library itself has a longer documentation.

share|improve this answer
    
Thanks, that's what I want. However I don't see, how to install and enable it. Can you include the relevant steps into your answer? I just did sudo aptitude install libhighlight-perl to get the libraries. According to your link then I have to get and install a plugin called format, but I don't know where and how... –  student Nov 3 '12 at 20:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.