auctex
[Top][All Lists]

## [AUCTeX] emaxima environments ($, language-specific indentation)  From: Tamas Papp Subject: [AUCTeX] emaxima environments ($, language-specific indentation) Date: Fri, 07 Mar 2014 10:07:56 +0100 User-agent: mu4e 0.9.9.6pre2; emacs 24.3.1

Hi,

I am using the emaxima LaTeX package to mix LaTeX and Maxima (symbolic
algebra) code. The relevant LaTeX environment looks like this:

--8<---------------cut here---------------start------------->8---
\begin{maxima}[]
eq: a+1=2;
\maximaoutput
a + 1 = 2
\end{maxima}
--8<---------------cut here---------------end--------------->8---

emaxima-mode is a small extension of AUCTeX that has some functions to
send the part between \begin{maxima}[] and \maximaoutput (if it exists,
if not the \end{maxima}) to an inferor maxima process and insert the
output into the bottom half of the environment. But otherwise the mode
is really AUCTeX mode, so this is probably the best place for me to get
help.

I have two questions:

1. in Maxima code can be terminated with $instead of ;, in which case the result is not displayed in the output. This confuses AUCTeX (code highlighting etc), because it thinks math mode has been started. A workaround is --8<---------------cut here---------------start------------->8--- \begin{maxima}[] eq: a+1=2$ /* a maxima comment that closes the \$ */
\maximaoutput
a + 1 = 2
\end{maxima}
--8<---------------cut here---------------end--------------->8---

but this is cumbersome.

I tried pushing "maxima" to LaTeX-verbatim-environments-local, and that
fixes the highlighting issue, but then it disables indentation.

2. Is it possible to have Emacs apply different indentation/highligthing
rules in an environment (or between two arbitrary strings)?

Best,

Tamas