Hi!

Right now, I'm trying to improve the LaTeX backend latex.conf, namely the 
support for listing blocks. Contrary to HTML where all markup is neatly tucked 
away in tags, LaTeX needs newlines/empty lines to make some environment 
commands to work.

The problem right now is that I need output like

\begin{verbatim} % <- this \n is important to LaTeX!
<some listingcontent as it comes from |>
\end{verbatim}
 % This empty line matters to LaTeX
<Next paragraph>

I can hack around the empty line at the end by simply inserting a comment as 
above; unfortunately, this is not an option after \begin{listing}, since this 
is a verbatim environment. :(

As those working on latex.conf before me already noticed, a solution like the 
following doesn't work:

[listingblock]
\begin\{lstlisting\}

|

\end\{lstlisting\}

% FIXXME: this LaTeX comment is a dirty hack to circumvent missing \n


The reason is that seemingly you only can

- force empty line into the backend output by writing

some text

some text

- force newlines by writing

Some-Text
Some-Text

But the following strips all newlines outside the content of | :

some text
|
some text

And the following does the same:

some text

|

some text


This seems to be a feature built in with XML-like backend output in mind (to 
not get accidetal spaces before/after tags). Unfortunately - in some special 
but important cases - with LaTeX this is a bug that can't be hacked around (as 
in my case with verbatim).

Or is there some well hidden (or undocumented ?) switch to suppress that 
newlines get eaten? (Well, at least it doesn't eat my childern. Nor my cat.)

Right now it seems I have to use a filter to get the desired behaviour. But I 
might be blind.


Bye
Andreas

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to