LaTeX forum ⇒ AnnouncementsNew feature: Syntax Highlighting

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

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:

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


Now:

\documentclass{article}
\usepackage{tikz}
\begin{document}
% Eight bullets arranged in a circle, some with letters next to it
\begin{tikzpicture}[every node/.style={node distance=2ex}]
  \foreach \i in {1,...,8}% a for loop
    \node (\i) at (45*\i:1.6) {\textbullet};% nodes with names 1, ..., 8
  \node[right of=1] {L};
  \node[right of=2] {T};
  \node[right of=3] {X};
\end{tikzpicture}
\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
LaTeX.org admin

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook

Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 1 guest