A bit more XHTML-related documentation. This is just a start.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32990 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-01-12 19:37:45 +00:00
parent acc5af9912
commit b753d5244f
2 changed files with 394 additions and 40 deletions

View File

@ -1,5 +1,5 @@
#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
\lyxformat 374
\lyxformat 376
\begin_document
\begin_header
\textclass scrbook
@ -51,6 +51,7 @@ logicalmkup
theorems-ams
theorems-ams-extended
\end_modules
\maintain_unincluded_children false
\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
@ -191,20 +192,29 @@ User's Guide
\emph default
is already quite lengthy, and it contains information on all of the basic
features one needs to know in order to prepare most documents.
However, the LyX Team has worked to LyX extensible through various configuratio
n files and external packages.
However, the LyX Team has worked to make LyX extensible through various
configuration files and external packages.
That means that if you want to support the Fizzwizzle LaTeX package, you
can create a layout file (or module) for it without having to alter LyX
itself.
We've already had contributions of several new features this way.
This is the place where all of those get documented.
We've already had contributions of several new features this way, and some
of them are documented here.
There are also some more `advanced' features, such as how to control the
presentation of bibliographies and how to work with multi-part documents,
that are not covered in the
\emph on
User's Guide
\emph default
and are discussed here.
\end_layout
\begin_layout Standard
This manual also documents some special features, like fax support, version
control, and SGML support, which require additional software to work properly.
Lastly, there's a chapter of LaTeX tools and tips, things you can use to
spruce up your documents by directly using the powerful features of LaTeX.
There is also a chapter on LyX's support for HTML.
And lastly, there's a chapter of LaTeX tools and tips, things you can use
to spruce up your documents by directly using the powerful features of
LaTeX.
After all, LyX
\emph on
is
@ -232,7 +242,7 @@ User's Guide
\end_layout
\begin_layout Standard
Since all the topics in this manual depend heavily on LyX's interaction
Since many of the topics in this manual depend heavily on LyX's interaction
with LaTeX, this first chapter covers the inner workings of LyX and how
to direct LyX to generate exactly the LaTeX code you want.
It is obviously for more seasoned LyX users.
@ -2098,7 +2108,8 @@ Customizing Bibliographies with BibTeX
\end_layout
\begin_layout Standard
The basics how to use BibTeX are explained in section
The most basic information about how to use BibTeX with LyX is contained
in the section
\emph on
Bibliography databases (BibTeX)
\emph default
@ -4116,6 +4127,352 @@ savelabelitemi}
\end_layout
\begin_layout Chapter
LyX and the World Wide Web
\end_layout
\begin_layout Standard
LyX has long supported the export of documents to various web-friendly formats,
such as HTML.
Before verson 1.7, however, HTML export was always accomplished by the use
of external converters.
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
For details on the use of external converters with LyX, see the
\size normal
\emph on
Converters
\emph default
section of the Customization manual.
\end_layout
\end_inset
These fall into two large groups: there are converters that use LaTeX as
an intermediate format, such as
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
htlatex
\end_layout
\end_inset
,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
html2latex
\end_layout
\end_inset
, and
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
plastex
\end_layout
\end_inset
, relying upon LyX to produce the LaTeX; and there is a converter that works
directly on LyX files,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
eLyXer
\end_layout
\end_inset
.
All of these have different advantages and disadvantages.
\end_layout
\begin_layout Standard
The LaTeX-based converters have the advantage that, in principle, they know
everything about the exported document that LaTeX does.
Such converters do not care, for example, if a certain block of code was
produced by LyX or was Evil Red Text.
They know about
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
aux
\end_layout
\end_inset
files, counters, and references, and can often make use of the
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
bbl
\end_layout
\end_inset
files generated by BibTeX.
On the other hand, LaTeX is a very hard language to parse---it is sometimes
said that only TeX itself understands TeX---and LaTeX-based converters
will often choke on what seem to be quite simple constructs; complex ones
can throw them completely, and as of this writing, for example, the
\emph on
Embedded Objects
\emph default
manual will not export with
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
htlatex
\end_layout
\end_inset
, though the others will.
The other issue concerns how math is handled.
These converters typically convert the formulae into little pictures that
are then linked from the HTML document.
Since these are actually generated by LaTeX, they are accurate.
But they do not scale well, and just getting them to look as if they are
actually meant to be in your document---so that the font sizes seem to
be roughly the same---can be a challenge.
\end_layout
\begin_layout Standard
Alex Fernandez's
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
eLyXer
\end_layout
\end_inset
solves some of these problems.
In particular, its rendering of math tends to look better than
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
htlatex
\end_layout
\end_inset
's, at least in simpler cases, since it renders math using a neat combination
of HTML and CSS rather than converting the formulae to images.
But more complex formula tend to be rendered less well than with
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
htlatex
\end_layout
\end_inset
, since there is no reasonable way of scaling parentheses in HTML, for example.
More importantly (as of version 0.39, at least),
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
eLyXer
\end_layout
\end_inset
has no support for math macros, for user-defined paragraph or character
styles, or for tables of contents and figures.
These limitations make
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
eLyXer
\end_layout
\end_inset
unsuitable for many of the documents more advanced LyX users would produce.
In principle, of course, all of these problems could be solved, but the
LyX developers have decided to follow a different path and made LyX itself
capable of writing XHTML, just as it is capable of writing LaTeX, DocBook,
and plaintext.
\end_layout
\begin_layout Standard
As of this writing, XHTML output remains under development and should probably
be regarded as
\begin_inset Quotes eld
\end_inset
experimental
\begin_inset Quotes erd
\end_inset
.
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
The file
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
development/HTML.notes
\end_layout
\end_inset
, which can be found in the LyX source tree or
\begin_inset CommandInset href
LatexCommand href
name "accessed online"
target "http://www.lyx.org/trac/browser/lyx-devel/trunk/development/HTML/HTML.notes"
\end_inset
, usually contains up-to-date information about the state of XHTML output.
\end_layout
\end_inset
Still, the developers have chosen this approach because it has several
potential advantages over the other two.
\end_layout
\begin_layout Standard
These advantages are primarily due to the fact that the XHTML output routines,
since they are part of LyX, know everything LyX knows about the document
being exported.
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
Another advantege is that, since these routines are internal to LyX, they
are immune to changes in LyX's file format, or to changes in the semantics
of existing insets.
\end_layout
\end_inset
So they know about the table of contents (as displayed in the Outline),
about the counters associated with different paragraph styles, and about
user-defined styles.
The XHTML output routines know what LyX knows about internationalization,
too, so they will output
\begin_inset Quotes eld
\end_inset
Chaper 1
\begin_inset Quotes erd
\end_inset
or
\begin_inset Quotes eld
\end_inset
\lang ngerman
Kapitel
\lang english
1
\begin_inset Quotes erd
\end_inset
, depending upon the language in effect at the time.
\end_layout
\begin_layout Standard
Quite generally, the output routines know everything LyX knows about document
layout, that is, about the document is to be rendered on screen.
We can use this information when we output the document as XHTML.
In particular, LyX
\emph on
automatically
\emph default
generates CSS style information corresponding to the layout information
it uses to render the document on screen: if section headings are supposed
to be sans-serif and bold as seen in LyX, then (by default) they will be
sans-serif and bold when viewed in a web browser, too.
And this is true not just for pre-defined styles, like Section, but for
any style, including user-defined styles.
Indeed, the XHTML output routines make no distinction between user-defined
paragraph and character styles and LyX's own pre-defined styles: in each
case, everything LyX knows about the styles is contained in the layout
files.
And much the same is true as regards pre-defined textual insets, such as
footnotes, and custom versions.
\end_layout
\begin_layout Standard
The result is that XHTML output can be customized and extended in
\emph on
exactly
\emph default
the same way LaTeX output can be customized and extended: through layout
files and modules.
See chapter five of the
\emph on
Customization
\emph default
manual for the details.
\end_layout
\begin_layout Standard
As for math, LyX renders math using MathML.
This has advantages and disadvantages.
The advantage is that MathML is a dialect of XML designed specifically
for mathematics on the web, and it typically renders very well in browsers
that support it.
The first disadvantage is that not all browsers support MathML, and support
is not complete even in the Gecko-based browsers, such as Firefox.
A second disadvantage, as compared to rendering math by images, is that
LyX can only output MathML for LaTeX constructs that it knows about, which
means that the use of ERT in math---e.g., the command
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
\backslash
BGassert
\end_layout
\end_inset
from the
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
begriff.sty
\end_layout
\end_inset
package---will produce nothing helpful.
Eventually, therefore, LyX will offer the user the option to use MathML
or images, and it will offer this choice on a case by case basis.
\end_layout
\begin_layout Chapter
The LyX Server
\end_layout

View File

@ -1,5 +1,5 @@
#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
\lyxformat 375
\lyxformat 376
\begin_document
\begin_header
\textclass scrbook
@ -56,6 +56,7 @@
\end_preamble
\options intoc,bibtotoc,idxtotoc,BCOR7mm,tablecaptionabove
\use_default_options false
\maintain_unincluded_children false
\language english
\inputencoding auto
\fontencoding global
@ -122,7 +123,7 @@
\papercolumns 1
\papersides 2
\paperpagestyle default
\tracking_changes true
\tracking_changes false
\output_changes false
\html_use_mathml true
\html_be_strict true
@ -13052,20 +13053,14 @@ pdftex
dvipdfm
\family default
is no longer under development and therefore a bit outdated.
\change_inserted 1 1262887469
\end_layout
\begin_layout Subsubsection
\change_inserted 1 1262887469
XHTML
\begin_inset Index idx
status collapsed
\begin_layout Plain Layout
\change_inserted 1 1262887469
FileFormats! XHTML
\end_layout
@ -13076,8 +13071,6 @@ FileFormats! XHTML
status collapsed
\begin_layout Plain Layout
\change_inserted 1 1262887469
HTML
\end_layout
@ -13087,8 +13080,6 @@ HTML
\end_layout
\begin_layout Standard
\change_inserted 1 1262888147
This file type has the extension
\begin_inset Quotes eld
\end_inset
@ -13106,28 +13097,36 @@ This file type has the extension
It does not itself contain images and the like but only links them, and
when LyX produces XHTML, it also generates corresponding images in formats
suitable for the purpose.
\end_layout
\begin_layout Standard
\change_inserted 1 1262888092
As of this writing, LyX's `native' XHTML output remains somewhat `experimental',
and not all LyX features work properly.
It is our hope, however, that native output will solve many of the problems
users have encountered when using third-party LyX- or LaTeX-to-HTML converters.
\end_layout
\begin_layout Standard
\change_inserted 1 1262888116
Math is output as MathML, which renders nicely in browsers that support
Math is output as MathML, which renders nicely in browsers that support
it, but not all do.
Eventually, we will offer the option of instead outputing math as images.
\end_layout
\begin_layout Standard
XHTML output remains
\begin_inset Quotes eld
\end_inset
\change_inserted 1 1262888178
under development
\begin_inset Quotes erd
\end_inset
, and not all LyX features are supported yet.
See the chapter
\begin_inset Quotes eld
\end_inset
LyX and the World Wide Web
\begin_inset Quotes erd
\end_inset
, in the
\emph on
Additional Features
\emph default
manual, for more information.
\end_layout
\begin_layout Standard
You can export your document as an XHTML file using the menu item
\family sans
File\SpecialChar \menuseparator
@ -13135,8 +13134,6 @@ Export\SpecialChar \menuseparator
LyXHTML
\family default
.
\change_unchanged
\end_layout
\begin_layout Subsection