On 12/06/2011 11:54 AM, Steve Litt wrote:
> On Tuesday, December 06, 2011 04:46:28 AM Guenter Milde wrote:
>
>> As LyX now offers native HTML export,
>> is there an equivalent to Document>Settings>LaTeX preamble
>> for "raw" HTML code in the document header?
>>
Code for the document header can be added via Local Layout, e.g.:

AddToHTMLPreamble
    <style type="text/css">
        // css commands here
    </style>
EndPreamble

You can put whatever you like there. JavaScript, meta tags, whatever.

>> Günter
> LyXHTML was much worse. I put in the following comment:
>
> =======================
> ebook
> cover=”./bigtitle.jpg”
> publisher=”Troubleshooters.Com”
> =======================
>
> Here was the output from LyXHTML:
>
> ======================
> <!-- class="note_comment"><a id='magicparlabel-41888' />
> ebook<!-- Output Error: Closing tag `div' when other tags are open, 
> namely: --><!-- Output Error: !-- --></!--><!-- Output Error: 
> &LyX_parsep_tag& --></div>
>
> <div class="plain_layout"><a id='magicparlabel-41892' />
> cover=&rdquo;./bigtitle.jpg&rdquo;</div>
>
> <div class="plain_layout"><a id='magicparlabel-41899' />
> publisher=&rdquo;Troubleshooters.Com&rdquo;<!-- Output Error: Tried to 
> close `!--' when tag was not open. Tag discarded. --><!-- Output 
> Error: Tags still open in closeFontTags(). Probably not a problem,
> but you might want to check these tags: --><!-- Output Error: div --
>> <!-- Output Error: No paragraph separation tag found in 
> endParagraph(). --></div>
> ======================
>
There's some bug here involving multi-paragraph comments. I'll sort it out.

> The other thing is, from my understanding, unlike eLyXer which enables 
> you to specify a .css file on the command line, the only way to 
> specify a .css file in LyX's native LyXHTML is to define it within the 
> layout file. 
>
A recent patch from Rob Oakes will change this, in the sense that the
CSS will be written to a separate file. You can then modify it at will,
or replace it completely, as you wish. There's no need to specify anything.

> First of all, in this book I have no layout file -- it's 
> document class Book plain and simple. 
>
Then you do have a layout file: book.layout. And what it is doing can be
modified in different ways: You can write a module that you load with
the file, or you can enter your custom layout information into Local
Layout. Presumably, you'd want to do it as a module in this sort of
case, for re-usability. Or, as I said, you can do CSS separately. It's
entirely up to you.

> But second of all, even if I 
> did, what I'd want is for the layout file to determine the PDF 
> appearance, with the .css determining the flowing text eBook 
> appearance.
>
There's a misunderstanding here. In the PDF case, what the layout file
determines is what LaTeX gets output. Then pdflatex (or whatever) gets
run on that file, and you get a PDF. In the XHTML case, the layout file
determines what CSS gets output. Then the browser (or whatever)
determines how the whole thing gets displayed. The LaTeX-oriented parts
of the layout file are inactive when XHTML is output, just as the
XHTML-oriented parts of the layout file are inactive when LaTeX is output.

So the layout controls what gets output in both cases. But of course the
CSS is what's determining how the eBook appears, but as the LaTeX
determines how the PDF appears.

Richard

Reply via email to