Initial import
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@5 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
75e32b1e8f
commit
b0b66fcae9
252 changed files with 49000 additions and 0 deletions
460
source/distro/COPYING.TXT
Normal file
460
source/distro/COPYING.TXT
Normal file
|
@ -0,0 +1,460 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
121
source/distro/History.txt
Normal file
121
source/distro/History.txt
Normal file
|
@ -0,0 +1,121 @@
|
|||
Version history for Writer2LaTeX
|
||||
================================
|
||||
|
||||
Version 0.9.4 (February 2009)
|
||||
-Filters:
|
||||
- Changed to oxt format and separated into Writer2LaTeX and Writer2xhtml extensions
|
||||
- Added (localized) dialogs to the filters
|
||||
- LaTeX:
|
||||
- Export vector graphics to pdf for use with pdfTeX.
|
||||
- Support equations generated by OOoLaTeX.
|
||||
- XHTML:
|
||||
- Improved navigation features for splitted documents
|
||||
- Do not export hidden or filtered rows and columns. Apply print ranges.
|
||||
- Improved batch conversion
|
||||
- General:
|
||||
- Export images to a subdirectory.
|
||||
|
||||
Version 0.5 (June 2007)
|
||||
- LaTeX:
|
||||
- support fancyhdr.sty
|
||||
- support geometry.sty
|
||||
- support supertabular.sty
|
||||
- support tabulary.sty
|
||||
- support colortbl.sty
|
||||
- support l, c, r columns in tables
|
||||
- support floating figures and tables
|
||||
- some graphics improvements
|
||||
- custom tabstop handling
|
||||
- flexible handling of notes (ignore, comment, marginpar, pdf annotation)
|
||||
- string replace (eg. LaTeX -> \LaTeX)
|
||||
- XHTML:
|
||||
- convert an entire directory with index page(s)
|
||||
- convert using a template document
|
||||
- support html forms
|
||||
- custom tabstop handling
|
||||
- support continued lists
|
||||
- improved export of table formatting
|
||||
- support background images
|
||||
- improved table of contents
|
||||
- General:
|
||||
- support OpenDocument
|
||||
- now installable as uno package (extension)
|
||||
- no longer using the XMerge framework
|
||||
|
||||
Version 0.4 (July 2005)
|
||||
- LaTeX:
|
||||
- improved readability of output (wrap long lines, do not include unused
|
||||
labels and hypertargets)
|
||||
- support for more languages
|
||||
- writer.sty is replaced by the optional package ooomath.sty
|
||||
- color.sty is now optional
|
||||
- new options to ignore hard page and line breaks
|
||||
- new option to ignore double spaces
|
||||
- new option to specify that the document is *not* multilingual
|
||||
- support for cp1251 (Windows cyrillic) and latin2 inputenc
|
||||
- improved style maps for paragraphs (avoid line break, verbatim content)
|
||||
- cleaned up configuration of formatting
|
||||
- improved export of list formatting
|
||||
- support for other documentclasses than article
|
||||
- support for lastpage.sty
|
||||
- support for eurosym.sty
|
||||
- support for tipa.sty
|
||||
- support for various 8-bit fonts: Wingdings, Windows Symbol
|
||||
- support for OpenSymbol
|
||||
- XHTML:
|
||||
- converts units to px (default)
|
||||
- Calc2xhtml added
|
||||
- improved support for table formatting; table formatting is now always
|
||||
exported
|
||||
- (partial) bidi support
|
||||
- support for sections (margins and background color)
|
||||
- new option to scale column widths
|
||||
- new options to ignore double spaces, hard line breaks and empty paragraphs
|
||||
- General
|
||||
- Added ant build file (provided by Michael Niedermair)
|
||||
- Now possible to specify output path+file name on command line
|
||||
- removed usage of document specific configuration files (*-config.xml)
|
||||
- new option to create user configuration automatically
|
||||
|
||||
Version 0.3.2 (February 2004)
|
||||
- LaTeX:
|
||||
- support for custom math symbols (%symbol)
|
||||
- improved handling of paragraph formatting
|
||||
- support for table borders
|
||||
- support for alphabetical index
|
||||
- support for pdf meta data
|
||||
- XHTML:
|
||||
- support for three different XHTML variants
|
||||
- long documents can be split in several XHTML documents
|
||||
- support for custom style sheets
|
||||
- more flexible handling of fomatting
|
||||
- support for most XHTML elements (including blockquote, dl, hr)
|
||||
- support for alphabetical index
|
||||
- support for meta data
|
||||
|
||||
Version 0.3 (October 2003)
|
||||
- support for BibTeX
|
||||
- support for greek and russian text
|
||||
- support for more languages
|
||||
- support for latin1, cp1250, iso-8859-7, koi8-r and utf8 (Dominique
|
||||
Unruh's ucs.sty) inputencodings
|
||||
- support for symbol fonts: pifont.sty, wasysym.sty, ifsym.sty and
|
||||
bbding.sty
|
||||
- support for ulem.sty (underline/cross out)
|
||||
- export of footnotes configuration, list label styles, heading
|
||||
styles and hard paragraph formatting can be disabled
|
||||
- custom export of list styles
|
||||
- bugfixes
|
||||
|
||||
Version 0.2 (March 2003)
|
||||
- support for tables
|
||||
- support for graphics
|
||||
- support for outline numbering and list styles
|
||||
- support for page styles
|
||||
- support for sections (columns)
|
||||
- custom export of text and paragraph styles
|
||||
- integration with xmerge (enables use as export filter)
|
||||
- export to XHTML + MathML
|
||||
|
||||
Version 0.1 (September 2002)
|
||||
- first simple version
|
18
source/distro/Readme.txt
Normal file
18
source/distro/Readme.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
Writer2LaTeX version 0.9.4
|
||||
==========================
|
||||
|
||||
This is the distribution of Writer2LaTeX version 0.9.4
|
||||
|
||||
Latest version can be found at the web site
|
||||
http://writer2latex.sourceforge.net
|
||||
|
||||
You can read about installation and usage of Writer2LaTeX
|
||||
in the user guide, which is included in the
|
||||
directory doc.
|
||||
|
||||
Bugs and feature requests should be reported to
|
||||
henrikjust (at) openoffice.org
|
||||
|
||||
|
||||
February 2009
|
||||
Henrik Just
|
325
source/distro/changelog.txt
Normal file
325
source/distro/changelog.txt
Normal file
|
@ -0,0 +1,325 @@
|
|||
Changelog for Writer2LaTeX version 0.5 -> 1.0
|
||||
|
||||
---------- version 1.0 beta ----------
|
||||
|
||||
[w2l] Bugfix: Fixed crash for tables with fewer columns than rows
|
||||
|
||||
---------- version 0.9.4 -----------
|
||||
|
||||
[w2l] Added sample LaTeX configuration for Google Docs from Elefterios Stamatogiannakis
|
||||
|
||||
[w2x] Added MathML named entites table from Bruno Mascret
|
||||
|
||||
[all] Bugfix: Locked controls are now updated correctly when the dialog is displayed
|
||||
|
||||
[w2l] New backed xetex (initial prototype)
|
||||
|
||||
[c2x] Bugfix: Corrected wrong calculation of column number for columns with two letters
|
||||
(affected apply_print_ranges=true)
|
||||
|
||||
[c2x] Bugfix: Ensure that we always export a document, even if there are no defined
|
||||
print ranges (affected apply_print_ranges=true)
|
||||
|
||||
[c2x] Bugfix: Now also exports uplink for spreadsheets
|
||||
|
||||
[w2l] Bugfix: No longer incorrectly assume math mode when exporting plain text
|
||||
|
||||
[all] Added support for the new Writer notes/annotations (which now can contain several
|
||||
formatted paragraphs rather than a single, plain text paragraph)
|
||||
|
||||
[all] Added russian and ukrainian translations from Volodymyr Volkov
|
||||
|
||||
[all] Bugfix: Removed PreferredFilter propery from type definitions (makes sense
|
||||
only for import filters)
|
||||
|
||||
[all] Changed unix startscript: By default assume that w2l and writer2latex are
|
||||
in the same directory (thus using dirname $0), and assume that the java executable
|
||||
is either in the PATH or the location is defined by JAVA_HOME
|
||||
(which these assumptions manual editing of the script is usually not required)
|
||||
|
||||
[all] Added french translation from Jacques Lamoine
|
||||
|
||||
[w2l] The option simple_table_limit now refers to the *total* width of the table
|
||||
measured in characters rather than the width of individual cells
|
||||
|
||||
[w2x] Bugfix: The position and dimensions of a frame is now calculated correctly
|
||||
(previously the size of margins, borders and padding was not taken into account)
|
||||
|
||||
[w2l] The inputencoding utf8 now uses the LaTeX standard rather than ucs.sty
|
||||
(which only supports latin and cyrillic alphabets)
|
||||
|
||||
[w2l] New style map family "text-attribute" to map text formatting to LaTeX code
|
||||
currently only the values "bold", "italic", "small-caps", "subscript" and
|
||||
"superscript" are supported, and the verbatim attribute is not supported
|
||||
|
||||
---------- version 0.9.3 -----------
|
||||
|
||||
[all] All source files are now US ASCII; added encoding of source files to build file
|
||||
|
||||
[all] Added more File-based methods to the API
|
||||
|
||||
[w2l] The paper sizes defined by standard LaTeX document classes are now
|
||||
identified and added as global options (a4paper, a5paper, b5paper,
|
||||
letterpaper, legalpaper, executivepaper, including landscape variants)
|
||||
|
||||
[w2x] Bugfix: Now only exports the name of a text box if it actually exists!
|
||||
|
||||
[w2l] Removed option "pagecolor" from \hypersetup (this option has been removed
|
||||
from the hyperref package)
|
||||
|
||||
[all] Filter bugfix: The new option name "ConfigURL" is now used in the dialogs
|
||||
|
||||
[all] Added (partial) german localization from Martin Friedrich
|
||||
|
||||
[w2x] New option use_named_entities: When set to true, named character entities
|
||||
as defined in xhtml 1.0 are used (currently only those within ISO latin 1)
|
||||
|
||||
[w2x] Characters not supported by the encoding are now exported as numeric
|
||||
character entities
|
||||
|
||||
[w2x] Bugfix: Internal hyperlinks to tables, sections, frames and graphics now
|
||||
works correctly
|
||||
|
||||
[w2x] Bugfix: Subtables are no longer exported with an id attribute
|
||||
|
||||
[all] Bugfix: table:number-rows-repeated is now treated correctly
|
||||
|
||||
[c2x] New option: apply_print_ranges
|
||||
|
||||
---------- version 0.9.2 -----------
|
||||
|
||||
[c2x] No longer exports <tbody> for tables without <thead>
|
||||
|
||||
[all] Renamed "class" to "family" in style maps to avoid confusion
|
||||
with css classes (old name is still accepted)
|
||||
|
||||
[all] Filter: Renamed template and config options to the more
|
||||
descriptive TemplateURL and ConfigURL
|
||||
|
||||
[all] API: Added convenience method convert(File) to Converterer
|
||||
|
||||
[all] API: Added convenience method write(File) to ConverterResult
|
||||
|
||||
[all] New option: save_images_in_subdir
|
||||
|
||||
[all] Use Robert Harders public domain Base64 decoder (replacing
|
||||
the non-standard decoder in sun.misc)
|
||||
|
||||
[all] MIMETypes used in the API are now defined in writer2latex.api.MIMETypes
|
||||
|
||||
[all] Renamed the option keep_image_size to original_image_size (the meaning of
|
||||
this option was confusing). The old name is still recognized.
|
||||
|
||||
[all] OOo now saves SVM files with a MIME type in the package format.
|
||||
This is now recognized by w2l, which implies that GraphicConverter
|
||||
implementations can use SVM files from a package
|
||||
|
||||
[w2x] New uno service org.openoffice.da.writer2xhtml.BatchConverter
|
||||
provides batch conversion via uno. Interaction with the user can be implemented
|
||||
using the interface org.openoffice.da.writer2xhtml.XBatchHandler
|
||||
|
||||
[w2x] Batch processing from the command line can now be cancelled (using the Enter key)
|
||||
|
||||
[all] API: Created new API for batch conversion
|
||||
|
||||
[w2l] Bugfix: Tables were in rare cases exported with invalid row alignment
|
||||
(null character)
|
||||
|
||||
[w2x] Filter ui bugfix: Default value for RepeatLevels changed from
|
||||
6 to 5 (6 was not valid)
|
||||
|
||||
[w2x] Filter: The xhtml export now uses it's own custom configuration
|
||||
(writer2xhtml.xml, also stored in the user configuration of OOo)
|
||||
|
||||
[w2l] Tabstops are now exported as \ \ , which usually is closer to
|
||||
the expectations of the user (and is not ignored at the beginning of a par.)
|
||||
|
||||
[w2x] Empty paragraphs are now (again!) exported with a
|
||||
(otherwise they are ignored by the browser)
|
||||
|
||||
[w2x] Xhtml specific options no longer starts with the prefix xhtml_
|
||||
(is still accepted for backwards compatibility)
|
||||
|
||||
[all] Filter: Added display name and description to the extensions
|
||||
|
||||
[w2x] BatchConverter: Localized alternative text for icons
|
||||
|
||||
[w2b] Bugfix: Replace ";" with "and" also in in editor field
|
||||
|
||||
[w2x] Added new options xslt_path to give the path to the XSL
|
||||
transformation from w3c (also in the ui)
|
||||
|
||||
[all] Filter: Optimized the size of the extensions by excluding code not
|
||||
relevant for the format(s) supported by the extension
|
||||
|
||||
[all] Separated LaTeX and xhtml code. As a consequence, it is possible to build
|
||||
and run Writer2LaTeX with support for only one format
|
||||
|
||||
[c2x] New options display_hiddens_rows_cols and display_filtered_rows_cols. If
|
||||
set to false (default), rows and columns that are hidden or filtered are not
|
||||
exported
|
||||
|
||||
[all] Filter: Translated dialogs to Danish
|
||||
|
||||
[all] Filter: Raised requirement in description.xml to OOo 2.2
|
||||
(needs support for localized dialogs)
|
||||
|
||||
[w2l] Added ui option "Support additional symbols". This sets all the
|
||||
options use_pifont, use_ifsym, use_wasysym, use_eurosym and use_tipa.
|
||||
The pseudo-option additional_symbols can be used in the LockedOptions list
|
||||
|
||||
[all] Bugfix: The class w2l.xmerge.DOMDocument did not throw IOException when
|
||||
trying to read a non-xml document
|
||||
|
||||
[w2x] Bugfix: The convert method did not restart document enumeration
|
||||
(relevant if it's called several times for the same converter instance)
|
||||
|
||||
[w2x] API: Created new API for batch conversion, which is also moved
|
||||
from Application to a separate class
|
||||
|
||||
[all] API: The API now uses a interface to the configuration rather than using
|
||||
the class writer2latex.util.Config
|
||||
|
||||
[w2x] Style of header/footer in index pages (batch conversion) aligned with
|
||||
document header/footer
|
||||
|
||||
[all] Added package descriptions to the javadoc
|
||||
|
||||
[w2l] Always export non-breaking space as ~ even if inputenc supports it
|
||||
directly - non-breaking spaces are usually not easy to identify in text editors
|
||||
|
||||
---------- version 0.9.1 -----------
|
||||
|
||||
[w2x] New option: xhtml_add_bom (default false), if set to true
|
||||
a BOM will be added at the start of generated xhtml files
|
||||
|
||||
[w2x] Fixed typo in filter name: XHTML 1.0 + MathML 2.0 should be
|
||||
XHTML 1.1 + MathML 2.0
|
||||
|
||||
[w2l] Added support for the latin language
|
||||
|
||||
[w2l] Removed article.xml from w2l - it now belongs to Writer4LaTeX
|
||||
|
||||
[all] The distribution now includes a sample configuration
|
||||
package: xhtml-config-sample.oxt
|
||||
|
||||
[all] Filter: Split the filter component into two extensions:
|
||||
writer2latex.oxt for LaTeX and BibTeX, writer2xhtml.oxt for xhtml
|
||||
The build file now produces optimized jars for each application, and the
|
||||
standalone jar does not contain any uno code
|
||||
|
||||
[w2l] Added (imcomplete) support for some of the Euclid fonts from Design Science
|
||||
|
||||
[w2b] Replace ";" with "and" in author field (multiple authors)
|
||||
|
||||
[w2l] Added support for formulas inserted by OOoLaTeX
|
||||
|
||||
[w2x] Now adds mini-toc to the element with id "panel" if it exists in the xhtml
|
||||
template
|
||||
|
||||
[w2l] API: Added new api for standalone StarMath converter
|
||||
Writer2LaTeX api: writer2latex.api.StarMathConverter
|
||||
Uno service: org.openoffice.da.writer2latex.StarMathConverter
|
||||
|
||||
[all] Filter: Added dialogs to all filters (w2l, w2x and c2x)
|
||||
|
||||
[w2l] Vector graphics (except wmf) is now exported as pdf if backend is pdftex
|
||||
|
||||
[all] API: In the GraphicConverter interface, the method
|
||||
supportsFormat has been replaced with the method supportsConversion
|
||||
|
||||
[w2l] Added support for *numbered* display equations: If paragraph
|
||||
contains exactly one equation and exactly one sequence field (and otherwise
|
||||
only whitespace and brackets), it treated as a numbered equation
|
||||
|
||||
[w2l] I18n: If several characters in a row are converted using math mode, they
|
||||
are now combined (ie. ${\alpha}{\beta}$ rather than ${\alpha}$${\beta}$)
|
||||
|
||||
[all] Extended FilterData to support the property AutoCreate. If set to true,
|
||||
the configuration file will be created if it does not exist
|
||||
|
||||
[w2l] Even if formatting=IGNORE_ALL, we should still obey character style maps
|
||||
from the configuration
|
||||
|
||||
[w2x] Added german translation of navigation pane (w2l.util.L10n)
|
||||
|
||||
[all] Bugfix: A paragraph with a bibliographic reference as the only
|
||||
content was considered empty (and the reference was lost)
|
||||
|
||||
[w2l] Use url decoding when creating file names for linked sections
|
||||
(in order to obtain more readable file names)
|
||||
|
||||
[w2l] Avoid redundant \mathit in StarMathConverter in some rare
|
||||
cases (such as greek letters pasted into Math)
|
||||
|
||||
[w2l] Support formulas for sequence fields (only the most common
|
||||
cases oow:Name, oow:Name+Number, oow:Name-Number and oow:Number)
|
||||
|
||||
[c2x] New options xhtml_display_hidden_sheets, xhtml_use_title_as_heading and
|
||||
xhtml_use_sheet_names_as_headings
|
||||
|
||||
[o2x] New option xhtml_notes. If true notes (annotations) are exported to xhtml
|
||||
comments, if false they are ignored
|
||||
|
||||
[c2x] Convert notes (annotations)
|
||||
|
||||
[w2l] Heading formatting: The prefix and suffix to the counter should not be
|
||||
included in \thesection, but rather in the formatting. This means that the
|
||||
prefix and suffix no longer will be exported if formatting=CONVERT_BASIC
|
||||
|
||||
[w2l] Added support for chapter references to reference marks and bookmarks
|
||||
(if the marks are contained in a heading)
|
||||
|
||||
[w2l] New option external_bibtex_files gives a list of BibTeX files. If nonempty,
|
||||
these files will be used instead of converting the actual bibliography marks
|
||||
|
||||
[w2l] New option metadata. If true, export metadata as \author,
|
||||
\date and pdf metadata, as well as pdf metadata (if use_hyperref is true)
|
||||
|
||||
[all] Filters/API: Changed filternames to the more obvious
|
||||
org.openoffice.da.writer2latex etc.
|
||||
|
||||
[w2l] Updated clean.xml and ultraclean.xml. Both configurations
|
||||
now exports predefined Writer styles (like article.xml)
|
||||
|
||||
[w2x] New option: xhtml_repeat_levels defines the number of heading
|
||||
levels to repeat when splitting a file (0 means no levels are repeated)
|
||||
|
||||
[w2x] Allow xhtml templates without header and footer elements
|
||||
|
||||
[w2x] Bugfix (w2l.office.ListCounter): OpenDocument does not use
|
||||
numberings like 1.0.1 if a list level is missing, but rather 1.1.1
|
||||
|
||||
[all] Command line application now uses internal standard configurations
|
||||
(*ultraclean.xml etc.)
|
||||
|
||||
[all] Command line application now accepts several configuration
|
||||
files (by using the -config option more than once)
|
||||
|
||||
[w2x] Use text style for label when applying numbering to heading
|
||||
|
||||
[w2x] Added support for other list styes applied to headings
|
||||
|
||||
[w2x] Added support for text:restart-numbering, text:is-list-header on headings
|
||||
|
||||
[w2x] No longer add hr and [] to links in navigation (the template and style
|
||||
sheet should take care of this)
|
||||
|
||||
[all] New filter configuration concept: Configuration packages containing an OOo
|
||||
template, a w2l configuration and registry information to bind these together:
|
||||
When a configuration package is installed in OOo, the configuration is added
|
||||
to the filter ui, and is preselected for documents based on the OOo template
|
||||
|
||||
[all] Repackaging: Distribution files are included in source, build
|
||||
file is extended to create the distribution; source distribution is separated
|
||||
|
||||
[all] Changed to new extension format (.oxt)
|
||||
|
||||
[all] Filter: Added messagebox to display the error in case an
|
||||
exception happens during conversion
|
||||
|
||||
[all] Moved default configurations to jar; the FilterData property
|
||||
can refer to these using the special url *filename.xml
|
||||
|
||||
[all] The filter now reads the FilterData property, which can be
|
||||
used to specify options, configuration fil (url) and xhtml template (url)
|
BIN
source/distro/doc/user-manual.odt
Normal file
BIN
source/distro/doc/user-manual.odt
Normal file
Binary file not shown.
BIN
source/distro/doc/w2llogo.png
Normal file
BIN
source/distro/doc/w2llogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
83
source/distro/latex/obsolete/writer.sty
Normal file
83
source/distro/latex/obsolete/writer.sty
Normal file
|
@ -0,0 +1,83 @@
|
|||
%% File: ooomath.sty, Copyright (C) 2002-2004 Henrik Just
|
||||
%%
|
||||
%% This file may be distributed and/or modified under the
|
||||
%% conditions of the LaTeX Project Public License, either version 1.2
|
||||
%% of this license or (at your option) any later version.
|
||||
%% The latest version of this license is in
|
||||
%% http://www.latex-project.org/lppl.txt
|
||||
%% and version 1.2 or later is part of all distributions of LaTeX
|
||||
%% version 1999/12/01 or later.
|
||||
%%
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{ooomath}[2004/08/08 v1.0 - stylefile used by Writer2LaTeX]
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Some math mode macros defining additional symbols
|
||||
% \ddotsup is taken from "The comprehensive LaTeX symbol list"
|
||||
\newcommand\defeq{\stackrel{\mathrm{def}}{=}}
|
||||
\newcommand\lambdabar{\mathchar'26\mkern-10mu\lambda}
|
||||
\newcommand\ddotsup{\mathinner{\mkern1mu\raise\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu\raise4\p@\hbox{.}\mkern2mu\raise7\p@
|
||||
\hbox{.}\mkern1mu}}
|
||||
% Fallback definitions for math mode macros defined in other packages
|
||||
\providecommand\multimapdotbothA{\bullet\kern-0.4em-\kern-0.4em\circ}
|
||||
\providecommand\multimapdotbothB{\circ\kern-0.4em-\kern-0.4em\bullet}
|
||||
\providecommand\oiint{\oint} % should be area integral...
|
||||
\providecommand\oiiint{\oint} % should be volume integral...
|
||||
\providecommand\llbracket{[} % should be double...
|
||||
\providecommand\rrbracket{]} % should be double...
|
||||
% More math mode macros
|
||||
\newcommand\wideslash[2]{{}^{#1}/_{#2}} % too small
|
||||
\newcommand\widebslash[2]{{}_{#1}\backslash^{#2}} % too small
|
||||
\newcommand\normalsubformula[1]{\text{$#1$}}
|
||||
\newcommand\boldsubformula[1]{\text{\mathversion{bold}$#1$}}
|
||||
% Multiscripts, based on leftidx.sty by Harald Harders
|
||||
\newlength{\idxmathdepth}
|
||||
\newlength{\idxmathtotal}
|
||||
\newlength{\idxmathwidth}
|
||||
\newlength{\idxraiseme}
|
||||
%
|
||||
\newcommand{\idxdheight}[1]{%
|
||||
\protect\settoheight{\idxmathtotal}{\(\displaystyle#1\)}%
|
||||
\protect\settodepth{\idxmathdepth}{\(\displaystyle#1\)}%
|
||||
\protect\settowidth{\idxmathwidth}{\(\displaystyle#1\)}%
|
||||
\protect\addtolength{\idxmathtotal}{\idxmathdepth}%
|
||||
\protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}}
|
||||
\newcommand{\idxtheight}[1]{%
|
||||
\protect\settoheight{\idxmathtotal}{\(\textstyle #1\)}%
|
||||
\protect\settodepth{\idxmathdepth}{\(\textstyle #1\)}%
|
||||
\protect\settowidth{\idxmathwidth}{\(\textstyle#1\)}%
|
||||
\protect\addtolength{\idxmathtotal}{\idxmathdepth}%
|
||||
\protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}}
|
||||
\newcommand{\idxsheight}[1]{%
|
||||
\protect\settoheight{\idxmathtotal}{\(\scriptstyle #1\)}%
|
||||
\protect\settodepth{\idxmathdepth}{\(\scriptstyle #1\)}%
|
||||
\protect\settowidth{\idxmathwidth}{\(\scriptstyle#1\)}%
|
||||
\protect\addtolength{\idxmathtotal}{\idxmathdepth}%
|
||||
\protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}}
|
||||
\newcommand{\idxssheight}[1]{%
|
||||
\protect\settoheight{\idxmathtotal}{\(\scriptscriptstyle #1\)}%
|
||||
\protect\settodepth{\idxmathdepth}{\(\scriptscriptstyle #1\)}%
|
||||
\protect\settowidth{\idxmathwidth}{\(\scriptscriptstyle#1\)}%
|
||||
\protect\addtolength{\idxmathtotal}{\idxmathdepth}%
|
||||
\protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}}
|
||||
% \multiscripts{<prescripts>}{<under>}{<over>}{<formula>}{<scripts>}
|
||||
\newcommand\multiscripts[5]{%
|
||||
\mathchoice%
|
||||
{\idxdheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2}
|
||||
{\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}%
|
||||
{\idxtheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2}
|
||||
{\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}%
|
||||
{\idxsheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2}
|
||||
{\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}%
|
||||
{\idxssheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2}
|
||||
{\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}
|
||||
}%
|
||||
\newcommand\mathoverstrike[1]{%
|
||||
\mathchoice%
|
||||
{\idxdheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}%
|
||||
{\idxtheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}%
|
||||
{\idxsheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}%
|
||||
{\idxssheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}%
|
||||
}
|
||||
\endinput
|
||||
|
83
source/distro/latex/ooomath.sty
Normal file
83
source/distro/latex/ooomath.sty
Normal file
|
@ -0,0 +1,83 @@
|
|||
%% File: ooomath.sty, Copyright (C) 2002-2004 Henrik Just
|
||||
%%
|
||||
%% This file may be distributed and/or modified under the
|
||||
%% conditions of the LaTeX Project Public License, either version 1.2
|
||||
%% of this license or (at your option) any later version.
|
||||
%% The latest version of this license is in
|
||||
%% http://www.latex-project.org/lppl.txt
|
||||
%% and version 1.2 or later is part of all distributions of LaTeX
|
||||
%% version 1999/12/01 or later.
|
||||
%%
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{ooomath}[2004/12/27 v1.01 - stylefile used by Writer2LaTeX]
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% Some math mode macros defining additional symbols
|
||||
% \ddotsup is taken from "The comprehensive LaTeX symbol list"
|
||||
\newcommand\defeq{\stackrel{\mathrm{def}}{=}}
|
||||
\newcommand\lambdabar{\mathchar'26\mkern-10mu\lambda}
|
||||
\newcommand\ddotsup{\mathinner{\mkern1mu\raise\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu\raise4\p@\hbox{.}\mkern2mu\raise7\p@
|
||||
\hbox{.}\mkern1mu}}
|
||||
% Fallback definitions for math mode macros defined in other packages
|
||||
\providecommand\multimapdotbothA{\bullet\kern-0.4em-\kern-0.4em\circ}
|
||||
\providecommand\multimapdotbothB{\circ\kern-0.4em-\kern-0.4em\bullet}
|
||||
\providecommand\oiint{\oint} % should be area integral...
|
||||
\providecommand\oiiint{\oint} % should be volume integral...
|
||||
\providecommand\llbracket{[} % should be double...
|
||||
\providecommand\rrbracket{]} % should be double...
|
||||
% More math mode macros
|
||||
\newcommand\wideslash[2]{{}^{#1}/_{#2}} % too small
|
||||
\newcommand\widebslash[2]{{}_{#1}\backslash^{#2}} % too small
|
||||
\newcommand\normalsubformula[1]{\text{\mathversion{normal}$#1$}}
|
||||
\newcommand\boldsubformula[1]{\text{\mathversion{bold}$#1$}}
|
||||
% Multiscripts, based on leftidx.sty by Harald Harders
|
||||
\newlength{\idxmathdepth}
|
||||
\newlength{\idxmathtotal}
|
||||
\newlength{\idxmathwidth}
|
||||
\newlength{\idxraiseme}
|
||||
%
|
||||
\newcommand{\idxdheight}[1]{%
|
||||
\protect\settoheight{\idxmathtotal}{\(\displaystyle#1\)}%
|
||||
\protect\settodepth{\idxmathdepth}{\(\displaystyle#1\)}%
|
||||
\protect\settowidth{\idxmathwidth}{\(\displaystyle#1\)}%
|
||||
\protect\addtolength{\idxmathtotal}{\idxmathdepth}%
|
||||
\protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}}
|
||||
\newcommand{\idxtheight}[1]{%
|
||||
\protect\settoheight{\idxmathtotal}{\(\textstyle #1\)}%
|
||||
\protect\settodepth{\idxmathdepth}{\(\textstyle #1\)}%
|
||||
\protect\settowidth{\idxmathwidth}{\(\textstyle#1\)}%
|
||||
\protect\addtolength{\idxmathtotal}{\idxmathdepth}%
|
||||
\protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}}
|
||||
\newcommand{\idxsheight}[1]{%
|
||||
\protect\settoheight{\idxmathtotal}{\(\scriptstyle #1\)}%
|
||||
\protect\settodepth{\idxmathdepth}{\(\scriptstyle #1\)}%
|
||||
\protect\settowidth{\idxmathwidth}{\(\scriptstyle#1\)}%
|
||||
\protect\addtolength{\idxmathtotal}{\idxmathdepth}%
|
||||
\protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}}
|
||||
\newcommand{\idxssheight}[1]{%
|
||||
\protect\settoheight{\idxmathtotal}{\(\scriptscriptstyle #1\)}%
|
||||
\protect\settodepth{\idxmathdepth}{\(\scriptscriptstyle #1\)}%
|
||||
\protect\settowidth{\idxmathwidth}{\(\scriptscriptstyle#1\)}%
|
||||
\protect\addtolength{\idxmathtotal}{\idxmathdepth}%
|
||||
\protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}}
|
||||
% \multiscripts{<prescripts>}{<under>}{<over>}{<formula>}{<scripts>}
|
||||
\newcommand\multiscripts[5]{%
|
||||
\mathchoice%
|
||||
{\idxdheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2}
|
||||
{\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}%
|
||||
{\idxtheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2}
|
||||
{\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}%
|
||||
{\idxsheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2}
|
||||
{\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}%
|
||||
{\idxssheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2}
|
||||
{\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}
|
||||
}%
|
||||
\newcommand\mathoverstrike[1]{%
|
||||
\mathchoice%
|
||||
{\idxdheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}%
|
||||
{\idxtheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}%
|
||||
{\idxsheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}%
|
||||
{\idxssheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}%
|
||||
}
|
||||
\endinput
|
||||
|
113
source/distro/samples/config/google-docs-config.xml
Normal file
113
source/distro/samples/config/google-docs-config.xml
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- gdocs.xml
|
||||
This is a sample configuration file for Writer2LaTeX.
|
||||
The options are set to produce the cleanest possible
|
||||
LaTeX file from an Google Docs document.
|
||||
The configuration is provided by Elefterios Stamatogiannakis
|
||||
-->
|
||||
|
||||
|
||||
<config>
|
||||
<option name="documentclass" value="article" />
|
||||
<option name="backend" value="generic" />
|
||||
<option name="inputencoding" value="ascii" />
|
||||
<option name="multilingual" value="false" />
|
||||
<option name="use_ooomath" value="false" />
|
||||
<option name="use_color" value="false" />
|
||||
<option name="use_colortbl" value="false" />
|
||||
<option name="use_geometry" value="false" />
|
||||
<option name="use_fancyhdr" value="false" />
|
||||
<option name="use_hyperref" value="false" />
|
||||
<option name="use_caption" value="true" />
|
||||
<option name="use_endnotes" value="false" />
|
||||
<option name="use_bibtex" value="true" />
|
||||
<option name="bibtex_style" value="plain" />
|
||||
<option name="formatting" value="ignore_most" />
|
||||
<option name="page_formatting" value="ignore_all" />
|
||||
<option name="ignore_empty_paragraphs" value="true" />
|
||||
<option name="ignore_hard_page_breaks" value="true" />
|
||||
<option name="ignore_hard_line_breaks" value="true" />
|
||||
<option name="ignore_double_spaces" value="true" />
|
||||
<option name="use_supertabular" value="false" />
|
||||
<option name="simple_table_limit" value="10000" />
|
||||
<option name="wrap_lines_after" value="0" />
|
||||
<option name="debug" value="false" />
|
||||
<heading-map max-level="5">
|
||||
<heading-level-map writer-level="1" name="section" level="1" />
|
||||
<heading-level-map writer-level="2" name="subsection" level="2" />
|
||||
<heading-level-map writer-level="3" name="subsubsection" level="3" />
|
||||
<heading-level-map writer-level="4" name="paragraph" level="4" />
|
||||
<heading-level-map writer-level="5" name="subparagraph" level="5" />
|
||||
</heading-map>
|
||||
<custom-preamble />
|
||||
|
||||
<!-- Style maps: These rules defines how styles in OOo are mapped to LaTeX code.
|
||||
A number of predefined Writer styles are converted -->
|
||||
|
||||
<!-- "Title" is mapped to \maketitle. If the user chooses to export meta data,
|
||||
the author and date will be inserted automatically -->
|
||||
<style-map name="Title" class="paragraph" before="\title{" after="} \maketitle" line-break="false" />
|
||||
|
||||
<!-- "Quotations" is mapped to a quotation environment -->
|
||||
<style-map name="Quotations" family="paragraph-block" next="Quotations" before="\begin{quotation}" after="\end{quotation}" />
|
||||
<style-map name="Quotations" family="paragraph" before="" after="" />
|
||||
|
||||
<!-- Preformatted Text is mapped to a verbatim environment
|
||||
Note the attribute verbatim, which instructs OOo to output the content
|
||||
verbatim (characters not available in the inputencoding will be replaced
|
||||
by question marks; other content will be lost). -->
|
||||
<style-map name="Preformatted Text" family="paragraph-block" next="Preformatted Text" before="\begin{verbatim}" after="\end{verbatim}" />
|
||||
<style-map name="Preformatted Text" family="paragraph" before="" after="" verbatim="true" />
|
||||
|
||||
<!-- "Horizontal line" is mapped to a \hrule -->
|
||||
<style-map name="Horizontal Line" family="paragraph" before="" after=" \begin{center}\hrule\end{center}" />
|
||||
|
||||
<!-- "Emphasis" text style is mapped to \emph -->
|
||||
<style-map name="Emphasis" family="text" before="\emph{" after="}" />
|
||||
|
||||
<!-- Italics text style is mapped to \emph -->
|
||||
<style-map class="text-attribute" name="italic" before="\emph{" after="}" />
|
||||
|
||||
<!-- Underlined text style is mapped to latex verbatim output -->
|
||||
<style-map class="text-attribute" name="underline" before="" after="" verbatim="true"/>
|
||||
|
||||
<!-- Superscript text style is mapped to \textsuperscript -->
|
||||
<style-map class="text-attribute" name="superscript" before="\textsuperscript{" after="}" />
|
||||
|
||||
<!-- Subscript text style is mapped to clean latex -->
|
||||
<style-map class="text-attribute" name="subscript" before="$_{\textrm{" after="}}$" />
|
||||
|
||||
<!-- "Strong Emphasis" text style is mapped to \textbf -->
|
||||
<style-map name="Strong Emphasis" family="text" before="\textbf{" after="}"/>
|
||||
|
||||
<!-- "Teletype" text style is mapped to \texttt -->
|
||||
<style-map name="Teletype" family="text" before="\texttt{" after="}" />
|
||||
|
||||
<!-- "List Heading" and "List Contents" are mapped to a description environment -->
|
||||
<style-map name="List Heading" family="paragraph-block" next="List Heading;List Contents" before="\begin{description}" after="\end{description}"/>
|
||||
<style-map name="List Heading" family="paragraph" before="\item[" after="]" line-break="false" />
|
||||
<style-map name="List Contents" family="paragraph" before="" after="" />
|
||||
|
||||
<!-- Various characters are mapped to more human friendly latex entities-->
|
||||
<string-replace input=""" latex-code=""" />
|
||||
<string-replace input="<" latex-code="<" />
|
||||
<string-replace input=">" latex-code=">" />
|
||||
<string-replace input="‘" latex-code="`" />
|
||||
<string-replace input="’" latex-code="'" />
|
||||
<string-replace input="‚" latex-code="'" />
|
||||
<string-replace input="“" latex-code="``" />
|
||||
<string-replace input="”" latex-code="''" />
|
||||
<string-replace input="„" latex-code=""" />
|
||||
<string-replace input="" latex-code=""" />
|
||||
<string-replace input="" latex-code="''" />
|
||||
<string-replace input="" latex-code="'" />
|
||||
<string-replace input="" latex-code="``" />
|
||||
<string-replace input="" latex-code="'" />
|
||||
<string-replace input="'" latex-code="'" />
|
||||
|
||||
<!-- Some mappings to help with citations. -->
|
||||
<string-replace input="<<<" latex-code="\cite{" />
|
||||
<string-replace input=">>>" latex-code="}" />
|
||||
|
||||
</config>
|
||||
|
BIN
source/distro/samples/xhtml/sample-xhtml.odt
Normal file
BIN
source/distro/samples/xhtml/sample-xhtml.odt
Normal file
Binary file not shown.
22
source/distro/w2l
Normal file
22
source/distro/w2l
Normal file
|
@ -0,0 +1,22 @@
|
|||
# *Very* simple script to run Writer2LaTeX (unix version)
|
||||
# Created by Henrik Just, october 2003
|
||||
# Modified december 2003 as suggested by Juan Julian Merelo Guervos
|
||||
# Modified may 2004 as suggested by J. Wolfgang Kaltz
|
||||
# Last modified december 2008
|
||||
|
||||
# If writer2latex.jar is not in the same directory as the script, please
|
||||
# edit the following line to contain the full path to Writer2LaTeX:
|
||||
W2LPATH=`dirname $0`
|
||||
|
||||
# If the required JVM is not in your path, or the path is not set by JAVA_HOME,
|
||||
# please edit the following line to contain the full path and file name
|
||||
MYJAVAEXE="java"
|
||||
|
||||
if [ "$JAVA_HOME" = "" ]
|
||||
then
|
||||
JAVAEXE="$MYJAVAEXE"
|
||||
else
|
||||
JAVAEXE="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
|
||||
$JAVAEXE -jar "$W2LPATH/writer2latex.jar" "$@"
|
19
source/distro/w2l.bat
Normal file
19
source/distro/w2l.bat
Normal file
|
@ -0,0 +1,19 @@
|
|||
@echo off
|
||||
rem *Very* simple batch file to run Writer2LaTeX
|
||||
rem Created by Henrik Just, october 2003
|
||||
rem Modfied december 2003 as suggested by Juan Julian Merelo Guervos
|
||||
rem Last modified july 2007
|
||||
|
||||
rem Please edit the following line to contain the full path to Writer2LaTeX:
|
||||
|
||||
set W2LPATH="c:\writer2latex09"
|
||||
|
||||
rem If the Java executable is not in your path, please edit the following
|
||||
rem line to contain the full path and file name
|
||||
|
||||
set JAVAEXE="java"
|
||||
|
||||
%JAVAEXE% -jar %W2LPATH%\writer2latex.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
|
||||
set W2LPATH=
|
||||
set JAVAEXE=
|
612
source/distro/xslt/pmathml.xsl
Normal file
612
source/distro/xslt/pmathml.xsl
Normal file
|
@ -0,0 +1,612 @@
|
|||
<xsl:stylesheet
|
||||
version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:mml="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
|
||||
xmlns:fns="http://www.w3.org/2002/Math/preference"
|
||||
xmlns:doc="http://www.dcarlisle.demon.co.uk/xsldoc"
|
||||
xmlns:ie5="http://www.w3.org/TR/WD-xsl"
|
||||
exclude-result-prefixes="h ie5 fns msxsl fns doc"
|
||||
extension-element-prefixes="msxsl fns doc"
|
||||
>
|
||||
|
||||
<!--
|
||||
$Id: pmathml.xsl,v 1.8 2003/06/23 14:46:44 davidc Exp $
|
||||
|
||||
Copyright David Carlisle 2001, 2002.
|
||||
|
||||
Use and distribution of this code are permitted under the terms of the <a
|
||||
href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
|
||||
>W3C Software Notice and License</a>.
|
||||
-->
|
||||
|
||||
<!-- MathPlayer mpdialog code for contributed by
|
||||
Jack Dignan and Robert Miner, both of Design Science.
|
||||
-->
|
||||
|
||||
<xsl:output method="xml" omit-xml-declaration="yes" />
|
||||
|
||||
<ie5:if doc:id="iehack" test=".">
|
||||
<ie5:eval no-entities="t">'<!--'</ie5:eval>
|
||||
</ie5:if>
|
||||
|
||||
|
||||
<fns:x name="mathplayer" o="MathPlayer.Factory.1">
|
||||
<object id="mmlFactory"
|
||||
classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987">
|
||||
</object>
|
||||
<?import namespace="mml" implementation="#mmlFactory"?>
|
||||
</fns:x>
|
||||
|
||||
<fns:x name="techexplorer" o="techexplorer.AxTchExpCtrl.1">
|
||||
<object id="mmlFactory" classid="clsid:0E76D59A-C088-11D4-9920-002035EFB1A4">
|
||||
</object>
|
||||
<?import namespace="mml" implementation="#mmlFactory"?>
|
||||
</fns:x>
|
||||
|
||||
|
||||
<!-- SCRIPT not script due to weird mozilla bug
|
||||
http://bugzilla.mozilla.org/show_bug.cgi?id=158457
|
||||
-->
|
||||
|
||||
<fns:x name="css" o="Microsoft.FreeThreadedXMLDOM">
|
||||
<SCRIPT for="window" event="onload">
|
||||
var xsl = new ActiveXObject("Microsoft.FreeThreadedXMLDOM");
|
||||
xsl.async = false;
|
||||
xsl.validateOnParse = false;
|
||||
xsl.load("pmathmlcss.xsl");
|
||||
var xslTemplate = new ActiveXObject("MSXML2.XSLTemplate.3.0");
|
||||
xslTemplate.stylesheet=xsl.documentElement;
|
||||
var xslProc = xslTemplate.createProcessor();
|
||||
xslProc.input = document.XMLDocument;
|
||||
xslProc.transform();
|
||||
var str = xslProc.output;
|
||||
<!-- work around bug in IE6 under Win XP, RM 6/5/2002 -->
|
||||
var repl = "replace";
|
||||
if (window.navigator.appVersion.match(/Windows NT 5.1/)) { repl = ""; }
|
||||
var newDoc = document.open("text/html", repl);
|
||||
newDoc.write(str);
|
||||
</SCRIPT>
|
||||
</fns:x>
|
||||
|
||||
|
||||
<h:p>
|
||||
in mpdialog mode, we just write out some JavaScript to display
|
||||
dialog to the reader asking whether they want to install MathPlayer
|
||||
Depending on the response we get, we then instantiate an XSL processor
|
||||
and reprocess the doc, passing $secondpass according to the
|
||||
reader response.
|
||||
</h:p>
|
||||
<h:p>Using d-o-e is fairly horrible, but this code is only for IE
|
||||
anyway, and we need to force HTML semantics in this case.</h:p>
|
||||
|
||||
<xsl:variable name="mpdialog">
|
||||
var cookieName = "MathPlayerInstall=";
|
||||
function MPInstall(){
|
||||
var showDialog=true;
|
||||
var c = document.cookie;
|
||||
var i = c.indexOf(cookieName);
|
||||
if (i >= 0) {
|
||||
if ( c.substr(i + cookieName.length, 1) >= 2) { showDialog=false; }
|
||||
}
|
||||
if (showDialog) {
|
||||
MPDialog();
|
||||
c = document.cookie;
|
||||
i = c.indexOf(cookieName);
|
||||
}
|
||||
if (i >= 0) return c.substr(i + cookieName.length, 1);
|
||||
else return null;
|
||||
}
|
||||
|
||||
function MPDialog() {
|
||||
var vArgs="";
|
||||
var sFeatures="dialogWidth:410px;dialogHeight:190px;help:off;status:no";
|
||||
var text = "";
|
||||
text += "javascript:document.write('"
|
||||
text += '<script>'
|
||||
text += 'function fnClose(v) { '
|
||||
text += 'var exp = new Date();'
|
||||
text += 'var thirtyDays = exp.getTime() + (30 * 24 * 60 * 60 * 1000);'
|
||||
text += 'exp.setTime(thirtyDays);'
|
||||
text += 'var cookieProps = ";expires=" + exp.toGMTString();'
|
||||
text += 'if (document.forms[0].dontask.checked) v+=2;'
|
||||
text += 'document.cookie="' + cookieName + '"+v+cookieProps;'
|
||||
text += 'window.close();'
|
||||
text += '}'
|
||||
text += '</' + 'script>'
|
||||
text += '<head><title>Install MathPlayer?</title></head>'
|
||||
text += '<body bgcolor="#D4D0C8"><form>'
|
||||
text += '<table cellpadding=10 style="font-family:Arial;font-size:10pt" border=0 width=100%>'
|
||||
text += '<tr><td align=left>This page requires Design Science\\\'s MathPlayer&trade;.<br>'
|
||||
text += 'Do you want to download and install MathPlayer?</td></tr>';
|
||||
text += '<tr><td align=center><input type="checkbox" name="dontask">'
|
||||
text += 'Don\\\'t ask me again</td></tr>'
|
||||
text += '<tr><td align=center><input id=yes type="button" value=" Yes "'
|
||||
text += ' onClick="fnClose(1)">&nbsp;&nbsp;&nbsp;'
|
||||
text += '<input type="button" value=" No " onClick="fnClose(0)"></td></tr>'
|
||||
text += '</table></form>';
|
||||
text += '</body>'
|
||||
text += "')"
|
||||
window.showModalDialog( text , vArgs, sFeatures );
|
||||
}
|
||||
|
||||
function WaitDialog() {
|
||||
var vArgs="";
|
||||
var sFeatures="dialogWidth:510px;dialogHeight:150px;help:off;status:no";
|
||||
var text = "";
|
||||
text += "javascript:document.write('"
|
||||
text += '<script>'
|
||||
text += 'window.onload=fnLoad;'
|
||||
text += 'function fnLoad() {document.forms[0].yes.focus();}'
|
||||
text += 'function fnClose(v) { '
|
||||
text += 'window.returnValue=v;'
|
||||
text += 'window.close();'
|
||||
text += '}'
|
||||
text += '</' + 'script>'
|
||||
text += '<head><title>Wait for Installation?</title></head>'
|
||||
text += '<body bgcolor="#D4D0C8" onload="fnLoad()"><form><'
|
||||
text += 'table cellpadding=10 style="font-family:Arial;font-size:10pt" border=0 width=100%>'
|
||||
text += '<tr><td align=left>Click OK once MathPlayer is installed '
|
||||
text += 'to refresh the page.<br>'
|
||||
text += 'Click Cancel to view the page immediately without MathPlayer.</td></tr>';
|
||||
text += '<tr><td align=center><input id=yes type="button" '
|
||||
text += 'value=" OK " onClick="fnClose(1)">&nbsp;&nbsp;&nbsp;'
|
||||
text += '<input type="button" value="Cancel" onClick="fnClose(0)"></td></tr>'
|
||||
text += '</table></form>';
|
||||
text += '</body>'
|
||||
text += "')"
|
||||
return window.showModalDialog( text , vArgs, sFeatures );
|
||||
}
|
||||
|
||||
var result = MPInstall();
|
||||
|
||||
var action = "fallthrough";
|
||||
if (result == 1 || result == 3) {
|
||||
window.open("http://www.dessci.com/webmath/mathplayer");
|
||||
var wait = WaitDialog();
|
||||
if ( wait == 1) {
|
||||
action = "install";
|
||||
document.location.reload();
|
||||
|
||||
}
|
||||
}
|
||||
if (action == "fallthrough") {
|
||||
var xsl = new ActiveXObject("Microsoft.FreeThreadedXMLDOM");
|
||||
xsl.async = false;
|
||||
xsl.validateOnParse = false;
|
||||
xsl.load("pmathmlcss.xsl");
|
||||
var xslTemplate = new ActiveXObject("MSXML2.XSLTemplate.3.0");
|
||||
xslTemplate.stylesheet=xsl.documentElement;
|
||||
var xslProc = xslTemplate.createProcessor();
|
||||
xslProc.input = document.XMLDocument;
|
||||
|
||||
xslProc.transform();
|
||||
var str = xslProc.output;
|
||||
<!-- work around bug in IE6 under Win XP, RM 6/5/2002 -->
|
||||
var repl = "replace";
|
||||
if (window.navigator.appVersion.match(/Windows NT 5.1/)) { repl = ""; }
|
||||
var newDoc = document.open("text/html", repl);
|
||||
newDoc.write(str);
|
||||
document.close();
|
||||
}
|
||||
</xsl:variable>
|
||||
|
||||
<fns:x name="mathplayer-dl" >mathplayer-dl</fns:x>
|
||||
|
||||
<fns:x name="techexplorer-plugin" >techexplorer-plugin</fns:x>
|
||||
|
||||
<xsl:variable name="root" select="/"/>
|
||||
|
||||
|
||||
|
||||
<xsl:param name="activex">
|
||||
<xsl:choose>
|
||||
<xsl:when test="/*/@fns:renderer='techexplorer-plugin'">techexplorer-plugin</xsl:when>
|
||||
<xsl:when test="system-property('xsl:vendor')!='Microsoft'"/>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="docpref" select="document('')/*/fns:x[@name=$root/*/@fns:renderer][1]"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$docpref='mathplayer-dl'">mathplayer-dl</xsl:when>
|
||||
<xsl:when test="$docpref and fns:isinstalled(string($docpref/@o))='true'">
|
||||
<xsl:copy-of select="$docpref/node()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="(document('')/*/fns:x[fns:isinstalled(string(@o))='true'])[1]/node()"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:param>
|
||||
|
||||
<h:div doc:ref="iehack">
|
||||
<h:h3>IE5 hacks</h:h3>
|
||||
<h:p>This code will be ignored by an XSLT engine as a top level
|
||||
element in a foreign namespace. It will be executed by an IE5XSL
|
||||
engine and insert <!-- into the output stream, ie the start of a
|
||||
comment. This will comment out all the XSLT code which will be copied
|
||||
to the output. A similar clause below will close this comment, it is
|
||||
then followed by the IE5XSL templates to be executed.</h:p>
|
||||
<h:p>This trick is due to Jonathan Marsh of Microsoft, and used in
|
||||
<h:a href="http://www.w3.org/TR/2001/WD-query-datamodel-20010607/xmlspec-ie-dm.xsl">the stylesheet for
|
||||
the XPath 2 data model draft</h:a>.</h:p>
|
||||
</h:div>
|
||||
|
||||
<h:h2>XSLT stylesheet</h:h2>
|
||||
<h:h3>MSXSL script block</h:h3>
|
||||
|
||||
<h:p>The following script block implements an extension function that
|
||||
tests whether a specified ActiveX component is known to the client.
|
||||
This is used below to test for the existence of MathML rendering
|
||||
components.</h:p>
|
||||
<msxsl:script language="JScript" implements-prefix="fns">
|
||||
function isinstalled(ax)
|
||||
{
|
||||
try {
|
||||
var ActiveX = new ActiveXObject(ax);
|
||||
return "true";
|
||||
} catch (e) {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
</msxsl:script>
|
||||
|
||||
<h:p>The main bulk of this stylesheet is an identity transformation so...</h:p>
|
||||
<xsl:template match="*|comment()">
|
||||
<xsl:copy>
|
||||
<xsl:copy-of select="@*"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<h:p>XHTML elements are copied sans prefix (XHTML is default namespace
|
||||
here, so these elements will still be in XHTML namespace</h:p>
|
||||
<xsl:template match="h:*">
|
||||
<xsl:element name="{local-name(.)}">
|
||||
<xsl:copy-of select="@*"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>IE's treatment of XHTML as HTML needs a little help here...</h:p>
|
||||
<xsl:template match="h:br|h:hr">
|
||||
<xsl:choose>
|
||||
<xsl:when test="system-property('xsl:vendor')='Microsoft'">
|
||||
<xsl:value-of disable-output-escaping="yes" select="concat('<',local-name(.))"/>
|
||||
<xsl:apply-templates mode="verb" select="@*"/>
|
||||
<xsl:text disable-output-escaping="yes">></xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:element name="{local-name(.)}">
|
||||
<xsl:copy-of select="@*"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>This just ensures the mathml prefix declaration isn't copied from
|
||||
the source at this stage, so that the system will use the mml prefix
|
||||
coming from this stylesheet</h:p>
|
||||
<xsl:template match="h:html|html">
|
||||
<html>
|
||||
<xsl:copy-of select="@*[not(namespace-uri(.)='http://www.w3.org/2002/Math/preference')]"/>
|
||||
<xsl:apply-templates/>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>We modify the head element to add code to specify a Microsoft
|
||||
"Behaviour" if the behaviour component is known to the system.</h:p>
|
||||
<h:span doc:ref="mp">Test for MathPlayer (Design Science)</h:span>
|
||||
<h:span doc:ref="te">Test for Techexplorer (IBM)</h:span>
|
||||
<h:span doc:ref="ms"><h:div>Test for Microsoft. In this case we just
|
||||
output a small HTML file that executes a script that will re-process
|
||||
the source docuument with a different stylesheet. Doing things this
|
||||
way avoids the need to xsl:import the second stylesheet, which would
|
||||
very much increase the processing overhead of running this
|
||||
stylesheet.</h:div></h:span>
|
||||
<h:span doc:ref="other">Further tests (eg for netscape/mozilla) could
|
||||
be added here if necessary</h:span>
|
||||
<xsl:template match="h:head|head">
|
||||
<head>
|
||||
|
||||
<!-- new if for IE frames bug -->
|
||||
<xsl:if test="system-property('xsl:vendor')='Microsoft'">
|
||||
<xsl:if test="name(msxsl:node-set($activex)/*)=''">
|
||||
<object id="mmlFactory"
|
||||
classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987">
|
||||
</object>
|
||||
<xsl:processing-instruction name="import">
|
||||
namespace="mml" implementation="#mmlFactory"
|
||||
</xsl:processing-instruction>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when doc:id="mp" test="$activex='mathplayer-dl'">
|
||||
<xsl:if test="fns:isinstalled('MathPlayer.Factory.1')='false'">
|
||||
<SCRIPT for="window" event="onload">
|
||||
<xsl:value-of select="$mpdialog" disable-output-escaping="yes"/>
|
||||
</SCRIPT>
|
||||
</xsl:if>
|
||||
<xsl:copy-of select="document('')/*/fns:x[@name='mathplayer']"/>
|
||||
</xsl:when>
|
||||
<xsl:when doc:id="mp" test="not($activex='techexplorer-plugin') and system-property('xsl:vendor')='Microsoft'">
|
||||
<xsl:copy-of select="$activex"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise doc:id="other">
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:apply-templates/>
|
||||
</head>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="mml:math" priority="22">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$activex='techexplorer-plugin'">
|
||||
<embed type="text/mathml" height="75" width="300">
|
||||
<xsl:attribute name="mmldata">
|
||||
<xsl:apply-templates mode="verb" select="."/>
|
||||
</xsl:attribute>
|
||||
</embed>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:element name="mml:{local-name(.)}">
|
||||
<xsl:copy-of select="@*"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- squash annotation elements -->
|
||||
|
||||
|
||||
|
||||
<h:p>Somewhat bizarrely in an otherwise namespace aware system,
|
||||
Microsoft behaviours are defined to trigger off the
|
||||
<h:em>prefix</h:em> not the <h:em>Namespace</h:em>. In the code above
|
||||
we associated a MathML rendering behaviour (if one was found) with the
|
||||
prefix <h:code>mml:</h:code> so here we ensure that this is the prefix
|
||||
that actually gets used in the output.</h:p>
|
||||
<xsl:template match="mml:*">
|
||||
<xsl:element name="mml:{local-name(.)}">
|
||||
<xsl:copy-of select="@*"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>Copy semantics element through in IE (so mathplayer gets to see
|
||||
mathplayer annotations, otherwise use first child or a presentation annotation.</h:p>
|
||||
<xsl:template match="mml:semantics">
|
||||
<xsl:choose>
|
||||
<xsl:when test="system-property('xsl:vendor')='Microsoft'">
|
||||
<xsl:element name="mml:{local-name(.)}">
|
||||
<xsl:copy-of select="@*"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
<xsl:when test="mml:annotation-xml[@encoding='MathML-Presentation']">
|
||||
<xsl:apply-templates select="mml:annotation-xml[@encoding='MathML-Presentation']/node()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates select="*[1]"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- a version of my old verb.xsl -->
|
||||
|
||||
<!-- non empty elements and other nodes. -->
|
||||
<xsl:template mode="verb" match="*[*]|*[text()]|*[comment()]|*[processing-instruction()]">
|
||||
<xsl:value-of select="concat('<',local-name(.))"/>
|
||||
<xsl:apply-templates mode="verb" select="@*"/>
|
||||
<xsl:text>></xsl:text>
|
||||
<xsl:apply-templates mode="verb"/>
|
||||
<xsl:value-of select="concat('</',local-name(.),'>')"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- empty elements -->
|
||||
<xsl:template mode="verb" match="*">
|
||||
<xsl:value-of select="concat('<',local-name(.))"/>
|
||||
<xsl:apply-templates mode="verb" select="@*"/>
|
||||
<xsl:text>/></xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- attributes
|
||||
Output always surrounds attribute value by "
|
||||
so we need to make sure no literal " appear in the value -->
|
||||
<xsl:template mode="verb" match="@*">
|
||||
<xsl:value-of select="concat(' ',local-name(.),'=')"/>
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="from" select="'"'"/>
|
||||
<xsl:with-param name="to" select="'&quot;'"/>
|
||||
<xsl:with-param name="string" select="."/>
|
||||
</xsl:call-template>
|
||||
<xsl:text>"</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- pis -->
|
||||
<xsl:template mode="verb" match="processing-instruction()"/>
|
||||
|
||||
<!-- only works if parser passes on comment nodes -->
|
||||
<xsl:template mode="verb" match="comment()"/>
|
||||
|
||||
|
||||
<!-- text elements
|
||||
need to replace & and < by entity references-->
|
||||
<xsl:template mode="verb" match="text()">
|
||||
<a name="{generate-id(.)}"/>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to" select="'&gt;'"/>
|
||||
<xsl:with-param name="from" select="'>'"/>
|
||||
<xsl:with-param name="string">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to" select="'&lt;'"/>
|
||||
<xsl:with-param name="from" select="'<'"/>
|
||||
<xsl:with-param name="string">
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="to" select="'&amp;'"/>
|
||||
<xsl:with-param name="from" select="'&'"/>
|
||||
<xsl:with-param name="string" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- end verb mode -->
|
||||
|
||||
<!-- replace all occurences of the character(s) `from'
|
||||
by the string `to' in the string `string'.-->
|
||||
<xsl:template name="string-replace" >
|
||||
<xsl:param name="string"/>
|
||||
<xsl:param name="from"/>
|
||||
<xsl:param name="to"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($string,$from)">
|
||||
<xsl:value-of select="substring-before($string,$from)"/>
|
||||
<xsl:value-of select="$to"/>
|
||||
<xsl:call-template name="string-replace">
|
||||
<xsl:with-param name="string" select="substring-after($string,$from)"/>
|
||||
<xsl:with-param name="from" select="$from"/>
|
||||
<xsl:with-param name="to" select="$to"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$string"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- end of verb.xsl -->
|
||||
|
||||
|
||||
|
||||
<h:h2>IE5XSL stylesheet</h:h2>
|
||||
<h:p>In a rare fit of sympathy for users of
|
||||
<h:em>the-language-known-as-XSL-in-IE5</h:em> this file incorporates a
|
||||
version of the above code designed to work in the Microsoft dialect.
|
||||
This is needed otherwise users of a MathML rendering behaviour would
|
||||
have to make a choice whether they wanted to use this stylesheet
|
||||
(keeping their source documents conforming XHTML+MathML) or to use
|
||||
the explicit Microsoft Object code, which is less portable, but would
|
||||
work in at least IE5.5.</h:p>
|
||||
|
||||
<h:p>This entire section of code, down to the end of the stylesheet is
|
||||
contained within this ie5:if. Thus XSLT sees it as a top level element
|
||||
from a foreign namespace and silently ignores it. IE5XSL sees it as
|
||||
"if true" and so executes the code.</h:p>
|
||||
|
||||
|
||||
<h:p doc:ref="closecomment">First close the comment started at the beginning. This ensures
|
||||
that the bulk of the XSLT code, while being copied to the result tree
|
||||
by the IE5XSL engine, will not be rendered in the browser.</h:p>
|
||||
|
||||
<h:span doc:ref="eval">Lacking attribute value templates in
|
||||
xsl:element, and the local-name() function, we resort to constructing
|
||||
the start and end tags in strings in javascript, then using
|
||||
no-entities attribute which is the IE5XSL equivalent of disable-output-encoding</h:span>
|
||||
<ie5:if test=".">
|
||||
|
||||
<ie5:eval doc:id="closecomment" no-entities="t">'-->'</ie5:eval>
|
||||
|
||||
<ie5:apply-templates select=".">
|
||||
|
||||
|
||||
<ie5:script>
|
||||
function mpisinstalled()
|
||||
{
|
||||
try {
|
||||
var ActiveX = new ActiveXObject("MathPlayer.Factory.1");
|
||||
return "true";
|
||||
} catch (e) {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
</ie5:script>
|
||||
|
||||
<ie5:template match="/">
|
||||
<ie5:apply-templates/>
|
||||
</ie5:template>
|
||||
|
||||
<ie5:template match="head|h:head"/>
|
||||
|
||||
<ie5:template match="text()">
|
||||
<ie5:value-of select="."/>
|
||||
</ie5:template>
|
||||
|
||||
<ie5:template match="*|@*">
|
||||
<ie5:copy>
|
||||
<ie5:apply-templates select="*|text()|@*"/>
|
||||
</ie5:copy>
|
||||
</ie5:template>
|
||||
|
||||
|
||||
<ie5:template match="mml:*">
|
||||
<ie5:eval no-entities="t" doc:id="eval">'<mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1)</ie5:eval>
|
||||
<ie5:for-each select="@*">
|
||||
<ie5:eval no-entities="t">' ' + this.nodeName</ie5:eval>="<ie5:value-of select="."/>"
|
||||
</ie5:for-each>
|
||||
<ie5:eval no-entities="t">'>'</ie5:eval>
|
||||
<ie5:apply-templates select="*|text()"/>
|
||||
<ie5:eval no-entities="t">'</mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1) + '>'</ie5:eval>
|
||||
</ie5:template>
|
||||
|
||||
|
||||
<ie5:template match="mml:math">
|
||||
<ie5:if expr="mpisinstalled()=='false'">
|
||||
<embed type="text/mathml" height="75" width="300">
|
||||
<ie5:attribute name="mmldata">
|
||||
<ie5:eval doc:id="eval" no-entities="t">'<math>'</ie5:eval>
|
||||
<ie5:apply-templates/>
|
||||
<ie5:eval doc:id="eval" no-entities="t">'</math>'</ie5:eval>
|
||||
</ie5:attribute>
|
||||
</embed>
|
||||
</ie5:if>
|
||||
<ie5:if expr="mpisinstalled()=='true'">
|
||||
<ie5:eval doc:id="eval" no-entities="t">'<mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1)</ie5:eval>
|
||||
<ie5:for-each select="@*">
|
||||
<ie5:eval no-entities="t">' ' + this.nodeName</ie5:eval>="<ie5:value-of select="."/>"
|
||||
</ie5:for-each>
|
||||
<ie5:eval no-entities="t">'>'</ie5:eval>
|
||||
<ie5:apply-templates select="*|text()"/>
|
||||
<ie5:eval no-entities="t">'</mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1) + '>'</ie5:eval>
|
||||
</ie5:if>
|
||||
</ie5:template>
|
||||
|
||||
<ie5:template match="html|h:html">
|
||||
<html xmlns:mml="http://www.w3.org/1998/Math/MathML">
|
||||
<head>
|
||||
<ie5:if expr="mpisinstalled()=='true'">
|
||||
<object id="mmlFactory"
|
||||
classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987">
|
||||
</object>
|
||||
<ie5:pi name="IMPORT">
|
||||
namespace="mml" implementation="#mmlFactory"
|
||||
</ie5:pi>
|
||||
</ie5:if>
|
||||
<ie5:apply-templates select="h:head/*|head/*"/>
|
||||
</head>
|
||||
<body>
|
||||
<ie5:apply-templates select="body|h:body"/>
|
||||
</body>
|
||||
</html>
|
||||
</ie5:template>
|
||||
|
||||
</ie5:apply-templates>
|
||||
|
||||
|
||||
</ie5:if>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
872
source/distro/xslt/pmathmlcss.xsl
Normal file
872
source/distro/xslt/pmathmlcss.xsl
Normal file
|
@ -0,0 +1,872 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!--
|
||||
Presentation MathML Stylesheet
|
||||
-->
|
||||
|
||||
<!--
|
||||
$Id: pmathmlcss.xsl,v 1.1 2002/03/20 12:20:57 mf Exp $
|
||||
|
||||
Copyright David Carlisle 2001, 2002.
|
||||
|
||||
Use and distribution of this code are permitted under the terms of the <a
|
||||
href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
|
||||
>W3C Software Notice and License</a>.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet
|
||||
version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:h="http://www.w3.org/1999/xhtml"
|
||||
xmlns:m="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:doc="http://www.dcarlisle.demon.co.uk/xsldoc"
|
||||
xmlns:x="data:,x"
|
||||
exclude-result-prefixes="x h doc"
|
||||
>
|
||||
|
||||
<h:h2>Dictionary</h:h2>
|
||||
|
||||
<h:p> The following elements in the x: namespace form an
|
||||
implementation of an "Operator Dictionary" for this MathML
|
||||
Implementation. In the case of stretch operators, the element
|
||||
specifies the symbol parts via the latin-1 equivalent character based
|
||||
on the encoding in the symbol font. It is a clear "failure to comply
|
||||
to the spec" that using latin 1 characters (or numeric character
|
||||
references) in the latin 1 range access glyphs in teh symbol font via
|
||||
font position, however most of these character parts are not in
|
||||
Unicode (until 3.2), so there is no standard way to access these characters.</h:p>
|
||||
|
||||
<x:x x="{" m="0em" stretch="true" top="ì" middle="í" extend="ï" bottom="î">{</x:x>
|
||||
<x:x x="}" m="0em" stretch="true" top="ü" middle="ý" extend="ú" bottom="þ">{</x:x>
|
||||
|
||||
<x:x x="(" m="0em" stretch="true" top="æ" middle="ç" extend="ç" bottom="è">(</x:x>
|
||||
<x:x x=")" m="0em" stretch="true" top="ö" middle="÷" extend="÷" bottom="ø">)</x:x>
|
||||
|
||||
<x:x x="[" m="0em" stretch="true" top="é" middle="ê" extend="ê" bottom="ë">[</x:x>
|
||||
<x:x x="]" m="0em" stretch="true" top="ù" middle="ú" extend="ú" bottom="û">]</x:x>
|
||||
|
||||
<x:x x="〚" m="0em" stretch="true" top="éé" middle="êê" extend="êê" bottom="ëë">[[</x:x>
|
||||
<x:x x="〛" m="0em" stretch="true" top="ùù" middle="úú" extend="úú" bottom="ûû">]]</x:x>
|
||||
|
||||
<x:x x="|" m="0em" stretch="true" top="ç" middle="ç" extend="ç" bottom="ç">|</x:x>
|
||||
<x:x x="||" m="0em" stretch="true" top="çç" middle="çç" extend="çç" bottom="çç">||</x:x>
|
||||
|
||||
<x:x x="⁡" m="0em"></x:x><!-- applyfunction -->
|
||||
<x:x x="⁢" m="0em"></x:x><!-- invisibletimes -->
|
||||
<x:x x="-">−</x:x>
|
||||
<x:x x="≃"><span style="position:
|
||||
relative; top: +.1em;">−</span><span style="position:
|
||||
relative; left: -.55em; top: -.2em; margin: 0em;">~</span></x:x>
|
||||
<x:x x="︸" m="0em">_v_</x:x>
|
||||
|
||||
|
||||
<h:p>Remove these for now, as XML parser in IE6 is broken and doesn't
|
||||
accept plane 1 characters.</h:p>
|
||||
<!--
|
||||
<x:x x="𝔸" v="doublestruck">A</x:x>
|
||||
<x:x x="𝔹" v="doublestruck">B</x:x>
|
||||
<x:x x="ℂ" v="doublestruck">C</x:x>
|
||||
<x:x x="𝔻" v="doublestruck">D</x:x>
|
||||
|
||||
<x:x x="𝕒" v="doublestruck">a</x:x>
|
||||
<x:x x="𝕓" v="doublestruck">b</x:x>
|
||||
<x:x x="𝕔" v="doublestruck">c</x:x>
|
||||
<x:x x="𝕕" v="doublestruck">d</x:x>
|
||||
|
||||
<x:x x="𝔄" v="fraktur">A</x:x>
|
||||
<x:x x="𝔅" v="fraktur">B</x:x>
|
||||
<x:x x="ℭ" v="fraktur">C</x:x>
|
||||
<x:x x="𝔇" v="fraktur">D</x:x>
|
||||
|
||||
<x:x x="𝔞" v="fraktur">a</x:x>
|
||||
<x:x x="𝔟" v="fraktur">b</x:x>
|
||||
<x:x x="𝔠" v="fraktur">c</x:x>
|
||||
<x:x x="𝔡" v="fraktur">d</x:x>
|
||||
-->
|
||||
|
||||
<h:p>Grab all of the above into a variable.</h:p>
|
||||
<xsl:variable name="opdict" select="document('')/*/x:x"/>
|
||||
|
||||
<h:h2>HTML elements</h:h2>
|
||||
|
||||
<h:p>
|
||||
XHTML elements get passed straight through, sans namespace prefix.
|
||||
</h:p>
|
||||
<xsl:template match="h:*">
|
||||
<xsl:element name="{local-name(.)}">
|
||||
<xsl:copy-of select="@*"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<h:p>
|
||||
Template for the head element copies the original content, aand in
|
||||
addition adds a script element and CSS style element that implement
|
||||
the core of the MathML renderer.
|
||||
</h:p>
|
||||
|
||||
<h:p doc:ref="malign">
|
||||
The malign function first finds the left most item in the aligngroup, and
|
||||
then modifies the left margin of each item to make them
|
||||
align. (Currently only left alignment is supported.)
|
||||
</h:p>
|
||||
|
||||
<h:p doc:ref="mrowStretch">
|
||||
The mrowStretch function implements stretchy brackets. It is called
|
||||
repeatedly, once for each mo child,after a span corresponding to an
|
||||
mrow. The arguments are the id of teh span and the characters to use
|
||||
for the parts of the stretch operator.
|
||||
constructed fence. The
|
||||
</h:p>
|
||||
|
||||
<h:p doc:ref="css">
|
||||
Inline CSS style block handles all font and size specification for the
|
||||
various MathML operators.
|
||||
</h:p>
|
||||
|
||||
<xsl:template match="h:head">
|
||||
|
||||
<xsl:element name="{local-name(.)}">
|
||||
<xsl:copy-of select="@*"/>
|
||||
<xsl:apply-templates/>
|
||||
|
||||
<script>
|
||||
|
||||
<xsl:text doc:id="malign">
|
||||
function malign (l)
|
||||
{
|
||||
var m = 0;
|
||||
for ( i = 0; i < l.length ; i++)
|
||||
{
|
||||
m = Math.max(m,l[i].offsetLeft);
|
||||
}
|
||||
for ( i = 0; i < l.length ; i++)
|
||||
{
|
||||
l[i].style.marginLeft=m - l[i].offsetLeft;
|
||||
}
|
||||
}
|
||||
</xsl:text>
|
||||
|
||||
<xsl:text doc:id="mrowStretch">
|
||||
function mrowStretch (opid,opt,ope,opm,opb){
|
||||
opH = opid.offsetHeight;
|
||||
var opH;
|
||||
var i;
|
||||
var es;
|
||||
if (mrowH > opH * 2) {
|
||||
m= "<font size='+1' face='symbol'>" + opm + "</font><br/>" ;
|
||||
if ((mrowH < opH * 3) &&(opm == ope) ) m="";
|
||||
es="";
|
||||
for ( i = 3; i <= mrowH / (2*opH) ; i += 1) es += "<font size='+1' face='symbol'>" + ope + "</font><br/>" ;
|
||||
opid.innerHTML="<table class='lr'><tr><td><font size='+1' face='symbol'>" +
|
||||
opt + "</font><br/>" +
|
||||
es +
|
||||
m +
|
||||
es +
|
||||
"<font size='+1' face='symbol'>" + opb + "</font></td></tr></table>";
|
||||
}
|
||||
}
|
||||
</xsl:text>
|
||||
|
||||
<xsl:text doc:id="msubsup">
|
||||
function msubsup (bs,bbs,x,b,p){
|
||||
<!--
|
||||
p.style.setExpression("top",bs +" .offsetTop - " + (p.offsetHeight/2 +(bbs.offsetHeight - Math.max(bbs.offsetHeight, b.offsetHeight + p.offsetHeight)*.5)));
|
||||
-->
|
||||
p.style.setExpression("top",bs +" .offsetTop -" + (p.offsetHeight/2));
|
||||
b.style.setExpression("top",bs + ".offsetTop + " + (bbs.offsetHeight - b.offsetHeight*.5));
|
||||
x.style.setExpression("marginLeft",Math.max(p.offsetWidth,b.offsetWidth));
|
||||
document.recalc(true);
|
||||
}
|
||||
</xsl:text>
|
||||
|
||||
<!--
|
||||
function msubsupzz (bs,x,b,p){
|
||||
p.style.setExpression("top",bs +" .offsetTop - " + bs +
|
||||
"p.offsetHeight/2 +(" + bs + ".offsetHeight - Math.max(" + bs + ".offsetHeight, (" + bs + "b.offsetHeight + " + bs + "p.offsetHeight)*.5))");
|
||||
b.style.setExpression("top",bs + ".offsetTop + " + bs + ".offsetHeight - " + bs + "b.offsetHeight/2");
|
||||
x.style.setExpression("marginLeft","Math.max(" + bs +"p.offsetWidth,"
|
||||
+ bs +"b.offsetWidth)");
|
||||
}
|
||||
-->
|
||||
|
||||
<xsl:text doc:id="msup">
|
||||
function msup (bs,x,p){
|
||||
p.style.setExpression("top",bs +" .offsetTop -" + (p.offsetHeight/2));
|
||||
x.style.setExpression("marginLeft", bs +"p.offsetWidth");
|
||||
x.style.setExpression("height", bs + ".offsetHeight + " + p.offsetHeight);
|
||||
document.recalc(true);
|
||||
}
|
||||
</xsl:text>
|
||||
|
||||
<xsl:text doc:id="msub">
|
||||
function msub (bs,x,p){
|
||||
p.style.setExpression("top",bs +" .offsetTop +" + (p.offsetHeight/2));
|
||||
x.style.setExpression("marginLeft", bs +"p.offsetWidth");
|
||||
x.style.setExpression("height", bs + ".offsetHeight + " + p.offsetHeight);
|
||||
document.recalc(true);
|
||||
}
|
||||
</xsl:text>
|
||||
|
||||
<xsl:text doc:id="toggle">
|
||||
function toggle (x) {
|
||||
for ( i = 0 ; i < x.childNodes.length ; i++) {
|
||||
if (x.childNodes.item(i).style.display=='inline') {
|
||||
x.childNodes.item(i).style.display='none';
|
||||
if ( i+1 == x.childNodes.length) {
|
||||
x.childNodes.item(0).style.display='inline';
|
||||
} else {
|
||||
x.childNodes.item(i+1).style.display='inline';
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</xsl:text>
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
<xsl:text doc:id="css">
|
||||
|
||||
.msubsup {
|
||||
<!--background-color: red;-->
|
||||
font-size: 80%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.munderover {
|
||||
display: inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.lr {
|
||||
display: inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.mi {
|
||||
font-style: serif;
|
||||
}
|
||||
|
||||
|
||||
.mspace{
|
||||
display: inline;
|
||||
}
|
||||
.mtext {
|
||||
font-style: serif;
|
||||
}
|
||||
.ms {
|
||||
font-style: monospace;
|
||||
}
|
||||
|
||||
.mi1 {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.doublestruck {
|
||||
font-family: castellar, algerian,niagara engraved;
|
||||
}
|
||||
.mo {
|
||||
padding-right: .3em;
|
||||
padding-left: .3em;
|
||||
}
|
||||
|
||||
.mn {
|
||||
}
|
||||
|
||||
.msqrt {
|
||||
border-style: solid;
|
||||
border-color: black;
|
||||
border-width: .1em 0pt 0pt .1em;
|
||||
padding-left: .2em;
|
||||
margin-left: 0em;
|
||||
margin-top: .2em;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.actuarial {
|
||||
border-style: solid;
|
||||
border-color: black;
|
||||
border-width: .1em .1em 0pt 0pt ;
|
||||
padding-right: .2em;
|
||||
margin-right: 0em;
|
||||
margin-top: .2em;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.ssa {
|
||||
position:relative; top:+0.5ex;
|
||||
width: 0pt;
|
||||
color: red;
|
||||
}
|
||||
|
||||
|
||||
.mover {
|
||||
margin: 0pt;
|
||||
padding: 0pt;
|
||||
display: inline;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mtable {
|
||||
display: inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
.mfrac {
|
||||
text-align: center;
|
||||
display:inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.mfraca {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.mfracaa {
|
||||
border-width: 0em 0em .2ex 0em ; border-style: solid;
|
||||
border-color: black;
|
||||
}
|
||||
|
||||
|
||||
.mfracb {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.merror{
|
||||
background-color: white ;
|
||||
border-style: solid;
|
||||
border-color: #FF0000;
|
||||
color: #FF0000;
|
||||
}
|
||||
.mphantom{
|
||||
visibility: hidden;
|
||||
}
|
||||
</xsl:text>
|
||||
</style>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>
|
||||
Unimplemented MathML elements get copied literally, in red, mainly as
|
||||
a debugging aid.
|
||||
</h:p>
|
||||
<xsl:template match="m:*">
|
||||
<span style="color: red;"><<xsl:value-of select="local-name(.)"/>></span>
|
||||
<xsl:apply-templates/>
|
||||
<span style="color: red;"></<xsl:value-of select="local-name(.)"/>></span>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>
|
||||
mi: set default font based on string length, otherwise behaviour based
|
||||
on entries in the operator dictionary if one exists, or content is
|
||||
copied through to the output unchanged.
|
||||
</h:p>
|
||||
<xsl:template match="m:mi">
|
||||
<span class="mi">
|
||||
<xsl:if test="1=string-length(normalize-space(.))">
|
||||
<xsl:attribute name="class">mi1</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="@mathvariant"/>
|
||||
<xsl:variable name="x" select="normalize-space(.)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$opdict[@x=$x and @v]">
|
||||
<xsl:attribute name="class"><xsl:value-of select="$opdict[@x=$x]/@v"/></xsl:attribute>
|
||||
<xsl:value-of select="$opdict[@x=$x and @v]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$x"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>
|
||||
Handling of mathvariant attribute.
|
||||
The choice of font families here (currently) avoids math-specific
|
||||
fonts but does use several fionts coming with windows 9.x and/or
|
||||
office 2000.
|
||||
</h:p>
|
||||
<xsl:template match="@mathvariant[.='bold']">
|
||||
<xsl:attribute name="style">font-weight: bold; font-style: upright</xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="@mathvariant[.='bold-italic']">
|
||||
<xsl:attribute name="style">font-style: upright; font-weight: bold; font-style: italic;</xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="@mathvariant[.='italic']">
|
||||
<xsl:attribute name="style">font-style: italic; </xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="@mathvariant[.='monospace']">
|
||||
<xsl:attribute name="style">font-family: monospace; </xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="@mathvariant[.='sans-serif']">
|
||||
<xsl:attribute name="style">font-family: sans-serif; </xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="@mathvariant[.='bold-sans-serif']">
|
||||
<xsl:attribute name="style">font-family: sans-serif; font-weight: bold; </xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="@mathvariant[.='fraktur']">
|
||||
<xsl:attribute name="style">font-family: old english text mt</xsl:attribute>
|
||||
<xsl:attribute name="class"></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="@mathvariant[.='double-struck']">
|
||||
<xsl:attribute name="class">doublestruck</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="@mathvariant[.='script']">
|
||||
<xsl:attribute name="style">font-family: brush script mt italic</xsl:attribute>
|
||||
<xsl:attribute name="class"></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<h:p>mo: Generate a unique ID so that a script at the end of any
|
||||
surrounding mrow may replace the conent by a suitably stretched
|
||||
operator if need be.</h:p>
|
||||
<xsl:template match="m:mo">
|
||||
<span id="{generate-id()}" class="mo">
|
||||
<xsl:apply-templates/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>mn: a simple span</h:p>
|
||||
<xsl:template match="m:mn">
|
||||
<span class="mn">
|
||||
<xsl:apply-templates/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>munder: currently only supports underline, with a bottom border</h:p>
|
||||
<xsl:template match="m:munder">
|
||||
<span class="munder">
|
||||
<xsl:if test="normalize-space(*[2])='̲'">
|
||||
<xsl:attribute
|
||||
name="style">border-width: 0pt 0pt .1em 0pt; border-style: solid;"</xsl:attribute>
|
||||
</xsl:if>
|
||||
<span><xsl:apply-templates select="*[1]"/></span>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>mover: currently only supports overline, with a top border</h:p>
|
||||
<xsl:template match="m:mover">
|
||||
<span class="munder">
|
||||
<xsl:if test="normalize-space(*[2])='¯'">
|
||||
<xsl:attribute
|
||||
name="style">border-width: .1em 0pt 0pt 0pt; border-style: solid;"</xsl:attribute>
|
||||
</xsl:if>
|
||||
<span><xsl:apply-templates select="*[1]"/></span>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>munderover: </h:p>
|
||||
<xsl:template match="m:munderover">
|
||||
<table class="munderover">
|
||||
<tr><td><xsl:apply-templates select="*[3]"/></td></tr>
|
||||
<tr><td><xsl:apply-templates select="*[1]"/></td></tr>
|
||||
<tr><td><xsl:apply-templates select="*[2]"/></td></tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>mtext: a simple span</h:p>
|
||||
<xsl:template match="m:mtext">
|
||||
<span class="mtext">
|
||||
<xsl:value-of select="normalize-space(.)"/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>mstyle: not many attributes currently supported</h:p>
|
||||
<xsl:template match="m:mstyle">
|
||||
<span>
|
||||
<xsl:attribute name="style">
|
||||
<xsl:if test="@color">color: <xsl:value-of select="@color"/>; </xsl:if>
|
||||
<xsl:if test="@background">background-color: <xsl:value-of select="@background"/>; </xsl:if>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<h:p>mglyph: Uses disable output escaping to construct a numeric
|
||||
character reference. Uses IE's non conforming behaviour of using this
|
||||
number to access the font encoding rather than unicode.</h:p>
|
||||
<xsl:template match="m:mglyph">
|
||||
<font face="{@fontfamily}"><xsl:value-of
|
||||
disable-output-escaping="yes" select="'&#'"/>
|
||||
<xsl:value-of select="@index"/>;<xsl:text/>
|
||||
</font>
|
||||
</xsl:template>
|
||||
|
||||
<h:p>ms: a simple span with left and right character added to the content.</h:p>
|
||||
<xsl:template match="m:ms">
|
||||
<span class="ms">
|
||||
<xsl:value-of select="@lquote"/><xsl:if test="not(@lquote)">"</xsl:if>
|
||||
<xsl:value-of select="normalize-space(.)"/>
|
||||
<xsl:value-of select="@rquote"/><xsl:if test="not(@rquote)">"</xsl:if>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:math">
|
||||
<xsl:call-template name="mrow"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<xsl:template match="m:mfenced">
|
||||
<xsl:variable name="l">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@open"><xsl:value-of select="@open"/></xsl:when>
|
||||
<xsl:otherwise>(</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="r">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@close"><xsl:value-of select="@close"/></xsl:when>
|
||||
<xsl:otherwise>)</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="s">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@sep">
|
||||
<xsl:call-template name="text">
|
||||
<xsl:with-param name="x" select="@sep"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>,</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<span id="{generate-id()}L"><xsl:value-of select="$l"/></span>
|
||||
<span id="{generate-id()}M">
|
||||
<xsl:for-each select="*">
|
||||
<xsl:apply-templates select="."/>
|
||||
<xsl:if test="position() != last()"><span id="{generate-id()}X{position()}"><xsl:value-of select="$s"/></span></xsl:if>
|
||||
</xsl:for-each>
|
||||
</span>
|
||||
<span id="{generate-id()}R"><xsl:value-of select="$r"/></span>
|
||||
<script>
|
||||
|
||||
<xsl:if test="$s=$opdict[@stretch='true']/@x">
|
||||
<xsl:for-each select="*[position()<last()]">
|
||||
<xsl:variable name="opdictentry" select="$opdict[@x=$s]"/>
|
||||
mrowStretch(<xsl:value-of select="concat(generate-id(),'X',position())"/>,"<xsl:value-of
|
||||
select="$opdictentry/@top"/>","<xsl:value-of
|
||||
select="$opdictentry/@extend"/>","<xsl:value-of
|
||||
select="$opdictentry/@middle"/>","<xsl:value-of
|
||||
select="$opdictentry/@bottom"/>");</xsl:for-each>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:variable name="opdictentry" select="$opdict[@x=$l]"/>
|
||||
var mrowH = <xsl:value-of select="generate-id()"/>M.offsetHeight;
|
||||
mrowStretch(<xsl:value-of select="generate-id()"/>L,"<xsl:value-of
|
||||
select="$opdictentry/@top"/>","<xsl:value-of
|
||||
select="$opdictentry/@extend"/>","<xsl:value-of
|
||||
select="$opdictentry/@middle"/>","<xsl:value-of
|
||||
select="$opdictentry/@bottom"/>");<xsl:text/>
|
||||
|
||||
<xsl:variable name="opdictentry2" select="$opdict[@x=$r]"/>
|
||||
mrowStretch(<xsl:value-of select="generate-id()"/>R,"<xsl:value-of
|
||||
select="$opdictentry2/@top"/>","<xsl:value-of
|
||||
select="$opdictentry2/@extend"/>","<xsl:value-of
|
||||
select="$opdictentry2/@middle"/>","<xsl:value-of
|
||||
select="$opdictentry2/@bottom"/>");<xsl:text/>
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<xsl:template match="m:mmultiscripts">
|
||||
<table style="display:inline; vertical-align: middle;">
|
||||
<tr>
|
||||
<xsl:for-each select="*[preceding-sibling::m:mprescripts and position() mod 2 = 0]">
|
||||
<td><xsl:apply-templates select="."/></td>
|
||||
</xsl:for-each>
|
||||
<td rowspan="2"><xsl:apply-templates select="*[1]"/></td>
|
||||
<xsl:for-each select="*[not(preceding-sibling::m:mprescripts) and position() !=1 and position() mod 2 = 1]">
|
||||
<td><xsl:apply-templates select="."/></td>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
<tr>
|
||||
<xsl:for-each select="*[preceding-sibling::m:mprescripts and position() mod 2 = 1]">
|
||||
<td><xsl:apply-templates select="."/></td>
|
||||
</xsl:for-each>
|
||||
<xsl:for-each select="*[not(preceding-sibling::m:mprescripts) and
|
||||
not(self::m:mprescripts) and position() mod 2 = 0]">
|
||||
<td><xsl:apply-templates select="."/></td>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:none"></xsl:template>
|
||||
|
||||
<xsl:template match="m:merror">
|
||||
<span class="merror"><xsl:call-template name="mrow"/></span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:mphantom">
|
||||
<span class="mphantom"><xsl:apply-templates/></span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:maction[@type='tooltip']">
|
||||
<span title="{*[2]}"><xsl:apply-templates select="*[1]"/></span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:maction[@type='toggle']">
|
||||
<span id="{generate-id()}" onclick="toggle({generate-id()})">
|
||||
<span style="display:inline;"><xsl:apply-templates select="*[1]"/></span>
|
||||
<xsl:for-each select="*[position() > 1]">
|
||||
<span style="display:none;"><xsl:apply-templates select="."/></span>
|
||||
</xsl:for-each>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:maction[@type='statusline']">
|
||||
<span id="{generate-id()}"
|
||||
onmouseover="window.status='{*[2]}';"
|
||||
onmouseout="window.status='';"
|
||||
>
|
||||
<xsl:apply-templates select="*[1]"/></span>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:maction[@type='highlight']">
|
||||
<span id="{generate-id()}"
|
||||
onmouseover="{generate-id()}.style.backgroundColor='yellow';"
|
||||
onmouseout="{generate-id()}.style.backgroundColor='white';"><xsl:apply-templates/></span>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<xsl:template match="m:mrow" name="mrow">
|
||||
<span id="{generate-id()}" class="mrow">
|
||||
<xsl:apply-templates select="*"/>
|
||||
</span>
|
||||
<xsl:if test="m:mo[@stretch='true' or normalize-space(.)=$opdict[@stretch='true']/@x]">
|
||||
<script>
|
||||
var mrowH = <xsl:value-of select="generate-id()"/>.offsetHeight;
|
||||
<xsl:for-each select="m:mo[@stretch='true' or
|
||||
normalize-space(.)=$opdict[@stretch='true']/@x]">
|
||||
|
||||
<xsl:variable name="o" select="normalize-space(.)"/>
|
||||
<xsl:variable name="opdictentry" select="$opdict[@x=$o]"/>
|
||||
mrowStretch(<xsl:value-of select="generate-id()"/>,"<xsl:value-of
|
||||
select="$opdictentry/@top"/>","<xsl:value-of
|
||||
select="$opdictentry/@extend"/>","<xsl:value-of
|
||||
select="$opdictentry/@middle"/>","<xsl:value-of
|
||||
select="$opdictentry/@bottom"/>");</xsl:for-each>
|
||||
</script>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:msubsup">
|
||||
<span id="{generate-id()}" >
|
||||
<xsl:apply-templates select="*[1]"/></span
|
||||
><span id="{generate-id()}b" class="msubsup"><xsl:apply-templates
|
||||
select="*[2]"/></span
|
||||
><span id="{generate-id()}p" class="msubsup"><xsl:apply-templates
|
||||
select="*[3]"/></span
|
||||
><span id="{generate-id()}x"></span>
|
||||
<script>
|
||||
msubsup("<xsl:value-of select="concat(generate-id(),'",',generate-id(),',',generate-id(),'x,',generate-id(),'b,',generate-id())"/>p);
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h:table//m:msubsup|m:mtable//m:msubsup|m:msubsup"
|
||||
priority="2">
|
||||
<span>
|
||||
<xsl:apply-templates select="*[1]"/>
|
||||
</span
|
||||
><sub><xsl:apply-templates
|
||||
select="*[2]"/></sub>
|
||||
<sup><xsl:apply-templates
|
||||
select="*[3]"/></sup>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:msup
|
||||
">
|
||||
<span id="{generate-id()}">
|
||||
<xsl:apply-templates select="*[1]"/>
|
||||
</span
|
||||
><span id="{generate-id()}p" class="msubsup"><xsl:apply-templates
|
||||
select="*[2]"/></span
|
||||
><span id="{generate-id()}x"></span>
|
||||
<script>
|
||||
msup("<xsl:value-of select="concat(generate-id(),'",',generate-id(),'x,',generate-id())"/>p);
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h:table//m:msup|m:mtable//m:msup|m:msup"
|
||||
priority="2">
|
||||
<span>
|
||||
<xsl:apply-templates select="*[1]"/>
|
||||
</span
|
||||
><sup><xsl:apply-templates
|
||||
select="*[2]"/></sup>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:msub
|
||||
">
|
||||
<span id="{generate-id()}">
|
||||
<xsl:apply-templates select="*[1]"/>
|
||||
</span
|
||||
><span id="{generate-id()}p" class="msubsup"><xsl:apply-templates
|
||||
select="*[2]"/></span
|
||||
><span id="{generate-id()}x"></span>
|
||||
<script>
|
||||
msub("<xsl:value-of select="concat(generate-id(),'",',generate-id(),'x,',generate-id())"/>p);
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h:table//m:msub|m:mtable//m:msub|m:msub"
|
||||
priority="2">
|
||||
<span>
|
||||
<xsl:apply-templates select="*[1]"/>
|
||||
</span
|
||||
><sub><xsl:apply-templates
|
||||
select="*[2]"/></sub>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:*/text()" name="text">
|
||||
<xsl:param name="x" select="normalize-space(.)"/>
|
||||
<xsl:variable name="mo" select="document('')/*/x:x[@x=$x]"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mo"><xsl:copy-of select="$mo/node()"/></xsl:when>
|
||||
<xsl:otherwise><xsl:copy-of select="$x"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:msqrt">
|
||||
<span class="msqrtx">\</span><span class="msqrt">
|
||||
<xsl:apply-templates/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:menclose[@notation='radical']">
|
||||
<span class="msqrtx">\</span><span class="msqrt">
|
||||
<xsl:apply-templates/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:menclose[@notation='actuarial']">
|
||||
<span class="actuarial">
|
||||
<xsl:apply-templates/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:menclose">
|
||||
<span class="msqrt">
|
||||
<xsl:apply-templates/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:mroot">
|
||||
<span class="msqrtx"><sup><xsl:apply-templates select="*[2]"/></sup>\</span><span class="msqrt">
|
||||
<xsl:apply-templates select="*[1]"/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:mfrac">
|
||||
<xsl:param name="full" select="not(ancestor::m:mfrac)"/>
|
||||
<table class="mfrac">
|
||||
<xsl:if test="$full">
|
||||
<xsl:attribute name="style">font-size: 75% ;</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="not($full)">
|
||||
<xsl:attribute name="style">font-size: 100% ;</xsl:attribute>
|
||||
</xsl:if>
|
||||
<tr id="a{generate-id()}" class="mfraca"><td class="mfracaa">
|
||||
<xsl:apply-templates select="*[1]"/>
|
||||
</td></tr>
|
||||
<tr id="b{generate-id()}" class="mfracb"><td>
|
||||
<xsl:apply-templates select="*[2]"/>
|
||||
</td></tr>
|
||||
</table><xsl:if test="$full"><script>
|
||||
if ( a<xsl:value-of select="generate-id()"
|
||||
/>.offsetHeight > b<xsl:value-of select="generate-id()"
|
||||
/>.offsetHeight ) b<xsl:value-of select="generate-id()
|
||||
"/>.style.setExpression("height",a<xsl:value-of select="generate-id()"/>.offsetHeight );
|
||||
else a<xsl:value-of
|
||||
select="generate-id()"/>.style.setExpression("height",b<xsl:value-of
|
||||
select="generate-id()"/>.offsetHeight );
|
||||
</script></xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:padded">
|
||||
<span>
|
||||
<xsl:attribute name="display">
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:mspace">
|
||||
<span style="padding-left: {@width};"></span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:mtable">
|
||||
<table class="mtable">
|
||||
<xsl:apply-templates/>
|
||||
</table>
|
||||
<script>
|
||||
<xsl:variable name="t" select="."/>
|
||||
<xsl:for-each select="m:mtr[1]/m:mtd">
|
||||
<xsl:variable name="c" select="position()"/>
|
||||
<xsl:for-each select="descendant::m:maligngroup">
|
||||
<xsl:variable name="g" select="position()"/>
|
||||
malign([<xsl:for-each
|
||||
select="$t/m:mtr/m:mtd[$c]/descendant::m:maligngroup[$g]">
|
||||
<xsl:value-of select="generate-id()"/>
|
||||
<xsl:if test="position()<last()">,</xsl:if>
|
||||
</xsl:for-each>]);</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
</script>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:mtr">
|
||||
<tr>
|
||||
<xsl:apply-templates/>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="m:mtd">
|
||||
<td>
|
||||
<xsl:apply-templates/>
|
||||
</td>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="m:maligngroup">
|
||||
<xsl:variable name="g">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@groupalign">
|
||||
</xsl:when>
|
||||
<xsl:when test="ancestor::td/@groupalign">
|
||||
</xsl:when>
|
||||
<xsl:when test="ancestor::tr/@groupalign">
|
||||
</xsl:when>
|
||||
<xsl:when test="ancestor::table/@groupalign">
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>left</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<span id="{generate-id()}"></span>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
Loading…
Add table
Add a link
Reference in a new issue