On 10/05/2009 04:03 PM, Jack M. Lyon wrote:
Esteemed LyXers:
For any particular style in a custom LyX layout file, is there a way
to have LyX convert paragraph breaks to newlines (\\) when converting
the text to LaTeX?
For example, in the following style--
Style Poem
Category Poem
Margin Static
LatexType Environment
LatexName verse1
LeftMargin MMMMMMMM
TopSep 1
BottomSep 1
ParSkip 0.4
Align Left
AlignPossible Block, Left, Right, Center
LabelType No_Label
End
--I need a command that will convert paragraph breaks to newlines in
the LaTeX text inside the paragraph environment verse1. So the text in
LyX will look like this (styled as Poem):
My name is Ozymandias, king of kings.
Look on my works, ye Mighty, and despair!
And the text in LaTeX will look like this--
\begin{verse1}
My name is Ozymandias, king of kings.\\
Look on my works, ye Mighty, and despair!
\end{verse1}
--RATHER than this:
\begin{verse1}
My name is Ozymandias, king of kings.
Look on my works, ye Mighty, and despair!
\end{verse1}
I've explored Newline and PassThru, but they don't seem to do what I
need. Any suggestions?
Or, failing that, is there a way to do the conversion (just for that
environment) in LaTeX itself, rather than having LyX do it?
I don't think there's any way to do this, as you describe what you want.
Probably there is some way to redefine charcodes, etc, inside the verse1
environment, so that \n\n becomes just a newline, but that is way beyond me.
That said, I'm guessing that what you want, perhaps, is just not to have
such a large line separation in the output. If so, then perhaps
redefining \parsep in the definition of the verse1 environment---or
defining a new environment, if that's what's necessary---would give you
the output you want.
rh