[TxMt] Bugs in LaTeX highlighting

Brad Miller bonelake at gmail.com
Mon Nov 20 00:11:10 UTC 2006


Hi Haris,

I've just been doing a bunch of writing again and I noticed that there
is a problem with the strategy of putting % Java or % Python at the
end of the lstliting line.

When I do this, I lose the first line of code inside the listing.  to
get everything I expect I have to add a blank line right after the
\begin{lstlisting}

For example:

\begin{lstlisting][caption=lkjasdfjk,label=lst:foo,float=htb] % python
def bar(baz):
   print 'hello'
\end{lstlisting}

Latex outputs the listing as:
   print 'hello'

I think this must have something to do with how LaTeX interprets
comment characters but I've never really dug into that bit of TeX
complexity before.  Any thoughts?  Are others seeing this same
behavior?

Brad


On 10/20/06, Charilaos Skiadas <skiadas at hanover.edu> wrote:
> On Oct 14, 2006, at 10:43 PM, Allan Odgaard wrote:
>
> >    \begin{lstlisting}{} % Java
> >
> > So don't worry about presently having to create a rule per thing we
> > want to support, as that's only a (somewhat) short-term solution.
>
> Ok, I have now added support for Java lstlistings with this comment
> type. We will be adding other languages on a need basis, so let me
> know if you need lstlistings in some other language.
>
> Haris
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>



More information about the textmate mailing list