[luatex] [Dev-luatex] Line breaks

Heiko Oberdiek heiko.oberdiek at googlemail.com
Sat Feb 19 14:05:18 CET 2011


On Sat, Feb 19, 2011 at 01:41:30PM +0100, Paul Isambert wrote:

> >No, the conversion is done by TeX, \directlua sees the \par then.
> 
> Then
> 
> \directlua{
> 
> foo = 1}
> 
> should be read as "\parfoo=1", and it isn't. Or is there something
> I'm missing?

Yes, you example and some testing shows, that it isn't tex.print,
but \directlua seems to remove \par if it has its original meaning.

  \def\par{bar}
  \directlua{

  foo = 1}

Then Lua sees "barfoo = 1".

Something like the following should fix the OP's problem:

\begingroup
  \def\par{\endgraf}
  \directlua{
    text = [[
      This is a paragraph
      with some lines.

      This is another paragraph,
      separated from the first
      by a blank line. ]]
    tex.print(text)
  }
\endgroup

Yours sincerely
  Heiko Oberdiek


More information about the luatex mailing list