[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX] Font locking -- highlighting only the second of two pairs of br
From: |
AW |
Subject: |
[AUCTeX] Font locking -- highlighting only the second of two pairs of brackets |
Date: |
Fri, 16 Apr 2010 17:19:33 +0200 |
User-agent: |
KMail/1.13.2 (Linux/2.6.31.12-0.2-desktop; KDE/4.4.2; i686; ; ) |
Dear all,
did you ever try to write documents with two columns, German (or whatever
language) text in the left and a translation in the right hand column? LaTeX
may produce a nice PDF, but in your editor you get confused easily.which text
belongs to which column.
For the two parallel running columns I employ the »parcolumns«-package and
define a macro called »\PC« followed by two mandatory arguments. The first
one takes the German text, the second one the English text.
What I'd like to do is to highlight the second argument, but not the first
one. Often I'm writing a text completely in German and translate it later or
ask somebody to translate. I would be helpfull to have the English text (or
the yet empty brackets) highlighted.
Here is a small example:
%%%%%%%%%%%%%%%%
\documentclass[pagesize,english,ngerman]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel,parcolumns}
\newcommand\PC[2]{\parcolumns[distance=2em]{2}
\colchunk[1]{\selectlanguage{ngerman}#1}%
\colchunk[2]{\selectlanguage{english}#2}%
\colplacechunks
\vspace{0.3\baselineskip}%
}
\begin{document}
\PC{Deutscher Text}{English text}
\end{document}
%%%%%%%%%%%%
Highlighting both brackets is possible by adding
(font-latex-user-keyword-classes (quote (("Parcolumns" (("PC" "{{"))
(:background "yellow") command))))
to .emacs. But how to highlight only the second pair of brackets?
The easiest way would be to redefine the PC-Macro to start with English
version and have the German version on the right hand side. But I really would
like to keep the German text on the left.
Any suggestions would be appreciated!
Regards,
Alexander
- [AUCTeX] Font locking -- highlighting only the second of two pairs of brackets,
AW <=