LaTeX forum ⇒ AnnouncementsNew feature: Syntax Highlighting

Rules, announcements and news for this LaTeX Community
User avatar
Stefan Kottwitz
Site Admin
Posts: 8523
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

New feature: Syntax Highlighting

Postby Stefan Kottwitz » Sun Feb 12, 2012 3:21 pm

Hello,

last night I installed syntax highlighting for code in our forum posts. The default language is LaTeX, so all code pieces in our now more than 56.000 posts will show syntax highlighting.

Previously:

  1. \documentclass{article}
  2. \usepackage{tikz}
  3. \begin{document}
  4. % Eight bullets arranged in a circle, some with letters next to it
  5. \begin{tikzpicture}[every node/.style={node distance=2ex}]
  6. \foreach \i in {1,...,8}% a for loop
  7. \node (\i) at (45*\i:1.6) {\textbullet};% nodes with names 1, ..., 8
  8. \node[right of=1] {L};
  9. \node[right of=2] {T};
  10. \node[right of=3] {X};
  11. \end{tikzpicture}
  12. \end{document}


Now:

  1. \documentclass{article}
  2. \usepackage{tikz}
  3. \begin{document}
  4. % Eight bullets arranged in a circle, some with letters next to it
  5. \begin{tikzpicture}[every node/.style={node distance=2ex}]
  6. \foreach \i in {1,...,8}% a for loop
  7. \node (\i) at (45*\i:1.6) {\textbullet};% nodes with names 1, ..., 8
  8. \node[right of=1] {L};
  9. \node[right of=2] {T};
  10. \node[right of=3] {X};
  11. \end{tikzpicture}
  12. \end{document}


This feature shall enhance the readability of code in the forum, especially when it's complex code, and eases discovering syntax errors..

So I even stronger recommend using the Code button for posting code instead of just writing as it was normal text. The result is much nicer.

Stefan
Site admin

Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 1 guest