Skip to content
Commits on Source (8)
target
.classpath
.settings
.project
/bin
/dist
*~
sudo: required
language: java
jdk:
- oraclejdk8
- oraclejdk9
- openjdk7
before_install:
- sudo apt-get -qq update
- sudo apt-get build-dep libjlatexmath-java
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
after_success:
- mvn cobertura:cobertura coveralls:report
addons:
hosts:
- jlmhost
hostname: jlmhost
jlatexmath (1.0.7)
* Fix °C
* Fix deformed characters in SVG output by changing font scaling
jlatexmath (1.0.6)
* Add TeX style macros \bangle, \brace and \brack.
* Add the macro \questeq.
* Add the macro \longdiv.
* Add \qquad as a Java macro rather than a String definition
* Fix an issue with predefined string commands with a RowAtom (\qquad used two times)
jlatexmath (1.0.5)
* Remove ligatures info for cyrillic
* Add italic correction only in math mode.
* Add a command \mathnormal.
* Float.MIN_VALUE is not -Float.MAX_VALUE !
* Italic correction was not taken into account when making box for a CharSymbol.
* Support ~ as non breakable space.
jlatexmath (1.0.4)
* Fix color displayed with the command bgcolor.
* Add the linking exception to the license
jlatexmath (1.0.3)
* Pound sign was invalid in roman font.
* Fix paths in MANIFEST.MF
* By default, slightly increase left and right insets.
* Allow use of # in code.
* Add macro \fcscore.
* CharBox not correctly drawn in multithread context
* Add macros \texteuro and \euro ( and map char € on \euro)
* Add macro \st (i.e. strike-through)
* Fix arrow shift in \overrightarrow macro
* Fix several bugs due to modification in VRowAtom.
jlatexmath (1.0.2)
* Fix for ticket 1113: by default interline is 1ex (can be set with TeXIconBuilder::setInterLineSpacing (see Example7))
* Fix bug with maxwidth.
* Use default Java font when char is in an unknown unicode block.
* Fix bug in \LaTeX (due to modification of EM value)
* Fix bug in parser when no chars after command \cr
* Add missing glyph in jlm_cmex10.ttf (char 183)
* jlatexmath-minimal.zip renamed to jlatexmath-minimal-${version}.zip
jlatexmath (1.0.1)
* Negative spaces were not taken into accound at the end of a horizontal
box.
* Add command \Join.
* Fix bad space around \begin{array}...\end{array}
* There were no spaces around fraction (\nulldelimiterspace).
* Eat one white (if it exists) after a \cr.
* Color name must not be case sensitive
* Add an example to connect C++ and JLaTeXMath in using Giws
* Fix bad cmex10.ttf rendering with OpenJDK
* Add \L, \l, \yen, \mathsterling (in unicode too)
* Handle nbsp, \P and \S
* Fix ligatures definitions in XML (\textbf{\text{-7}} was printed as \Omega)
* Handle auto-break after a binop or relation op.
* Spaces were not ignored in tabular options.
* Bad positions of the exponent & indice with Bigr{|}_1^3
* Fix bug with line-breaking (infinite loop on "\\ {abcdef}a" or exceptions).
* Option added for max. width vs exact width.
Thanks to Felix Natter for the patch.
* Update the example to use the TeXIconBuilder.
Thanks to Felix Natter for the patch.
jlatexmath (1.0.0)
* Fix bug 767: U with umlaut was shown as O with umlaut
* Handle breakline in math mode
* Remove String::isEmpty for Java 5 compatibility
* Fix bug 907: bad rendering of text{text{x_1Test}}
jlatexmath (0.9.8)
* Bugs 907 fixed: bad rendering of \text{\text{x_1Test}}.
* Handle breakline.
* Add a static method TexFormula::getAsText to manage breakline and text
as default.
jlatexmath (0.9.7)
* Fix bugs with \bold{\b and \DeclareMathOperator{\ in partial mode.
* Add a static method TeXFormula.getAsText to break the line according to \n and to convert into a RomanAtom.
* newcommand{ threw an exception in partial mode.
* Fix bug with T carron and L carron.
* Add the unicode for Euler's constant.
* Fix bug when getting length.
* Add the TeX macros: \above and \abovewithdelims.
* Blanks after a command were skipped in text mode.
* Extend the way to code colors in \textcolor, \colorbox, \fcolorbox,
fgcolor and bgcolor.
Now \textcolor{color} where color could be 255,0,0 (int RGB) or
1.0,0,0 (float RGB) or 1.0,0,0,0.5 (float CMYK) or 0.6 (Gray) or
#FF0000 (html RGB) or FF0000 (hexa RGB) are accepted.
* \v accent was badly scaled in certain font files.
* Resizebox could lead to a box with NaN as dimensions !
* Add " for ''
* Bug with \fg
* Add a command \jlmXML which can replaces $foo by the value of foo
attribute.
* Add the possibility to add a break in a line in using \-.
* Bad type for FencedAtom.
* Bad translation of &8821; (right guillemet) into LaTeX.
* Issue with default color in TeXIcon.
* Fix build problems.
* Change FSF address in LICENSE files.
* Add a check !=null in cache.
* Bugs fix: Columns was not centered in matrix env and \cot was
displayed as \cos.
* Add an option in jlmDynamic ([i]) to give the possibility to insert
a group as if it was not a group.
jlatexmath (0.9.6)
* A TeXFormula.root must not be null in partial mode.
* Provide a manifest for the fop plugin defining the dependency on the
jlatexmath jar package
jlatexmath (0.9.5)
* Remove the Java reflection use and reorganization in the fonts dir.
* Delegate the font rendering to java.
* add \jlmText,\jlmTextit,\jlmTextbf,\jlmTextitbf and \jlmExternalFont
* \huge\huge bug definitly fixed
* \huge\huge foo apply two times the huge factor
* In \overbrace{a}, the brace were misplaced.
* Add \(...\) & \[...\], $$...$$, \begin{math}...\end{math} and
\begin{displaymath}...\end{displaymath}
* No display with \left in partial mode
* The fop plugin is now available with fop 0.95 and 1.0
* \left(...\right) was inactive in \mathsf
-- Calixte Denizet <calixte@contrib.scilab.org>
jlatexmath (0.9.4)
* Update build.xml to add a base directory in zip archives.
* Add \og and \fg.
* In text mode, the normal dot must be a punctuation symbol.
* Add \cal.
* Add \it, \bf, \sc, ...
* Add commands \textsc and \textcircled.
* Fix a bug in the FOP plugin when latex is mixed with other
image source.
* $...$ was ignored
* Add \raisebox and \romannumeral.
* Handle options in \includegraphics.
* Add a static method TeXFormula.setDefaultDPI().
* Add a static method TeXFormula.setDPITarget(float dpi).
* Add shadowbox, doublebox and ovalbox.
* Fix bugs on rotatebox (bad default center), with the parser
(...\end{foo}a... gave an error)) and improve the debug mode.
* Add Unicode chars again and forgotten commands
* Avoid the loading of Greek fonts in math mode in GeoGebra.
* Add characters in Unicode.
* Fix a bug on \bigtriangleup and \bigtriangledown (use stmary ones)
* Add support for few Unicode characters.
* Fix a bug of cyclic referency between atoms coming from Unicode
mapping.
* Convert foreign numbers into roman ones
* Add a preview of an error in partial mode
* Add the left quote and reduce slightly the space under for underarrows
* The percent for comments was not handled
* HTML entity &#8495; forgotten
* Fix bug in aligned & alignedat env. (thanks to Graeme Kidd)
* Add a thread-safe cache to cache the images generated from a formula
* Can use dollar in \text or \mbox to switch into math mode
* Add a static method TeXFormula.getPartialTeXFormula(String) which
ignores errors and returns a partial TeXFormula (with no errors).
Useful to display LaTeX on typing.
* JLM is now ready for support FOP 1.0 :)
* Fix a bug in jlmDynamic where the contents where preprocessed
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr>
jlatexmath (0.9.3)
* 0.9.3 version
* Fix bug of size with colored box
* Add a map between Unicode (math) and LaTeX symbols
(e.g. &#8734; => \infty)
* problem with @{blah} in array env.
jlatexmath (0.9.2)
* add new commands \tiny, \footnotesize,... and \overwithdelims,...
* Handle vertical and horizontal lines in array environment
* Fix bug in the render of (over|under)braces
* Fix bug with A{\scriptstyle BCD}E
* Fix bug with \left(A\leftarrow B\right)
* Fix bug with option *{20}c in array env.
* An argument beginning with \left must be closed by \right (thanks to Juan Enrique)
* Fix bug with \over (http://bugzilla.scilab.org/show_bug.cgi?id=7226)
* Improve the render of a cfrac (thanks to Juan Enrique)
* Improve the way to get the arguments of a macro (thanks to Juan Enrique)
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr>
* Add cfrac macro
* Possibility to have empty columns in array
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr>
jlatexmath (0.9.1)
* Few modifications in fop-plugin and improve \includegraphics
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr>
* Moved fop.properties at the root directory (this is only needed to
build and run fop plugin)
* examples/Export/build.xml uses fop.properties
-- Sylvestre Ledru <sylvestre.ledru@scilab.org> Tue, 16 Feb 2010 10:51:04 +0100
jlatexmath (0.9)
* Avoid two generations of labels with fop.
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Fri, 12 Feb 2010 18:23:56 +0100
jlatexmath (0.8.9)
* Add new environments of amsmath : gather, flalign, alignat...
* Add commands genfrac, rule, underscore, hdotsfor, multicolumn, ...
* Add commands \textsuperscript et \textsubscript
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Thu, 11 Feb 2010 15:32:27 +0100
jlatexmath (0.8.7)
* Add the command \prescript
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Mon, 11 Jan 2010 19:07:18 +0100
* Add the commands \mathclap, \mathrlap, \mathllap, \clap, \rlap and \llap
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Mon, 11 Jan 2010 16:29:51 +0100
* A basic (without options) \includegraphics command added
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Sun, 10 Jan 2010 22:17:04 +0100
jlatexmath (0.8.6)
* \over, \hspace and \vspace are supported
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Sun, 10 Jan 2010 14:59:45 +0100
jlatexmath (0.8.5)
* add a stroke T
* Fix few bugs of rendering : cedilla, mathbf
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Sun, 03 Jan 2010 18:35:12 +0100
* Complete unicode table for latin alphabets
* Fix few bugs of rendering
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Sat, 02 Jan 2010 20:03:36 +0100
jlatexmath (0.8.4)
* Greek support added
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Thu, 31 Dec 2009 16:10:23 +0100
jlatexmath (0.8.3)
* Cyrillic is now supported with unicode encoding (so we can search a cyrillic string in a pdf)
* Fix several little bugs
* Usage of commands such as \mathrm, \mathit, ... has been improved
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Wed, 30 Dec 2009 17:33:47 +0100
* Adds \fgcolor and \bgcolor
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Sat, 26 Dec 2009 21:05:38 +0100
* Fixes a bug with kerns pairs.
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Fri, 25 Dec 2009 00:03:44 +0100
* Provides a target to build the doc "ant doc"
-- Sylvestre Ledru <Sylvestre.ledru@scilab.org> Wed, 16 Dec 2009 14:33:26 +0100
jlatexmath (0.8.2)
* Fixes a bad sqrt symbol and adds a little space after an atom under a sqrt
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Thu, 17 Dec 2009 21:27:38 +0100
jlatexmath (0.8.1)
* Fixes a regression in the version 0.8
-- Sylvestre Ledru <Sylvestre.ledru@scilab.org> Wed, 16 Dec 2009 14:33:26 +0100
jlatexmath (0.8)
* Jlatexmath can now compile under Java 1.5 (registerFont is disabled
in this case).
-- Sylvestre Ledru <Sylvestre.ledru@scilab.org> Tue, 15 Dec 2009 17:46:18 +0100
jlatexmath (0.7)
* Bad name in MANIFEST for stmary
-- Calixte Denizet <Calixte.Denizet@ac-rennes.fr> Thu, 12 Dec 2009 15:50:38 +0100
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, 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 or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
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 give any other recipients of the Program a copy of this License
along with the Program.
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 Program or any portion
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
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 Program, 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 Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) 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; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, 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 executable. However, as a
special exception, the source code 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.
If distribution of executable or 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 counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program 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.
5. 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 Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program 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 to
this License.
7. 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 Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program 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 Program.
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.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program 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.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 Program
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 Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, 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
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
JLaTeXMath Library - Displays LaTeX commands
JLateXMath is an fork of JMathTeX with a lot of modifications to support
many more LaTeX commands, drop of the jdom dependency and easy evolution
capabilities.
Copyright (C) 2009-2011 DENIZET Calixte
Copyright (C) Kris Coolsaet
Copyright (C) Nico Van Cleemput
Copyright (C) Kurt Vermeulen
Copyright 2004-2007 Universiteit Gent
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301, USA.
Linking this library statically or dynamically with other modules
is making a combined work based on this library. Thus, the terms
and conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce
an executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under terms
of your choice, provided that you also meet, for each linked independent
module, the terms and conditions of the license of that module.
An independent module is a module which is not derived from or based
on this library. If you modify this library, you may extend this exception
to your version of the library, but you are not obliged to do so.
If you do not wish to do so, delete this exception statement from your
version.
The archive contains several fonts :
1) the fonts eufb10.ttf, eufm10.ttf, msam10.ttf and msbm10.ttf are under OFL (Open Font License);
2) the font dsrom10.ttf is under a free license;
3) the font stmary10.ttf and rsfs10.ttf are in PD (Public Domain);
4) the fonts cmbsy10.ttf, cmbx10.ttf, cmbxti10.ttf, cmex10.ttf, cmmi10.ttf, cmr10.ttf, cmss10.ttf, cmssbx10.ttf, cmsy10.ttf and cmtt10.ttf are under Knuth License.
5) the greek fonts fcmbipg.ttf, fcmripg.tff, fcmrpg.ttf, fcsropg.ttf, fcmbpg.ttf, fcsbpg.ttf, fctrpg.ttf, fcsrpg.ttf are under GNU GPL version 2.
6) the cyrillic fonts wnbx10.ttf, wnss10.ttf, wnti10.ttf, wnr10.ttf, wnssi10.ttf, wnbxti10.ttf, wnssbx10.ttf, wntt10.ttf are under Knuth License.
You can find a copy of these licenses in org/scilab/forge/jlatexmath/fonts/licences.
<img src="docs/images/Logo.png"/>
<a href="https://travis-ci.org/opencollab/jlatexmath"><img src="https://travis-ci.org/opencollab/jlatexmath.svg"/></a><br/>
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.scilab.forge/jlatexmath/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/org.scilab.forge/jlatexmath)<br/>
[![Coverage Status](https://coveralls.io/repos/github/opencollab/jlatexmath/badge.svg?branch=master)](https://coveralls.io/github/opencollab/jlatexmath?branch=master)
JLaTeXMath is a Java library. Its main purpose is to display mathematical formulas written in LaTeX. JLaTeXMath is the best Java library to display LaTeX code.
This library is used by numerous important projects like <a href="http://www.scilab.org/">Scilab</a>, <a href="http://www.geogebra.org/">Geogebra</a>, <a href="http://freeplane.sourceforge.net">Freeplane</a>, <a href="http://www.mathpiper.org/">Mathpiper</a>, <a href="http://db-maths.nuxit.net/CaRMetal/index_en.html">CaRMetal</a>, <a href="http://ultrastudio.org/">Ultrastudio</a>, etc.
The default encoding is UTF-8.
Most LaTeX commands are available including:
* macros from <i>amsmath</i> and symbols from <i>amssymb</i> and <i>stmaryrd</i>
* `\includegraphics` (without options)
* TeX macro `\over`
* accents from <i>amsxtra</i> package
* macros `\definecolor`, `\textcolor`, `\colorbox` and `\fcolorbox` from the package <i>color</i>
* macros `\rotatebox`, `\reflectbox` and `\scalebox` from the package <i>graphicx</i>
* most latin unicode characters are available and cyrillic or greek characters are in the artifacts <i>jlatexmath-font-cyrillic</i> and <i>jlatexmath-font-greek</i>
* commands `\newcommand` and `\newenvironment`
* environments `array`, `matrix`, `pmatrix`,..., `eqnarray`, `cases`
* vertical and horizontal lines are handled in array environment
* commands to change the size of the font are available : `\tiny`, `\small`,...,`\LARGE`, `\huge`, `\Huge`
* fonts which are embedded in the jlatexmath jar file for use by <a href="http://xmlgraphics.apache.org/fop/">fop 1.0</a> to generate PDF, PS or EPS (SVG export with shaped fonts works fine too). Since jlatexmath version 0.9.5, the fop plugin is fully compatible with fop 1.0 and xmlgraphics 1.4
* and probably other things I forgot...
A few examples are available in the source distribution, they show how to use <i>JLaTeXMath</i> and how to write new commands using Java.
A first example :
&nbsp;&nbsp;&nbsp;&nbsp;<img src="docs/images/Formula1.png"/>
a second one :
&nbsp;&nbsp;&nbsp;&nbsp;<img src="docs/images/Formula2.png"/>
and a third one :
&nbsp;&nbsp;&nbsp;&nbsp;<img src="docs/images/Formula3.png"/>
<i>JLaTeXMath</i> is used by <a href="http://www.scilab.org">Scilab</a> to display formulas written in LaTeX in graphic windows:
<img src="docs/images/ScilabScreenshot.png"/>
<i>JLaTeXMath</i> is a fork of the excellent project <a href="http://jmathtex.sourceforge.net/">JMathTeX</a>.
To build the jlatexmath artifacts just type
mvn clean install
Some examples are provided to show how to use easily the library.
Have fun and if you meet any problem, don't hesitate to create a new issue on github.
## License
Regarding JLaTeXMath’s Classpath Exception and JavaScript: If you use the Google Web Toolkit (GWT) to compile JLaTeXMath to an “executable” (in JavaScript) you can then include/link this “executable” JavaScript library on a website or inside another program. In this case the rest of the website/program need not be licensed under the GPL.
## Benchmarks
To run jmh benchmarks (measuring parse and render performance):
```bash
# benchmarks are in core module
cd jlatexmath
mvn clean install -P benchmark
```
## Code coverage
To run code coverage
```bash
mvn -DrepoToken=TOKEN clean cobertura:cobertura coveralls:report
```
The minimal JLaTeXMath distribution doesn't contain the fonts, they're in separate jars. This kind of distribution is useful for web applications and I wrote it for GeoGebra team, if you want register a new alphabet just use for example :
WebStartAlphabetRegistration.register(AlphabetRegistration.JLM_GREEK);
the package jlm_greek.jar will be load if and only if greek language is present the text.
Calixte.
\ No newline at end of file
libjlatexmath-java (1.0.6-1.1) UNRELEASED; urgency=medium
libjlatexmath-java (1.0.7-1) unstable; urgency=medium
* Non-maintainer upload.
[ Felix Natter ]
* Moved the package to Git
-- Felix Natter <fnatter@gmx.net> Wed, 01 Nov 2017 09:53:59 +0100
[ Sylvestre Ledru ]
* New upstream release (and imported in the git repo)
* Package moved to salsa
* Standards-Version: 4.1.3
-- Sylvestre Ledru <sylvestre@debian.org> Wed, 18 Apr 2018 08:28:25 +0200
libjlatexmath-java (1.0.6-1) unstable; urgency=medium
......
......@@ -8,9 +8,9 @@ Build-Depends-Indep: libbuild-helper-maven-plugin-java (>= 3.0.0),
libbatik-java,
libfop-java,
libxmlgraphics-commons-java
Standards-Version: 4.1.1
Vcs-Git: https://anonscm.debian.org/git/pkg-java/libjlatexmath-java.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/libjlatexmath-java.git
Standards-Version: 4.1.3
Vcs-Git: https://salsa.debian.org/science-team/libjlatexmath-java.git
Vcs-Browser: https://salsa.debian.org/science-team/libjlatexmath-java
Homepage: https://github.com/opencollab/jlatexmath
Package: libjlatexmath-java
......
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.scilab.forge</groupId>
<artifactId>jlatexmath-parent</artifactId>
<version>1.0.7</version>
</parent>
<artifactId>jlatexmath-example-export</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>Examples of exporting latex formulas as PNG, PDF, SVG, EPS</description>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>jlatexmath</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<version>${fop.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-codec</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>xmlgraphics-commons</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus.staging.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</configuration>
</plugin>
</plugins>
</build>
</project>
In using fop 0.95 it's possible to generate PDF, PS or EPS via a SVG file.
The glyphs can be converted into path to avoid the embedding of the fonts and make readable SVG files for the web or other usage.
To compile check you have put in the classpath or in a directory you can precise in build.xml (with the variable myclasspath), the following jars :
fop.jar
avalon-framework.jar
xml-apis-ext.jar
commons-io.jar
commons-logging.jar
\ No newline at end of file
package org.scilab.forge.jlatexmath.examples.export;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Insets;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import javax.swing.JLabel;
import org.apache.batik.dom.GenericDOMImplementation;
import org.apache.batik.svggen.SVGGeneratorContext;
import org.apache.batik.svggen.SVGGraphics2D;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.fop.render.ps.EPSTranscoder;
import org.apache.fop.render.ps.PSTranscoder;
import org.apache.fop.svg.AbstractFOPTranscoder;
import org.apache.fop.svg.PDFTranscoder;
import org.scilab.forge.jlatexmath.DefaultTeXFont;
import org.scilab.forge.jlatexmath.TeXConstants;
import org.scilab.forge.jlatexmath.TeXFormula;
import org.scilab.forge.jlatexmath.TeXIcon;
import org.scilab.forge.jlatexmath.cyrillic.CyrillicRegistration;
import org.scilab.forge.jlatexmath.greek.GreekRegistration;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
public class Convert {
public static final int PDF = 0;
public static final int PS = 1;
public static final int EPS = 2;
public static void toSVG(String latex, String file, boolean fontAsShapes) throws IOException {
DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
String svgNS = "http://www.w3.org/2000/svg";
Document document = domImpl.createDocument(svgNS, "svg", null);
SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);
SVGGraphics2D g2 = new SVGGraphics2D(ctx, fontAsShapes);
DefaultTeXFont.registerAlphabet(new CyrillicRegistration());
DefaultTeXFont.registerAlphabet(new GreekRegistration());
TeXFormula formula = new TeXFormula(latex);
TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20);
icon.setInsets(new Insets(5, 5, 5, 5));
g2.setSVGCanvasSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
g2.setColor(Color.white);
g2.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight());
JLabel jl = new JLabel();
jl.setForeground(new Color(0, 0, 0));
icon.paintIcon(jl, g2, 0, 0);
boolean useCSS = true;
FileOutputStream svgs = new FileOutputStream("target/" + file);
Writer out = new OutputStreamWriter(svgs, "UTF-8");
g2.stream(out, useCSS);
svgs.flush();
svgs.close();
}
public static void SVGTo(String inSVG, String out, int type) {
AbstractFOPTranscoder trans;
switch (type) {
case PDF:
trans = new PDFTranscoder();
break;
case PS:
trans = new PSTranscoder();
break;
case EPS:
trans = new EPSTranscoder();
break;
default:
trans = null;
}
try {
String filename = "target/" + inSVG;
System.out.println("transcoding "
+ filename);
TranscoderInput input = new TranscoderInput(new FileInputStream(filename));
OutputStream os = new FileOutputStream("target/" + out);
TranscoderOutput output = new TranscoderOutput(os);
trans.transcode(input, output);
os.flush();
os.close();
} catch (Exception e) {
System.out.println(
"Problem when exporting " + inSVG + " to " + out + "!\n" + e.toString());
throw new RuntimeException(e);
}
}
}
/* Example1.java
* =========================================================================
* This file is part of the JLaTeXMath Library - http://jlatexmath.sourceforge.net
*
* Copyright (C) 2009 DENIZET Calixte
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* A copy of the GNU General Public License can be found in the file
* LICENSE.txt provided with the source distribution of this program (see
* the META-INF directory in the source jar). This license can also be
* found on the GNU website at http://www.gnu.org/licenses/gpl.html.
*
* If you did not receive a copy of the GNU General Public License along
* with this program, contact the lead developer, or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* Linking this library statically or dynamically with other modules
* is making a combined work based on this library. Thus, the terms
* and conditions of the GNU General Public License cover the whole
* combination.
*
* As a special exception, the copyright holders of this library give you
* permission to link this library with independent modules to produce
* an executable, regardless of the license terms of these independent
* modules, and to copy and distribute the resulting executable under terms
* of your choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module.
* An independent module is a module which is not derived from or based
* on this library. If you modify this library, you may extend this exception
* to your version of the library, but you are not obliged to do so.
* If you do not wish to do so, delete this exception statement from your
* version.
*
*/
package org.scilab.forge.jlatexmath.examples.export;
import java.io.IOException;
/**
* A class to test LaTeX rendering.
**/
public class Example1 {
public static void main(String[] args) {
String latex = "\\begin{array}{lr}\\mbox{\\textcolor{Blue}{Russian}}&\\mbox{\\textcolor{Melon}{Greek}}\\\\";
latex += "\\mbox{" + "привет мир".toUpperCase() + "}&\\mbox{" + "γειά κόσμο".toUpperCase() + "}\\\\";
latex += "\\mbox{привет мир}&\\mbox{γειά κόσμο}\\\\";
latex += "\\mathbf{\\mbox{привет мир}}&\\mathbf{\\mbox{γειά κόσμο}}\\\\";
latex += "\\mathit{\\mbox{привет мир}}&\\mathit{\\mbox{γειά κόσμο}}\\\\";
latex += "\\mathsf{\\mbox{привет мир}}&\\mathsf{\\mbox{γειά κόσμο}}\\\\";
latex += "\\mathtt{\\mbox{привет мир}}&\\mathtt{\\mbox{γειά κόσμο}}\\\\";
latex += "\\mathbf{\\mathit{\\mbox{привет мир}}}&\\mathbf{\\mathit{\\mbox{γειά κόσμο}}}\\\\";
latex += "\\mathbf{\\mathsf{\\mbox{привет мир}}}&\\mathbf{\\mathsf{\\mbox{γειά κόσμο}}}\\\\";
latex += "\\mathsf{\\mathit{\\mbox{привет мир}}}&\\mathsf{\\mathit{\\mbox{γειά κόσμο}}}\\\\";
latex += "&\\\\";
latex += "\\mbox{\\textcolor{Salmon}{Bulgarian}}&\\mbox{\\textcolor{Tan}{Serbian}}\\\\";
latex += "\\mbox{здравей свят}&\\mbox{Хелло уорлд}\\\\";
latex += "&\\\\";
latex += "\\mbox{\\textcolor{Turquoise}{Bielorussian}}&\\mbox{\\textcolor{LimeGreen}{Ukrainian}}\\\\";
latex += "\\mbox{прывітаньне Свет}&\\mbox{привіт світ}\\\\";
latex += "\\end{array}";
try {
Convert.toSVG(latex, "Example1.svg", false);
Convert.toSVG(latex, "Example1_shaped.svg", true);
Convert.SVGTo("Example1.svg", "Example1.pdf", Convert.PDF);
Convert.SVGTo("Example1_shaped.svg", "Example1_shaped.pdf", Convert.PDF);
Convert.SVGTo("Example1.svg", "Example1.ps", Convert.PS);
Convert.SVGTo("Example1.svg", "Example1.eps", Convert.EPS);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}
/* Example2.java
* =========================================================================
* This file is part of the JLaTeXMath Library - http://jlatexmath.sourceforge.net
*
* Copyright (C) 2009 DENIZET Calixte
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* A copy of the GNU General Public License can be found in the file
* LICENSE.txt provided with the source distribution of this program (see
* the META-INF directory in the source jar). This license can also be
* found on the GNU website at http://www.gnu.org/licenses/gpl.html.
*
* If you did not receive a copy of the GNU General Public License along
* with this program, contact the lead developer, or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* Linking this library statically or dynamically with other modules
* is making a combined work based on this library. Thus, the terms
* and conditions of the GNU General Public License cover the whole
* combination.
*
* As a special exception, the copyright holders of this library give you
* permission to link this library with independent modules to produce
* an executable, regardless of the license terms of these independent
* modules, and to copy and distribute the resulting executable under terms
* of your choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module.
* An independent module is a module which is not derived from or based
* on this library. If you modify this library, you may extend this exception
* to your version of the library, but you are not obliged to do so.
* If you do not wish to do so, delete this exception statement from your
* version.
*
*/
package org.scilab.forge.jlatexmath.examples.export;
import java.io.IOException;
/**
* A class to test LaTeX rendering.
**/
public class Example2 {
public static void main(String[] args) {
String latex = "\\begin{array}{l}";
latex += "\\forall\\varepsilon\\in\\mathbb{R}_+^*\\ \\exists\\eta>0\\ |x-x_0|\\leq\\eta\\Longrightarrow|f(x)-f(x_0)|\\leq\\varepsilon\\\\";
latex += "\\det\\begin{bmatrix}a_{11}&a_{12}&\\cdots&a_{1n}\\\\a_{21}&\\ddots&&\\vdots\\\\\\vdots&&\\ddots&\\vdots\\\\a_{n1}&\\cdots&\\cdots&a_{nn}\\end{bmatrix}\\overset{\\mathrm{def}}{=}\\sum_{\\sigma\\in\\mathfrak{S}_n}\\varepsilon(\\sigma)\\prod_{k=1}^n a_{k\\sigma(k)}\\\\";
latex += "\\sideset{_\\alpha^\\beta}{_\\gamma^\\delta}{\\begin{pmatrix}a&b\\\\c&d\\end{pmatrix}}\\\\";
latex += "\\int_0^\\infty{x^{2n} e^{-a x^2}\\,dx} = \\frac{2n-1}{2a} \\int_0^\\infty{x^{2(n-1)} e^{-a x^2}\\,dx} = \\frac{(2n-1)!!}{2^{n+1}} \\sqrt{\\frac{\\pi}{a^{2n+1}}}\\\\";
latex += "\\int_a^b{f(x)\\,dx} = (b - a) \\sum\\limits_{n = 1}^\\infty {\\sum\\limits_{m = 1}^{2^n - 1} {\\left( { - 1} \\right)^{m + 1} } } 2^{ - n} f(a + m\\left( {b - a} \\right)2^{-n} )\\\\";
latex += "\\int_{-\\pi}^{\\pi} \\sin(\\alpha x) \\sin^n(\\beta x) dx = \\textstyle{\\left \\{ \\begin{array}{cc} (-1)^{(n+1)/2} (-1)^m \\frac{2 \\pi}{2^n} \\binom{n}{m} & n \\mbox{ odd},\\ \\alpha = \\beta (2m-n) \\\\ 0 & \\mbox{otherwise} \\\\ \\end{array} \\right .}\\\\";
latex += "L = \\int_a^b \\sqrt{ \\left|\\sum_{i,j=1}^ng_{ij}(\\gamma(t))\\left(\\frac{d}{dt}x^i\\circ\\gamma(t)\\right)\\left(\\frac{d}{dt}x^j\\circ\\gamma(t)\\right)\\right|}\\,dt\\\\";
latex += "\\begin{array}{rl} s &= \\int_a^b\\left\\|\\frac{d}{dt}\\vec{r}\\,(u(t),v(t))\\right\\|\\,dt \\\\ &= \\int_a^b \\sqrt{u'(t)^2\\,\\vec{r}_u\\cdot\\vec{r}_u + 2u'(t)v'(t)\\, \\vec{r}_u\\cdot\\vec{r}_v+ v'(t)^2\\,\\vec{r}_v\\cdot\\vec{r}_v}\\,\\,\\, dt. \\end{array}\\\\";
latex += "\\end{array}";
try {
Convert.toSVG(latex, "Example2.svg", false);
Convert.toSVG(latex, "Example2_shaped.svg", true);
Convert.SVGTo("Example2.svg", "Example2.pdf", Convert.PDF);
Convert.SVGTo("Example2_shaped.svg", "Example2_shaped.pdf", Convert.PDF);
Convert.SVGTo("Example2.svg", "Example2.ps", Convert.PS);
Convert.SVGTo("Example2.svg", "Example2.eps", Convert.EPS);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}
/* Example3.java
* =========================================================================
* This file is part of the JLaTeXMath Library - http://jlatexmath.sourceforge.net
*
* Copyright (C) 2009 DENIZET Calixte
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* A copy of the GNU General Public License can be found in the file
* LICENSE.txt provided with the source distribution of this program (see
* the META-INF directory in the source jar). This license can also be
* found on the GNU website at http://www.gnu.org/licenses/gpl.html.
*
* If you did not receive a copy of the GNU General Public License along
* with this program, contact the lead developer, or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* Linking this library statically or dynamically with other modules
* is making a combined work based on this library. Thus, the terms
* and conditions of the GNU General Public License cover the whole
* combination.
*
* As a special exception, the copyright holders of this library give you
* permission to link this library with independent modules to produce
* an executable, regardless of the license terms of these independent
* modules, and to copy and distribute the resulting executable under terms
* of your choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module.
* An independent module is a module which is not derived from or based
* on this library. If you modify this library, you may extend this exception
* to your version of the library, but you are not obliged to do so.
* If you do not wish to do so, delete this exception statement from your
* version.
*
*/
package org.scilab.forge.jlatexmath.examples.export;
import java.io.IOException;
/**
* A class to test LaTeX rendering.
**/
public class Example3 {
public static void main(String[] args) {
String latex = "\\definecolor{gris}{gray}{0.9}";
latex += "\\definecolor{noir}{rgb}{0,0,0}";
latex += "\\definecolor{bleu}{rgb}{0,0,1}\\newcommand{\\pa}{\\left|}";
latex += "\\begin{array}{c}";
latex += "\\JLaTeXMath\\\\";
latex += "\\begin{split}";
latex += " &Тепловой\\ поток\\ \\mathrm{Тепловой\\ поток}\\ \\mathtt{Тепловой\\ поток}\\\\";
latex += " &\\boldsymbol{\\mathrm{Тепловой\\ поток}}\\ \\mathsf{Тепловой\\ поток}\\\\";
latex += "|I_2| &= \\pa\\int_0^T\\psi(t)\\left\\{ u(a,t)-\\int_{\\gamma(t)}^a \\frac{d\\theta}{k} (\\theta,t) \\int_a^\\theta c(\\xi) u_t (\\xi,t)\\,d\\xi\\right\\}dt\\right|\\\\";
latex += "&\\le C_6 \\Bigg|\\pa f \\int_\\Omega \\pa\\widetilde{S}^{-1,0}_{a,-} W_2(\\Omega, \\Gamma_1)\\right|\\ \\right|\\left| |u|\\overset{\\circ}{\\to} W_2^{\\widetilde{A}}(\\Omega;\\Gamma_r,T)\\right|\\Bigg|\\\\";
latex += "&\\\\";
latex += "&\\textcolor{magenta}{\\mathrm{Produit\\ avec\\ Java\\ et\\ \\LaTeX\\ par\\ }\\mathscr{C}\\mathcal{A}\\mathfrak{L}\\mathbf{I}\\mathtt{X}\\mathbb{T}\\mathsf{E}}\\\\";
latex += "&\\begin{pmatrix}\\alpha&\\beta&\\gamma&\\delta\\\\\\aleph&\\beth&\\gimel&\\daleth\\\\\\mathfrak{A}&\\mathfrak{B}&\\mathfrak{C}&\\mathfrak{D}\\\\\\boldsymbol{\\mathfrak{a}}&\\boldsymbol{\\mathfrak{b}}&\\boldsymbol{\\mathfrak{c}}&\\boldsymbol{\\mathfrak{d}}\\end{pmatrix}\\quad{(a+b)}^{\\frac{n}{2}}=\\sqrt{\\sum_{k=0}^n\\tbinom{n}{k}a^kb^{n-k}}\\quad \\Biggl(\\biggl(\\Bigl(\\bigl(()\\bigr)\\Bigr)\\biggr)\\Biggr)\\\\";
latex += "&\\forall\\varepsilon\\in\\mathbb{R}_+^*\\ \\exists\\eta>0\\ |x-x_0|\\leq\\eta\\Longrightarrow|f(x)-f(x_0)|\\leq\\varepsilon\\\\";
latex += "&\\det\\begin{bmatrix}a_{11}&a_{12}&\\cdots&a_{1n}\\\\a_{21}&\\ddots&&\\vdots\\\\\\vdots&&\\ddots&\\vdots\\\\a_{n1}&\\cdots&\\cdots&a_{nn}\\end{bmatrix}\\overset{\\mathrm{def}}{=}\\sum_{\\sigma\\in\\mathfrak{S}_n}\\varepsilon(\\sigma)\\prod_{k=1}^n a_{k\\sigma(k)}\\\\";
latex += "&\\Delta f(x,y)=\\frac{\\partial^2f}{\\partial x^2}+\\frac{\\partial^2f}{\\partial y^2}\\qquad\\qquad \\fcolorbox{noir}{gris}{n!\\underset{n\\rightarrow+\\infty}{\\sim} {\\left(\\frac{n}{e}\\right)}^n\\sqrt{2\\pi n}}\\\\";
latex += "&\\sideset{_\\alpha^\\beta}{_\\gamma^\\delta}{\\begin{pmatrix}a&b\\\\c&d\\end{pmatrix}}\\xrightarrow[T]{n\\pm i-j}\\sideset{^t}{}A\\xleftarrow{\\overrightarrow{u}\\wedge\\overrightarrow{v}}\\underleftrightarrow{\\iint_{\\mathds{R}^2}e^{-\\left(x^2+y^2\\right)}\\,\\mathrm{d}x\\mathrm{d}y}";
latex += "\\end{split}\\\\";
latex += "\\rotatebox{30}{\\sum_{n=1}^{+\\infty}}\\quad\\mbox{Mirror rorriM}\\reflectbox{\\mbox{Mirror rorriM}}";
latex += "\\end{array}";
try {
Convert.toSVG(latex, "Example3.svg", false);
Convert.toSVG(latex, "Example3_shaped.svg", true);
Convert.SVGTo("Example3.svg", "Example3.pdf", Convert.PDF);
Convert.SVGTo("Example3_shaped.svg", "Example3_shaped.pdf", Convert.PDF);
Convert.SVGTo("Example3.svg", "Example3.ps", Convert.PS);
Convert.SVGTo("Example3.svg", "Example3.eps", Convert.EPS);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}