summaryrefslogtreecommitdiff
path: root/xmerge
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-12-11 09:03:05 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-12-11 09:03:05 +0000
commitb7db135b871b1f400eaed004dec348776d13170f (patch)
tree04bb16f06066f590b7e439d1a8ac4e010a3f7d53 /xmerge
parent6d98a198efe40c9b9be0f952575bf77f5cb45a27 (diff)
CWS-TOOLING: integrate CWS writer2latexexternal
2008-12-10 18:49:30 +0100 mba r265224 : #i97016#: module title and description added 2008-12-05 16:40:46 +0100 rene r264909 : jut is not needed and supposed to be removed 2008-12-05 08:50:58 +0100 rene r264887 : typo 2008-12-05 01:13:25 +0100 rene r264882 : try this (analogous to id_Module_Root_Extension_Dictionary_En) 2008-12-04 21:41:09 +0100 rene r264874 : dependencies 2008-12-04 21:32:00 +0100 rene r264873 : add packinfo 2008-12-03 14:57:20 +0100 rene r264789 : fixup 2008-12-03 14:05:55 +0100 rene r264773 : remove, the oxt provides them 2008-12-02 15:52:28 +0100 rene r264711 : autoconf 2008-12-02 15:50:00 +0100 rene r264710 : merge changes from writer2latexexternal/CVS and update writer2latex to 0.5.0.2
Diffstat (limited to 'xmerge')
-rw-r--r--xmerge/prj/build.lst3
-rw-r--r--xmerge/prj/d.lst1
-rw-r--r--xmerge/source/writer2latex/build.xml176
-rw-r--r--xmerge/source/writer2latex/makefile.mk42
-rw-r--r--xmerge/source/writer2latex/source/META-INF/converter.xml57
-rw-r--r--xmerge/source/writer2latex/source/writer2latex.xml49
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/Application.java329
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/COPYING.TXT460
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/Readme.txt18
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/bibtex/BibTeXDocument.java229
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/bibtex/DocumentSerializerImpl.java112
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/bibtex/PluginFactoryImpl.java111
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/Context.java236
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/ConverterHelper.java48
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/ConverterPalette.java355
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/DocumentSerializerImpl.java84
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/HeadingMap.java69
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/LaTeXDocument.java148
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/LaTeXDocumentPortion.java194
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/PluginFactoryImpl.java111
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/BlockConverter.java550
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/DrawConverter.java285
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/FieldConverter.java322
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/IndexConverter.java274
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/Info.java65
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/InlineConverter.java406
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/MathmlConverter.java101
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/NoteConverter.java281
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/content/StarMathConverter.java1589
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/BeforeAfter.java44
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/CharStyleConverter.java507
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/I18n.java1100
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/ListStyleConverter.java371
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/NoteConfigurationConverter.java146
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/PageStyleConverter.java347
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/ParStyleConverter.java566
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/SectionStyleConverter.java65
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/StyleConverter.java55
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/StyleMap.java107
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/TableFormatter.java289
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/TableStyleConverter.java68
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/latex/style/symbols.xml3154
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/BibMark.java146
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/FontDeclaration.java45
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/ImageLoader.java130
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/IndexMark.java98
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/ListCounter.java84
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/ListStyle.java124
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/MIMETypes.java91
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/MasterPage.java58
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/MetaData.java166
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/OfficeStyle.java51
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/OfficeStyleFamily.java83
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/PageMaster.java96
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/ParStyle.java45
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/PropertySet.java82
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/SVMReader.java232
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/SectionStyle.java54
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/StyleWithProperties.java126
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/TableGridModel.java258
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/TableLine.java62
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/WriterStyleCollection.java308
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/office/XMLString.java324
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/util/CSVList.java69
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/util/Config.java576
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/util/ExportNameCollection.java97
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/util/L10n.java77
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/util/Misc.java223
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/util/SimpleInputBuffer.java96
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/xmerge/BinaryGraphicsDocument.java175
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/xmerge/NewDOMDocument.java160
-rw-r--r--xmerge/source/writer2latex/source/writer2latex/xmerge/SxiDocument.java95
-rw-r--r--xmerge/source/writer2latex/uno-config/META-INF/manifest.xml10
-rw-r--r--xmerge/source/writer2latex/uno-config/writer2latex_filters.xcu32
-rw-r--r--xmerge/source/writer2latex/uno-config/writer2latex_types.xcu30
75 files changed, 1 insertions, 17826 deletions
diff --git a/xmerge/prj/build.lst b/xmerge/prj/build.lst
index 65edec37be46..c9f6a8e4d332 100644
--- a/xmerge/prj/build.lst
+++ b/xmerge/prj/build.lst
@@ -8,5 +8,4 @@ xmrg xmerge\source\pexcel nmake - all xmrg_pexcel xmrg_xmerge xmrg_inc
xmrg xmerge\source\pocketword nmake - all xmrg_pword xmrg_xmerge xmrg_inc NULL
xmrg xmerge\source\htmlsoff nmake - all xmrg_htmlsoff xmrg_inc NULL
xmrg xmerge\source\activesync nmake - all xmrg_activesync xmrg_inc NULL
-xmrg xmerge\source\writer2latex nmake - all xmrg_writer2latex xmrg_xmerge xmrg_inc NULL
-xmrg xmerge\util nmake - all xmrg_util xmrg_xmerge xmrg_bridge xmrg_aportis xmrg_pexcel xmrg_pword xmrg_writer2latex NULL
+xmrg xmerge\util nmake - all xmrg_util xmrg_xmerge xmrg_bridge xmrg_aportis xmrg_pexcel xmrg_pword NULL
diff --git a/xmerge/prj/d.lst b/xmerge/prj/d.lst
index 250944387ebc..03cd7235c126 100644
--- a/xmerge/prj/d.lst
+++ b/xmerge/prj/d.lst
@@ -2,7 +2,6 @@
..\%__SRC%\class\pexcel.jar %_DEST%\bin%_EXT%\pexcel.jar
..\%__SRC%\class\htmlsoff.jar %_DEST%\bin%_EXT%\htmlsoff.jar
..\%__SRC%\class\aportisdoc.jar %_DEST%\bin%_EXT%\aportisdoc.jar
-..\%__SRC%\class\writer2latex.jar %_DEST%\bin%_EXT%\writer2latex.jar
..\%__SRC%\class\XMergeBridge.jar %_DEST%\bin%_EXT%\XMergeBridge.jar
..\%__SRC%\class\pocketword.jar %_DEST%\bin%_EXT%\pocketword.jar
..\%__SRC%\bin\xmergesync.dll %_DEST%\bin%_EXT%\xmergesync.dll
diff --git a/xmerge/source/writer2latex/build.xml b/xmerge/source/writer2latex/build.xml
deleted file mode 100644
index 04d949cf30a0..000000000000
--- a/xmerge/source/writer2latex/build.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-<!--
- ############################################################################
- # This is the Ant build file for writer2latex
- ############################################################################
--->
-<project name="writer2latex" default="build" basedir=".">
-
- <description>writer2latex - build file</description>
-
- <!-- ================================================================= -->
- <!-- settings -->
- <!-- ================================================================= -->
- <!-- project prefix, used for targets and build.lst -->
- <property name="prj.prefix" value="xmrg"/>
-
- <!-- name of this sub target used in recursive builds -->
- <property name="target" value="writer2latex"/>
-
- <!-- relative path to project directory -->
- <property name="prj" value="../.."/>
-
- <!-- path component for current java package -->
- <property name="package" value="."/>
-
- <!-- set wether we want to compile with or without deprecation -->
- <property name="deprecation" value="on"/>
-
- <!-- ================================================================= -->
- <!-- solar build environment targets -->
- <!-- ================================================================= -->
- <!-- in case of stand-alone usage, hard-wired to Windows (wntmsci10)-->
- <property name="platform" value="wntmsci10" />
- <property name="proext" value=".pro" />
- <property name="out" location="..\..\${platform}${proext}" />
- <property name="solar.jar" location="${LOCAL_OFFICE_PATH}/program/classes" />
-
- <!-- define how to handle CLASSPATH environment -->
- <property name="build.sysclasspath" value="ignore"/>
- <property name="build.dir" location="${out}/class"/>
- <property name="src.dir" location="${basedir}/source"/>
- <property name="target.dir" location="${build.dir}/${ant.project.name}"/>
- <property name="target.jar" location="${build.dir}/${ant.project.name}.jar"/>
- <property name="javadoc.dir" location="${target.dir}/doc/javadoc"/>
- <path id="classpath">
- <pathelement location="${build.dir}/xmerge.jar"/>
- </path>
-
- <target name="info">
- <echo message="--------------------"/>
- <echo message="${target}"/>
- <echo message="--------------------"/>
- </target>
-
- <target name="all"
- description="Build nearly everything"
- depends="info, compile, copy-config, jar, javadoc, zipdoc, create-uno-package" />
-
- <target name="build"
- description="Build nearly everything"
- depends="info, compile, copy-config, jar, create-uno-package" />
-
- <target name="init" >
- <mkdir dir="${target.dir}"/>
- <mkdir dir="${javadoc.dir}"/>
- </target>
-
- <target name="help" description="Displays usage information">
- <echo>Usage: ant &lt;target&gt;
- The following targets are supported:
- all
- Build the project
- compile
- Compile all file except the tests.
- jar
- Create the jar file.
- javadoc
- Create the javadoc documentation in target/javadoc.
- </echo>
- </target>
-
- <target name="compile" depends="init"
- description="Compile the Java files (without tests)">
- <!-- compile the application code -->
- <javac srcdir="${src.dir}"
- destdir="${target.dir}"
- debug="${debug}"
- deprecation="${deprecation}"
- optimize="${optimize}">
- <classpath refid="classpath"/>
- </javac>
- </target>
-
- <target name="jar"
- depends="init, compile, copy-config"
- description="Create writer2latex jar file containing all compiled classes except test cases.">
- <jar jarfile="${target.jar}">
- <fileset dir="${target.dir}">
- <patternset>
- <exclude name="**/*Test.class"/>
- <exclude name="**/AllTests.class"/>
- <exclude name="doc/**/*"/>
- <include name="**/*.xml"/>
- <include name="**/*.class"/>
- <include name="org/**/*"/>
- </patternset>
- </fileset>
- <manifest>
- <attribute name="Built-By" value="${user.name}"/>
- <attribute name="Main-Class" value="writer2latex.Application"/>
- <attribute name="Class-Path" value="xml-apis.jar xercesImpl.jar xmerge.jar"/>
- </manifest>
- </jar>
- </target>
-
-
- <target name="copy-config"
- description="Copies the XML configuration to the output tree">
- <copy todir="${target.dir}" verbose="true">
- <fileset dir="${src.dir}">
- <include name="**/*.xml"/>
- <include name="**/*.txt"/>
- </fileset>
- </copy>
- </target>
-
- <!-- compile java sources in ${package} and sub packages -->
- <target name="javadoc" depends="init">
- <javadoc packagenames="writer2latex.*"
- destdir="${javadoc.dir}"
- verbose="false"
- author="true"
- version="true"
- nodeprecated="true"
- nodeprecatedlist="true"
- use="true"
- Doctitle="Writer2Latex API"
- windowtitle="Writer2Latex API"
- sourcepath="${src.dir}"
- excludepackagenames="org.openoffice.xmerge.test,org.openoffice.xmerge.converter.xml.sxc.minicalc"
- classpathref="classpath">
- <link offline="true" href="http://java.sun.com/j2se/1.3/docs/api" packagelistLoc="${solar.doc}/jdk13"/>
- </javadoc>
- <copy todir="${javadoc.dir}">
- <fileset dir="${src.dir}">
- <include name="**/*.gif"/>
- <include name="**/*.png"/>
- </fileset>
- </copy>
- </target>
-
- <!-- zip together all the javadocs -->
- <target name="zipdoc" depends="javadoc">
- <zip zipfile="${target.dir}/writer2latex_javadoc.zip"
- basedir="${javadoc.dir}"
- update="true"/>
- </target>
-
- <!-- zip together JAR and configuration -->
- <target name="create-uno-package" depends="jar" description="deliver Office UNO package">
- <zip zipfile="${build.dir}/writer2latex.uno.pkg" update="true">
- <fileset dir="${basedir}/uno-config">
- <include name="**/*.*"/>
- </fileset>
- <fileset dir="${build.dir}">
- <include name="${ant.project.name}.jar"/>
- </fileset>
- </zip>
- </target>
-
- <!-- clean up -->
- <target name="clean">
- <delete dir="${target.dir}"/>
- <delete file="${target.jar}"/>
- <delete file="${build.dir}/writer2latex.uno.pkg"/>
- </target>
-</project>
diff --git a/xmerge/source/writer2latex/makefile.mk b/xmerge/source/writer2latex/makefile.mk
deleted file mode 100644
index 4e9c6b04938a..000000000000
--- a/xmerge/source/writer2latex/makefile.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2008 by Sun Microsystems, Inc.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# $RCSfile: makefile.mk,v $
-#
-# $Revision: 1.5 $
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-TARGET=writer2latex
-PRJ=../..
-PRJNAME=xmerge
-
-.IF "$(WITH_WRITER2LATEX)" == "NO"
-@all:
- @echo "building without writer2latex"
-.ENDIF
-
-.INCLUDE : ant.mk
-ALLTAR: ANTBUILD
diff --git a/xmerge/source/writer2latex/source/META-INF/converter.xml b/xmerge/source/writer2latex/source/META-INF/converter.xml
deleted file mode 100644
index 99c7c2076bca..000000000000
--- a/xmerge/source/writer2latex/source/META-INF/converter.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- #
- # converter.xml
- #
- # This library is free software; you can redistribute it and/or
- # modify it under the terms of the GNU Lesser General Public
- # License version 2.1, as published by the Free Software Foundation.
- #
- # This library 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
- # Lesser General Public License for more details.
- #
- # You should have received a copy of the GNU Lesser General Public
- # License along with this library; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- # MA 02111-1307 USA
- #
- # Copyright: 2001-2004 by Henrik Just
- #
- # All Rights Reserved.
- #
--->
-<converters>
- <converter type="staroffice/sxw" version="1.0">
- <converter-display-name>
- LaTeX 2e
- </converter-display-name>
- <converter-description>
- OpenOffice Writer XML to LaTeX 2e conversion
- </converter-description>
- <converter-vendor>
- Henrik Just (henrikjust@openoffice.org)
- </converter-vendor>
- <converter-class-impl>
- writer2latex.latex.PluginFactoryImpl
- </converter-class-impl>
- <converter-target type="application/x-latex" />
- </converter>
- <converter type="staroffice/sxw" version="1.0">
- <converter-display-name>
- BibTeX data file
- </converter-display-name>
- <converter-description>
- OpenOffice Writer XML to BibTeX conversion
- </converter-description>
- <converter-vendor>
- Henrik Just (henrikjust@openoffice.org)
- </converter-vendor>
- <converter-class-impl>
- writer2latex.bibtex.PluginFactoryImpl
- </converter-class-impl>
- <converter-target type="application/x-bibtex" />
- </converter>
-</converters>
-
diff --git a/xmerge/source/writer2latex/source/writer2latex.xml b/xmerge/source/writer2latex/source/writer2latex.xml
deleted file mode 100644
index 7c28f5744770..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<config>
- <option name="create_user_config" value="true" />
- <option name="backend" value="generic" />
- <option name="no_preamble" value="false" />
- <option name="documentclass" value="article" />
- <option name="global_options" value="" />
- <option name="inputencoding" value="ascii" />
- <option name="multilingual" value="true" />
- <option name="greek_math" value="true" />
- <option name="use_ooomath" value="false" />
- <option name="use_pifont" value="false" />
- <option name="use_ifsym" value="false" />
- <option name="use_wasysym" value="false" />
- <option name="use_bbding" value="false" />
- <option name="use_eurosym" value="false" />
- <option name="use_tipa" value="false" />
- <option name="use_color" value="true" />
- <option name="use_hyperref" value="true" />
- <option name="use_endnotes" value="false" />
- <option name="use_ulem" value="false" />
- <option name="use_lastpage" value="false" />
- <option name="use_bibtex" value="false" />
- <option name="bibtex_style" value="plain" />
- <option name="formatting" value="convert_basic" />
- <option name="page_formatting" value="convert_all" />
- <option name="ignore_hard_page_breaks" value="false" />
- <option name="ignore_hard_line_breaks" value="false" />
- <option name="ignore_empty_paragraphs" value="false" />
- <option name="ignore_double_spaces" value="false" />
- <option name="xhtml_no_doctype" value="false" />
- <option name="xhtml_custom_stylesheet" value="" />
- <option name="xhtml_ignore_styles" value="false" />
- <option name="xhtml_use_dublin_core" value="true" />
- <option name="xhtml_convert_to_px" value="true" />
- <option name="xhtml_scaling" value="100%" />
- <option name="xhtml_column_scaling" value="100%" />
- <option name="xhtml_split_level" value="0" />
- <option name="xhtml_calc_split" value="false" />
- <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 />
-</config>
diff --git a/xmerge/source/writer2latex/source/writer2latex/Application.java b/xmerge/source/writer2latex/source/writer2latex/Application.java
deleted file mode 100644
index 3924772b75d9..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/Application.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/************************************************************************
- *
- * Application.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2006 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.4b (2006-11-03)
- *
- */
-
-package writer2latex;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Enumeration;
-import javax.xml.parsers.ParserConfigurationException;
-import org.xml.sax.SAXException;
-
-import org.openoffice.xmerge.Convert;
-import org.openoffice.xmerge.ConvertData;
-import org.openoffice.xmerge.Document;
-import org.openoffice.xmerge.converter.xml.OfficeDocument;
-import org.openoffice.xmerge.converter.xml.sxc.SxcDocument;
-import org.openoffice.xmerge.converter.xml.sxw.SxwDocument;
-
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-import writer2latex.office.*;
-import writer2latex.xmerge.SxiDocument;
-//import writer2latex.xhtml.XhtmlDocument;
-import writer2latex.latex.*;
-
-/**
- * <p>Commandline utility to convert an OpenOffice.org Writer XML file to a LaTeX file<.</p>
- * <p>The code is based on org.openoffice.xmerge.test.Driver</p>
- */
-public final class Application {
- // Version number and date of Writer2LaTeX
- private static final String VERSION = "0.4b";
- private static final String DATE = "2006-11-03";
-
- public static String getVersion() { return VERSION; }
- public static String getDate() { return DATE; }
-
- /** Based on command-line parameters. */
- private String sOutputFormat = null;
- private String toMime = null;
- private String sFileName = null;
- private String sOutPathName = null;
- private String sOutFileName = null;
- private String sConfigFileName = null;
-
- Config config;
-
- /**
- * Main method
- *
- * @param args The argument passed on the command line.
- */
-
- public static final void main (String[] args){
- try {
- Application app = new Application();
- app.parseCommandLine(args);
- System.out.println("Starting conversion...");
- app.doConversion();
- System.out.println("Done!");
- } catch (IllegalArgumentException ex) {
- String msg = ex.getMessage();
- showUsage(msg);
- } catch (Exception ex) {
- String msg = ex.getMessage();
- if (msg != null) System.out.println("\n" + msg);
- ex.printStackTrace();
- }
-
- }
-
- /**
- * Converts the document
- *
- * @throws IllegalArgumentException If an argument is invalid.
- */
- private void doConversion() {
-
- // If filename ends with .xml, we suppose that it's flat xml (and is Writer)
- boolean bFlat = sFileName.toLowerCase().endsWith(".xml");
- // Determine the type of document by the extension:
- boolean bCalc = sFileName.toLowerCase().endsWith(".sxc");
- boolean bImpress = sFileName.toLowerCase().endsWith(".sxi");
-
- ConvertData dataOut = null;
-
- // Create and use the converter
- // No longer uses the XMerge interface
- // Somewhat messy, should be changed if XMerge is discarded
- OfficeDocument oooDoc;
- if (bCalc) {
- oooDoc = new SxcDocument(sFileName);
- }
- else if (bImpress) {
- oooDoc = new SxiDocument(sFileName);
- }
- else {
- oooDoc = new SxwDocument(sFileName);
- }
- File f = new File(sFileName);
- // Make sure the input file actually exists before using it
- try {
- if (!f.exists()) {
- System.out.println("I'm sorry, I can't find "+sFileName);
- System.exit(0);
- }
- FileInputStream fis = new FileInputStream(f);
- oooDoc.read(fis,!bFlat);
- }
- catch (IOException e) {
- System.out.println("Oops, there was an error reading "+sFileName);
- e.printStackTrace();
- }
-
- try {
- if (toMime.equals(MIMETypes.LATEX)) {
- writer2latex.latex.ConverterPalette converter
- = new writer2latex.latex.ConverterPalette((SxwDocument)oooDoc,sConfigFileName);
- converter.setOutFileName(sOutFileName);
- dataOut = converter.convert();
- }
- else if (toMime.equals(MIMETypes.BIBTEX)) {
- writer2latex.bibtex.DocumentSerializerImpl converter
- = new writer2latex.bibtex.DocumentSerializerImpl((SxwDocument)oooDoc);
- converter.setOutFileName(sOutFileName);
- dataOut = converter.serialize();
- }
-/* disabled XHTML filter part
- else if (toMime.equals(MIMETypes.XHTML)) {
- writer2latex.xhtml.DocumentSerializerImpl converter
- = new writer2latex.xhtml.DocumentSerializerImpl(oooDoc,
- XhtmlDocument.XHTML10, sConfigFileName);
- converter.setOutFileName(sOutFileName);
- dataOut = converter.serialize();
- }
- else if (toMime.equals(MIMETypes.XHTML_MATHML)) {
- writer2latex.xhtml.DocumentSerializerImpl converter
- = new writer2latex.xhtml.DocumentSerializerImpl(oooDoc,
- XhtmlDocument.XHTML_MATHML, sConfigFileName);
- converter.setOutFileName(sOutFileName);
- dataOut = converter.serialize();
- }
- else if (toMime.equals(MIMETypes.XHTML_MATHML_XSL)) {
- writer2latex.xhtml.DocumentSerializerImpl converter
- = new writer2latex.xhtml.DocumentSerializerImpl(oooDoc,
- XhtmlDocument.XHTML_MATHML_XSL, sConfigFileName);
- converter.setOutFileName(sOutFileName);
- dataOut = converter.serialize();
- }
- */
- }
- catch (Exception e) {
- System.out.println("Conversion failed");
- e.printStackTrace();
- }
-
- // TODO: Should do some further checking on the feasability of writing
- // the directory and the files.
- File dir = new File(sOutPathName);
- if (!dir.exists()) { dir.mkdirs(); }
-
- Enumeration docEnum = dataOut.getDocumentEnumeration();
- while (docEnum.hasMoreElements()) {
- Document docOut = (Document)docEnum.nextElement();
- String fileName = sOutPathName+docOut.getFileName();
- try {
- FileOutputStream fos = new FileOutputStream(fileName);
- docOut.write(fos);
- fos.flush();
- fos.close();
- } catch (Exception writeExcept) {
- System.out.println("\nThere was an error writing out file <" +
- fileName + ">");
- writeExcept.printStackTrace();
- }
- }
- }
-
- /**
- * Display usage.
- */
- private static void showUsage(String msg) {
- System.out.println();
- System.out.println("This is Writer2LaTeX, Version " + VERSION
- + " (" + DATE + ")");
- System.out.println();
- if (msg != null) System.out.println(msg);
- System.out.println();
- System.out.println("Usage:");
- System.out.println(" java -jar <path>/writer2latex.jar <options> <document> [<output path/file name>]");
- System.out.println("where <options> is one of the following:");
- System.out.println(" [-latex] [-config <configuration file>]");
- System.out.println(" -bibtex");
-/* System.out.println(" -xhtml [-config <configuration file>]");
- System.out.println(" -xhtml+mathml [-config <configuration file>]");
- System.out.println(" -xhtml+mathml+xsl [-config <configuration file>]");*/
- }
-
-
- /**
- * Parse command-line arguments.
- *
- * @param args Array of command line arguments.
- *
- * @throws IllegalArgumentException If an argument is invalid.
- */
- private void parseCommandLine(String args[])
- throws IllegalArgumentException {
-
- if (args.length == 0) {
- throw new IllegalArgumentException();
- }
-
- int i = 0;
- String sArg;
-
-
- sArg = getArg(i,args);
- /*if ("-xhtml".equals(sArg)) {
- sOutputFormat = "xhtml";
- toMime = MIMETypes.XHTML;
- i++;
- }
- else if ("-xhtml+mathml".equals(sArg)) {
- sOutputFormat = "xhtml";
- toMime = MIMETypes.XHTML_MATHML;
- i++;
- }
- else if ("-xhtml+mathml+xsl".equals(sArg)) {
- sOutputFormat = "xhtml";
- toMime = MIMETypes.XHTML_MATHML_XSL;
- i++;
- }else
- */ if ("-bibtex".equals(sArg)) {
- sOutputFormat = "BibTeX";
- toMime = MIMETypes.BIBTEX;
- i++;
- }
- else if ("-latex".equals(sArg)) {
- sOutputFormat = "LaTeX";
- toMime = MIMETypes.LATEX;
- i++;
- }
- else { // assume LaTeX as default
- sOutputFormat = "LaTeX";
- toMime = MIMETypes.LATEX;
- }
-
- sArg = getArg(i,args);
- if ("-config".equals(sArg)) {
- i++;
- sConfigFileName = getArg(i++,args);
- }
-
- sFileName = getArg(i++,args);
-
- String sFullOutFileName;
- if (i<args.length) { sFullOutFileName = getArg(i,args); }
- else { sFullOutFileName = Misc.removeExtension(sFileName); }
- if (sFullOutFileName.endsWith(File.separator)) { // directory only
- sOutPathName=sFullOutFileName;
- sOutFileName = (new File(sFileName)).getName();
- }
- else { // directory and filename
- File f = new File(sFullOutFileName);
- sOutPathName = f.getParent();
- if (sOutPathName==null) { sOutPathName=""; } else { sOutPathName+=File.separator; }
- sOutFileName = f.getName();
- }
- sOutFileName = Misc.removeExtension(sOutFileName);
-
- System.out.println();
- System.out.println("This is Writer2" + sOutputFormat
- + ", Version " + VERSION + " (" + DATE + ")");
- System.out.println();
-
- }
-
-
- /**
- * Extract the next argument from the array, while checking to see
- * that the array size is not exceeded. Throw a friendly error
- * message in case the arg is missing.
- *
- * @param i Argument index.
- * @param args Array of command line arguments.
- *
- * @return The argument with the specified index.
- *
- * @throws IllegalArgumentException If an argument is invalid.
- */
- private String getArg(int i, String args[])
- throws IllegalArgumentException {
-
- if (i < args.length)
- return args[i];
- else throw new
- IllegalArgumentException("I'm sorry, the commandline ended abnormally");
- }
-
-
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/COPYING.TXT b/xmerge/source/writer2latex/source/writer2latex/COPYING.TXT
deleted file mode 100644
index 101dfa2cf856..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/COPYING.TXT
+++ /dev/null
@@ -1,460 +0,0 @@
- 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
-
-
diff --git a/xmerge/source/writer2latex/source/writer2latex/Readme.txt b/xmerge/source/writer2latex/source/writer2latex/Readme.txt
deleted file mode 100644
index 2d6a3ebb1c93..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/Readme.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-Writer2LaTeX version 0.4 beta
-=============================
-
-This is the distribution of Writer2LaTeX version 0.4 beta.
-
-Latest version can be found at the web site
- http://www.hj-gym.dk/~hj/writer2latex
-
-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
-
-
-December 2004
-Henrik Just
diff --git a/xmerge/source/writer2latex/source/writer2latex/bibtex/BibTeXDocument.java b/xmerge/source/writer2latex/source/writer2latex/bibtex/BibTeXDocument.java
deleted file mode 100644
index d09fffc1efbc..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/bibtex/BibTeXDocument.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/************************************************************************
- *
- * BibTeXDocument.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2005 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3j (2005-03-07)
- *
- */
-
-package writer2latex.bibtex;
-
-import org.openoffice.xmerge.Document;
-
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-
-import writer2latex.Application;
-import writer2latex.latex.style.I18n;
-import writer2latex.util.ExportNameCollection;
-import writer2latex.office.BibMark;
-
-/**
- * <p>Class representing a BibTeX document.</p>
- *
- */
-public class BibTeXDocument implements Document {
- private static final String FILE_EXTENSION = ".bib";
-
- private String sName;
- private Hashtable entries = new Hashtable();
- private ExportNameCollection exportNames = new ExportNameCollection(true);
- private I18n i18n;
-
- /**
- * <p>Constructs a new BibTeX Document.</p>
- *
- * <p>This new document is empty. Bibliographic data must added
- * using the <code>put</code> method.</p>
- *
- * @param name The name of the <code>BibTeXDocument</code>.
- */
- public BibTeXDocument(String sName) {
- this.sName = trimDocumentName(sName);
- i18n = new I18n("ascii");
- }
-
- /**
- * <p>This method is supposed to read <code>byte</code> data from the InputStream.
- * Currently it does nothing, since we don't need it (yet?).</p>
- *
- * @param is InputStream containing a BibTeX data file.
- *
- * @throws IOException In case of any I/O errors.
- */
- public void read(InputStream docData) throws IOException {
- // Do nothing.
- }
-
-
- /**
- * <p>Returns the <code>Document</code> name with no file extension.</p>
- *
- * @return The <code>Document</code> name with no file extension.
- */
- public String getName() {
- return sName;
- }
-
-
- /**
- * <p>Returns the <code>Document</code> name with file extension.</p>
- *
- * @return The <code>Document</code> name with file extension.
- */
- public String getFileName() {
- return new String(sName + FILE_EXTENSION);
- }
-
-
- /**
- * <p>Writes out the <code>Document</code> content to the specified
- * <code>OutputStream</code>.</p>
- *
- * <p>This method may not be thread-safe.
- * Implementations may or may not synchronize this
- * method. User code (i.e. caller) must make sure that
- * calls to this method are thread-safe.</p>
- *
- * @param os <code>OutputStream</code> to write out the
- * <code>Document</code> content.
- *
- * @throws IOException If any I/O error occurs.
- */
- public void write(OutputStream os) throws IOException {
- // BibTeX files are plain ascii
- OutputStreamWriter osw = new OutputStreamWriter(os,"ASCII");
- osw.write("%% This file was converted to BibTeX by Writer2BibTeX ver. "+Application.getVersion()+".\n");
- osw.write("%% See http://www.hj-gym.dk/~hj/writer2latex for more info.\n");
- osw.write("\n");
- Enumeration enumeration = entries.elements();
- while (enumeration.hasMoreElements()) {
- BibMark entry = (BibMark) enumeration.nextElement();
- osw.write("@");
- osw.write(entry.getEntryType().toUpperCase());
- osw.write("{");
- osw.write(exportNames.getExportName(entry.getIdentifier()));
- osw.write(",\n");
- for (int i=0; i<BibMark.FIELD_COUNT; i++) {
- String sValue = entry.getField(i);
- if (sValue!=null) {
- osw.write(" ");
- osw.write(getFieldName(i).toUpperCase());
- osw.write(" = {");
- for (int j=0; j<sValue.length(); j++) {
- String s = i18n.convert(sValue.charAt(j),false,"en");
- if (s.charAt(0)=='\\') { osw.write("{"); }
- osw.write(s);
- if (s.charAt(0)=='\\') { osw.write("}"); }
- }
- osw.write("},\n");
- }
- }
- osw.write("}\n\n");
- }
- osw.flush();
- osw.close();
- }
-
- /**
- * <p> Return BibTeX name of field </p>
- */
- public static final String getFieldName(int nField) {
- switch (nField) {
- case BibMark.ADDRESS: return "address";
- case BibMark.ANNOTE: return "annote";
- case BibMark.AUTHOR: return "author";
- case BibMark.BOOKTITLE: return "booktitle";
- case BibMark.CHAPTER: return "chapter";
- // case BibMark.CROSSREF: return "croosref"; // not in OOo
- case BibMark.EDITION: return "edition";
- case BibMark.EDITOR: return "editor";
- case BibMark.HOWPUBLISHED: return "howpublished";
- case BibMark.INSTITUTION: return "institution";
- case BibMark.JOURNAL: return "journal";
- // case BibMark.KEY: return "key"; // not in OOo
- case BibMark.MONTH: return "month";
- case BibMark.NOTE: return "note";
- case BibMark.NUMBER: return "number";
- case BibMark.ORGANIZATIONS: return "organization";
- case BibMark.PAGES: return "pages";
- case BibMark.PUBLISHER: return "publisher";
- case BibMark.SCHOOL: return "school";
- case BibMark.SERIES: return "series";
- case BibMark.TITLE: return "title";
- case BibMark.REPORT_TYPE: return "type";
- case BibMark.VOLUME: return "volume";
- case BibMark.YEAR: return "year";
- case BibMark.URL: return "url";
- case BibMark.CUSTOM1: return "custom1";
- case BibMark.CUSTOM2: return "custom2";
- case BibMark.CUSTOM3: return "custom3";
- case BibMark.CUSTOM4: return "custom4";
- case BibMark.CUSTOM5: return "custom5";
- case BibMark.ISBN: return "isbn";
- default: return null;
- }
- }
-
-
- /*
- * <p>Check if this entry exists</p>
- */
- public boolean containsKey(String sIdentifier) {
- return entries.containsKey(sIdentifier);
- }
-
- /*
- * <p>Add an entry</p>
- */
- public void put(BibMark entry) {
- entries.put(entry.getIdentifier(),entry);
- exportNames.addName(entry.getIdentifier());
- }
-
- /*
- * <p>Get export name for an identifier</p>
- */
- public String getExportName(String sIdentifier) {
- return exportNames.getExportName(sIdentifier);
- }
-
- /*
- * Utility method to make sure the document name is stripped of any file
- * extensions before use.
- */
- private String trimDocumentName(String name) {
- String temp = name.toLowerCase();
-
- if (temp.endsWith(FILE_EXTENSION)) {
- // strip the extension
- int nlen = name.length();
- int endIndex = nlen - FILE_EXTENSION.length();
- name = name.substring(0,endIndex);
- }
-
- return name;
- }
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/bibtex/DocumentSerializerImpl.java b/xmerge/source/writer2latex/source/writer2latex/bibtex/DocumentSerializerImpl.java
deleted file mode 100644
index a9e7272477d5..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/bibtex/DocumentSerializerImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/************************************************************************
- *
- * DocumentSerializerImpl.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2001-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * version 0.3.3g (2004-11-30)
- *
- */
-
-package writer2latex.bibtex;
-
-import org.openoffice.xmerge.ConvertData;
-import org.openoffice.xmerge.ConvertException;
-import org.openoffice.xmerge.Document;
-import org.openoffice.xmerge.DocumentSerializer;
-import org.openoffice.xmerge.converter.xml.sxw.SxwDocument;
-
-import java.io.IOException;
-
-import org.w3c.dom.NodeList;
-
-import writer2latex.office.*;
-import writer2latex.util.*;
-
-/**
- * <p>BibTeX implementation of <code>DocumentSerializer</code>
- * for use by {@link
- * writer2latex.bibtex.PluginFactoryImpl
- * PluginFactoryImpl}.</p>
- *
- * <p>This converts an OpenOffice Writer XML files to a BibTeX file<.</p>
- *
- */
-public final class DocumentSerializerImpl
- implements DocumentSerializer {
-
- private SxwDocument sxwDoc;
- private String sOutFileName;
-
- public void setOutFileName(String s) {
- sOutFileName = Misc.trimDocumentName(s,".bib");
- }
-
- /**
- * <p>Initialises a new <code>DocumentSerializerImpl</code> using the.<br>
- * supplied <code>Document</code></p>
- *
- * <p>The supplied document should be an {@link
- * org.openoffice.xmerge.converter.xml.sxw.SxwDocument SxwDocument}
- * object.</p>
- *
- * @param document The <code>Document</code> to convert.
- */
- public DocumentSerializerImpl(Document doc) {
- sxwDoc = (SxwDocument) doc;
- sOutFileName = sxwDoc.getName();
- }
-
-
- /**
- * <p>Convert the data passed into the <code>DocumentSerializerImpl</code>
- * constructor into BibTeX format.</p>
- *
- * <p>This method may or may not be thread-safe. It is expected
- * that the user code does not call this method in more than one
- * thread. And for most cases, this method is only done once.</p>
- *
- * @return <code>ConvertData</code> object to pass back the
- * converted data.
- *
- * @throws ConvertException If any conversion error occurs.
- * @throws IOException If any I/O error occurs.
- */
- public ConvertData serialize() throws IOException, ConvertException {
- ConvertData convertData = new ConvertData();
- BibTeXDocument bibDoc = new BibTeXDocument(sOutFileName);
-
- // Collect all text:bibliography-mark elements from content.xml
- org.w3c.dom.Document doc = sxwDoc.getContentDOM();
- NodeList list;
- list = doc.getElementsByTagName(XMLString.TEXT_BIBLIOGRAPHY_MARK);
- int nLen = list.getLength();
- for (int i=0; i<nLen; i++) {
- String sIdentifier = Misc.getAttribute(list.item(i),XMLString.TEXT_IDENTIFIER);
- if (!bibDoc.containsKey(sIdentifier)) {
- bibDoc.put(new BibMark(list.item(i)));
- }
- }
-
- // Return the converted data
- convertData.addDocument(bibDoc);
- return convertData;
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/bibtex/PluginFactoryImpl.java b/xmerge/source/writer2latex/source/writer2latex/bibtex/PluginFactoryImpl.java
deleted file mode 100644
index b4bcb01aef37..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/bibtex/PluginFactoryImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/************************************************************************
- *
- * PluginFactoryImpl.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * version 0.4 (2003-07-29)
- *
- */
-
-
-package writer2latex.bibtex;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-import org.openoffice.xmerge.Document;
-import org.openoffice.xmerge.ConvertData;
-import org.openoffice.xmerge.DocumentSerializer;
-import org.openoffice.xmerge.DocumentSerializerFactory;
-
-import org.openoffice.xmerge.converter.xml.sxw.SxwPluginFactory;
-
-import org.openoffice.xmerge.util.registry.ConverterInfo;
-
-
-/**
- * Factory class used to create converters to BibTeX format.
- */
-public final class PluginFactoryImpl extends SxwPluginFactory
- implements DocumentSerializerFactory {
-
- /**
- * <p>Constructor that caches the <code>ConvertInfo</code> that
- * corresponds to the registry information for this plug-in.</p>
- *
- * @param ci <code>ConvertInfo</code> object.
- */
- public PluginFactoryImpl (ConverterInfo ci) {
- super(ci);
- }
-
- /**
- * <p>The <code>DocumentSerializer</code> is used to convert
- * from the OpenOffice Writer <code>Document</code> format
- * to BibTeX <code>Document</code> format.</p>
- *
- * <p>The <code>Document</code> object is passed along to the
- * created <code>DocumentSerializer</code> via its constructor.
- * The <code>Document</code> is read and converted when the
- * the <code>DocumentSerializer</code> object's
- * <code>serialize</code> method is called.</p>
- *
- * @param doc <code>Document</code> object that the created
- * <code>DocumentSerializer</code> object uses
- * as input.
- *
- * @return A <code>DocumentSerializer</code> object.
- */
- public DocumentSerializer createDocumentSerializer(Document doc) {
- return new DocumentSerializerImpl(doc);
- }
-
-
- /**
- * <p>Create a <code>Document</code> object that corresponds to
- * the BibTeX data passed in via the <code>InputStream</code>
- * object.
- *
- * <p>This method will read from the given <code>InputStream</code>
- * object. The returned <code>Document</code> object will contain
- * the necessary data for the other objects created by the
- * <code>PluginFactoryImpl</code> to process, like the
- * <code>DocumentSerializerImpl</code> object and a
- * <code>DocumentMerger</code> object.</p>
- * <p>Currently this method doesn't read anything, since it it not used.</p>
- *
- * @param name The <code>Document</code> name.
- * @param is <code>InputStream</code> object corresponding
- * to the <code>Document</code>.
- *
- * @return A <code>Document</code> object representing the
- * BibTeX format.
- *
- * @throws IOException If any I/O error occurs.
- */
-
- public Document createDeviceDocument(String name, InputStream is)
- throws IOException {
- BibTeXDocument bibDoc = new BibTeXDocument(name);
- bibDoc.read(is); // this has no effect currently
- return bibDoc;
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/Context.java b/xmerge/source/writer2latex/source/writer2latex/latex/Context.java
deleted file mode 100644
index ef12eaafc1b3..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/Context.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/************************************************************************
- *
- * Context.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-11)
- *
- */
-
-package writer2latex.latex;
-
-import writer2latex.office.XMLString;
-import writer2latex.office.StyleWithProperties;
-
-public class Context {
-
- // *** Formatting Info (current values in the source OOo document) ***
-
- // Current list style
- private String sListStyleName = null;
-
- // Current character formatting attributes
- private String sFontName = null;
- private String sFontStyle = null;
- private String sFontVariant = null;
- private String sFontWeight = null;
- private String sFontSize = null;
- private String sFontColor = null;
- private String sLang = null;
- private String sCountry = null;
-
- // *** Structural Info (identifies contructions in the LaTeX document) ***
-
- // within the header or footer of a pagestyle
- private boolean bInHeaderFooter = false;
-
- // within a table cell
- private boolean bInTable = false;
-
- // within a multicols environment
- private boolean bInMulticols = false;
-
- // within a list of this level
- private int nListLevel = 0;
-
- // within a minipage environment
- private boolean bInFrame = false;
-
- // within a \footnote or \endnote
- private boolean bInFootnote = false;
-
- // in verbatim mode
- private boolean bVerbatim = false;
-
- // *** Special Info ***
-
- // Inside a construction, where footnotes are disallowed
- private boolean bNoFootnotes = false;
-
- // Inside an area, where lists are ignored
- private boolean bIgnoreLists = false;
-
- // *** Accessor Methods ***
-
- public void setListStyleName(String sListStyleName) { this.sListStyleName = sListStyleName; }
-
- public String getListStyleName() { return sListStyleName; }
-
- public void setFontName(String sFontName) { this.sFontName = sFontName; }
-
- public String getFontName() { return sFontName; }
-
- public void setFontStyle(String sFontStyle) { this.sFontStyle = sFontStyle; }
-
- public String getFontStyle() { return sFontStyle; }
-
- public void setFontVariant(String sFontVariant) { this.sFontVariant = sFontVariant; }
-
- public String getFontVariant() { return sFontVariant; }
-
- public void setFontWeight(String sFontWeight) { this.sFontWeight = sFontWeight; }
-
- public String getFontWeight() { return sFontWeight; }
-
- public void setFontSize(String sFontSize) { this.sFontSize = sFontSize; }
-
- public String getFontSize() { return sFontSize; }
-
- public void setFontColor(String sFontColor) { this.sFontColor = sFontColor; }
-
- public String getFontColor() { return sFontColor; }
-
- public void setLang(String sLang) { this.sLang = sLang; }
-
- public String getLang() { return sLang; }
-
- public void setCountry(String sCountry) { this.sCountry = sCountry; }
-
- public String getCountry() { return sCountry; }
-
- public void setInHeaderFooter(boolean bInHeaderFooter) {
- this.bInHeaderFooter = bInHeaderFooter;
- }
-
- public boolean isInHeaderFooter() { return bInHeaderFooter; }
-
- public void setInTable(boolean bInTable) { this.bInTable = bInTable; }
-
- public boolean isInTable() { return bInTable; }
-
- public void setInMulticols(boolean bInMulticols) {
- this.bInMulticols = bInMulticols;
- }
-
- public boolean isInMulticols() { return bInMulticols; }
-
- public void setListLevel(int nListLevel) { this.nListLevel = nListLevel; }
-
- public void incListLevel() { nListLevel++; }
-
- public int getListLevel() { return nListLevel; }
-
- public void setInFrame(boolean bInFrame) { this.bInFrame = bInFrame; }
-
- public boolean isInFrame() { return bInFrame; }
-
- public void setInFootnote(boolean bInFootnote) {
- this.bInFootnote = bInFootnote;
- }
-
- public boolean isInFootnote() { return bInFootnote; }
-
- public void setNoFootnotes(boolean bNoFootnotes) {
- this.bNoFootnotes = bNoFootnotes;
- }
-
- public boolean isNoFootnotes() { return bNoFootnotes; }
-
- public void setIgnoreLists(boolean bIgnoreLists) {
- this.bIgnoreLists = bIgnoreLists;
- }
-
- public boolean isIgnoreLists() { return bIgnoreLists; }
-
- public boolean isVerbatim() { return bVerbatim; }
-
- public void setVerbatim(boolean bVerbatim) { this.bVerbatim = bVerbatim; }
-
- // update context
-
- public void updateFormattingFromStyle(StyleWithProperties style) {
- String s;
-
- if (style==null) { return; }
-
- s = style.getProperty(XMLString.STYLE_FONT_NAME);
- if (s!=null) { setFontName(s); }
-
- s = style.getProperty(XMLString.FO_FONT_STYLE);
- if (s!=null) { setFontStyle(s); }
-
- s = style.getProperty(XMLString.FO_FONT_VARIANT);
- if (s!=null) { setFontVariant(s); }
-
- s = style.getProperty(XMLString.FO_FONT_WEIGHT);
- if (s!=null) { setFontWeight(s); }
-
- s = style.getProperty(XMLString.FO_FONT_SIZE);
- if (s!=null) { setFontSize(s); }
-
- s = style.getProperty(XMLString.FO_COLOR);
- if (s!=null) { setFontColor(s); }
-
- s = style.getProperty(XMLString.FO_LANGUAGE);
- if (s!=null) { setLang(s); }
-
- s = style.getProperty(XMLString.FO_COUNTRY);
- if (s!=null) { setCountry(s); }
- }
-
- public void resetFormattingFromStyle(StyleWithProperties style) {
- setFontName(null);
- setFontStyle(null);
- setFontVariant(null);
- setFontWeight(null);
- setFontSize(null);
- setFontColor(null);
- setLang(null);
- setCountry(null);
- updateFormattingFromStyle(style);
- }
-
-
- // clone this Context
- public Object clone() {
- Context newContext = new Context();
-
- newContext.setListStyleName(sListStyleName);
- newContext.setFontName(sFontName);
- newContext.setFontStyle(sFontStyle);
- newContext.setFontVariant(sFontVariant);
- newContext.setFontWeight(sFontWeight);
- newContext.setFontSize(sFontSize);
- newContext.setFontColor(sFontColor);
- newContext.setLang(sLang);
- newContext.setCountry(sCountry);
- newContext.setInHeaderFooter(bInHeaderFooter);
- newContext.setInTable(bInTable);
- newContext.setInMulticols(bInMulticols);
- newContext.setListLevel(nListLevel);
- newContext.setInFrame(bInFrame);
- newContext.setInFootnote(bInFootnote);
- newContext.setNoFootnotes(bNoFootnotes);
- newContext.setIgnoreLists(bIgnoreLists);
-
- return newContext;
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/ConverterHelper.java b/xmerge/source/writer2latex/source/writer2latex/latex/ConverterHelper.java
deleted file mode 100644
index 294ed2710ff5..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/ConverterHelper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/************************************************************************
- *
- * ConverterHelper.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-08-29)
- *
- */
-
-package writer2latex.latex;
-
-import writer2latex.util.Config;
-import writer2latex.latex.LaTeXDocumentPortion;
-
-/**
- * <p>This is an abstract superclass for converter helpers.</p>
- */
-public abstract class ConverterHelper {
-
- protected Config config;
- protected ConverterPalette palette;
-
- protected ConverterHelper(Config config, ConverterPalette palette) {
- this.config = config;
- this.palette = palette;
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/ConverterPalette.java b/xmerge/source/writer2latex/source/writer2latex/latex/ConverterPalette.java
deleted file mode 100644
index 2a989932baf4..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/ConverterPalette.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/************************************************************************
- *
- * ConverterPalette.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-04)
- *
- */
-
-package writer2latex.latex;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Element;
-
-import java.io.File;
-import java.io.OutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.zip.ZipException;
-import java.util.LinkedList;
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.net.URLDecoder;
-
-import org.openoffice.xmerge.ConvertData;
-import org.openoffice.xmerge.converter.xml.EmbeddedObject;
-import org.openoffice.xmerge.converter.xml.EmbeddedBinaryObject;
-import org.openoffice.xmerge.converter.xml.EmbeddedXMLObject;
-import org.openoffice.xmerge.converter.xml.sxw.SxwDocument;
-
-import writer2latex.Application;
-import writer2latex.util.*;
-import writer2latex.xmerge.*;
-import writer2latex.office.*;
-import writer2latex.latex.style.*;
-import writer2latex.latex.content.*;
-
-/**
- * <p>This class converts a Writer XML file to a LaTeX file<.</p>
- */
-public final class ConverterPalette {
- // Basic data
- private Config config;
- private ConvertData convertData;
- private LaTeXDocument texDoc;
- private SxwDocument sxwDoc;
- private String sOutFileName;
-
- // Styles
- private I18n i18n;
- private WriterStyleCollection wsc = new WriterStyleCollection();
- private CharStyleConverter charSc;
- private ListStyleConverter listSc;
- private ParStyleConverter parSc;
- private PageStyleConverter pageSc;
- private SectionStyleConverter sectionSc;
- private TableStyleConverter tableSc;
- private NoteConfigurationConverter noteCc;
-
- // Content
- private BlockConverter blockCv;
- private IndexConverter indexCv;
- private NoteConverter noteCv;
- private InlineConverter inlineCv;
- private FieldConverter fieldCv;
- private DrawConverter drawCv;
- private MathmlConverter mathmlCv;
- private Info info;
-
- // Default context
- private Context mainContext;
-
- // Meta Data
- private MetaData metaData;
-
- // Graphics
- private ImageLoader imageLoader;
-
- // Constructor
- public ConverterPalette(SxwDocument sxwDoc, String sConfigFileName) {
- sOutFileName = sxwDoc.getName();
- config = new Config();
- // Read the specified configuration, if any
- if (sConfigFileName!=null) {
- File f = new File(sConfigFileName);
- if (f.exists()) {
- config.read(sConfigFileName);
- }
- else {
- System.out.println("Oops - the configuration file " + sConfigFileName + " does not exist!");
- }
- }
-
- this.sxwDoc = sxwDoc;
- convertData = new ConvertData();
-
- metaData = new MetaData(sxwDoc);
-
- // Load style info
- wsc.loadStylesFromDOM(sxwDoc.getStyleDOM(),sxwDoc.getContentDOM());
-
- i18n = new I18n(wsc,config,this);
- charSc = new CharStyleConverter(wsc,config,this);
- listSc = new ListStyleConverter(wsc,config,this);
- pageSc = new PageStyleConverter(wsc,config,this);
- parSc = new ParStyleConverter(wsc,config,this);
- sectionSc = new SectionStyleConverter(wsc,config,this);
- tableSc = new TableStyleConverter(wsc,config,this);
- noteCc = new NoteConfigurationConverter(wsc,config,this);
-
- blockCv = new BlockConverter(config,this);
- indexCv = new IndexConverter(config,this);
- noteCv = new NoteConverter(config,this);
- inlineCv = new InlineConverter(config,this);
- fieldCv = new FieldConverter(config,this);
- drawCv = new DrawConverter(config,this);
- mathmlCv = new MathmlConverter(config,this);
- info = new Info(config,this);
-
- if (config.debug()) {
- System.out.println();
- System.out.println("Loaded "+i18n.getCharCount()+" unicode symbols");
- }
- }
-
- public void setOutFileName(String s) {
- sOutFileName = Misc.trimDocumentName(s,".tex");
- }
-
- public String getOutFileName() { return sOutFileName; }
-
- public I18n getI18n() { return i18n; }
- public CharStyleConverter getCharSc() { return charSc; }
- public ParStyleConverter getParSc() { return parSc; }
- public ListStyleConverter getListSc() { return listSc; }
- public PageStyleConverter getPageSc() { return pageSc; }
- public SectionStyleConverter getSectionSc() { return sectionSc; }
- public TableStyleConverter getTableSc() { return tableSc; }
- public NoteConfigurationConverter getNoteCc() { return noteCc; }
- public BlockConverter getBlockCv() { return blockCv; }
- public IndexConverter getIndexCv() { return indexCv; }
- public NoteConverter getNoteCv() { return noteCv; }
- public InlineConverter getInlineCv() { return inlineCv; }
- public FieldConverter getFieldCv() { return fieldCv; }
- public DrawConverter getDrawCv() { return drawCv; }
- public MathmlConverter getMathmlCv() { return mathmlCv; }
- public Info getInfo() { return info; }
-
- public boolean isPackage() {
- return sxwDoc.getStyleDOM()==null;
- }
-
- public Context getMainContext() { return mainContext; }
-
- public MetaData getMetaData() { return metaData; }
-
- public ImageLoader getImageLoader() { return imageLoader; }
-
- public void addDocument(org.openoffice.xmerge.Document doc) { convertData.addDocument(doc); }
-
- public EmbeddedObject getEmbeddedObject(String sHref) {
- if (sHref.startsWith("#")) {
- // Embedded object in package
- sHref = sHref.substring(1);
- if (sHref.startsWith("./")) { sHref = sHref.substring(2); }
- return sxwDoc.getEmbeddedObject(sHref);
- }
- else {
- // TODO: Linked object
- return null;
- }
- }
-
- public ConvertData convert() {
- // Cannot initialize the imageloader in the constructor, because
- // sOutFileName may be changed later
- imageLoader = new ImageLoader(sxwDoc,sOutFileName,true);
- this.texDoc = new LaTeXDocument(sOutFileName);
- texDoc.setEncoding(I18n.writeJavaEncoding(config.getInputencoding()));
-
- Document styles = sxwDoc.getStyleDOM();
- Document doc = sxwDoc.getContentDOM();
-
- i18n.setDefaultLanguage(i18n.getMajorityLanguage());
-
- // Setup context.
- // The default language is specified in the default paragraph style:
- mainContext = new Context();
- mainContext.resetFormattingFromStyle(wsc.getDefaultParStyle());
-
- // Create main LaTeXDocumentPortions
- LaTeXDocumentPortion packages = new LaTeXDocumentPortion(false);
- LaTeXDocumentPortion declarations = new LaTeXDocumentPortion(false);
- LaTeXDocumentPortion body = new LaTeXDocumentPortion(true);
-
- // Traverse the body (in flat HTML there may be several bodies, but
- // the first one is the main body).
- NodeList list;
- list = doc.getElementsByTagName(XMLString.OFFICE_BODY);
- int nLen = list.getLength();
- if (nLen > 0) {
- Element node = (Element) list.item(0);
- prepass(node);
- blockCv.traverseBlockText(node,body,mainContext);
- noteCv.insertEndnotes(body);
- }
-
- // Add declarations from our helpers
- i18n.appendDeclarations(packages,declarations);
- charSc.appendDeclarations(packages,declarations);
- parSc.appendDeclarations(packages,declarations);
- listSc.appendDeclarations(packages,declarations);
- pageSc.appendDeclarations(packages,declarations);
- sectionSc.appendDeclarations(packages,declarations);
- tableSc.appendDeclarations(packages,declarations);
- noteCc.appendDeclarations(packages,declarations);
-
- blockCv.appendDeclarations(packages,declarations);
- indexCv.appendDeclarations(packages,declarations);
- noteCv.appendDeclarations(packages,declarations);
- inlineCv.appendDeclarations(packages,declarations);
- fieldCv.appendDeclarations(packages,declarations);
- drawCv.appendDeclarations(packages,declarations);
- mathmlCv.appendDeclarations(packages,declarations);
-
- // Add custom preamble
- LinkedList customPreamble = config.getCustomPreamble();
- int nCPLen = customPreamble.size();
- for (int i=0; i<nCPLen; i++) {
- declarations.append( (String) customPreamble.get(i) ).nl();
- }
-
- // Set \title (for \maketitle)
- createMeta("title",metaData.getTitle(),declarations);
-
- // Create options for documentclass
- CSVList docOptions = new CSVList(',');
-
- StyleWithProperties dpStyle = wsc.getDefaultParStyle();
- if (dpStyle!=null) {
- String s = dpStyle.getProperty(XMLString.FO_FONT_SIZE);
- if ("10pt".equals(s)) { docOptions.addValue("10pt"); }
- if ("11pt".equals(s)) { docOptions.addValue("11pt"); }
- if ("12pt".equals(s)) { docOptions.addValue("12pt"); }
- }
-
- // TODO: twoside option should be optional :-)
- if (config.pageFormatting()!=Config.IGNORE_ALL) { docOptions.addValue("twoside"); }
-
- // Temp solution. TODO: Fix when new CSVList is implemented
- if (config.getGlobalOptions().length()>0) {
- docOptions.addValue(config.getGlobalOptions());
- }
-
- // Assemble the document
- LaTeXDocumentPortion result = texDoc.getContents();
-
- if (!config.noPreamble()) {
- // Create document class declaration
- result.append("% This file was converted to LaTeX by Writer2LaTeX ver. "+Application.getVersion()).nl()
- .append("% see http://www.hj-gym.dk/~hj/writer2latex for more info").nl();
- result.append("\\documentclass");
- if (!docOptions.isEmpty()) {
- result.append("[").append(docOptions.toString()).append("]");
- }
- result.append("{").append(config.getDocumentclass()).append("}").nl();
-
- result.append(packages)
- .append(declarations)
- .append("\\begin{document}").nl();
- }
-
- result.append(body);
-
- if (!config.noPreamble()) {
- result.append("\\end{document}").nl();
- }
-
- // Return the converted data
- convertData.addDocument(texDoc);
- if (indexCv.getBibTeXDocument()!=null) {
- convertData.addDocument(indexCv.getBibTeXDocument());
- }
- return convertData;
- }
-
- private void createMeta(String sName, String sValue,LaTeXDocumentPortion ldp) {
- if (sValue==null) { return; }
- // Meta data is assumed to be in the default language:
- ldp.append("\\"+sName+"{"+i18n.convert(sValue,false,mainContext.getLang())+"}").nl();
- }
-
- /* Prepass. Ensures that we onl include \label and \hypertarget
- when it is actually needed.
- An exception is text:reference, where we always include the \label
- */
- private void prepass(Node node) {
- if (node.hasChildNodes()) {
- NodeList list = node.getChildNodes();
- int nLen = list.getLength();
- for (int i=0; i<nLen; i++) {
- Node child = list.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE) {
- String sName = child.getNodeName();
- if (sName.equals(XMLString.TEXT_FOOTNOTE_REF)) {
- String sRefName = Misc.getAttribute(child,XMLString.TEXT_REF_NAME);
- if (sRefName!=null) { noteCv.addFootnoteName(sRefName); }
- }
- else if (sName.equals(XMLString.TEXT_ENDNOTE_REF)) {
- String sRefName = Misc.getAttribute(child,XMLString.TEXT_REF_NAME);
- if (sRefName!=null) { noteCv.addEndnoteName(sRefName); }
- }
- else if (sName.equals(XMLString.TEXT_SEQUENCE_REF)) {
- String sRefName = Misc.getAttribute(child,XMLString.TEXT_REF_NAME);
- if (sRefName!=null) { fieldCv.addSequenceName(sRefName); }
- }
- else if (sName.equals(XMLString.TEXT_BOOKMARK_REF)) {
- String sRefName = Misc.getAttribute(child,XMLString.TEXT_REF_NAME);
- if (sRefName!=null) { fieldCv.addBookmarkName(sRefName); }
- }
- else if (sName.equals(XMLString.TEXT_A)) {
- String sHref = Misc.getAttribute(child,XMLString.XLINK_HREF);
- if (sHref!=null && sHref.startsWith("#")) {
- fieldCv.addTargetName(sHref.substring(1));
- }
- }
- prepass(child);
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/DocumentSerializerImpl.java b/xmerge/source/writer2latex/source/writer2latex/latex/DocumentSerializerImpl.java
deleted file mode 100644
index d3b5b9b3f3fa..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/DocumentSerializerImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/************************************************************************
- *
- * DocumentSerializerImpl.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2001-2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * version 0.3.3f (2004-09-22)
- *
- */
-
-package writer2latex.latex;
-
-import org.openoffice.xmerge.ConvertData;
-import org.openoffice.xmerge.ConvertException;
-import org.openoffice.xmerge.Document;
-import org.openoffice.xmerge.DocumentSerializer;
-import org.openoffice.xmerge.converter.xml.sxw.SxwDocument;
-
-import java.io.IOException;
-
-/**
- * <p>LaTeX implementation of <code>DocumentSerializer</code></p>
- *
- * <p>This converts an OpenOffice Writer XML files to a LaTeX file<.</p>
- *
- */
-public final class DocumentSerializerImpl
- implements DocumentSerializer {
-
- private SxwDocument sxwDoc;
-
- /**
- * <p>Initialises a new <code>DocumentSerializerImpl</code> using the.<br>
- * supplied <code>Document</code></p>
- *
- * <p>The supplied document should be an {@link
- * org.openoffice.xmerge.converter.xml.sxw.SxwDocument SxwDocument}
- * object.</p>
- *
- * @param document The <code>Document</code> to convert.
- */
- public DocumentSerializerImpl(Document doc) {
- sxwDoc = (SxwDocument) doc;
- }
-
-
- /**
- * <p>Convert the data passed into the <code>DocumentSerializerImpl</code>
- * constructor into LaTeX format.</p>
- *
- * <p>This method may or may not be thread-safe. It is expected
- * that the user code does not call this method in more than one
- * thread. And for most cases, this method is only done once.</p>
- *
- * @return <code>ConvertData</code> object to pass back the
- * converted data.
- *
- * @throws ConvertException If any conversion error occurs.
- * @throws IOException If any I/O error occurs.
- */
- public ConvertData serialize() throws IOException, ConvertException {
- // The actual conversion is done elsewhere, this file only contains the
- // xmerge plugin logic
- ConverterPalette converter = new ConverterPalette(sxwDoc,null);
- return converter.convert();
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/HeadingMap.java b/xmerge/source/writer2latex/source/writer2latex/latex/HeadingMap.java
deleted file mode 100644
index 10cb2f0c0b68..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/HeadingMap.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/************************************************************************
- *
- * HeadingMap.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-08-26)
- *
- */
-
-package writer2latex.latex;
-
-/** This class contains data for the mapping of OOo headings to LaTeX headings.
- A LaTeX heading is characterized by a name and a level.
- The heading is inserted with \name{...} or \name[...]{...}
- The headings are supposed to be "normal" LaTeX headings,
- ie. the names are also counter names, and the headings
- can be reformatted using \@startsection etc.
- Otherwise max-level should be zero.
-*/
-public class HeadingMap {
- private int nMaxLevel;
- private String[] sName;
- private int[] nLevel;
-
- /** Constructor: Create a new HeadingMap
- @param nMaxLevel the maximal level of headings that are mapped */
- public HeadingMap(int nMaxLevel) {
- reset(nMaxLevel);
- }
-
- /** Clear all data associated with this HeadingMap (in order to reuse it) */
- public void reset(int nMaxLevel) {
- this.nMaxLevel = nMaxLevel;
- sName = new String[nMaxLevel+1];
- nLevel = new int[nMaxLevel+1];
- }
-
- /** Set data associated with a specific heading level */
- public void setLevelData(int nWriterLevel, String sName, int nLevel) {
- this.sName[nWriterLevel] = sName;
- this.nLevel[nWriterLevel] = nLevel;
- }
-
- /** Returns the maximal Writer level associated with this HeadingMap */
- public int getMaxLevel() { return nMaxLevel; }
-
- /** Return the name (for counter and \@startsection) for this level */
- public String getName(int nWriterLevel) { return sName[nWriterLevel]; }
-
- /** Return the LaTeX level for this Writer level (for \@startsection) */
- public int getLevel(int nWriterLevel) { return nLevel[nWriterLevel]; }
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/LaTeXDocument.java b/xmerge/source/writer2latex/source/writer2latex/latex/LaTeXDocument.java
deleted file mode 100644
index a7454764bc20..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/LaTeXDocument.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/************************************************************************
- *
- * LaTeXDocument.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-08-26)
- *
- */
-
-package writer2latex.latex;
-
-import org.openoffice.xmerge.Document;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-
-/**
- * <p>Class representing a LaTeX document.</p>
- *
- */
-public class LaTeXDocument implements Document {
- private static final String FILE_EXTENSION = ".tex";
-
- private String sName;
-
- private String sEncoding = "ASCII";
-
- private LaTeXDocumentPortion contents;
-
- /**
- * <p>Constructs a new LaTeX Document.</p>
- *
- * <p>This new document is empty. Document data must added to the preamble and
- * the body using appropriate methods.</p>
- *
- * @param name The name of the <code>LaTeXDocument</code>.
- */
- public LaTeXDocument(String sName) {
- this.sName = trimDocumentName(sName);
- contents = new LaTeXDocumentPortion(true);
- }
-
- /**
- * <p>This method is supposed to read <code>byte</code> data from the InputStream.
- * Currently it does nothing, since we don't need it.</p>
- *
- * @param is InputStream containing a LaTeX data file.
- *
- * @throws IOException In case of any I/O errors.
- */
- public void read(InputStream docData) throws IOException {
- // Do nothing.
- }
-
-
- /**
- * <p>Returns the <code>Document</code> name with no file extension.</p>
- *
- * @return The <code>Document</code> name with no file extension.
- */
- public String getName() {
- return sName;
- }
-
-
- /**
- * <p>Returns the <code>Document</code> name with file extension.</p>
- *
- * @return The <code>Document</code> name with file extension.
- */
- public String getFileName() {
- return new String(sName + FILE_EXTENSION);
- }
-
-
- /**
- * <p>Writes out the <code>Document</code> content to the specified
- * <code>OutputStream</code>.</p>
- *
- * <p>This method may not be thread-safe.
- * Implementations may or may not synchronize this
- * method. User code (i.e. caller) must make sure that
- * calls to this method are thread-safe.</p>
- *
- * @param os <code>OutputStream</code> to write out the
- * <code>Document</code> content.
- *
- * @throws IOException If any I/O error occurs.
- */
- public void write(OutputStream os) throws IOException {
- OutputStreamWriter osw = new OutputStreamWriter(os,sEncoding);
- contents.write(osw,72,"\n");
- osw.flush();
- osw.close();
- }
-
- /**
- * <p> Set the output encoding to use when writing the document.</p>
- */
- public void setEncoding(String sEncoding) { this.sEncoding = sEncoding; }
-
- /**
- * <p>Returns the <code>LaTeXDocumentPortion</code>, that contains the
- * contents of the document.</p>
- *
- * @return The content <code>LaTeXDocumentPortion</code>.
- */
- public LaTeXDocumentPortion getContents(){
- return contents;
- }
-
- /*
- * Utility method to make sure the document name is stripped of any file
- * extensions before use.
- */
- private String trimDocumentName(String name) {
- String temp = name.toLowerCase();
-
- if (temp.endsWith(FILE_EXTENSION)) {
- // strip the extension
- int nlen = name.length();
- int endIndex = nlen - FILE_EXTENSION.length();
- name = name.substring(0,endIndex);
- }
-
- return name;
- }
-}
- \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/LaTeXDocumentPortion.java b/xmerge/source/writer2latex/source/writer2latex/latex/LaTeXDocumentPortion.java
deleted file mode 100644
index e6701914de7a..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/LaTeXDocumentPortion.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/************************************************************************
- *
- * LaTeXDocumentPortion.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-08-26)
- *
- */
-
-package writer2latex.latex;
-
-import java.io.OutputStreamWriter;
-import java.io.IOException;
-import java.util.Vector;
-
-import writer2latex.util.Misc;
-
-/** This class represents a portion of a LaTeX document. A portion is any
-number of lines, and may include subportions. */
-public class LaTeXDocumentPortion {
-
- private Vector nodes; // The collection of all nodes in this portion
-
- private StringBuffer curText; // The currently active node (always the last node)
- private boolean bEmpty; // Is the active node empty?
-
- private boolean bWrap; // Do we allow line wrap in this portion?
-
- public LaTeXDocumentPortion(boolean bWrap){
- this.bWrap = bWrap;
- nodes = new Vector();
- curText = new StringBuffer();
- bEmpty = true;
- }
-
- /** Add another portion to the end of this portion */
- public LaTeXDocumentPortion append(LaTeXDocumentPortion ldp) {
- if (!bEmpty) {
- // add the current node to the node list and create new current node
- nodes.add(curText);
- curText = new StringBuffer();
- bEmpty = true;
- }
- nodes.add(ldp);
- return this;
- }
-
- /** Add a string to the end of this portion */
- public LaTeXDocumentPortion append(String s){
- curText.append(s);
- bEmpty = false; // even if this is the empty string!
- return this;
- }
-
- /** Add a newline to the end of this portion */
- public LaTeXDocumentPortion nl(){
- curText.append("\n");
- bEmpty = false;
- return this;
- }
-
- /** write a segment of text (eg. a word) to the output */
- private void writeSegment(String s, int nStart, int nEnd, OutputStreamWriter osw) throws IOException {
- for (int i=nStart; i<nEnd; i++) { osw.write(s.charAt(i)); }
- }
-
- /** write the contents of a StringBuffer to the output */
- private void writeBuffer(StringBuffer text, OutputStreamWriter osw, int nLineLen, String sNewline) throws IOException {
- String s = text.toString();
- int nLen = s.length();
-
- int[] nBreakPoints = new int[100];
- int nLastBPIndex = 99;
-
- int nStart = 0;
-
- while (nStart<nLen) {
- // identify line and breakpoints
- int nBPIndex = 0;
- boolean bEscape = false;
- boolean bComment = false;
- int nNewline = nStart;
- char c;
- while (nNewline<nLen) {
- if (nBPIndex==nLastBPIndex) {
- nBreakPoints = Misc.doubleIntArray(nBreakPoints);
- nLastBPIndex = nBreakPoints.length-1;
- }
- c = s.charAt(nNewline);
- if (c=='\n') {
- nBreakPoints[nBPIndex++] = nNewline;
- break;
- }
- if (bEscape) { bEscape = false; }
- else if (c=='\\') { bEscape = true; }
- else if (c=='%') { bComment = true; }
- else if (!bComment && c==' ') { nBreakPoints[nBPIndex++] = nNewline; }
- nNewline++;
- }
- if (nBPIndex==nLastBPIndex) {
- nBreakPoints = Misc.doubleIntArray(nBreakPoints);
- nLastBPIndex = nBreakPoints.length-1;
- }
- if (nNewline==nLen) { nBreakPoints[nBPIndex++] = nNewline; }
-
- // write out line
- int nCurLineLen = nBreakPoints[0]-nStart;
- writeSegment(s,nStart,nBreakPoints[0],osw);
- for (int i=0; i<nBPIndex-1; i++) {
- int nSegmentLen = nBreakPoints[i+1]-nBreakPoints[i];
- if (nSegmentLen+nCurLineLen>nLineLen) {
- // break line before this segment
- osw.write(sNewline);
- nCurLineLen = nSegmentLen;
- }
- else {
- // segment fits in current line
- osw.write(" ");
- nCurLineLen += nSegmentLen;
- }
- writeSegment(s,nBreakPoints[i]+1,nBreakPoints[i+1],osw);
- }
- osw.write(sNewline);
- nStart = nNewline+1;
- }
- }
-
- /** write the contents of a StringBuffer to the output without wrap */
- private void writeBuffer(StringBuffer text, OutputStreamWriter osw, String sNewline) throws IOException {
- String s = text.toString();
- int nLen = s.length();
-
- int nStart = 0;
-
- while (nStart<nLen) {
- // identify line
- int nNewline = nStart;
- while (nNewline<nLen) {
- if (s.charAt(nNewline)=='\n') { break; }
- nNewline++;
- }
-
- // write out line
- writeSegment(s,nStart,nNewline,osw);
- osw.write(sNewline);
- nStart = nNewline+1;
- }
- }
-
- /** Write this portion to the output (note: nLineLen=0 means no wrap) */
- public void write(OutputStreamWriter osw, int nLineLen, String sNewline) throws IOException {
- int n = nodes.size();
- for (int i=0; i<n; i++) {
- if (nodes.get(i) instanceof LaTeXDocumentPortion) {
- ((LaTeXDocumentPortion) nodes.get(i)).write(osw,nLineLen,sNewline);
- }
- else if (bWrap && nLineLen>0) {
- writeBuffer((StringBuffer) nodes.get(i),osw,nLineLen,sNewline);
- }
- else {
- writeBuffer((StringBuffer) nodes.get(i),osw,sNewline);
- }
- }
- if (!bEmpty) { // write current node as well
- if (bWrap && nLineLen>0) {
- writeBuffer(curText,osw,nLineLen,sNewline);
- }
- else {
- writeBuffer(curText,osw,sNewline);
- }
- }
- }
-
-} // end class LaTeXDocumentPortion
-
-// TO DO: consider StringBuffer->ByteArrayOutputStream
-
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/PluginFactoryImpl.java b/xmerge/source/writer2latex/source/writer2latex/latex/PluginFactoryImpl.java
deleted file mode 100644
index 471925214ba6..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/PluginFactoryImpl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/************************************************************************
- *
- * PluginFactoryImpl.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * version 0.3.3f (2004-08-28)
- *
- */
-
-
-package writer2latex.latex;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-import org.openoffice.xmerge.Document;
-import org.openoffice.xmerge.ConvertData;
-import org.openoffice.xmerge.DocumentSerializer;
-import org.openoffice.xmerge.DocumentSerializerFactory;
-
-import org.openoffice.xmerge.converter.xml.sxw.SxwPluginFactory;
-
-import org.openoffice.xmerge.util.registry.ConverterInfo;
-
-
-/**
- * Factory class used to create converters to LaTeX 2e format.
- */
-public final class PluginFactoryImpl extends SxwPluginFactory
- implements DocumentSerializerFactory {
-
- /**
- * <p>Constructor that caches the <code>ConvertInfo</code> that
- * corresponds to the registry information for this plug-in.</p>
- *
- * @param ci <code>ConvertInfo</code> object.
- */
- public PluginFactoryImpl (ConverterInfo ci) {
- super(ci);
- }
-
- /**
- * <p>The <code>DocumentSerializer</code> is used to convert
- * from the OpenOffice Writer <code>Document</code> format
- * to LaTeX <code>Document</code> format.</p>
- *
- * <p>The <code>Document</code> object is passed along to the
- * created <code>DocumentSerializer</code> via its constructor.
- * The <code>Document</code> is read and converted when the
- * the <code>DocumentSerializer</code> object's
- * <code>serialize</code> method is called.</p>
- *
- * @param doc <code>Document</code> object that the created
- * <code>DocumentSerializer</code> object uses
- * as input.
- *
- * @return A <code>DocumentSerializer</code> object.
- */
- public DocumentSerializer createDocumentSerializer(Document doc) {
- return new DocumentSerializerImpl(doc);
- }
-
-
- /**
- * <p>Create a <code>Document</code> object that corresponds to
- * the LaTeX data passed in via the <code>InputStream</code>
- * object.
- *
- * <p>This method will read from the given <code>InputStream</code>
- * object. The returned <code>Document</code> object will contain
- * the necessary data for the other objects created by the
- * <code>PluginFactoryImpl</code> to process, like the
- * <code>DocumentSerializerImpl</code> object and a
- * <code>DocumentMerger</code> object.</p>
- * <p>Currently this method doesn't read anything, since it it not used.</p>
- *
- * @param name The <code>Document</code> name.
- * @param is <code>InputStream</code> object corresponding
- * to the <code>Document</code>.
- *
- * @return A <code>Document</code> object representing the
- * LaTeX format.
- *
- * @throws IOException If any I/O error occurs.
- */
-
- public Document createDeviceDocument(String name, InputStream is)
- throws IOException {
- LaTeXDocument texDoc = new LaTeXDocument(name);
- texDoc.read(is); // this has no effect currently
- return texDoc;
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/BlockConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/BlockConverter.java
deleted file mode 100644
index 77dff48fab22..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/BlockConverter.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/************************************************************************
- *
- * BlockConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2006 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.4b (2006-11-03)
- *
- */
-
-package writer2latex.latex.content;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-import writer2latex.office.XMLString;
-import writer2latex.office.TableGridModel;
-import writer2latex.latex.Context;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.HeadingMap;
-import writer2latex.latex.ConverterHelper;
-import writer2latex.latex.ConverterPalette;
-import writer2latex.latex.style.BeforeAfter;
-import writer2latex.latex.style.StyleMap;
-import writer2latex.latex.style.TableFormatter;
-
-/**
- * <p>This class handles basic block content, including the main text body,
- * sections, tables, lists, headings and paragraphs.</p>
- */
-public class BlockConverter extends ConverterHelper {
-
- public BlockConverter(Config config, ConverterPalette palette) {
- super(config,palette);
- }
-
- /** <p> Traverse block text (eg. content of body, section, list item).
- * This is traversed in logical order and dedicated handlers take care of
- * each block element.</p>
- * <p> (Note: As a rule, all handling of block level elements should add a
- * newline to the LaTeX document at the end of the block)</p>
- * @param <code>node</code> The element containing the block text
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void traverseBlockText(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // The current paragraph block:
- StyleMap blockMap = config.getParBlockStyleMap();
- String sBlockName = null;
-
- if (node.hasChildNodes()) {
- NodeList list = node.getChildNodes();
- int nLen = list.getLength();
-
- for (int i = 0; i < nLen; i++) {
- Node childNode = list.item(i);
-
- if (childNode.getNodeType() == Node.ELEMENT_NODE) {
- Element child = (Element)childNode;
- String sTagName = child.getTagName();
-
- palette.getInfo().addDebugInfo(child,ldp);
-
- // Start/End a paragraph block
- if (sTagName.equals(XMLString.TEXT_P)) {
- String sStyleName = child.getAttribute(XMLString.TEXT_STYLE_NAME);
- if (sBlockName!=null && !blockMap.isNext(sBlockName,sStyleName)) {
- // end current block
- String sAfter = blockMap.getAfter(sBlockName);
- if (sAfter.length()>0) ldp.append(sAfter).nl();
- sBlockName = null;
- }
- if (sBlockName==null && blockMap.contains(sStyleName)) {
- // start a new block
- sBlockName = sStyleName;
- String sBefore = blockMap.getBefore(sBlockName);
- if (sBefore.length()>0) ldp.append(sBefore).nl();
- }
- }
- else if (sBlockName!=null) {
- // non-paragraph: end current block
- String sAfter = blockMap.getAfter(sBlockName);
- if (sAfter.length()>0) ldp.append(sAfter).nl();
- sBlockName = null;
- }
-
-
- // Basic block content; handle by this class
- if (sTagName.equals(XMLString.TEXT_P)) {
- handleParagraph(child,ldp,oc,i==nLen-1);
- }
-
- else if(sTagName.equals(XMLString.TEXT_H)) {
- handleHeading(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TEXT_UNORDERED_LIST)) {
- handleList(child,ldp,oc,false);
- }
-
- else if (sTagName.equals(XMLString.TEXT_ORDERED_LIST)) {
- handleList(child,ldp,oc,true);
- }
- else if (sTagName.equals(XMLString.TABLE_TABLE)) {
- handleTable(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TABLE_SUB_TABLE)) {
- handleTable(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TEXT_SECTION)) {
- handleSection(child,ldp,oc);
- }
-
- // Draw elements may appear in block context if they are
- // anchored to page
- else if (sTagName.startsWith("draw:")) {
- palette.getDrawCv().handleDrawElement(child,ldp,oc);
- }
-
- // Indexes
- else if (sTagName.equals(XMLString.TEXT_TABLE_OF_CONTENT)) {
- palette.getIndexCv().handleTOC(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TEXT_ILLUSTRATION_INDEX)) {
- palette.getIndexCv().handleLOF(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TEXT_TABLE_INDEX)) {
- palette.getIndexCv().handleLOT(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TEXT_OBJECT_INDEX)) {
- palette.getIndexCv().handleObjectIndex(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TEXT_USER_INDEX)) {
- palette.getIndexCv().handleUserIndex(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TEXT_ALPHABETICAL_INDEX)) {
- palette.getIndexCv().handleAlphabeticalIndex(child,ldp,oc);
- }
-
- else if (sTagName.equals(XMLString.TEXT_BIBLIOGRAPHY)) {
- palette.getIndexCv().handleBibliography(child,ldp,oc);
- }
-
- // Sequence declarations appear in the main text body
- else if (sTagName.equals(XMLString.TEXT_SEQUENCE_DECLS)) {
- //handleSeqeuenceDecls(child);
- }
- // other tags are ignored
- }
- }
- }
-
- if (sBlockName!=null) {
- // end current block
- String sAfter = blockMap.getAfter(sBlockName);
- if (sAfter.length()>0) ldp.append(sAfter).nl();
- sBlockName = null;
- }
-
- }
-
- /** <p> Process a section (text:section tag)</p>
- * @param <code>node</code> The element containing the section
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleSection(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // TODO: Support linked sections
-
- // We may need a hyperlink target
- palette.getFieldCv().addTarget(node,"|region",ldp);
-
- // Apply the style
- String sStyleName = node.getAttribute(XMLString.TEXT_STYLE_NAME);
- BeforeAfter ba = new BeforeAfter();
- Context ic = (Context) oc.clone();
- palette.getSectionSc().applySectionStyle(sStyleName,ba,ic);
-
- // Do conversion
- if (ba.getBefore().length()>0) { ldp.append(ba.getBefore()).nl(); }
- traverseBlockText(node,ldp,ic);
- if (ba.getAfter().length()>0) { ldp.append(ba.getAfter()).nl(); }
- }
-
- /** <p> Process a table (table:table or table:sub-table tag)</p>
- * @param <code>node</code> The element containing the table
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleTable(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // Get a grid model of the table
- TableGridModel table = new TableGridModel(node);
-
- // Update the context
- Context ic = (Context) oc.clone();
- ic.setInTable(true);
-
- // Apply table style
- boolean bApplyCellFormat = config.formatting()>=Config.CONVERT_MOST;
- TableFormatter formatter = palette.getTableSc().getTableFormatter(table,
- !ic.isInMulticols(), bApplyCellFormat);
-
- // We may need a hyperlink target
- if (!formatter.isSubtable()) {
- palette.getFieldCv().addTarget(node,"|table",ldp);
- }
-
- // Export table declaration
- BeforeAfter baTable = new BeforeAfter();
- formatter.applyTableStyle(baTable);
- ldp.append(baTable.getBefore()).nl();
-
- // Export rows
- if (bApplyCellFormat || !formatter.isLongtable()) { ic.setNoFootnotes(true); }
- int nRowCount = table.getRowCount();
- int nColCount = table.getColCount();
- boolean bInHeader = false;
- // Add interrow material before first row:
- ldp.append(formatter.getInterrowMaterial(0)).nl();
- for (int nRow=0; nRow<nRowCount; nRow++){
- // Longtables may have headers:
- if (formatter.isLongtable()) {
- if (nRow==0 && table.getRow(nRow).isHeader()) {
- bInHeader = true;
- if (!bApplyCellFormat) { ic.setNoFootnotes(true); }
- }
- else if (bInHeader && !table.getRow(nRow).isHeader()) {
- bInHeader = false;
- if (!bApplyCellFormat) { ic.setNoFootnotes(false); }
- palette.getNoteCv().flushFootnotes(ldp,oc);
- ldp.append("\\endhead").nl();
- }
- }
-
- // Export columns in this row
- int nCol = 0;
- while (nCol<nColCount) {
- Element cell = (Element) table.getCell(nRow,nCol);
- if (XMLString.TABLE_TABLE_CELL.equals(cell.getNodeName())) {
- BeforeAfter baCell = new BeforeAfter();
- formatter.applyCellStyle(nRow,nCol,baCell);
- ldp.append(baCell.getBefore());
- traverseBlockText(cell,ldp,ic);
- ldp.append(baCell.getAfter());
- }
- // Otherwise ignore; the cell is covered by a \multicolumn entry.
- // (table:covered-table-cell)
- int nColSpan = Misc.getPosInteger(cell.getAttribute(
- XMLString.TABLE_NUMBER_COLUMNS_SPANNED),1);
- if (nCol+nColSpan<nColCount) { ldp.append("&").nl(); }
- nCol+=nColSpan;
- }
- ldp.append("\\\\").append(formatter.getInterrowMaterial(nRow+1)).nl();
- }
-
- // End table
- ldp.append(baTable.getAfter()).nl();
-
- // Footnotes are now allowed
- if (bApplyCellFormat || !formatter.isLongtable()) {
- palette.getNoteCv().flushFootnotes(ldp,oc);
- }
- }
-
-
- /** <p> Process a list (text:ordered-lst or text:unordered-list tag)</p>
- * @param <code>node</code> The element containing the list
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- * @param <code>bOrdered</code> true if this list is an ordered list
- */
- public void handleList(Element node, LaTeXDocumentPortion ldp, Context oc, boolean bOrdered) {
- // Set up new context
- Context ic = (Context) oc.clone();
- ic.incListLevel();
-
- // If the list contains headings, ignore it!
- if (ic.isIgnoreLists() || listContainsHeadings(node)) {
- ic.setIgnoreLists(true);
- traverseList(node,ldp,ic);
- return;
- }
-
- // Get the style name, if we don't know it already
- if (ic.getListStyleName()==null) {
- ic.setListStyleName(node.getAttribute(XMLString.TEXT_STYLE_NAME));
- }
-
- // Apply the style
- BeforeAfter ba = new BeforeAfter();
- palette.getListSc().applyListStyle(ic.getListStyleName(),ic.getListLevel(),
- bOrdered,"true".equals(node.getAttribute(XMLString.TEXT_CONTINUE_NUMBERING)),
- ba);
-
- // Export the list
- if (ba.getBefore().length()>0) { ldp.append(ba.getBefore()).nl(); }
- traverseList(node,ldp,ic);
- if (ba.getAfter().length()>0) { ldp.append(ba.getAfter()).nl(); }
- }
-
- /*
- * Process the contents of a list
- */
- private void traverseList (Element node, LaTeXDocumentPortion ldp, Context oc) {
- if (node.hasChildNodes()) {
- NodeList list = node.getChildNodes();
- int nLen = list.getLength();
-
- for (int i = 0; i < nLen; i++) {
- Node child = list.item(i);
-
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName();
-
- palette.getInfo().addDebugInfo((Element)child,ldp);
-
- if (nodeName.equals(XMLString.TEXT_LIST_ITEM)) {
- handleListItem((Element)child,ldp,oc);
- }
- if (nodeName.equals(XMLString.TEXT_LIST_HEADER)) {
- handleListItem((Element)child,ldp,oc);
- }
- }
- }
- }
- }
-
- private void handleListItem(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // Are we ignoring this list?
- if (oc.isIgnoreLists()) {
- traverseBlockText(node,ldp,oc);
- return;
- }
-
- // Apply the style
- BeforeAfter ba = new BeforeAfter();
- palette.getListSc().applyListItemStyle(
- oc.getListStyleName(), oc.getListLevel(),
- node.getNodeName().equals(XMLString.TEXT_LIST_HEADER),
- "true".equals(node.getAttribute(XMLString.TEXT_RESTART_NUMBERING)),
- Misc.getPosInteger(node.getAttribute(XMLString.TEXT_START_VALUE),1)-1,
- ba);
-
- // export the list item
- if (ba.getBefore().length()>0) {
- ldp.append(ba.getBefore());
- if (config.formatting()>=Config.CONVERT_MOST) { ldp.nl(); }
- }
- traverseBlockText(node,ldp,oc);
- if (ba.getAfter().length()>0) { ldp.append(ba.getAfter()).nl(); }
- }
-
- /*
- * Helper: Check to see, if this list contains headings
- * (in that case we will ignore the list!)
- */
- private boolean listContainsHeadings (Node node) {
- if (node.hasChildNodes()) {
- NodeList nList = node.getChildNodes();
- int len = nList.getLength();
- for (int i = 0; i < len; i++) {
- Node child = nList.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName();
- if (nodeName.equals(XMLString.TEXT_LIST_ITEM)) {
- if (listItemContainsHeadings(child)) return true;
- }
- if (nodeName.equals(XMLString.TEXT_LIST_HEADER)) {
- if (listItemContainsHeadings(child)) return true;
- }
- }
- }
- }
- return false;
- }
-
- private boolean listItemContainsHeadings(Node node) {
- if (node.hasChildNodes()) {
- NodeList nList = node.getChildNodes();
- int len = nList.getLength();
- for (int i = 0; i < len; i++) {
- Node child = nList.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String nodeName = child.getNodeName();
- if(nodeName.equals(XMLString.TEXT_H)) {
- return true;
- }
- if (nodeName.equals(XMLString.TEXT_ORDERED_LIST)) {
- if (listContainsHeadings(child)) return true;
- }
- if (nodeName.equals(XMLString.TEXT_UNORDERED_LIST)) {
- if (listContainsHeadings(child)) return true;
- }
- }
- }
- }
- return false;
- }
-
- /** <p>Process a heading.</p>
- * @param <code>node</code> The text:h element node containing the heading
- * @param <code>ldp</code> The <code>LaTeXDocumentPortion</code> to add LaTeX code to
- * @param <code>oc</code> The current context
- */
- public void handleHeading(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // Get the level, the heading map and the style name
- int nLevel = Misc.getPosInteger(node.getAttribute(XMLString.TEXT_LEVEL),1);
- HeadingMap hm = config.getHeadingMap();
- String sStyleName = node.getAttribute(XMLString.TEXT_STYLE_NAME);
-
- if (nLevel<=hm.getMaxLevel()) {
- // Always push the font used
- palette.getI18n().pushSpecialTable(palette.getParSc().getFontName(sStyleName));
-
- // Apply style
- BeforeAfter baHardPage = new BeforeAfter();
- BeforeAfter baHardChar = new BeforeAfter();
- Context ic = (Context) oc.clone();
- // Footnotes with multiple paragraphs does not work in sections
- ic.setNoFootnotes(true);
- palette.getParSc().applyHardHeadingStyle(nLevel, sStyleName,
- baHardPage, baHardChar, ic);
-
- // Export the heading
- ldp.append(baHardPage.getBefore());
- ldp.append("\\"+hm.getName(nLevel));
- // If this heading contains formatting, add optional argument:
- if (baHardChar.getBefore().length()>0 || containsElements(node)) {
- ldp.append("[");
- palette.getInlineCv().traversePlainInlineText(node,ldp,ic);
- ldp.append("]");
- }
- ldp.append("{").append(baHardChar.getBefore());
- palette.getInlineCv().traverseInlineText(node,ldp,ic,false);
- ldp.append(baHardChar.getAfter()).append("}").nl();
- ldp.append(baHardPage.getAfter());
-
- // Flush pending footnotes
- palette.getNoteCv().flushFootnotes(ldp,oc);
-
- // Include any floating frames
- palette.getDrawCv().flushFloatingFrames(ldp,ic);
-
- // Pop the font name
- palette.getI18n().popSpecialTable();
- }
- else { // beyond supported headings - export as ordinary paragraph
- handleParagraph(node,ldp,oc,false);
- }
- }
-
- /* Check to see if this node contains any element nodes, except reference marks */
- private boolean containsElements(Node node) {
- if (!node.hasChildNodes()) { return false; }
- NodeList list = node.getChildNodes();
- int nLen = list.getLength();
- for (int i = 0; i < nLen; i++) {
- Node child = list.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE &&
- !child.getNodeName().startsWith(XMLString.TEXT_REFERENCE_MARK)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * <p> Process a text:p tag</p>
- * @param <code>node</code> The text:h element node containing the heading
- * @param <code>ldp</code> The <code>LaTeXDocumentPortion</code> to add LaTeX code to
- * @param <code>oc</code> The current context
- * @param <code>bLastInBlock</code> If this is true, the paragraph is the
- * last one in a block, and we need no trailing blank line (eg. right before
- * \end{enumerate}).
- */
- public void handleParagraph(Element node, LaTeXDocumentPortion ldp, Context oc, boolean bLastInBlock) {
- // Empty paragraphs are often used to achieve vertical spacing in WYSIWYG
- // word processors. Hence we translate an empty paragraph to \bigskip.
- // This also solves the problem that LaTeX ignores empty paragraphs, Writer doesn't.
- // In a well-structured document, an empty paragraph is probably a mistake,
- // hence the configuration can specify that it should be ignored.
- if (!node.hasChildNodes()) {
- if (!config.ignoreEmptyParagraphs()) {
- ldp.nl().append("\\bigskip").nl();
- if (!bLastInBlock) { ldp.nl(); }
- }
- return;
- }
-
- // Get the style name for this paragraph
- String sStyleName = node.getAttribute(XMLString.TEXT_STYLE_NAME);
-
- // Always push the font used
- palette.getI18n().pushSpecialTable(palette.getParSc().getFontName(sStyleName));
-
- // Apply the style
- BeforeAfter ba = new BeforeAfter();
- Context ic = (Context) oc.clone();
- palette.getParSc().applyParStyle(sStyleName,ba,ic);
-
- // Do conversion
- ldp.append(ba.getBefore());
- if (ic.isVerbatim()) {
- palette.getInlineCv().traverseVerbatimInlineText(node,ldp,ic,false);
- }
- else {
- palette.getInlineCv().traverseInlineText(node,ldp,ic,false);
- }
- ldp.append(ba.getAfter());
- // Add a blank line except within verbatim and last in a block:
- if (!bLastInBlock && !ic.isVerbatim()) { ldp.nl(); }
-
- // Flush any floating frames from this paragraph
- palette.getDrawCv().flushFloatingFrames(ldp,ic);
-
- // pop the font name
- palette.getI18n().popSpecialTable();
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/DrawConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/DrawConverter.java
deleted file mode 100644
index 6d78ca42b179..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/DrawConverter.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/************************************************************************
- *
- * DrawConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2006 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.4b (2006-11-03)
- *
- */
-
-package writer2latex.latex.content;
-
-import java.util.LinkedList;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-
-import org.openoffice.xmerge.converter.xml.EmbeddedObject;
-import org.openoffice.xmerge.converter.xml.EmbeddedXMLObject;
-
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-import writer2latex.util.CSVList;
-import writer2latex.xmerge.BinaryGraphicsDocument;
-import writer2latex.office.XMLString;
-import writer2latex.office.MIMETypes;
-import writer2latex.office.ImageLoader;
-import writer2latex.latex.Context;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterHelper;
-import writer2latex.latex.ConverterPalette;
-
-/**
- * <p>This class handles draw elements.</p>
- */
-public class DrawConverter extends ConverterHelper {
-
- private boolean bNeedGraphicx = false;
-
- // Keep track of floating frames (images, textboxes...)
- private LinkedList floatingFrames = new LinkedList();
-
- public DrawConverter(Config config, ConverterPalette palette) {
- super(config,palette);
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (bNeedGraphicx) {
- pack.append("\\usepackage");
- if (config.getBackend()==Config.PDFTEX) pack.append("[pdftex]");
- else if (config.getBackend()==Config.DVIPS) pack.append("[dvips]");
- pack.append("{graphicx}").nl();
- }
- }
-
- public void handleDrawElement(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // node must be an elment in the draw namespace
- String sName = node.getTagName();
- if (sName.equals(XMLString.DRAW_OBJECT)) {
- handleDrawObject(node,ldp,oc);
- }
- else if ((!oc.isInHeaderFooter()) && sName.equals(XMLString.DRAW_IMAGE)) {
- handleDrawImage(node,ldp,oc);
- }
- else if ((!oc.isInHeaderFooter()) && sName.equals(XMLString.DRAW_TEXT_BOX)) {
- handleDrawTextBox(node,ldp,oc);
- }
- else if (sName.equals(XMLString.DRAW_A)) {
- // we handle this like text:a
- palette.getFieldCv().handleAnchor(node,ldp,oc);
- }
- else {
- // Other drawing objects (eg. shapes) are currently not supported
- ldp.append("[Warning: Draw object ignored]");
- }
- }
-
- //-----------------------------------------------------------------
- // handle draw:object elements (OOo objects such as Chart, Math,...)
-
- private void handleDrawObject(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sHref = node.getAttribute(XMLString.XLINK_HREF);
- if (sHref!=null && sHref.length()>0) { // embedded or linked object
- EmbeddedObject object = palette.getEmbeddedObject(sHref);
- if (object!=null) {
- if (MIMETypes.MATH.equals(object.getType())) {
- try {
- Document settings = ((EmbeddedXMLObject) object).getSettingsDOM();
- Document formuladoc = ((EmbeddedXMLObject) object).getContentDOM();
- Element formula = Misc.getChildByTagName(formuladoc,XMLString.MATH_MATH);
- ldp.append(" $")
- .append(palette.getMathmlCv().convert(settings,formula))
- .append("$ ");
- }
- catch (org.xml.sax.SAXException e) {
- e.printStackTrace();
- }
- catch (java.io.IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
- else { // flat xml, object is contained in node
- Element formula = Misc.getChildByTagName(node,XMLString.MATH_MATH);
- if (formula!=null) {
- ldp.append(" $")
- .append(palette.getMathmlCv().convert(null,formula))
- .append("$ ");
- }
- }
- }
-
- //--------------------------------------------------------------------------
- // Handle draw:image elements
-
- private void handleDrawImage(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sName = node.getAttribute(XMLString.TEXT_NAME);
- palette.getFieldCv().addTarget(node,"|graphics",ldp);
- String sAnchor = node.getAttribute(XMLString.TEXT_ANCHOR_TYPE);
- if (oc.isInFrame() || "as-char".equals(sAnchor)) {
- handleDrawImageAsChar(node,ldp,oc);
- }
- else {
- floatingFrames.add(node);
- }
- }
-
- private void handleDrawImageAsChar(Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append(" ");
- includeGraphics(node,ldp,oc);
- ldp.append(" ");
- }
-
- private void handleDrawImageFloat(Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append("\\begin{center}").nl();
- includeGraphics(node,ldp,oc);
- ldp.nl().append("\\end{center}").nl();
- }
-
- private void includeGraphics(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sFileName = null;
- boolean bCommentOut = true;
- String sHref = node.getAttribute(XMLString.XLINK_HREF);
- if (sHref!=null && sHref.length()>0) {
- // Workaround for bug in OOo's flat sxw export: The xlink:href starts
- // with a # if the image is in the same directory or a subdirectory.
- // We simply ignore that, which is o.k. because we only handle flat xml.
- if (sHref.startsWith("#")) { sHref=sHref.substring(1); }
- // Linked image is not yet handled by ImageLoader. This is a temp.
- // solution (will go away when ImageLoader is finished)
- sFileName = sHref;
- int nExtStart = sHref.lastIndexOf(".");
- String sExt = nExtStart>=0 ? sHref.substring(nExtStart).toLowerCase() : "";
- // Accept only relative filenames and supported filetypes:
- bCommentOut = sFileName.indexOf(":")>-1 || !(
- (config.getBackend()==config.PDFTEX && MIMETypes.JPEG_EXT.equals(sExt)) ||
- (config.getBackend()==config.PDFTEX && MIMETypes.PNG_EXT.equals(sExt)) ||
- (config.getBackend()==config.DVIPS && MIMETypes.EPS_EXT.equals(sExt)));
- }
- else { // embedded or base64 encoded image
- BinaryGraphicsDocument bgd = palette.getImageLoader().getImage(node);
- if (bgd!=null) {
- palette.addDocument(bgd);
- sFileName = bgd.getFileName();
- String sMIME = bgd.getDocumentMIMEType();
- bCommentOut = !(
- (config.getBackend()==config.PDFTEX && MIMETypes.JPEG.equals(sMIME)) ||
- (config.getBackend()==config.PDFTEX && MIMETypes.PNG.equals(sMIME)) ||
- (config.getBackend()==config.DVIPS && MIMETypes.EPS.equals(sMIME)));
- }
- }
-
- if (sFileName==null) {
- ldp.append("[Warning: Image not found]");
- return;
- }
-
- // Now for the actual inclusion:
- bNeedGraphicx = true;
- /* TODO (0.4): handle cropping and mirror:
- style:mirror can be none, vertical (lodret), horizontal (vandret),
- horizontal-on-odd, or
- horizontal-on-even (vandret pa ulige hhv. lige side).
- mirror is handled with scalebox, eg:
- %\\scalebox{-1}[1]{...}
- can check for even/odd page first!!
-
- fo:clip="rect(t,r,b,l) svarer til trim
- value can be auto - no clip!
- cropping is handled with clip and trim:
- \\includegraphics[clip,trim=l b r t]{...}
- note the different order from xsl-fo!
- */
-
- String sWidth = Misc.truncateLength(node.getAttribute(XMLString.SVG_WIDTH));
- String sHeight = Misc.truncateLength(node.getAttribute(XMLString.SVG_HEIGHT));
- if (bCommentOut) {
- ldp.append(" [Warning: Image ignored] ");
- ldp.append("% Unhandled or unsupported graphics:").nl().append("%");
- }
- ldp.append("\\includegraphics");
-
- CSVList options = new CSVList(',');
- if (sWidth!=null) { options.addValue("width="+sWidth); }
- if (sHeight!=null) { options.addValue("height="+sHeight); }
- if (!options.isEmpty()) {
- ldp.append("[").append(options.toString()).append("]");
- }
-
- ldp.append("{").append(sFileName).append("}");
- if (bCommentOut) { ldp.nl(); }
- }
-
- //--------------------------------------------------------------------------
- // handle draw:text-box element
-
- private void handleDrawTextBox(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sName = node.getAttribute(XMLString.TEXT_NAME);
- palette.getFieldCv().addTarget(node,"|frame",ldp);
- String sAnchor = node.getAttribute(XMLString.TEXT_ANCHOR_TYPE);
- if (oc.isInFrame() || "as-char".equals(sAnchor)) {
- makeDrawTextBox(node, ldp, oc);
- }
- else {
- floatingFrames.add(node);
- }
- }
-
- private void handleDrawTextBoxFloat(Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append("\\begin{center}").nl();
- makeDrawTextBox(node, ldp, oc);
- ldp.append("\\end{center}").nl();
- }
-
- private void makeDrawTextBox(Element node, LaTeXDocumentPortion ldp, Context oc) {
- Context ic = (Context) oc.clone();
- ic.setInFrame(true);
- ic.setNoFootnotes(true);
-
- String sWidth = Misc.truncateLength(node.getAttribute(XMLString.SVG_WIDTH));
- ldp.append("\\begin{minipage}{").append(sWidth).append("}").nl();
- palette.getBlockCv().traverseBlockText(node,ldp,ic);
- ldp.append("\\end{minipage}");
- if (!oc.isNoFootnotes()) { palette.getNoteCv().flushFootnotes(ldp,oc); }
- }
-
- //-------------------------------------------------------------------------
- //handle any pending floating frames
-
- public void flushFloatingFrames(LaTeXDocumentPortion ldp, Context oc) {
- // todo: fix language
- if (oc.isInFrame()) { return; }
- int n = floatingFrames.size();
- if (n==0) { return; }
- for (int i=0; i<n; i++) {
- Element node = (Element) floatingFrames.get(i);
- String sName = node.getNodeName();
- if (sName.equals(XMLString.DRAW_IMAGE)) {
- handleDrawImageFloat(node,ldp,oc);
- }
- else if (sName.equals(XMLString.DRAW_TEXT_BOX)) {
- handleDrawTextBoxFloat(node,ldp,oc);
- }
- }
- floatingFrames.clear();
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/FieldConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/FieldConverter.java
deleted file mode 100644
index 89d47582dc75..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/FieldConverter.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/************************************************************************
- *
- * FieldConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-10-01)
- *
- */
-
-package writer2latex.latex.content;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-
-import org.w3c.dom.Element;
-
-import writer2latex.util.Config;
-import writer2latex.util.ExportNameCollection;
-import writer2latex.office.XMLString;
-import writer2latex.latex.Context;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterHelper;
-import writer2latex.latex.ConverterPalette;
-
-/**
- * <p>This class handles text fields and links in the document.</p>
- */
-public class FieldConverter extends ConverterHelper {
-
- // Links & references
- private ExportNameCollection targets = new ExportNameCollection(true);
- private ExportNameCollection refnames = new ExportNameCollection(true);
- private ExportNameCollection bookmarknames = new ExportNameCollection(true);
- private ExportNameCollection seqrefnames = new ExportNameCollection(true);
-
- private boolean bUsesPageCount = false;
-
- public FieldConverter(Config config, ConverterPalette palette) {
- super(config,palette);
- }
-
- /** <p>Append declarations needed by the <code>FieldConverter</code> to
- * the preamble.</p>
- * @param <code>pack</code> the <code>LaTeXDocumentPortion</code> to which
- * declarations of packages should be added (<code>\\usepackage</code>).
- * @param <code>decl</code> the <code>LaTeXDocumentPortion</code> to which
- * other declarations should be added.
- */
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- // page count
- if (bUsesPageCount) {
- pack.append("\\usepackage{lastpage}").nl();
- // Known bug: If the document ends with \\newpage the pagecount will be one off.
- /*decl.append("% Page count").nl()
- .append("\\makeatletter").nl()
- .append("\\newcounter{pagecount}").nl()
- .append("\\def\\makep@gecount{\\immediate\\write\\@mainaux{\\string\\setcounter{pagecount}{\\arabic{page}}}}").nl()
- .append("\\AtEndDocument{\\makep@gecount}").nl()
- .append("\\makeatother").nl();*/
- }
-
- // use hyperref.sty
- if (config.useHyperref()){
- pack.append("\\usepackage{hyperref}").nl();
- pack.append("\\hypersetup{");
- if (config.getBackend()==Config.PDFTEX) pack.append("pdftex, ");
- else if (config.getBackend()==Config.DVIPS) pack.append("dvips, ");
- //else pack.append("hypertex");
- pack.append("colorlinks=true, linkcolor=blue, filecolor=blue, pagecolor=blue, urlcolor=blue");
- if (config.getBackend()==Config.PDFTEX) {
- pack.append(createPdfMeta("pdftitle",palette.getMetaData().getTitle()))
- .append(createPdfMeta("pdfauthor",palette.getMetaData().getCreator()))
- .append(createPdfMeta("pdfsubject",palette.getMetaData().getSubject()))
- .append(createPdfMeta("pdfkeywords",palette.getMetaData().getKeywords()));
- }
- pack.append("}").nl();
- }
- }
-
- public void addSequenceName(String sName) {
- seqrefnames.addName(urlDecode(sName));
- }
-
- /** <p>Process a sequence field (text:sequence tag)</p>
- * @param <code>node</code> The element containing the sequence field
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleSequence(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // Temp solution: Use current value, but support page references
- palette.getInlineCv().traversePCDATA(node,ldp,oc);
- String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
- if (sName!=null && seqrefnames.containsName(sName)) {
- ldp.append("\\label{seq:"+seqrefnames.getExportName(sName)+"}");
- }
- }
-
- /** <p>Process a sequence reference (text:sequence-ref tag)</p>
- * @param <code>node</code> The element containing the sequence reference
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleSequenceRef(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
- String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
- if ("page".equals(sFormat) && sName!=null) {
- ldp.append("\\pageref{seq:"+seqrefnames.getExportName(sName)+"}");
- }
- else { // use current value
- palette.getInlineCv().traversePCDATA(node,ldp,oc);
- }
- }
-
-
- public void addReferenceName(String sName) {
- refnames.addName(urlDecode(sName));
- }
-
- /** <p>Process a reference mark (text:reference-mark tag)</p>
- * @param <code>node</code> The element containing the reference mark
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleReferenceMark(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // Note: Always include \label here, even when it's not used
- String sName = node.getAttribute(XMLString.TEXT_NAME);
- if (sName!=null) {
- ldp.append("\\label{ref:"+refnames.getExportName(sName)+"}");
- }
- }
-
- /** <p>Process a reference (text:reference-ref tag)</p>
- * @param <code>node</code> The element containing the reference
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleReferenceRef(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
- String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
- if ("page".equals(sFormat) && sName!=null) {
- ldp.append("\\pageref{ref:"+refnames.getExportName(sName)+"}");
- }
- else { // use current value
- palette.getInlineCv().traversePCDATA(node,ldp,oc);
- }
- }
-
- public void addBookmarkName(String sName) {
- bookmarknames.addName(urlDecode(sName));
- }
-
- /** <p>Process a bookmark (text:bookmark tag)</p>
- * <p>A bookmark may be the target for either a hyperlink or a reference,
- * so this will generate a <code>\\hyperref</code> and/or a <code>\\label</code></p>
- * @param <code>node</code> The element containing the bookmark
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleBookmark(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sName = node.getAttribute(XMLString.TEXT_NAME);
- if (sName!=null) {
- // A bookmark may be used as a target for a hyperlink as well as
- // for a reference. We export whatever is actually used:
- addTarget(node,"",ldp);
- if (bookmarknames.containsName(sName)) {
- ldp.append("\\label{bkm:"+bookmarknames.getExportName(sName)+"}");
- }
- }
- }
-
- /** <p>Process a bookmark reference (text:bookmark-ref tag).</p>
- * @param <code>node</code> The element containing the bookmark reference
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleBookmarkRef(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
- String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
- if ("page".equals(sFormat) && sName!=null) {
- ldp.append("\\pageref{bkm:"+bookmarknames.getExportName(sName)+"}");
- }
- else { // use current value
- palette.getInlineCv().traversePCDATA(node,ldp,oc);
- }
- }
-
- /** <p>Process a hyperlink (text:a tag)</p>
- * @param <code>node</code> The element containing the hyperlink
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleAnchor(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sHref = node.getAttribute(XMLString.XLINK_HREF);
- if (sHref!=null) {
- if (sHref.startsWith("#")) {
- // TODO: hyperlinks to headings (?) and objects
- if (config.useHyperref()) {
- ldp.append("\\hyperlink{")
- .append(targets.getExportName(urlDecode(sHref.substring(1))))
- .append("}{");
- // ignore text style (let hyperref.sty handle the decoration):
- palette.getInlineCv().traverseInlineText(node,ldp,oc,false);
- ldp.append("}");
- }
- else { // user don't want to include hyperlinks
- palette.getInlineCv().traverseInlineText(node,ldp,oc,true);
- }
- }
- else {
- if (config.useHyperref()) {
- ldp.append("\\href{").append(urlDecode(sHref)).append("}{");
- // ignore text style (let hyperref.sty handle the decoration):
- palette.getInlineCv().traverseInlineText(node,ldp,oc,false);
- ldp.append("}");
- }
- else { // user don't want to include hyperlinks
- palette.getInlineCv().traverseInlineText(node,ldp,oc,true);
- }
- }
- }
- else {
- palette.getInlineCv().traverseInlineText(node,ldp,oc,true);
- }
- }
-
- public void addTargetName(String sName) {
- targets.addName(urlDecode(sName));
- }
-
- /** <p>Add a <code>\\hypertarget</code></p>
- * @param <code>node</code> The element containing the name of the target
- * @param <code>sSuffix</code> A suffix to be added to the target,
- * e.g. "|table" for a reference to a table.
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- */
- public void addTarget(Element node, String sSuffix, LaTeXDocumentPortion ldp) {
- String sName = node.getAttribute(XMLString.TEXT_NAME);
- if (sName == null) { sName = node.getAttribute(XMLString.TABLE_NAME); }
- if (sName == null || !config.useHyperref()) { return; }
- if (!targets.containsName(sName+sSuffix)) { return; }
- ldp.append("\\hypertarget{")
- .append(targets.getExportName(sName+sSuffix))
- .append("}{}");
- }
-
- /** <p>Process a page number field (text:page-number tag)</p>
- * @param <code>node</code> The element containing the page number field
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handlePageNumber(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // TODO: Obey attributes!
- ldp.append("\\thepage{}");
- }
-
- /** <p>Process a page count field (text:page-count tag)</p>
- * @param <code>node</code> The element containing the page count field
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handlePageCount(Element node, LaTeXDocumentPortion ldp, Context oc) {
- // TODO: Obey attributes!
- // Note: Actually LastPage refers to the page number of the last page, not the number of pages
- if (config.useLastpage()) {
- bUsesPageCount = true;
- ldp.append("\\pageref{LastPage}");
- }
- else {
- ldp.append("?");
- }
- }
-
- // Helpers:
-
- private String createPdfMeta(String sName, String sValue) {
- if (sValue==null) { return ""; }
- // Replace commas with semicolons (the keyval package doesn't like commas):
- sValue = sValue.replace(',', ';');
- // Meta data is assumed to be in the default language:
- return ", "+sName+"="+palette.getI18n().convert(sValue,false,palette.getMainContext().getLang());
- }
-
- private String urlDecode(String s) {
- try {
- return URLDecoder.decode(s,"UTF-8");
- }
- catch (UnsupportedEncodingException e) {
- return "";
- }
- }
-
-
-
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/IndexConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/IndexConverter.java
deleted file mode 100644
index d947c49cb71c..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/IndexConverter.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/************************************************************************
- *
- * IndexConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-04)
- *
- */
-
-package writer2latex.latex.content;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-
-import writer2latex.office.XMLString;
-import writer2latex.office.IndexMark;
-import writer2latex.office.BibMark;
-
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterHelper;
-import writer2latex.latex.ConverterPalette;
-import writer2latex.latex.Context;
-
-import writer2latex.bibtex.BibTeXDocument;
-
-/**
- * <p>This class handles indexes (table of contents, list of tables, list of
- * illustrations, object index, user index, alphabetical index, bibliography)
- * as well as their associated index marks.</p>
- */
-public class IndexConverter extends ConverterHelper {
-
- private BibTeXDocument bibDoc;
-
- private boolean bContainsAlphabeticalIndex = false;
-
- /** <p>Construct a new <code>IndexConverter</code>.
- * @param <code>config</code> the configuration to use
- * @param <code>palette</code> the <code>ConverterPalette</code> to link to
- * if such a document is created by the <code>IndexConverter</code>
- */
- public IndexConverter(Config config, ConverterPalette palette) {
- super(config,palette);
- }
-
- /** <p>Append declarations needed by the <code>IndexConverter</code> to
- * the preamble.
- * @param <code>pack</code> the <code>LaTeXDocumentPortion</code> to which
- * declarations of packages should be added (<code>\\usepackage</code>).
- * @param <code>decl</code> the <code>LaTeXDocumentPortion</code> to which
- * other declarations should be added.
- */
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (bContainsAlphabeticalIndex) {
- pack.append("\\usepackage{makeidx}").nl();
- decl.append("\\makeindex").nl();
- }
- }
-
- /** Process Table of Contents (text:table-of-content tag)
- * @param <code>node</code> The element containing the Table of Contents
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleTOC (Element node, LaTeXDocumentPortion ldp, Context oc) {
- /* TODO: Apply more formatting by modfification of \l@section etc.
- Something like this:
- \newcommand\l@section[2]{\@dottedtocline{1}{1.5em}{2.3em}{\textbf{#1}}{\textit{#2}}
- Textformatting is trivial; see article.cls for examples of more complicated
- formatting. Note: The section number can't be formatted indivdually.*/
-
- Element source = Misc.getChildByTagName(node,XMLString.TEXT_TABLE_OF_CONTENT_SOURCE);
- if (source!=null) {
- if ("chapter".equals(source.getAttribute(XMLString.TEXT_INDEX_SOURCE))) {
- ldp.append("[Warning: Table of content (for this chapter) ignored!]").nl().nl();
- }
- else {
- int nLevel = Misc.getPosInteger(source.getAttribute(XMLString.TEXT_OUTLINE_LEVEL),1);
- ldp.append("\\setcounter{tocdepth}{"+nLevel+"}").nl();
- Element title = Misc.getChildByTagName(source,XMLString.TEXT_INDEX_TITLE_TEMPLATE);
- if (title!=null) {
- ldp.append("\\renewcommand\\contentsname{");
- palette.getInlineCv().traversePCDATA(title,ldp,oc);
- ldp.append("}").nl();
- }
- }
- }
- ldp.append("\\tableofcontents").nl();
- }
-
- /** Process List of Illustrations (text:list-of-illustrations tag)
- * @param <code>node</code> The element containing the List of Illustrations
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleLOF (Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append("[Warning: List of illustrations ignored]").nl().nl();
- // lpd.append("\\listoffigures").nl();
- }
-
- /** Process List of Tables (text:list-of-tables tag)
- * @param <code>node</code> The element containing the List of Tables
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleLOT (Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append("[Warning: List of tables ignored]").nl().nl();
- // lpd.append("\\listoftables").nl();
- }
-
- /** Process Object Index (text:object index tag)
- * @param <code>node</code> The element containing the Object Index
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleObjectIndex (Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append("[Warning: Object index ignored]").nl().nl();
- }
-
- /** Process User Index (text:user-index tag)
- * @param <code>node</code> The element containing the User Index
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleUserIndex (Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append("[Warning: User index ignored]").nl().nl();
- }
-
-
- /** Process Bibliography (text:bibliography tag)
- * @param <code>node</code> The element containing the Bibliography
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleBibliography (Element node, LaTeXDocumentPortion ldp, Context oc) {
- if (config.useBibtex()) {
- if (bibDoc==null) { bibDoc = new BibTeXDocument(palette.getOutFileName()); }
- ldp.append("\\bibliographystyle{")
- .append(config.bibtexStyle())
- .append("}").nl();
- ldp.append("\\bibliography{")
- .append(bibDoc.getName())
- .append("}").nl();
- }
- else { // typeset current content
- Element body = Misc.getChildByTagName(node,XMLString.TEXT_INDEX_BODY);
- if (body!=null) {
- Element title = Misc.getChildByTagName(body,XMLString.TEXT_INDEX_TITLE);
- if (title!=null) { palette.getBlockCv().traverseBlockText(title,ldp,oc); }
- palette.getBlockCv().traverseBlockText(body,ldp,oc);
- }
- }
- }
-
- /** Process a Bibliography Mark (text:bibliography-mark tag)
- * @param <code>node</code> The element containing the Mark
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleBibliographyMark(Element node, LaTeXDocumentPortion ldp, Context oc) {
- if (config.useBibtex()) {
- if (bibDoc==null) { bibDoc = new BibTeXDocument(palette.getOutFileName()); }
- String sIdentifier = node.getAttribute(XMLString.TEXT_IDENTIFIER);
- if (!bibDoc.containsKey(sIdentifier)) {
- bibDoc.put(new BibMark(node));
- }
- ldp.append("\\cite{")
- .append(bibDoc.getExportName(sIdentifier))
- .append("}");
- }
- else { // use current value
- palette.getInlineCv().traverseInlineText(node,ldp,oc,false);
- }
- }
-
- /** Get the BibTeX document, if any (the document is only created if it's
- * specified in the configuration *and* the document contains bibliographic data).
- * @return the <code>BiBTeXDocument</code>, or null if it does not exist.
- */
- public BibTeXDocument getBibTeXDocument () {
- return bibDoc;
- }
-
- /** Process Alphabetical Index (text:alphabetical-index tag)
- * @param <code>node</code> The element containing the Alphabetical Index
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleAlphabeticalIndex (Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append("\\printindex").nl();
- bContainsAlphabeticalIndex = true;
- }
-
-
- /** Process an Alphabetical Index Mark (text:alphabetical-index-mark{-start} tag)
- * @param <code>node</code> The element containing the Mark
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleAlphabeticalIndexMark(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sValue = IndexMark.getIndexValue(node);
- if (sValue!=null) {
- ldp.append("\\index{");
- String sKey1 = IndexMark.getKey1(node);
- if (sKey1!=null) {
- writeIndexText(sKey1,ldp,oc);
- ldp.append("!");
- }
- String sKey2 = IndexMark.getKey2(node);
- if (sKey2!=null) {
- writeIndexText(sKey2,ldp,oc);
- ldp.append("!");
- }
- writeIndexText(sValue,ldp,oc);
- ldp.append("}");
- }
- }
-
- // Helper: Write the text of an index mark, escaping special characters
- private void writeIndexText(String sText, LaTeXDocumentPortion ldp, Context oc) {
- String sTextOut = palette.getI18n().convert(sText,false,oc.getLang());
- // need to escape !, @, | and ":
- int nLen = sTextOut.length();
- boolean bBackslash = false;
- for (int i=0; i<nLen; i++) {
- if (bBackslash) {
- ldp.append(sTextOut.substring(i,i+1));
- bBackslash = false;
- }
- else {
- switch (sTextOut.charAt(i)) {
- case '\\' : bBackslash = true;
- ldp.append("\\");
- break;
- case '!' :
- case '@' :
- case '|' :
- case '"' : ldp.append("\"");
- default : ldp.append(sTextOut.substring(i,i+1));
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/Info.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/Info.java
deleted file mode 100644
index 8b842526a5cd..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/Info.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/************************************************************************
- *
- * Info.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-09-17)
- *
- */
-
-package writer2latex.latex.content;
-
-import org.w3c.dom.Element;
-
-import writer2latex.util.Config;
-import writer2latex.office.XMLString;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterHelper;
-import writer2latex.latex.ConverterPalette;
-
-/**
- * <p>This class creates various information to the user about the conversion.</p>
- */
-public class Info extends ConverterHelper {
-
- public Info(Config config, ConverterPalette palette) {
- super(config,palette);
- }
-
- public void addDebugInfo(Element node, LaTeXDocumentPortion ldp) {
- if (config.debug()) {
- ldp.append("% ").append(node.getNodeName());
- addDebugInfo(node,ldp,XMLString.TEXT_ID);
- addDebugInfo(node,ldp,XMLString.TEXT_NAME);
- addDebugInfo(node,ldp,XMLString.TABLE_NAME);
- addDebugInfo(node,ldp,XMLString.TEXT_STYLE_NAME);
- ldp.nl();
- }
- }
-
- private void addDebugInfo(Element node, LaTeXDocumentPortion ldp, String sAttribute) {
- String sValue = node.getAttribute(sAttribute);
- if (sValue!=null) {
- ldp.append(" ").append(sAttribute).append("=\"").append(sValue).append("\"");
- }
- }
-
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/InlineConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/InlineConverter.java
deleted file mode 100644
index 86d34cfe13fb..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/InlineConverter.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/************************************************************************
- *
- * InlineConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3h (2004-12-09)
- *
- */
-
-package writer2latex.latex.content;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-import writer2latex.office.XMLString;
-import writer2latex.latex.style.BeforeAfter;
-import writer2latex.latex.Context;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.HeadingMap;
-import writer2latex.latex.ConverterHelper;
-import writer2latex.latex.ConverterPalette;
-
-/**
- * <p>This class handles basic inline text.</p>
- */
-public class InlineConverter extends ConverterHelper {
-
- public InlineConverter(Config config, ConverterPalette palette) {
- super(config,palette);
- }
-
- /*
- * Process normal inline text
- */
- public void traverseInlineText (Element node, LaTeXDocumentPortion ldp,
- Context oc, boolean styled) {
-
- // don't style it if a {foot|end}note is the only content
- if (onlyNote(node)) { styled=false; }
-
- boolean bNoFootnotes = false;
-
- String styleName = node.getAttribute(XMLString.TEXT_STYLE_NAME);
-
- // Always push the font used
- palette.getI18n().pushSpecialTable(palette.getCharSc().getFontName(styleName));
-
- // Apply the style
- BeforeAfter ba = new BeforeAfter();
- Context ic = (Context) oc.clone();
- palette.getCharSc().applyTextStyle(styleName,ba,ic);
-
- // Footnote problems:
- // No footnotes in sub/superscript (will disappear)
- // No multiparagraph footnotes embedded in text command (eg. \textbf{..})
- // Simple solution: styled text element is forbidden footnote area
- if (styled && !ic.isInFootnote()) { bNoFootnotes = true; }
- //String s = style.getProperty(XMLString.STYLE_TEXT_POSITION);
- //if (s!=null && !bProcessingFootnote) { bNoFootnotes = true; }
-
- // Temp solution: Ignore hard formatting in header/footer (name clash problem)
- // only in package format.
- //TODO: Reenable this!!!
- /*if (sxwDoc.getStyleDOM()!=null && palette.getCharSc().isAutomatic(styleName) && ic.isInHeaderFooter()) {
- styled = false;
- }*/
-
- if (styled) {
- if (bNoFootnotes) { ic.setNoFootnotes(true); }
- ldp.append(ba.getBefore());
- }
-
- if (node.hasChildNodes()) {
- NodeList nList = node.getChildNodes();
- int len = nList.getLength();
-
- for (int i = 0; i < len; i++) {
-
- Node childNode = nList.item(i);
- short nodeType = childNode.getNodeType();
-
- switch (nodeType) {
- case Node.TEXT_NODE:
- String s = childNode.getNodeValue();
- if (s.length() > 0) {
- ldp.append(palette.getI18n().convert(s,false,ic.getLang()));
- }
- break;
-
- case Node.ELEMENT_NODE:
- Element child = (Element)childNode;
- String sName = child.getTagName();
- if (child.getNodeName().startsWith("draw:")) {
- palette.getDrawCv().handleDrawElement(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_S)) {
- if (config.ignoreDoubleSpaces()) {
- ldp.append(" ");
- }
- else {
- int count= Misc.getPosInteger(child.getAttribute(XMLString.TEXT_C),1);
- String sSpace = config.ignoreDoubleSpaces() ? " " : "\\ ";
- for ( ; count > 0; count--) { ldp.append("\\ "); }
- }
- }
- else if (sName.equals(XMLString.TEXT_TAB_STOP)) {
- // tab stops are not supported by the onverter, but the special usage
- // of tab stops in header and footer can be emulated with \hfill
- // TODO: Sometimes extra \hfill should be added at end of line
- if (ic.isInHeaderFooter()) { ldp.append("\\hfill "); }
- else { ldp.append(" "); }
- }
- else if (sName.equals(XMLString.TEXT_LINE_BREAK)) {
- if (!ic.isInHeaderFooter() && !config.ignoreHardLineBreaks()) {
- ldp.append("\\newline").nl();
- }
- else { ldp.append(" "); }
- }
- else if (sName.equals(XMLString.TEXT_SPAN)) {
- if (ic.isVerbatim()) {
- traverseVerbatimInlineText(child,ldp,ic,true);
- }
- else {
- traverseInlineText (child,ldp,ic,true);
- }
- }
- else if (sName.equals(XMLString.TEXT_A)) {
- palette.getFieldCv().handleAnchor(child,ldp,ic);
- }
- else if (sName.equals(XMLString.OFFICE_ANNOTATION)) {
- handleOfficeAnnotation(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_PAGE_NUMBER)) {
- palette.getFieldCv().handlePageNumber(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_PAGE_COUNT)) {
- palette.getFieldCv().handlePageCount(child,ldp,ic);
- }
- else if (ic.isInHeaderFooter()) {
- if (sName.equals(XMLString.TEXT_CHAPTER)) {
- handleChapterField(child,ldp,ic);
- }
- else if (sName.startsWith("text:")) {
- traverseInlineText(child,ldp,ic,false);
- }
- }
- else {
- // These tags are ignored in header and footer
- if (sName.equals(XMLString.TEXT_FOOTNOTE)) {
- palette.getNoteCv().handleFootnote(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_ENDNOTE)) {
- palette.getNoteCv().handleEndnote(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_SEQUENCE)) {
- palette.getFieldCv().handleSequence(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_SEQUENCE_REF)) {
- palette.getFieldCv().handleSequenceRef(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_FOOTNOTE_REF)) {
- palette.getNoteCv().handleFootnoteRef(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_ENDNOTE_REF)) {
- palette.getNoteCv().handleEndnoteRef(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_REFERENCE_MARK)) {
- palette.getFieldCv().handleReferenceMark(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_REFERENCE_MARK_START)) {
- palette.getFieldCv().handleReferenceMark(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_REFERENCE_REF)) {
- palette.getFieldCv().handleReferenceRef(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_BOOKMARK)) {
- palette.getFieldCv().handleBookmark(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_BOOKMARK_START)) {
- palette.getFieldCv().handleBookmark(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_BOOKMARK_REF)) {
- palette.getFieldCv().handleBookmarkRef(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_BIBLIOGRAPHY_MARK)) {
- palette.getIndexCv().handleBibliographyMark(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_ALPHABETICAL_INDEX_MARK)) {
- palette.getIndexCv().handleAlphabeticalIndexMark(child,ldp,ic);
- }
- else if (sName.equals(XMLString.TEXT_ALPHABETICAL_INDEX_MARK_START)) {
- palette.getIndexCv().handleAlphabeticalIndexMark(child,ldp,ic);
- }
- else if (sName.startsWith("text:")) {
- traverseInlineText(child,ldp,ic,false);
- }
- }
- break;
- default:
- // Do nothing
- }
- }
- }
-
- if (styled) {
- ldp.append(ba.getAfter());
- ic.setNoFootnotes(false);
- if (!ic.isInFootnote()) { palette.getNoteCv().flushFootnotes(ldp,oc); }
- }
-
- // finally pop the special table
- palette.getI18n().popSpecialTable();
- }
-
- /* traverse inline text, ignoring any draw objects, footnotes, formatting and hyperlinks */
- public void traversePlainInlineText(Element node,LaTeXDocumentPortion ldp, Context oc) {
- if (node.hasChildNodes()) {
-
- // Always push the font used
- String styleName = node.getAttribute(XMLString.TEXT_STYLE_NAME);
- palette.getI18n().pushSpecialTable(palette.getCharSc().getFontName(styleName));
-
- NodeList nList = node.getChildNodes();
- int len = nList.getLength();
-
- for (int i = 0; i < len; i++) {
-
- Node childNode = nList.item(i);
- short nodeType = childNode.getNodeType();
-
- switch (nodeType) {
- case Node.TEXT_NODE:
- String s = childNode.getNodeValue();
- if (s.length() > 0) {
- ldp.append(palette.getI18n().convert(s,false,oc.getLang()));
- }
- break;
-
- case Node.ELEMENT_NODE:
- Element child = (Element)childNode;
- String sName = child.getTagName();
- if (sName.equals(XMLString.TEXT_S)) {
- int count= Misc.getPosInteger(child.getAttribute(XMLString.TEXT_C),1);
- for ( ; count > 0; count--) {
- ldp.append("\\ ");
- }
- }
- else if (sName.equals(XMLString.TEXT_TAB_STOP)) {
- // tab stops are not supported by the onverter
- ldp.append(" ");
- }
- else if (sName.equals(XMLString.TEXT_FOOTNOTE)) {
- // ignore
- }
- else if (sName.equals(XMLString.TEXT_ENDNOTE)) {
- // ignore
- }
- else if (sName.startsWith("text:")) {
- traversePlainInlineText(child,ldp,oc);
- }
- break;
- default:
- // Do nothing
- }
- }
- // finally pop the special table
- palette.getI18n().popSpecialTable();
- }
- }
-
- /* traverse verbatim inline text, ignoring any draw objects, footnotes, formatting and hyperlinks */
- public void traverseVerbatimInlineText(Element node,LaTeXDocumentPortion ldp, Context oc, boolean bInline) {
- if (node.hasChildNodes()) {
-
- NodeList nList = node.getChildNodes();
- int len = nList.getLength();
-
- for (int i = 0; i < len; i++) {
-
- Node childNode = nList.item(i);
- short nodeType = childNode.getNodeType();
-
- switch (nodeType) {
- case Node.TEXT_NODE:
- String s = childNode.getNodeValue();
- if (s.length() > 0) {
- // text is copied verbatim! (Will be replaced by
- // question marks if outside inputenc)
- ldp.append(s);
- }
- break;
-
- case Node.ELEMENT_NODE:
- Element child = (Element)childNode;
- String sName = child.getTagName();
- if (sName.equals(XMLString.TEXT_S)) {
- int count= Misc.getPosInteger(child.getAttribute(XMLString.TEXT_C),1);
- for ( ; count > 0; count--) {
- ldp.append(" ");
- }
- }
- else if (sName.equals(XMLString.TEXT_TAB_STOP)) {
- // tab stops are not supported by the onverter
- ldp.append(" ");
- }
- else if (sName.equals(XMLString.TEXT_LINE_BREAK)) {
- if (!bInline) { ldp.nl(); }
- }
- else if (sName.equals(XMLString.TEXT_FOOTNOTE)) {
- // ignore
- }
- else if (sName.equals(XMLString.TEXT_ENDNOTE)) {
- // ignore
- }
- else if (sName.startsWith("text:")) {
- traverseVerbatimInlineText(child,ldp,oc,bInline);
- }
- break;
- default:
- // Do nothing
- }
- }
- }
- }
-
- public void traversePCDATA(Element node, LaTeXDocumentPortion ldp, Context oc) {
- if (node.hasChildNodes()) {
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i=0; i<nLen; i++) {
- if (nl.item(i).getNodeType()==Node.TEXT_NODE) {
- ldp.append(palette.getI18n().convert(nl.item(i).getNodeValue(),false,oc.getLang()));
- }
- }
- }
- }
-
- private void handleChapterField(Element node, LaTeXDocumentPortion ldp, Context oc) {
- HeadingMap hm = config.getHeadingMap();
- int nLevel = Misc.getPosInteger(node.getAttribute(XMLString.TEXT_OUTLINE_LEVEL),1);
- if (nLevel<=hm.getMaxLevel()) {
- int nLaTeXLevel = hm.getLevel(nLevel);
- if (nLaTeXLevel==1) {
- palette.getPageSc().setChapterField1(node.getAttribute(XMLString.TEXT_DISPLAY));
- ldp.append("{\\leftmark}");
- }
- else if (nLaTeXLevel==2) {
- palette.getPageSc().setChapterField2(node.getAttribute(XMLString.TEXT_DISPLAY));
- ldp.append("{\\rightmark}");
- }
- }
- }
-
- ////////////////////////////////////////////////////////////////////
- // Annotations
-
- private void handleOfficeAnnotation(Element node, LaTeXDocumentPortion ldp, Context oc) {
- ldp.append("%").nl().append("%");
- Element paragraph = Misc.getChildByTagName(node,XMLString.TEXT_P);
- if (paragraph!=null) { traversePCDATA(paragraph,ldp,oc); }
- ldp.nl();
- }
-
- /* Check to see if this node has a footnote or endnote as the only subnode */
- private boolean onlyNote(Node node) {
- if (!node.hasChildNodes()) { return false; }
- NodeList nList = node.getChildNodes();
- int nLen = nList.getLength();
-
- for (int i = 0; i < nLen; i++) {
-
- Node child = nList.item(i);
- short nType = child.getNodeType();
- String sName = child.getNodeName();
-
- switch (nType) {
- case Node.TEXT_NODE: return false;
- case Node.ELEMENT_NODE:
- if (!XMLString.TEXT_FOOTNOTE.equals(sName) &&
- !XMLString.TEXT_ENDNOTE.equals(sName)) { return false; }
- }
- }
- return true;
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/MathmlConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/MathmlConverter.java
deleted file mode 100644
index 73e17aa5d286..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/MathmlConverter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/************************************************************************
- *
- * MathmlConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3i (2004-12-28)
- *
- */
-
-package writer2latex.latex.content;
-
-import java.util.Hashtable;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import writer2latex.office.*;
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterPalette;
-import writer2latex.latex.ConverterHelper;
-import writer2latex.latex.style.I18n;
-
-/**
- * <p>This class converts mathml nodes to LaTeX.
- * (Actually it only converts the starmath annotation currently, if available).</p>
- */
-public final class MathmlConverter extends ConverterHelper {
-
- private StarMathConverter smc;
-
- private boolean bContainsFormulas = false;
-
- public MathmlConverter(Config config, ConverterPalette palette) {
- super(config,palette);
- smc = new StarMathConverter(palette.getI18n(),config);
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (bContainsFormulas) {
- if (config.useOoomath()) {
- pack.append("\\usepackage{ooomath}").nl();
- }
- else {
- smc.appendDeclarations(pack,decl);
- }
- // Until reading settings for formulas is implemented, we need this
- decl.append("\\everymath{\\displaystyle}").nl();
- }
- }
-
- public String convert(Node settings, Node formula) {
- // TODO: Use settings to determine display mode/text mode
- // formula must be a math:math node
- // First try to find a StarMath annotation
- Node semantics = Misc.getChildByTagName(formula,XMLString.MATH_SEMANTICS);
- if (semantics!=null) {
- Node annotation = Misc.getChildByTagName(semantics,XMLString.MATH_ANNOTATION);
- if (annotation!=null) {
- String sStarMath = "";
- if (annotation.hasChildNodes()) {
- NodeList anl = annotation.getChildNodes();
- int nLen = anl.getLength();
- for (int i=0; i<nLen; i++) {
- if (anl.item(i).getNodeType() == Node.TEXT_NODE) {
- sStarMath+=anl.item(i).getNodeValue();
- }
- }
- bContainsFormulas = true;
- return smc.convert(sStarMath);
- }
- }
- }
- // No annotation was found. In this case we should convert the mathml,
- // but currently we ignore the problem.
- // TODO: Investigate if Vasil I. Yaroshevich's MathML->LaTeX
- // XSL transformation could be used here. (Potential problem:
- // OOo uses MathML 1.01, not MathML 2)
- return "\\text{Warning: No StarMath annotation}";
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/NoteConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/NoteConverter.java
deleted file mode 100644
index fb81b7744eab..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/NoteConverter.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/************************************************************************
- *
- * NoteConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3h (2004-12-09)
- *
- */
-
-package writer2latex.latex.content;
-
-import java.util.LinkedList;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-import writer2latex.util.ExportNameCollection;
-import writer2latex.office.XMLString;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterHelper;
-import writer2latex.latex.ConverterPalette;
-import writer2latex.latex.Context;
-
-/**
- * <p>This class handles conversion of footnotes and endnotes, including
- * references.</p>
- */
-public class NoteConverter extends ConverterHelper {
-
- private ExportNameCollection footnotenames = new ExportNameCollection(true);
- private ExportNameCollection endnotenames = new ExportNameCollection(true);
- private boolean bContainsEndnotes = false;
- private boolean bContainsFootnotes = false;
- // Keep track of footnotes (inside minipage etc.), that should be typeset later
- private LinkedList postponedFootnotes = new LinkedList();
-
- public NoteConverter(Config config, ConverterPalette palette) {
- super(config,palette);
- }
-
- /** <p>Append declarations needed by the <code>NoteConverter</code> to
- * the preamble.
- * @param <code>pack</code> the <code>LaTeXDocumentPortion</code> to which
- * declarations of packages should be added (<code>\\usepackage</code>).
- * @param <code>decl</code> the <code>LaTeXDocumentPortion</code> to which
- * other declarations should be added.
- */
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (bContainsEndnotes) { pack.append("\\usepackage{endnotes}").nl(); }
- if (bContainsFootnotes) palette.getNoteCc().convertFootnotesConfiguration(decl);
- if (bContainsEndnotes) palette.getNoteCc().convertEndnotesConfiguration(decl);
- }
-
- /** <p>Process a footnote (text:footnote tag)
- * @param <code>node</code> The element containing the footnote
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleFootnote(Element node, LaTeXDocumentPortion ldp, Context oc) {
- Context ic = (Context) oc.clone();
- ic.setInFootnote(true);
-
- String sId = node.getAttribute(XMLString.TEXT_ID);
- Element fntbody = Misc.getChildByTagName(node,XMLString.TEXT_FOOTNOTE_BODY);
- if (fntbody != null) {
- bContainsFootnotes = true;
- if (ic.isNoFootnotes()) {
- ldp.append("\\footnotemark{}");
- postponedFootnotes.add(fntbody);
- }
- else {
- ldp.append("\\footnote");
- ldp.append("{");
- if (sId != null && footnotenames.containsName(sId)) {
- ldp.append("\\label{fnt:"+footnotenames.getExportName(sId)+"}");
- }
- traverseNoteBody(fntbody,ldp,ic);
- ldp.append("}");
- }
- }
- }
-
- /** Flush the queue of postponed footnotes */
- public void flushFootnotes(LaTeXDocumentPortion ldp, Context oc) {
- // We may still be in a context with no footnotes
- if (oc.isNoFootnotes()) { return; }
- // Type out all postponed footnotes:
- Context ic = (Context) oc.clone();
- ic.setInFootnote(true);
- int n = postponedFootnotes.size();
- if (n==1) {
- ldp.append("\\footnotetext{");
- traverseNoteBody((Element) postponedFootnotes.get(0),ldp,ic);
- ldp.append("}").nl();
- postponedFootnotes.clear();
- }
- else if (n>1) {
- // Several footnotes; have to adjust the footnote counter
- ldp.append("\\addtocounter{footnote}{-"+n+"}").nl();
- for (int i=0; i<n; i++) {
- ldp.append("\\stepcounter{footnote}\\footnotetext{");
- traverseNoteBody((Element) postponedFootnotes.get(i),ldp,ic);
- ldp.append("}").nl();
- }
- postponedFootnotes.clear();
- }
- }
-
- /** <p>Process an endnote (text:endnote tag)
- * @param <code>node</code> The element containing the endnote
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleEndnote(Element node, LaTeXDocumentPortion ldp, Context oc) {
- Context ic = (Context) oc.clone();
- ic.setInFootnote(true);
-
- String sId = node.getAttribute(XMLString.TEXT_ID);
- Element entbody = Misc.getChildByTagName(node,XMLString.TEXT_ENDNOTE_BODY);
- if (entbody != null) {
- if (ic.isNoFootnotes() && !config.useEndnotes()) {
- ldp.append("\\footnotemark()");
- postponedFootnotes.add(entbody);
- }
- else {
- if (config.useEndnotes()) {
- ldp.append("\\endnote");
- bContainsEndnotes = true;
- }
- else {
- ldp.append("\\footnote");
- bContainsFootnotes = true;
- }
- ldp.append("{");
- if (sId != null && endnotenames.containsName(sId)) {
- ldp.append("\\label{ent:"+endnotenames.getExportName(sId)+"}");
- }
- traverseNoteBody(entbody,ldp,ic);
- ldp.append("}");
- }
- }
- }
-
- /** <p>Insert the endnotes into the documents.
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * the endnotes should be added.
- */
- public void insertEndnotes(LaTeXDocumentPortion ldp) {
- if (bContainsEndnotes) {
- ldp.append("\\clearpage").nl()
- .append("\\theendnotes").nl();
- }
- }
-
- /** <p>Process a footnote reference (text:footnote-ref tag)
- * @param <code>node</code> The element containing the footnote reference
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleFootnoteRef(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
- String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
- if ("page".equals(sFormat) && sName!=null) {
- ldp.append("\\pageref{fnt:"+footnotenames.getExportName(sName)+"}");
- }
- else if ("text".equals(sFormat) && sName!=null) {
- ldp.append("\\ref{fnt:"+footnotenames.getExportName(sName)+"}");
- }
- else { // use current value
- palette.getInlineCv().traversePCDATA(node,ldp,oc);
- }
- }
-
- /** <p>Process an endnote reference (text:endnote-ref tag)
- * @param <code>node</code> The element containing the endnote reference
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to which
- * LaTeX code should be added
- * @param <code>oc</code> the current context
- */
- public void handleEndnoteRef(Element node, LaTeXDocumentPortion ldp, Context oc) {
- String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
- String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
- if ("page".equals(sFormat) && sName!=null) {
- ldp.append("\\pageref{ent:"+endnotenames.getExportName(sName)+"}");
- }
- else if ("text".equals(sFormat) && sName!=null) {
- ldp.append("\\ref{ent:"+endnotenames.getExportName(sName)+"}");
- }
- else { // use current value
- palette.getInlineCv().traversePCDATA(node,ldp,oc);
- }
- }
-
- /** <p>Add a footnote name. The method <code>handleFootnote</code> includes
- * a <code>\label</code> only if the footnote name is already known to the
- * <code>NoteConverter</code>. Hence this method is invoked by the prepass
- * for each footnote reference. The end result is, that only necessary
- * labels will be included.
- * @param <code>sName</code> the name (id) of the footnote
- */
- public void addFootnoteName(String sName) { footnotenames.addName(sName); }
-
- /** <p>Add an endnote name. The method <code>handleEndnote</code> includes
- * a <code>\label</code> only if the endnote name is already known to the
- * <code>NoteConverter</code>. Hence this method is invoked by the prepass
- * for each endnote reference. The end result is, that only necessary
- * labels will be included.
- * @param <code>sName</code> the name (id) of the endnote
- */
- public void addEndnoteName(String sName) { endnotenames.addName(sName); }
-
- /*
- * Process the contents of a footnote or endnote
- * TODO: Merge with BlockConverter.traverseBlockText?
- */
- private void traverseNoteBody (Element node, LaTeXDocumentPortion ldp, Context oc) {
- if (node.hasChildNodes()) {
- NodeList nList = node.getChildNodes();
- int len = nList.getLength();
-
- for (int i = 0; i < len; i++) {
- Node childNode = nList.item(i);
-
- if (childNode.getNodeType() == Node.ELEMENT_NODE) {
- Element child = (Element)childNode;
- String nodeName = child.getTagName();
-
- palette.getInfo().addDebugInfo(child,ldp);
-
- if (nodeName.equals(XMLString.TEXT_H)) {
- palette.getBlockCv().handleHeading(child,ldp,oc);
- }
-
- if (nodeName.equals(XMLString.TEXT_P)) {
- palette.getInlineCv().traverseInlineText(child,ldp,oc,false);
- if (i<len-1) {
- if (nList.item(i+1).getNodeName().startsWith(XMLString.TEXT_)) {
- ldp.append("\\par ");
- }
- else {
- ldp.nl();
- }
- }
- }
-
- if (nodeName.equals(XMLString.TEXT_ORDERED_LIST)) {
- palette.getBlockCv().handleList(child,ldp,oc,true);
- }
-
- if (nodeName.equals(XMLString.TEXT_UNORDERED_LIST)) {
- palette.getBlockCv().handleList(child,ldp,oc,false);
- }
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/content/StarMathConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/content/StarMathConverter.java
deleted file mode 100644
index 63fa3710399b..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/content/StarMathConverter.java
+++ /dev/null
@@ -1,1589 +0,0 @@
-/************************************************************************
- *
- * StarMathConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3i (2004-12-28)
- *
- */
-
-package writer2latex.latex.content;
-
-import java.util.Hashtable;
-import writer2latex.util.*;
-import writer2latex.latex.style.I18n;
-import writer2latex.latex.LaTeXDocumentPortion;
-
-/* TO DO:
- * better font handling, currently nested font attributes (eg. italic font fixed) don't work
- * text inherits font from text surrounding formula - should this be changed?
- * implement implicit left alignment of expressions starting with text
- * improve subsup: \sideset should possibly be replaced by \multiscripts
- * \multiscripts should only be used when absolutely neccessary
- * maybe \leftidx should also be used sometimes
- * alignment: how to make stack{{alignr x} % xxx} work??
- * alignment: fractions and binoms?
- * ...
- */
-
-//////////////////////////////////////////////////////////////////
-/* The converted formula requires LaTeX2e with the packages
- * amsmath.sty, amssymb.sty, amsfonts.sty, color.sty.
- * Also the following control sequences must be defined for starmath symbols
- * and constructions that are not provided by standard LaTeX2e+amsmath:
- * \defeq, \lambdabar, \ddotsup, \multimapdotbothA, \multimapdotbothB,
- * \llbracket, \rrbracket, \oiint, \oiiint,
- * \mathoverstrike, \wideslash, \widebslash, \boldsubformula,
- * \normalsubformula.
- * These should be declared in the preamble.
- * Some are defined in the packages stmaryrd.sty, pxfonts.sty, txfonts.sty,
- * but fallback definitions are provided in writer.sty if these packages are
- * not used. More info in the documentation on writer.sty.
- */
-
-//////////////////////////////////////////////////////////////////
-// Helper Classes
-
-// Some Character classifications
-class CharClasses{
-
- static final char[] aDelimiterTable =
- { ' ', '\t' , '\n', '\r', '+', '-', '*', '/', '=', '#',
- '%', '\\', '"', '~', '`', '>', '<', '&', '|', '(',
- ')', '{', '}', '[', ']', '^', '_', '\0'};
-
- static boolean isDelimiter(char cChar){
- // return true iff cChar is '\0' or a delimiter
- if (cChar=='\0') return false;
- int i=0;
- for (i=0;aDelimiterTable[i]!='\0';i++)
- if (aDelimiterTable[i]==cChar)
- break;
- return aDelimiterTable[i]!='\0';
- }
-
- static boolean isEndOrLineEnd(char cChar){
- switch (cChar){
- case '\0':
- case '\n':
- case '\r':
- return true;
- default:
- return false;
- }
- }
-
- static boolean isDigitOrDot(char cChar){
- return (cChar>='0' && cChar<='9') || cChar=='.' || cChar==',';
- }
-}
-
-// enumerate Tokens
-class Token{
- public static final Token END=new Token();
- public static final Token LGROUP=new Token();
- public static final Token RGROUP=new Token();
- public static final Token LPARENT=new Token();
- public static final Token RPARENT=new Token();
- public static final Token LBRACKET=new Token();
- public static final Token RBRACKET=new Token();
- public static final Token PLUS=new Token();
- public static final Token MINUS=new Token();
- public static final Token MULTIPLY=new Token();
- public static final Token DIVIDEBY=new Token();
- public static final Token ASSIGN=new Token();
- public static final Token POUND=new Token();
- public static final Token SPECIAL=new Token();
- public static final Token SLASH=new Token();
- public static final Token BACKSLASH=new Token();
- public static final Token BLANK=new Token();
- public static final Token SBLANK=new Token();
- public static final Token RSUB=new Token();
- public static final Token RSUP=new Token();
- public static final Token CSUB=new Token();
- public static final Token CSUP=new Token();
- public static final Token LSUB=new Token();
- public static final Token LSUP=new Token();
- public static final Token GT=new Token();
- public static final Token LT=new Token();
- public static final Token AND=new Token();
- public static final Token OR=new Token();
- public static final Token INTERSECT=new Token();
- public static final Token UNION=new Token();
- public static final Token NEWLINE=new Token();
- public static final Token BINOM=new Token();
- public static final Token FROM=new Token();
- public static final Token TO=new Token();
- public static final Token INT=new Token();
- public static final Token SUM=new Token();
- public static final Token OPER=new Token();
- public static final Token ABS=new Token();
- public static final Token SQRT=new Token();
- public static final Token FACT=new Token();
- public static final Token NROOT=new Token();
- public static final Token OVER=new Token();
- public static final Token TIMES=new Token();
- public static final Token GE=new Token();
- public static final Token LE=new Token();
- public static final Token GG=new Token();
- public static final Token LL=new Token();
- public static final Token DOTSAXIS=new Token();
- public static final Token DOTSLOW=new Token();
- public static final Token DOTSVERT=new Token();
- public static final Token DOTSDIAG=new Token();
- public static final Token DOTSUP=new Token();
- public static final Token DOTSDOWN=new Token();
- public static final Token ACUTE=new Token();
- public static final Token BAR=new Token();
- public static final Token BREVE=new Token();
- public static final Token CHECK=new Token();
- public static final Token CIRCLE=new Token();
- public static final Token DOT=new Token();
- public static final Token DDOT=new Token();
- public static final Token DDDOT=new Token();
- public static final Token GRAVE=new Token();
- public static final Token HAT=new Token();
- public static final Token TILDE=new Token();
- public static final Token VEC=new Token();
- public static final Token UNDERLINE=new Token();
- public static final Token OVERLINE=new Token();
- public static final Token OVERSTRIKE=new Token();
- public static final Token ITALIC=new Token();
- public static final Token NITALIC=new Token();
- public static final Token BOLD=new Token();
- public static final Token NBOLD=new Token();
- public static final Token PHANTOM=new Token();
- public static final Token FONT=new Token();
- public static final Token SIZE=new Token();
- public static final Token COLOR=new Token();
- public static final Token ALIGNL=new Token();
- public static final Token ALIGNC=new Token();
- public static final Token ALIGNR=new Token();
- public static final Token LEFT=new Token();
- public static final Token RIGHT=new Token();
- public static final Token LANGLE=new Token();
- public static final Token LBRACE=new Token();
- public static final Token LLINE=new Token();
- public static final Token LDLINE=new Token();
- public static final Token LCEIL=new Token();
- public static final Token LFLOOR=new Token();
- public static final Token NONE=new Token();
- public static final Token MLINE=new Token();
- public static final Token RANGLE=new Token();
- public static final Token RBRACE=new Token();
- public static final Token RLINE=new Token();
- public static final Token RDLINE=new Token();
- public static final Token RCEIL=new Token();
- public static final Token RFLOOR=new Token();
- public static final Token SIN=new Token();
- public static final Token COS=new Token();
- public static final Token TAN=new Token();
- public static final Token COT=new Token();
- public static final Token FUNC=new Token();
- public static final Token STACK=new Token();
- public static final Token MATRIX=new Token();
- public static final Token DPOUND=new Token();
- public static final Token PLACE=new Token();
- public static final Token TEXT=new Token();
- public static final Token NUMBER=new Token();
- public static final Token CHARACTER=new Token();
- public static final Token IDENT=new Token();
- public static final Token NEQ=new Token();
- public static final Token EQUIV=new Token();
- public static final Token DEF=new Token();
- public static final Token PROP=new Token();
- public static final Token SIM=new Token();
- public static final Token SIMEQ=new Token();
- public static final Token APPROX=new Token();
- public static final Token PARALLEL=new Token();
- public static final Token ORTHO=new Token();
- public static final Token IN=new Token();
- public static final Token NOTIN=new Token();
- public static final Token SUBSET=new Token();
- public static final Token SUBSETEQ=new Token();
- public static final Token SUPSET=new Token();
- public static final Token SUPSETEQ=new Token();
- public static final Token PLUSMINUS=new Token();
- public static final Token MINUSPLUS=new Token();
- public static final Token OPLUS=new Token();
- public static final Token OMINUS=new Token();
- public static final Token DIV=new Token();
- public static final Token OTIMES=new Token();
- public static final Token ODIVIDE=new Token();
- public static final Token TRANSL=new Token();
- public static final Token TRANSR=new Token();
- public static final Token IINT=new Token();
- public static final Token IIINT=new Token();
- public static final Token LINT=new Token();
- public static final Token LLINT=new Token();
- public static final Token LLLINT=new Token();
- public static final Token PROD=new Token();
- public static final Token COPROD=new Token();
- public static final Token FORALL=new Token();
- public static final Token EXISTS=new Token();
- public static final Token LIM=new Token();
- public static final Token NABLA=new Token();
- public static final Token TOWARD=new Token();
- public static final Token SINH=new Token();
- public static final Token COSH=new Token();
- public static final Token TANH=new Token();
- public static final Token COTH=new Token();
- public static final Token ASIN=new Token();
- public static final Token ACOS=new Token();
- public static final Token ATAN=new Token();
- public static final Token LN=new Token();
- public static final Token LOG=new Token();
- public static final Token UOPER=new Token();
- public static final Token BOPER=new Token();
- public static final Token BLACK=new Token();
- public static final Token WHITE=new Token();
- public static final Token RED=new Token();
- public static final Token GREEN=new Token();
- public static final Token BLUE=new Token();
- public static final Token CYAN=new Token();
- public static final Token MAGENTA=new Token();
- public static final Token YELLOW=new Token();
- public static final Token FIXED=new Token();
- public static final Token SANS=new Token();
- public static final Token SERIF=new Token();
- public static final Token POINT=new Token();
- public static final Token ASINH=new Token();
- public static final Token ACOSH=new Token();
- public static final Token ATANH=new Token();
- public static final Token ACOTH=new Token();
- public static final Token ACOT=new Token();
- public static final Token EXP=new Token();
- public static final Token CDOT=new Token();
- public static final Token ODOT=new Token();
- public static final Token LESLANT=new Token();
- public static final Token GESLANT=new Token();
- public static final Token NSUBSET=new Token();
- public static final Token NSUPSET=new Token();
- public static final Token NSUBSETEQ=new Token();
- public static final Token NSUPSETEQ=new Token();
- public static final Token PARTIAL=new Token();
- public static final Token NEG=new Token();
- public static final Token NI=new Token();
- public static final Token BACKEPSILON=new Token();
- public static final Token ALEPH=new Token();
- public static final Token IM=new Token();
- public static final Token RE=new Token();
- public static final Token WP=new Token();
- public static final Token EMPTYSET=new Token();
- public static final Token INFINITY=new Token();
- public static final Token ESCAPE=new Token();
- public static final Token LIMSUP=new Token();
- public static final Token LIMINF=new Token();
- public static final Token NDIVIDES=new Token();
- public static final Token DRARROW=new Token();
- public static final Token DLARROW=new Token();
- public static final Token DLRARROW=new Token();
- public static final Token UNDERBRACE=new Token();
- public static final Token OVERBRACE=new Token();
- public static final Token CIRC=new Token();
- //public static final Token TOP=new Token();
- public static final Token HBAR=new Token();
- public static final Token LAMBDABAR=new Token();
- public static final Token LEFTARROW=new Token();
- public static final Token RIGHTARROW=new Token();
- public static final Token UPARROW=new Token();
- public static final Token DOWNARROW=new Token();
- public static final Token DIVIDES=new Token();
- public static final Token SETN=new Token();
- public static final Token SETZ=new Token();
- public static final Token SETQ=new Token();
- public static final Token SETR=new Token();
- public static final Token SETC=new Token();
- public static final Token WIDEVEC=new Token();
- public static final Token WIDETILDE=new Token();
- public static final Token WIDEHAT=new Token();
- public static final Token WIDESLASH=new Token();
- public static final Token WIDEBACKSLASH=new Token();
- public static final Token LDBRACKET=new Token();
- public static final Token RDBRACKET=new Token();
- public static final Token UNKNOWN=new Token();
-}
-
-// enumerate Token groups
-class TGroup{
- public static final TGroup NONE=new TGroup();
- public static final TGroup OPER=new TGroup();
- public static final TGroup RELATION=new TGroup();
- public static final TGroup SUM=new TGroup();
- public static final TGroup PRODUCT=new TGroup();
- public static final TGroup UNOPER=new TGroup();
- public static final TGroup POWER =new TGroup();
- public static final TGroup ATTRIBUT=new TGroup();
- public static final TGroup ALIGN =new TGroup();
- public static final TGroup FUNCTION=new TGroup();
- public static final TGroup BLANK =new TGroup();
- public static final TGroup LBRACES=new TGroup();
- public static final TGroup RBRACES=new TGroup();
- public static final TGroup COLOR =new TGroup();
- public static final TGroup FONT=new TGroup();
- public static final TGroup STANDALONE=new TGroup();
- public static final TGroup LIMIT=new TGroup();
- public static final TGroup FONTATTR=new TGroup();
-}
-
-// Token tables
-class SmTokenTableEntry{ // This is simply a struct
- String sIdent;
- Token eType;
- String sLaTeX;
- TGroup eGroup1, eGroup2;
- int nLevel;
-
- SmTokenTableEntry(String sIdent, Token eType, String sLaTeX,
- TGroup eGroup1, TGroup eGroup2, int nLevel){
- this.sIdent=sIdent;
- this.eType=eType;
- this.sLaTeX=sLaTeX;
- this.eGroup1=eGroup1;
- this.eGroup2=eGroup2;
- this.nLevel=nLevel;
- }
-
- SmTokenTableEntry(String sIdent, Token eType, String sLaTeX,
- TGroup eGroup1, int nLevel){
- this(sIdent,eType,sLaTeX,eGroup1,TGroup.NONE,nLevel);
- }
-
- SmTokenTableEntry(String sIdent, Token eType, String sLaTeX,
- int nLevel){
- this(sIdent,eType,sLaTeX,TGroup.NONE,TGroup.NONE,nLevel);
- }
-}
-
-class SmTokenTable{
- private SmTokenTableEntry[] table;
-
- SmTokenTable(SmTokenTableEntry[] table){this.table=table;}
-
- boolean lookup(String sIdent, boolean bIgnoreCase, SmToken token){
- for (int i=0; i<table.length; i++){
- if (bIgnoreCase ? table[i].sIdent.equalsIgnoreCase(sIdent) : table[i].sIdent.equals(sIdent)){
- token.assign(table[i].eType, table[i].sLaTeX, table[i].eGroup1, table[i].eGroup2, table[i].nLevel);
- return true;
- }
- }
- return false;
- }
-
- static final SmTokenTableEntry[] keywords=
- {new SmTokenTableEntry( "Im",Token.IM, "\\Im ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "Re" , Token.RE, "\\Re ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "abs", Token.ABS, "", TGroup.UNOPER, 5),
- new SmTokenTableEntry( "arcosh", Token.ACOSH, "\\operatorname{arcosh}", TGroup.FUNCTION, 5 ),
- new SmTokenTableEntry( "arcoth", Token.ACOTH, "\\operatorname{arsinh}", TGroup.FUNCTION, 5 ),
- new SmTokenTableEntry( "acute", Token.ACUTE, "\\acute", TGroup.ATTRIBUT, 5 ),
- new SmTokenTableEntry( "aleph" , Token.ALEPH, "\\aleph ", TGroup.STANDALONE, 5 ),
- new SmTokenTableEntry( "alignc", Token.ALIGNC, "", TGroup.ALIGN, 0),
- new SmTokenTableEntry( "alignl", Token.ALIGNL, "", TGroup.ALIGN, 0),
- new SmTokenTableEntry( "alignr", Token.ALIGNR, "", TGroup.ALIGN, 0),
- new SmTokenTableEntry( "and", Token.AND, "\\wedge ", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "approx", Token.APPROX, "\\approx ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "arccos", Token.ACOS, "\\arccos ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "arccot", Token.ACOT, "\\arccot ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "arcsin", Token.ASIN, "\\arcsin ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "arctan", Token.ATAN, "\\arctan ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "arsinh", Token.ASINH, "\\operatorname{arsinh}", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "artanh", Token.ATANH, "\\operatorname{artanh}", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "backepsilon" , Token.BACKEPSILON, "\\backepsilon ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "bar", Token.BAR, "\\bar", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "binom", Token.BINOM, "" , 5 ),
- new SmTokenTableEntry( "black", Token.BLACK, "black", TGroup.COLOR, 0),
- new SmTokenTableEntry( "blue", Token.BLUE, "blue", TGroup.COLOR, 0),
- new SmTokenTableEntry( "bold", Token.BOLD, "\\boldsubformula", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "boper", Token.BOPER, "", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "breve", Token.BREVE, "\\breve", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "bslash", Token.BACKSLASH, "\\backslash ", TGroup.PRODUCT, 0 ),
- new SmTokenTableEntry( "cdot", Token.CDOT, "\\cdot ", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "check", Token.CHECK, "\\check", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "circ" , Token.CIRC, "\\circ ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "circle", Token.CIRCLE, "\\overset{\\circ}", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "color", Token.COLOR, "", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "coprod", Token.COPROD, "\\coprod ", TGroup.OPER, 5),
- new SmTokenTableEntry( "cos", Token.COS, "\\cos ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "cosh", Token.COSH, "\\cosh ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "cot", Token.COT, "\\cot ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "coth", Token.COTH, "\\coth ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "csub", Token.CSUB, "", TGroup.POWER, 0),
- new SmTokenTableEntry( "csup", Token.CSUP, "", TGroup.POWER, 0),
- new SmTokenTableEntry( "cyan", Token.CYAN, "cyan", TGroup.COLOR, 0),
- new SmTokenTableEntry( "dddot", Token.DDDOT, "\\dddot", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "ddot", Token.DDOT, "\\ddot", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "def", Token.DEF, "\\defeq ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "div", Token.DIV, "\\div ", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "divides", Token.DIVIDES, "|", TGroup.RELATION, 0),
- new SmTokenTableEntry( "dlarrow" , Token.DLARROW, "\\Leftarrow ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "dlrarrow" , Token.DLRARROW, "\\Leftrightarrow ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "dot", Token.DOT, "\\dot", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "dotsaxis", Token.DOTSAXIS, "\\cdots ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "dotsdiag", Token.DOTSDIAG, "\\ddots ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "dotsdown", Token.DOTSDOWN, "\\ddots ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "dotslow", Token.DOTSLOW, "\\ldots ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "dotsup", Token.DOTSUP, "\\ddotsup ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "dotsvert", Token.DOTSVERT, "\\vdots ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "downarrow" , Token.DOWNARROW, "\\downarrow ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "drarrow" , Token.DRARROW, "\\Rightarrow ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "emptyset" , Token.EMPTYSET, "\\emptyset ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "equiv", Token.EQUIV, "\\equiv ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "exists", Token.EXISTS, "\\exists ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "exp", Token.EXP, "\\exp ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "fact", Token.FACT, "!", TGroup.UNOPER, 5),
- new SmTokenTableEntry( "fixed", Token.FIXED, "\\mathtt", TGroup.FONT, 0),
- new SmTokenTableEntry( "font", Token.FONT, "", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "forall", Token.FORALL, "\\forall ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "from", Token.FROM, "", TGroup.LIMIT, 0),
- new SmTokenTableEntry( "func", Token.FUNC, "", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "ge", Token.GE, "\\geq ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "geslant", Token.GESLANT, "\\geqslant ", TGroup.RELATION, 0 ),
- new SmTokenTableEntry( "gg", Token.GG, "\\gg ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "grave", Token.GRAVE, "\\grave", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "green", Token.GREEN, "green", TGroup.COLOR, 0),
- new SmTokenTableEntry( "gt", Token.GT, ">", TGroup.RELATION, 0),
- new SmTokenTableEntry( "hat", Token.HAT, "\\hat", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "hbar" , Token.HBAR, "\\hbar ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "iiint", Token.IIINT, "\\iiint ", TGroup.OPER, 5),
- new SmTokenTableEntry( "iint", Token.IINT, "\\iint ", TGroup.OPER, 5),
- new SmTokenTableEntry( "in", Token.IN, "\\in ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "infinity" , Token.INFINITY, "\\infty ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "infty" , Token.INFINITY, "\\infty ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "int", Token.INT, "\\int ", TGroup.OPER, 5),
- new SmTokenTableEntry( "intersection", Token.INTERSECT, "\\cap ", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "ital", Token.ITALIC, "\\normalsubformula", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "italic", Token.ITALIC, "\\normalsubformula", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "lambdabar" , Token.LAMBDABAR, "\\lambdabar ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "langle", Token.LANGLE, "\\langle ", TGroup.LBRACES, 5),
- new SmTokenTableEntry( "lbrace", Token.LBRACE, "\\{", TGroup.LBRACES, 5),
- new SmTokenTableEntry( "lceil", Token.LCEIL, "\\lceil ", TGroup.LBRACES, 5),
- new SmTokenTableEntry( "ldbracket", Token.LDBRACKET, "\\llbracket ", TGroup.LBRACES, 5),
- new SmTokenTableEntry( "ldline", Token.LDLINE, "\\|", TGroup.LBRACES, 5),
- new SmTokenTableEntry( "le", Token.LE, "\\leq ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "left", Token.LEFT, "", 5),
- new SmTokenTableEntry( "leftarrow" , Token.LEFTARROW, "\\leftarrow ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "leslant", Token.LESLANT, "\\leqslant ", TGroup.RELATION, 0 ),
- new SmTokenTableEntry( "lfloor", Token.LFLOOR, "\\lfloor ", TGroup.LBRACES, 5),
- new SmTokenTableEntry( "lim", Token.LIM, "\\lim ", TGroup.OPER, 5),
- new SmTokenTableEntry( "liminf", Token.LIMINF, "\\liminf ", TGroup.OPER, 5),
- new SmTokenTableEntry( "limsup", Token.LIMSUP, "\\limsup ", TGroup.OPER, 5),
- new SmTokenTableEntry( "lint", Token.LINT, "\\oint ", TGroup.OPER, 5),
- new SmTokenTableEntry( "ll", Token.LL, "\\ll ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "lline", Token.LLINE, "|", TGroup.LBRACES, 5),
- new SmTokenTableEntry( "llint", Token.LLINT, "\\oiint ", TGroup.OPER, 5),
- new SmTokenTableEntry( "lllint", Token.LLLINT, "\\oiiint ", TGroup.OPER, 5),
- new SmTokenTableEntry( "ln", Token.LN, "\\ln ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "log", Token.LOG, "\\log ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "lsub", Token.LSUB, "", TGroup.POWER, 0),
- new SmTokenTableEntry( "lsup", Token.LSUP, "", TGroup.POWER, 0),
- new SmTokenTableEntry( "lt", Token.LT, "<", TGroup.RELATION, 0),
- new SmTokenTableEntry( "magenta", Token.MAGENTA, "magenta", TGroup.COLOR, 0),
- new SmTokenTableEntry( "matrix", Token.MATRIX, "", 5),
- new SmTokenTableEntry( "minusplus", Token.MINUSPLUS, "\\mp ", TGroup.UNOPER, TGroup.SUM, 5),
- new SmTokenTableEntry( "mline", Token.MLINE, "", 0),
- new SmTokenTableEntry( "nabla", Token.NABLA, "\\nabla ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "nbold", Token.NBOLD, "\\normalsubformula", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "ndivides", Token.NDIVIDES, "\\nmid ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "neg", Token.NEG, "\\neg ", TGroup.UNOPER, 5 ),
- new SmTokenTableEntry( "neq", Token.NEQ, "\\neq ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "newline", Token.NEWLINE, "", 0),
- new SmTokenTableEntry( "ni", Token.NI, "\\ni ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "nitalic", Token.NITALIC, "\\mathrm", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "none", Token.NONE, ".", TGroup.LBRACES, TGroup.RBRACES, 0),
- new SmTokenTableEntry( "notin", Token.NOTIN, "\\notin ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "nsubset", Token.NSUBSET, "\\not\\subset ", TGroup.RELATION, 0 ),
- new SmTokenTableEntry( "nsupset", Token.NSUPSET, "\\not\\supset ", TGroup.RELATION, 0 ),
- new SmTokenTableEntry( "nsubseteq", Token.NSUBSETEQ, "\\nsubseteq ", TGroup.RELATION, 0 ),
- new SmTokenTableEntry( "nsupseteq", Token.NSUPSETEQ, "\\nsupseteq ", TGroup.RELATION, 0 ),
- new SmTokenTableEntry( "nroot", Token.NROOT, "", TGroup.UNOPER, 5),
- new SmTokenTableEntry( "odivide", Token.ODIVIDE, "\\oslash ", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "odot", Token.ODOT, "\\odot ", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "ominus", Token.OMINUS, "\\ominus ", TGroup.SUM, 0),
- new SmTokenTableEntry( "oper", Token.OPER, "", TGroup.OPER, 5),
- new SmTokenTableEntry( "oplus", Token.OPLUS, "\\oplus ", TGroup.SUM, 0),
- new SmTokenTableEntry( "or", Token.OR, "\\vee ", TGroup.SUM, 0),
- new SmTokenTableEntry( "ortho", Token.ORTHO, "\\perp ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "otimes", Token.OTIMES, "\\otimes ", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "over", Token.OVER, "", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "overbrace", Token.OVERBRACE, "", TGroup.PRODUCT, 5),
- new SmTokenTableEntry( "overline", Token.OVERLINE, "\\overline", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "overstrike", Token.OVERSTRIKE, "\\mathoverstrike", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "owns", Token.NI, "\\ni ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "parallel", Token.PARALLEL, "\\parallel ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "partial", Token.PARTIAL, "\\partial ", TGroup.STANDALONE, 5 ),
- new SmTokenTableEntry( "phantom", Token.PHANTOM, "\\phantom", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "plusminus", Token.PLUSMINUS, "\\pm ", TGroup.UNOPER, TGroup.SUM, 5),
- new SmTokenTableEntry( "prod", Token.PROD, "\\prod ", TGroup.OPER, 5),
- new SmTokenTableEntry( "prop", Token.PROP, "\\propto ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "rangle", Token.RANGLE, "\\rangle ", TGroup.RBRACES, 0),
- new SmTokenTableEntry( "rbrace", Token.RBRACE, "\\}", TGroup.RBRACES, 0),
- new SmTokenTableEntry( "rceil", Token.RCEIL, "\\rceil ", TGroup.RBRACES, 0),
- new SmTokenTableEntry( "rdbracket", Token.RDBRACKET, "\\rrbracket ", TGroup.RBRACES, 0),
- new SmTokenTableEntry( "rdline", Token.RDLINE, "\\|", TGroup.RBRACES, 0),
- new SmTokenTableEntry( "red", Token.RED, "red", TGroup.COLOR, 0),
- new SmTokenTableEntry( "rfloor", Token.RFLOOR, "\\rfloor", TGroup.RBRACES, 0),
- new SmTokenTableEntry( "right", Token.RIGHT, "", 0),
- new SmTokenTableEntry( "rightarrow" , Token.RIGHTARROW, "\\rightarrow ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "rline", Token.RLINE, "|", TGroup.RBRACES, 0),
- new SmTokenTableEntry( "rsub", Token.RSUB, "", TGroup.POWER, 0),
- new SmTokenTableEntry( "rsup", Token.RSUP, "", TGroup.POWER, 0),
- new SmTokenTableEntry( "sans", Token.SANS, "\\mathsf", TGroup.FONT, 0),
- new SmTokenTableEntry( "serif", Token.SERIF, "\\mathrm", TGroup.FONT, 0),
- new SmTokenTableEntry( "setC" , Token.SETC, "\\mathbb{C}", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "setN" , Token.SETN, "\\mathbb{N}", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "setQ" , Token.SETQ, "\\mathbb{Q}", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "setR" , Token.SETR, "\\mathbb{R}", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "setZ" , Token.SETZ, "\\mathbb{Z}", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "setminus", Token.BACKSLASH, "\\setminus ", TGroup.PRODUCT, 0 ),
- new SmTokenTableEntry( "sim", Token.SIM, "\\sim ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "simeq", Token.SIMEQ, "\\simeq ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "sin", Token.SIN, "\\sin ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "sinh", Token.SINH, "\\sinh ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "size", Token.SIZE, "", TGroup.FONTATTR, 5),
- new SmTokenTableEntry( "slash", Token.SLASH, "/", TGroup.PRODUCT, 0 ),
- new SmTokenTableEntry( "sqrt", Token.SQRT, "", TGroup.UNOPER, 5),
- new SmTokenTableEntry( "stack", Token.STACK, "", 5),
- new SmTokenTableEntry( "sub", Token.RSUB, "", TGroup.POWER, 0),
- new SmTokenTableEntry( "subset", Token.SUBSET, "\\subset ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "subseteq", Token.SUBSETEQ, "\\subseteq ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "sum", Token.SUM, "\\sum ", TGroup.OPER, 5),
- new SmTokenTableEntry( "sup", Token.RSUP, "", TGroup.POWER, 0),
- new SmTokenTableEntry( "supset", Token.SUPSET, "\\supset ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "supseteq", Token.SUPSETEQ, "\\supseteq ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "tan", Token.TAN, "\\tan ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "tanh", Token.TANH, "\\tanh ", TGroup.FUNCTION, 5),
- new SmTokenTableEntry( "tilde", Token.TILDE, "\\tilde ", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "times", Token.TIMES, "\\times ", TGroup.PRODUCT, 0),
- new SmTokenTableEntry( "to", Token.TO, "", TGroup.LIMIT, 0),
- new SmTokenTableEntry( "toward", Token.TOWARD, "\\to ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "transl", Token.TRANSL, "\\multimapdotbothA ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "transr", Token.TRANSR, "\\multimapdotbothB ", TGroup.RELATION, 0),
- new SmTokenTableEntry( "underbrace", Token.UNDERBRACE, "", TGroup.PRODUCT, 5),
- new SmTokenTableEntry( "underline", Token.UNDERLINE, "\\underline", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "union", Token.UNION, "\\cup ", TGroup.SUM, 0),
- new SmTokenTableEntry( "uoper", Token.UOPER, "", TGroup.UNOPER, 5),
- new SmTokenTableEntry( "uparrow" , Token.UPARROW, "\\uparrow ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "vec", Token.VEC, "\\vec", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "white", Token.WHITE, "white", TGroup.COLOR, 0),
- new SmTokenTableEntry( "widebslash", Token.WIDEBACKSLASH, "", TGroup.PRODUCT, 0 ),
- new SmTokenTableEntry( "widehat", Token.WIDEHAT, "\\widehat ", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "widetilde", Token.WIDETILDE, "\\widetilde", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "wideslash", Token.WIDESLASH, "", TGroup.PRODUCT, 0 ),
- new SmTokenTableEntry( "widevec", Token.WIDEVEC, "\\overrightarrow", TGroup.ATTRIBUT, 5),
- new SmTokenTableEntry( "wp" , Token.WP, "\\wp ", TGroup.STANDALONE, 5),
- new SmTokenTableEntry( "yellow", Token.YELLOW, "yellow", TGroup.COLOR, 0)};
-
- static final SmTokenTableEntry[] symbols=
- {new SmTokenTableEntry("ALPHA",Token.SPECIAL,"A",5),
- new SmTokenTableEntry("BETA",Token.SPECIAL,"B",5),
- new SmTokenTableEntry("CHI",Token.SPECIAL,"X",5),
- new SmTokenTableEntry("DELTA",Token.SPECIAL,"\\Delta ",5),
- new SmTokenTableEntry("EPSILON",Token.SPECIAL,"E",5),
- new SmTokenTableEntry("ETA",Token.SPECIAL,"H",5),
- new SmTokenTableEntry("GAMMA",Token.SPECIAL,"\\Gamma ",5),
- new SmTokenTableEntry("IOTA",Token.SPECIAL,"I",5),
- new SmTokenTableEntry("KAPPA",Token.SPECIAL,"K",5),
- new SmTokenTableEntry("LAMBDA",Token.SPECIAL,"\\Lambda ",5),
- new SmTokenTableEntry("MU",Token.SPECIAL,"M",5),
- new SmTokenTableEntry("NU",Token.SPECIAL,"N",5),
- new SmTokenTableEntry("OMEGA",Token.SPECIAL,"\\Omega ",5),
- new SmTokenTableEntry("OMICRON",Token.SPECIAL,"O",5),
- new SmTokenTableEntry("PHI",Token.SPECIAL,"\\Phi ",5),
- new SmTokenTableEntry("PI",Token.SPECIAL,"\\Pi ",5),
- new SmTokenTableEntry("PSI",Token.SPECIAL,"\\Psi ",5),
- new SmTokenTableEntry("RHO",Token.SPECIAL,"P",5),
- new SmTokenTableEntry("SIGMA",Token.SPECIAL,"\\Sigma ",5),
- new SmTokenTableEntry("TAU",Token.SPECIAL,"T",5),
- new SmTokenTableEntry("THETA",Token.SPECIAL,"\\Theta ",5),
- new SmTokenTableEntry("UPSILON",Token.SPECIAL,"\\Upsilon ",5),
- new SmTokenTableEntry("XI",Token.SPECIAL,"\\Xi ",5),
- new SmTokenTableEntry("ZETA",Token.SPECIAL,"Z",5),
- new SmTokenTableEntry("alpha",Token.SPECIAL,"\\alpha ",5),
- new SmTokenTableEntry("beta",Token.SPECIAL,"\\beta ",5),
- new SmTokenTableEntry("chi",Token.SPECIAL,"\\chi ",5),
- new SmTokenTableEntry("delta",Token.SPECIAL,"\\delta ",5),
- new SmTokenTableEntry("epsilon",Token.SPECIAL,"\\epsilon ",5),
- new SmTokenTableEntry("eta",Token.SPECIAL,"\\eta ",5),
- new SmTokenTableEntry("gamma",Token.SPECIAL,"\\gamma ",5),
- new SmTokenTableEntry("iota",Token.SPECIAL,"\\iota ",5),
- new SmTokenTableEntry("kappa",Token.SPECIAL,"\\kappa ",5),
- new SmTokenTableEntry("lambda",Token.SPECIAL,"\\lambda ",5),
- new SmTokenTableEntry("mu",Token.SPECIAL,"\\mu ",5),
- new SmTokenTableEntry("nu",Token.SPECIAL,"\\nu ",5),
- new SmTokenTableEntry("omega",Token.SPECIAL,"\\omega ",5),
- new SmTokenTableEntry("omicron",Token.SPECIAL,"o",5),
- new SmTokenTableEntry("phi",Token.SPECIAL,"\\phi ",5),
- new SmTokenTableEntry("pi",Token.SPECIAL,"\\pi ",5),
- new SmTokenTableEntry("psi",Token.SPECIAL,"\\psi ",5),
- new SmTokenTableEntry("rho",Token.SPECIAL,"\\rho ",5),
- new SmTokenTableEntry("sigma",Token.SPECIAL,"\\sigma ",5),
- new SmTokenTableEntry("tau",Token.SPECIAL,"\\tau ",5),
- new SmTokenTableEntry("theta",Token.SPECIAL,"\\theta ",5),
- new SmTokenTableEntry("upsilon",Token.SPECIAL,"\\upsilon ",5),
- new SmTokenTableEntry("varepsilon",Token.SPECIAL,"\\varepsilon ",5),
- new SmTokenTableEntry("varphi",Token.SPECIAL,"\\varphi ",5),
- new SmTokenTableEntry("varpi",Token.SPECIAL,"\\varpi ",5),
- new SmTokenTableEntry("varrho",Token.SPECIAL,"\\varrho ",5),
- new SmTokenTableEntry("varsigma",Token.SPECIAL,"\\varsigma ",5),
- new SmTokenTableEntry("vartheta",Token.SPECIAL,"\\vartheta ",5),
- new SmTokenTableEntry("xi",Token.SPECIAL,"\\xi ",5),
- new SmTokenTableEntry("zeta",Token.SPECIAL,"\\zeta ",5),
- new SmTokenTableEntry("and",Token.SPECIAL,"\\wedge ",5),
- new SmTokenTableEntry("angle",Token.SPECIAL,"\\sphericalangle ",5),
- new SmTokenTableEntry("element",Token.SPECIAL,"\\in ",5),
- new SmTokenTableEntry("identical",Token.SPECIAL,"\\equiv ",5),
- new SmTokenTableEntry("infinite",Token.SPECIAL,"\\infty ",5),
- new SmTokenTableEntry("noelement",Token.SPECIAL,"\\notin ",5),
- new SmTokenTableEntry("notequal",Token.SPECIAL,"\\neq ",5),
- new SmTokenTableEntry("or",Token.SPECIAL,"\\vee ",5),
- new SmTokenTableEntry("perthousand",Token.SPECIAL,"\\text{\\textperthousand}",5),
- new SmTokenTableEntry("strictlygreaterthan",Token.SPECIAL,"\\gg ",5),
- new SmTokenTableEntry("strictlylessthan",Token.SPECIAL,"\\ll ",5),
- new SmTokenTableEntry("tendto",Token.SPECIAL,"\\to ",5)};
-}
-
-// Token (this is simply a struct)
-class SmToken{
- Token eType;
- String sLaTeX;
- TGroup eGroup1, eGroup2;
- int nLevel;
-
- SmToken(){
- this.assign(Token.UNKNOWN,"",0);
- }
-
- void assign(Token eType, String sLaTeX, TGroup eGroup1, TGroup eGroup2, int nLevel){
- this.eType=eType;
- this.sLaTeX=sLaTeX;
- this.eGroup1=eGroup1;
- this.eGroup2=eGroup2;
- this.nLevel=nLevel;
- }
-
- void assign(Token eType, String sLaTeX, TGroup eGroup1, int nLevel){
- assign(eType, sLaTeX, eGroup1, TGroup.NONE, nLevel);
- }
-
- void assign(Token eType, String sLaTeX, int nLevel){
- assign(eType, sLaTeX, TGroup.NONE, TGroup.NONE, nLevel);
- }
-}
-
-
-///////////////////////////////////////////////////////////////////
-// The converter class
-public final class StarMathConverter {
-
- // Variables
- private SmTokenTable keywords=new SmTokenTable(SmTokenTable.keywords);
- private SmTokenTable symbols=new SmTokenTable(SmTokenTable.symbols);
- private Hashtable configSymbols;
- private boolean bUseColor;
- private SmToken curToken=new SmToken(); // contains the data of the current token
- private SimpleInputBuffer buffer; // contains the starmath formula
- private Float fBaseSize; // base size for the formula (usually 12pt)
- private I18n i18n;
-
- // Flags to track need for ooomath.sty definitions
- private boolean bDefeq = false;
- private boolean bLambdabar = false;
- private boolean bDdotsup = false;
- private boolean bMultimapdotbothA = false;
- private boolean bMultimapdotbothB = false;
- private boolean bLlbracket = false;
- private boolean bRrbracket = false;
- private boolean bOiint = false;
- private boolean bOiiint = false;
- private boolean bWideslash = false;
- private boolean bWidebslash = false;
- private boolean bBoldsubformula = false;
- private boolean bNormalsubformula = false;
- private boolean bMultiscripts = false;
- private boolean bMathoverstrike = false;
-
- StarMathConverter(I18n i18n, Config config){
- this.i18n = i18n;
- configSymbols = config.getMathSymbols();
- bUseColor = config.useColor();
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (bDefeq) {
- decl.append("\\newcommand\\defeq{\\stackrel{\\mathrm{def}}{=}}").nl();
- }
- if (bLambdabar) {
- decl.append("\\newcommand\\lambdabar{\\mathchar'26\\mkern-10mu\\lambda}").nl();
- }
- if (bDdotsup) {
- decl.append("\\newcommand\\ddotsup{\\mathinner{\\mkern1mu\\raise1pt\\vbox{\\kern7pt\\hbox{.}}\\mkern2mu\\raise4pt\\hbox{.}\\mkern2mu\\raise7pt\\hbox{.}\\mkern1mu}}").nl();
- }
- if (bMultimapdotbothA) {
- decl.append("\\providecommand\\multimapdotbothA{\\bullet\\kern-0.4em-\\kern-0.4em\\circ}").nl();
- }
- if (bMultimapdotbothB) {
- decl.append("\\providecommand\\multimapdotbothB{\\circ\\kern-0.4em-\\kern-0.4em\\bullet}").nl();
- }
- if (bLlbracket) {
- decl.append("\\providecommand\\llbracket{[}").nl();
- }
- if (bRrbracket) {
- decl.append("\\providecommand\\rrbracket{]}").nl();
- }
- if (bOiint) {
- decl.append("\\providecommand\\oiint{\\oint}").nl();
- }
- if (bOiiint) {
- decl.append("\\providecommand\\oiiint{\\oint}").nl();
- }
- if (bWideslash) {
- decl.append("\\newcommand\\wideslash[2]{{}^{#1}/_{#2}}").nl();
- }
- if (bWidebslash) {
- decl.append("\\newcommand\\widebslash[2]{{}_{#1}\\backslash^{#2}}").nl();
- }
- if (bBoldsubformula) {
- decl.append("\\newcommand\\boldsubformula[1]{\\text{\\mathversion{bold}$#1$}}").nl();
- }
- if (bNormalsubformula) {
- decl.append("\\newcommand\\normalsubformula[1]{\\text{\\mathversion{normal}$#1$}}").nl();
- }
- if (bMultiscripts || bMathoverstrike) {
- decl.append("\\newlength{\\idxmathdepth}\\newlength{\\idxmathtotal}\\newlength{\\idxmathwidth}\\newlength{\\idxraiseme}").nl();
- decl.append("\\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}}").nl();
- decl.append("\\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}}").nl();
- decl.append("\\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}}").nl();
- decl.append("\\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}}").nl();
- }
- if (bMultiscripts) {
- decl.append("\\newcommand\\multiscripts[5]{\\mathchoice")
- .append("{\\idxdheight{#4}\\rule[-\\idxmathdepth]{0mm}{\\idxmathtotal}#1\\underset{#2}{\\overset{#3}{#4}}\\rule[-\\idxmathdepth]{0mm}{\\idxmathtotal}#5}")
- .append("{\\idxtheight{#4}\\rule[-\\idxmathdepth]{0mm}{\\idxmathtotal}#1\\underset{#2}{\\overset{#3}{#4}}\\rule[-\\idxmathdepth]{0mm}{\\idxmathtotal}#5}")
- .append("{\\idxsheight{#4}\\rule[-\\idxmathdepth]{0mm}{\\idxmathtotal}#1\\underset{#2}{\\overset{#3}{#4}}\\rule[-\\idxmathdepth]{0mm}{\\idxmathtotal}#5}")
- .append("{\\idxssheight{#4}\\rule[-\\idxmathdepth]{0mm}{\\idxmathtotal}#1\\underset{#2}{\\overset{#3}{#4}}\\rule[-\\idxmathdepth]{0mm}{\\idxmathtotal}#5}}")
- .nl();
- }
- if (bMathoverstrike) {
- decl.append("\\newcommand\\mathoverstrike[1]{\\mathchoice")
- .append("{\\idxdheight{#1}\\rlap{\\rule[\\idxraiseme]{\\idxmathwidth}{0.4pt}}{#1}}")
- .append("{\\idxtheight{#1}\\rlap{\\rule[\\idxraiseme]{\\idxmathwidth}{0.4pt}}{#1}}")
- .append("{\\idxsheight{#1}\\rlap{\\rule[\\idxraiseme]{\\idxmathwidth}{0.4pt}}{#1}}")
- .append("{\\idxssheight{#1}\\rlap{\\rule[\\idxraiseme]{\\idxmathwidth}{0.4pt}}{#1}}}")
- .nl();
- }
- }
-
- /////////////////////////////////////////
- // Tokenizer
-
- private boolean tokenInGroup(TGroup eGroup){
- return curToken.eGroup1==eGroup || curToken.eGroup2==eGroup;
- }
-
- private void skipWhiteSpaces(){
- while (Character.isWhitespace(buffer.peekChar())) buffer.getChar();
- }
-
- private void skipComment(){
- if (buffer.peekChar()!='%' || buffer.peekFollowingChar()!='%') return;
- while (!CharClasses.isEndOrLineEnd(buffer.peekChar())) buffer.getChar();
- }
-
- private void nextToken(){
- // read next token from buffer and update curToken
- int nStart;
- do // move to first significant character
- { nStart=buffer.getIndex();
- skipWhiteSpaces();
- skipComment();
- } while (nStart<buffer.getIndex());
- if (buffer.peekChar()=='\0'){ // End of input
- curToken.assign(Token.END,"",0);
- return;
- }
- else if (buffer.peekChar()=='"'){ // Text
- String sText="";
- buffer.getChar();
- while (buffer.peekChar()!='"' && buffer.peekChar()!='\0'){
- sText+=buffer.getChar(); // temporary...
- }
- buffer.getChar();
- // TODO: Language should be inherited from surrounding text
- curToken.assign(Token.TEXT, i18n.convert(sText,false,"en"), 5);
- return;
- }
- else if (buffer.peekChar()=='%'){ // Special
- buffer.getChar();
- String sIdent=buffer.getIdentifier();
- if (configSymbols.containsKey(sIdent)) { // symbol defined in configuration
- curToken.assign(Token.SPECIAL, (String) configSymbols.get(sIdent), 5);
- }
- else if (!symbols.lookup(sIdent,false,curToken))
- curToken.assign(Token.IDENT, i18n.convert(sIdent,true,"en"), 5);
- }
- else if (Character.isLetter(buffer.peekChar())){ // Identifier
- String sIdent=buffer.getIdentifier();
- if (!keywords.lookup(sIdent,true,curToken))
- curToken.assign(Token.IDENT, i18n.convert(sIdent,true,"en"), 5);
- return;
- }
- else if (CharClasses.isDigitOrDot(buffer.peekChar())){ // Number
- String sNumber=buffer.getNumber();
- curToken.assign(Token.NUMBER, sNumber, 5);
- return;
- }
- else {
- char cChar=buffer.getChar();
- switch (cChar) {
- case '<':
- if (buffer.peekChar()=='<'){
- buffer.getChar();
- curToken.assign(Token.LL, "\\ll ", TGroup.RELATION, 0);
- }
- else if (buffer.peekChar()=='='){
- buffer.getChar();
- curToken.assign(Token.LE, "\\le ", TGroup.RELATION, 0);
- }
- else if (buffer.peekChar()=='>'){
- buffer.getChar();
- curToken.assign(Token.NEQ, "\\neq ", TGroup.RELATION, 0);
- }
- else if (buffer.peekChar()=='?' && buffer.peekFollowingChar()=='>'){
- buffer.getChar(); buffer.getChar();
- curToken.assign(Token.PLACE, "\\Box ", TGroup.STANDALONE, 5); // no group in parse.cxx
- }
- else {
- curToken.assign(Token.LT, "<", TGroup.RELATION, 0);
- }
- return;
- case '>':
- if (buffer.peekChar()=='>'){
- buffer.getChar();
- curToken.assign(Token.GG, "\\gg ", TGroup.RELATION, 0);
- }
- else if (buffer.peekChar()=='='){
- buffer.getChar();
- curToken.assign(Token.GE, "\\ge ", TGroup.RELATION, 0);
- }
- else {
- curToken.assign(Token.GT, ">", TGroup.RELATION, 0);
- }
- return;
- case '[':
- curToken.assign(Token.LBRACKET, "[", TGroup.LBRACES, 5);
- return;
- case '\\':
- curToken.assign(Token.ESCAPE, "", 5);
- return;
- case ']':
- curToken.assign(Token.RBRACKET, "]", TGroup.RBRACES, 0);
- return;
- case '^':
- curToken.assign(Token.RSUP, "", TGroup.POWER, 0);
- return;
- case '_':
- curToken.assign(Token.RSUB, "", TGroup.POWER, 0);
- return;
- case '`':
- curToken.assign(Token.SBLANK, "\\;", TGroup.BLANK, 5);
- return;
- case '{':
- curToken.assign(Token.LGROUP, "{", 5);
- return;
- case '|':
- curToken.assign(Token.OR, "\\vee ", TGroup.SUM, 0);
- return;
- case '}':
- curToken.assign(Token.RGROUP, "}", 0);
- return;
- case '~':
- curToken.assign(Token.BLANK, "\\ ", TGroup.BLANK, 5);
- return;
- case '#':
- if (buffer.peekChar()=='#'){
- buffer.getChar();
- curToken.assign(Token.DPOUND, "", 0);
- }
- else {
- curToken.assign(Token.POUND, "", 0);
- }
- return;
- case '&':
- curToken.assign(Token.AND, "\\wedge ", TGroup.PRODUCT, 0);
- return;
- case '(':
- curToken.assign(Token.LPARENT, "(", TGroup.LBRACES, 5);
- return;
- case ')':
- curToken.assign(Token.RPARENT, ")", TGroup.RBRACES, 0);
- return;
- case '*':
- curToken.assign(Token.MULTIPLY, "\\ast ", TGroup.PRODUCT, 0);
- return;
- case '+':
- if (buffer.peekChar()=='-'){
- buffer.getChar();
- curToken.assign(Token.PLUSMINUS, "\\pm ", TGroup.UNOPER, TGroup.SUM, 5);
- }
- else {
- curToken.assign(Token.PLUS, "+", TGroup.UNOPER, TGroup.SUM, 5);
- }
- return;
- case '-':
- if (buffer.peekChar()=='+'){
- buffer.getChar();
- curToken.assign(Token.MINUSPLUS, "\\mp ", TGroup.UNOPER, TGroup.SUM, 5);
- }
- else {
- curToken.assign(Token.MINUS, "-", TGroup.UNOPER, TGroup.SUM, 5);
- }
- return;
- //case '.': // not relevant... ??
- // curToken.assign(Token.POINT, ".", 0);
- // return;
- case '/':
- curToken.assign(Token.DIVIDEBY, "/", TGroup.PRODUCT, 0);
- return;
- case '=':
- curToken.assign(Token.ASSIGN, "=", TGroup.RELATION, 0);
- return;
- default:
- Character cCharObject=new Character(cChar);
- curToken.assign(Token.CHARACTER,i18n.convert(cCharObject.toString(),true,"en"),5);
- return;
- }
-
- }
- }
-
- ////////////////////////////////////////////////
- // Grammar
-
- private String table(float fSize, Token eAlign){
- StringBuffer bufTable=new StringBuffer();
- String sLine=line(fSize,eAlign);
- if (curToken.eType==Token.NEWLINE){ // more than one line
- bufTable.append("\\begin{gathered}").append(sLine);
- while (curToken.eType==Token.NEWLINE){
- nextToken();
- bufTable.append("\\\\").append(line(fSize,eAlign));
- }
- return bufTable.append("\\end{gathered}").toString();
- }
- else { // only one line
- return sLine;
- }
- }
-
- private String align(float fSize, Token eAlign,boolean bUseAlignment,boolean bNeedNull){
- // Alignment works very different in StarMath and LaTeX:
- // In LaTeX alignment is accomplished using suitable \hfill's in appropriate spots.
- // Hence we need to pass on the current alignment as a parameter to decide where to \hfill.
- // bUseAlignment requires us to add a suitable \hfill (set true by table, matrix and stack).
- // bNeedNull requires us to add \null (an empty hbox) at the end (the matrix environment
- // needs this).
- // Currently fractions and binoms are *not* aligned.
- // In the other constructions alignment doesn't work if it's put inside a group:
- // stack{{alignl a}#aaaa} does not work, while stack{alignl a#aaaa} does work.
-
- if (tokenInGroup(TGroup.ALIGN)){
- eAlign=curToken.eType;
- nextToken();
- }
- if (bUseAlignment && eAlign==Token.ALIGNL){
- if (bNeedNull){
- return expression(fSize,eAlign)+"\\hfill\\null ";
- }
- else {
- return expression(fSize,eAlign)+"\\hfill ";
- }
- }
- else if (bUseAlignment && eAlign==Token.ALIGNR){
- return "\\hfill "+expression(fSize,eAlign);
- }
- else { // center alignment (default!) or no alignment
- return expression(fSize,eAlign);
- }
- }
-
- private String line(float fSize, Token eAlign){
- if (curToken.eType!=Token.NEWLINE && curToken.eType!=Token.END){
- // Add implicit left alignment for expressions starting with text
- // (Note: Don't pass on this alignment to subexpressions!)
- if (curToken.eType==Token.TEXT) {
- return expression(fSize,eAlign)+"\\hfill ";
- }
- else {
- return align(fSize,eAlign,true,false);
- }
- }
- else { // empty line
- return "{}"; // LaTeX doesn't like empty lines in gather
- }
- }
-
- private String expression(float fSize, Token eAlign){
- StringBuffer bufExpression=new StringBuffer().append(relation(fSize,eAlign));
- while (curToken.nLevel>=5){
- bufExpression.append(relation(fSize,eAlign));
- }
- return bufExpression.toString();
- }
-
- private String relation(float fSize, Token eAlign){
- StringBuffer bufRelation=new StringBuffer().append(sum(fSize,eAlign));
- while (tokenInGroup(TGroup.RELATION)){
- if (curToken.eType==Token.TRANSL) { bMultimapdotbothA=true; }
- else if (curToken.eType==Token.TRANSR) { bMultimapdotbothB=true; }
- else if (curToken.eType==Token.DEF) { bDefeq=true; }
- bufRelation.append(opsubsup(fSize,eAlign)).append(sum(fSize,eAlign));
- }
- return bufRelation.toString();
- }
-
- private String sum(float fSize, Token eAlign){
- StringBuffer bufSum=new StringBuffer().append(product(fSize,eAlign));
- while (tokenInGroup(TGroup.SUM)){
- bufSum.append(opsubsup(fSize,eAlign)).append(product(fSize,eAlign));
- }
- return bufSum.toString();
- }
-
- private String product(float fSize, Token eAlign){
- String sProduct=power(fSize,eAlign,true);
- sProduct=sProduct.substring(1,sProduct.length()-1);
- // a small hack to avoid double {}: Require {}, then remove them
- // and add them below if they are needed.
- while (tokenInGroup(TGroup.PRODUCT)){
- if (curToken.eType==Token.OVER){
- nextToken();
- sProduct="\\frac{"+sProduct+"}"+power(fSize,eAlign,true);
- } else if (curToken.eType==Token.BOPER){
- nextToken();
- sProduct+=special()+power(fSize,eAlign,false);
- } else if (curToken.eType==Token.OVERBRACE){
- nextToken();
- sProduct="\\overbrace{"+sProduct+"}^"+power(fSize,eAlign,true);
- } else if (curToken.eType==Token.UNDERBRACE){
- nextToken();
- sProduct="\\underbrace{"+sProduct+"}_"+power(fSize,eAlign,true);
- } else if (curToken.eType==Token.WIDESLASH){
- bWideslash=true;
- nextToken();
- sProduct="\\wideslash{"+sProduct+"}"+power(fSize,eAlign,true);
- } else if (curToken.eType==Token.WIDEBACKSLASH){
- bWidebslash=true;
- nextToken();
- sProduct="\\widebslash{"+sProduct+"}"+power(fSize,eAlign,true);
- } else {
- sProduct+=opsubsup(fSize,eAlign)+power(fSize,eAlign,false);
- }
- }
- return sProduct;
-
- }
-
- private String tosub(String s){
- return s!=null ? "_"+s : "";
- }
-
- private String tosup(String s){
- return s!=null ? "^"+s : "";
- }
-
- private String subsup(float fSize, Token eAlign,String sBody, TGroup eActiveGroup){
- // sBody is the string to attach scripts to
- // eActiveGroup must be TGroup.LIMIT or TGroup.POWER
- // in the former case sBody must contain a large operator (sum, int...)
- Token eScriptType;
- String sLsub=null, sLsup=null, sCsub=null, sCsup=null, sRsub=null, sRsup=null;
- while (tokenInGroup(eActiveGroup)){
- eScriptType=curToken.eType;
- nextToken();
- if (eScriptType==Token.FROM) sCsub="{"+relation(fSize,eAlign)+"}";
- else if (eScriptType==Token.TO) sCsup="{"+relation(fSize,eAlign)+"}";
- else if (eScriptType==Token.LSUB) sLsub=term(fSize,eAlign,true);
- else if (eScriptType==Token.LSUP) sLsup=term(fSize,eAlign,true);
- else if (eScriptType==Token.CSUB) sCsub=term(fSize,eAlign,true);
- else if (eScriptType==Token.CSUP) sCsup=term(fSize,eAlign,true);
- else if (eScriptType==Token.RSUB) sRsub=term(fSize,eAlign,true);
- else if (eScriptType==Token.RSUP) sRsup=term(fSize,eAlign,true);
- }
- if (sLsub==null && sLsup==null && sCsub==null && sCsup==null && sRsub==null && sRsup==null){
- return sBody;
- }
- if (eActiveGroup==TGroup.LIMIT){
- if (sLsub==null && sLsup==null && sRsub==null && sRsup==null){
- // ordinary limits
- return sBody+tosub(sCsub)+tosup(sCsup);
- }
- else { // nontrivial case: use \sideset
- // problem: always typesets the operator in \displaystyle
- // solution: use \multiscripts instead???
- return "\\sideset{"+tosub(sLsub)+tosup(sLsup)+"}{"+tosub(sRsub)+tosup(sRsup)+"}"
- +sBody+"\\limits"+tosub(sCsub)+tosup(sCsup);
- }
- }
- else {
- if (sLsub==null && sLsup==null && sCsub==null && sCsup==null){
- // ordinary scripts
- return sBody+tosub(sRsub)+tosup(sRsup);
- }
- else if (sLsub==null && sLsup==null && sRsub==null && sRsup==null){
- // scripts above/below
- if (sCsub==null){
- return "\\overset"+sCsup+"{"+sBody+"}";
- }
- else if (sCsup==null){
- return "\\underset"+sCsub+"{"+sBody+"}";
- }
- else {
- return "\\overset"+sCsup+"{\\underset"+sCsub+"{"+sBody+"}}";
- }
- }
- else {// general case: use \multiscripts
- bMultiscripts=true;
- if (sCsub==null) {sCsub="{}";}
- if (sCsup==null) {sCsup="{}";}
- return "\\multiscripts{"+tosub(sLsub)+tosup(sLsup)+"}"+sCsub+sCsup
- +"{"+sBody+"}{"+tosub(sRsub)+tosup(sRsup)+"}";
- }
- }
- }
-
- private String opsubsup(float fSize, Token eAlign){
- String sOperator=curToken.sLaTeX;
- nextToken();
- return subsup(fSize,eAlign,sOperator,TGroup.POWER);
- }
-
- private String power(float fSize, Token eAlign,boolean bNeedGroup){
- // bNeedGroup is true, if the power needs to be enclosed in braces
- // Since we don't want to add unnecessary braces the responsibility
- // is delegated to power - we need to look ahead to determine if {}
- // should be added.
- boolean bTermIsGroup=curToken.eType==Token.LGROUP;
- String sTerm=term(fSize,eAlign);
- if (bNeedGroup && (!bTermIsGroup || tokenInGroup(TGroup.POWER))){
- return "{"+subsup(fSize,eAlign,sTerm,TGroup.POWER)+"}";
- }
- else {
- return subsup(fSize,eAlign,sTerm,TGroup.POWER);
- }
- }
-
- private String blank(){
- StringBuffer bufBlank=new StringBuffer();
- while (tokenInGroup(TGroup.BLANK)){
- bufBlank.append(curToken.sLaTeX);
- nextToken();
- }
- return bufBlank.toString();
- }
-
- private String term(float fSize, Token eAlign, boolean bNeedGroup){
- // Special version of term used to avoid double {{grouping}}
- // if bNeedGroup=true we must return {term} in braces
- if (bNeedGroup && !(curToken.eType==Token.LGROUP)){
- return "{"+term(fSize,eAlign)+"}";
- }
- /*else if (!bNeedGroup && curToken.eType==Token.LGROUP){
- String sTerm=term(fSize,eAlign);
- return sTerm.substring(1,sTerm.length()-2); // renove unwanted {}
- }*/
- else {
- return term(fSize,eAlign);
- }
- }
-
- private String term(float fSize, Token eAlign){
- String sContent;
- if (curToken.eType==Token.ESCAPE)
- return escape();
- else if (curToken.eType==Token.LGROUP){
- nextToken();
- if (curToken.eType!=Token.RGROUP)
- sContent=align(fSize,eAlign,false,false);
- else
- sContent=""; // empty group
- if (curToken.eType==Token.RGROUP)
- nextToken();
- // otherwise there is an error in the formula
- // we close the group anyway to make us TeX'able.
- return "{"+sContent+"}";
- }
- else if (curToken.eType==Token.LEFT)
- return scalebrace(fSize,eAlign);
- else if (tokenInGroup(TGroup.BLANK))
- return blank();
- else if (curToken.eType==Token.TEXT){
- sContent=curToken.sLaTeX;
- nextToken();
- return "\\text{"+sContent+"}";
- }
- else if (curToken.eType==Token.CHARACTER || curToken.eType==Token.NUMBER
- || tokenInGroup(TGroup.STANDALONE)){
- if (curToken.eType==Token.LAMBDABAR) { bLambdabar=true; }
- if (curToken.eType==Token.DOTSUP) { bDdotsup=true; }
- sContent=curToken.sLaTeX;
- nextToken();
- return sContent;
- }
- else if (curToken.eType==Token.IDENT){
- sContent=curToken.sLaTeX;
- nextToken();
- return sContent.length()>1 ? "\\mathit{"+sContent+"}" : sContent;
- }
- else if (curToken.eType==Token.SPECIAL)
- return special();
- else if (curToken.eType==Token.BINOM)
- return binom(fSize,eAlign);
- else if (curToken.eType==Token.STACK)
- return stack(fSize,eAlign);
- else if (curToken.eType==Token.MATRIX)
- return matrix(fSize,eAlign);
- else if (tokenInGroup(TGroup.LBRACES))
- return brace(fSize,eAlign);
- else if (tokenInGroup(TGroup.OPER))
- return operator(fSize,eAlign);
- else if (tokenInGroup(TGroup.UNOPER))
- return unoper(fSize,eAlign);
- else if (tokenInGroup(TGroup.ATTRIBUT) || tokenInGroup(TGroup.FONTATTR))
- return attributes(fSize,eAlign);
- else if (tokenInGroup(TGroup.FUNCTION))
- return function();
- else { // error in formula
- nextToken();
- return "?";
- }
- }
-
- private String escape(){
- String sEscape;
- nextToken();
- if ((tokenInGroup(TGroup.LBRACES) || tokenInGroup(TGroup.RBRACES))
- && curToken.eType!=Token.NONE){
- sEscape=curToken.sLaTeX;
- nextToken();
- }
- else if (curToken.eType==Token.LGROUP){
- sEscape="\\{";
- nextToken();
- }
- else if (curToken.eType==Token.RGROUP){
- sEscape="\\}";
- nextToken();
- }
- else { // error in formula
- sEscape="";
- }
- return sEscape;
- }
-
- private String operator(float fSize, Token eAlign){
- String sOperator=oper();
- if (tokenInGroup(TGroup.LIMIT) || tokenInGroup(TGroup.POWER)){
- // Note: TGroup.LIMIT and TGroup.POWER are always in eGroup1, so this is OK:
- return subsup(fSize,eAlign,sOperator,curToken.eGroup1)+power(fSize,eAlign,false);
- }
- else {
- return sOperator+power(fSize,eAlign,false);
- }
- }
-
- private String oper(){
- if (curToken.eType==Token.LLINT) { bOiint=true; }
- else if (curToken.eType==Token.LLLINT) { bOiiint=true; }
- String sOper;
- if (curToken.eType==Token.OPER){
- nextToken();
- if (curToken.eType==Token.SPECIAL)
- sOper="\\operatornamewithlimits{"+curToken.sLaTeX+"}";
- else
- sOper="\\operatornamewithlimits{?}"; // error in formula
- }
- else {
- sOper=curToken.sLaTeX;
- }
- nextToken();
- return sOper;
- }
-
- private String unoper(float fSize, Token eAlign){
- if (curToken.eType==Token.ABS){
- nextToken();
- return "\\left|"+power(fSize,eAlign,false)+"\\right|";
- }
- else if (curToken.eType==Token.SQRT){
- nextToken();
- return "\\sqrt"+power(fSize,eAlign,true);
- }
- else if (curToken.eType==Token.NROOT){
- nextToken();
- return "\\sqrt["+power(fSize,eAlign,false)+"]"+power(fSize,eAlign,true);
- }
- else if (curToken.eType==Token.UOPER){
- nextToken();
- return special()+power(fSize,eAlign,false);
- }
- else if (curToken.eType==Token.FACT){
- String sOperator=opsubsup(fSize,eAlign);
- return power(fSize,eAlign,false)+sOperator;
- }
- else { // must be PLUS, MINUS, PLUSMINUS, MINUSPLUS or NEG
- return opsubsup(fSize,eAlign)+power(fSize,eAlign,false);
- }
- }
-
- private String attributes(float fSize, Token eAlign){
- String sAttribute;
- if (curToken.eType==Token.FONT){
- nextToken();
- if (tokenInGroup(TGroup.FONT)){
- sAttribute=curToken.sLaTeX;
- nextToken();
- return sAttribute+"{"+term(fSize,eAlign)+"}";
- }
- else { // error in formula
- return "?";
- }
- }
- else if (curToken.eType==Token.COLOR){
- nextToken();
- if (tokenInGroup(TGroup.COLOR)){
- sAttribute=curToken.sLaTeX; // the color name
- nextToken();
- if (bUseColor) {
- return "\\textcolor{"+sAttribute+"}{"+term(fSize,eAlign)+"}";
- // note: despite the name, \textcolor also works in math mode!
- }
- else {
- return term(fSize,eAlign);
- }
- }
- else { // error in formula
- return "?";
- }
- }
- else if (curToken.eType==Token.SIZE){
- nextToken();
- if (curToken.eType==Token.PLUS){
- nextToken();
- if (curToken.eType==Token.NUMBER){
- fSize+=Misc.getFloat(curToken.sLaTeX,0);
- nextToken();
- } // else error in formula: ignore
- }
- else if(curToken.eType==Token.MINUS){
- nextToken();
- if (curToken.eType==Token.NUMBER){
- fSize-=Misc.getFloat(curToken.sLaTeX,0);
- nextToken();
- } // else error in formula: ignore
- }
- else if(curToken.eType==Token.MULTIPLY){
- nextToken();
- if (curToken.eType==Token.NUMBER){
- fSize*=Misc.getFloat(curToken.sLaTeX,1);
- nextToken();
- } // else error in formula: ignore
- }
- else if(curToken.eType==Token.DIVIDEBY){
- nextToken();
- if (curToken.eType==Token.NUMBER){
- float f=Misc.getFloat(curToken.sLaTeX,1);
- if (f!=0) {fSize/=f;}
- nextToken();
- } // else error in formula: ignore
- }
- else if (curToken.eType==Token.NUMBER){
- fSize=Misc.getFloat(curToken.sLaTeX,fSize);
- nextToken();
- } // else error in formula: ignore
- return term(fSize,eAlign);
- // currently only reads the size, it is not used
- // should use fSize/fBaseSize to change to
- // \displaystyle, \textstyle, \scriptstyle, \scriptscriptstyle
- }
- else { // must be ATTRIBUT or FONTATTR
- if (curToken.eType == Token.OVERSTRIKE) { bMathoverstrike=true; }
- else if (curToken.eType == Token.BOLD) { bBoldsubformula=true; }
- else if (curToken.eType == Token.NBOLD) { bNormalsubformula=true; }
- sAttribute=curToken.sLaTeX;
- nextToken();
- return sAttribute+"{"+term(fSize,eAlign)+"}";
- }
- }
-
- private String scalebrace(float fSize, Token eAlign){
- String sLeft, sRight, sBody;
- nextToken();
- if (tokenInGroup(TGroup.LBRACES) || tokenInGroup(TGroup.RBRACES)){
- if (curToken.eType==Token.LDBRACKET) { bLlbracket=true; }
- else if (curToken.eType==Token.RDBRACKET) { bRrbracket=true; }
- sLeft=new String(curToken.sLaTeX);
- nextToken();
- sBody=scalebracebody(fSize,eAlign);
- if (curToken.eType==Token.RIGHT) {
- nextToken();
- if (tokenInGroup(TGroup.LBRACES) || tokenInGroup(TGroup.RBRACES)){
- if (curToken.eType==Token.LDBRACKET) { bLlbracket=true; }
- else if (curToken.eType==Token.RDBRACKET) { bRrbracket=true; }
- sRight=new String(curToken.sLaTeX);
- nextToken();
- }
- else { // no brace after right!
- sRight=".";
- }
- }
- else { // no right!
- return ".";
- }
- return "\\left"+sLeft+sBody+"\\right"+sRight;
- }
- else { // no brace after left!
- return "?";
- }
- }
-
- private String brace(float fSize, Token eAlign){
- String sLeft, sRight, sBody;
- if (curToken.eType==Token.LDBRACKET) { bLlbracket=true; }
- sLeft=new String(curToken.sLaTeX);
- nextToken();
- sBody=bracebody(fSize,eAlign);
- if (tokenInGroup(TGroup.RBRACES)){
- if (curToken.eType==Token.RDBRACKET) { bRrbracket=true; }
- sRight=new String(curToken.sLaTeX);
- nextToken();
- return sLeft+sBody+sRight;
- }
- else { // no right brace! (This is an error, we don't care);
- return sLeft+sBody;
- }
- }
-
-
- private String scalebracebody(float fSize, Token eAlign){
- if (curToken.eType==Token.MLINE){
- nextToken();
- return "\\left|"+scalebracebody(fSize,eAlign)+"\\right.";
- }
- else if (curToken.eType!=Token.RIGHT && curToken.eType!=Token.END){
- return align(fSize,eAlign,false,false)+scalebracebody(fSize,eAlign);
- }
- else { // Finished recursion
- return "";
- }
- }
-
- private String bracebody(float fSize, Token eAlign){
- if (curToken.eType==Token.MLINE){
- nextToken();
- return "|"+bracebody(fSize,eAlign);
- }
- else if (!tokenInGroup(TGroup.RBRACES) && curToken.eType!=Token.END){
- return align(fSize,eAlign,false,false)+bracebody(fSize,eAlign);
- }
- else { // Finished recursion
- return "";
- }
- }
-
- private String function(){
- String sFunction;
- if (curToken.eType==Token.FUNC){
- nextToken();
- if (curToken.eType==Token.IDENT){
- sFunction="\\operatorname{"+curToken.sLaTeX+"}";
- nextToken();
- }
- else { // error in formula
- sFunction="";
- }
- }
- else {
- sFunction=curToken.sLaTeX;
- nextToken();
- }
- return sFunction;
- }
-
- private String binom(float fSize, Token eAlign){
- nextToken();
- return "\\genfrac{}{}{0pt}{0}{"+sum(fSize,eAlign)+"}{"+sum(fSize,eAlign)+"}";
- }
-
- private String stack(float fSize, Token eAlign){
- nextToken();
- if (curToken.eType==Token.LGROUP){
- StringBuffer bufStack=new StringBuffer().append("\\begin{matrix}");
- do {
- nextToken();
- bufStack.append(align(fSize,eAlign,true,true));
- if (curToken.eType==Token.POUND) bufStack.append("\\\\");
- } while (curToken.eType==Token.POUND);
- if (curToken.eType==Token.RGROUP) nextToken(); // otherwise error in formula - ignore
- return bufStack.append("\\end{matrix}").toString();
- }
- else { // error in formula
- return "";
- }
- }
-
- private String matrix(float fSize, Token eAlign){
- nextToken();
- if (curToken.eType==Token.LGROUP){
- StringBuffer bufMatrix=new StringBuffer().append("\\begin{matrix}");
- do {
- nextToken();
- bufMatrix.append(align(fSize,eAlign,true,true));
- if (curToken.eType==Token.POUND) bufMatrix.append("&");
- else if (curToken.eType==Token.DPOUND) bufMatrix.append("\\\\");
- } while (curToken.eType==Token.POUND || curToken.eType==Token.DPOUND);
- if (curToken.eType==Token.RGROUP) nextToken(); // otherwise error in formula- ignore
- return bufMatrix.append("\\end{matrix}").toString();
- }
- else { // error in formula
- return "";
- }
- }
-
- private String special() {
- String sSpecial=curToken.sLaTeX;
- nextToken();
- return sSpecial;
- }
-
-
- ////////////////////////////////////////////////
- // Finally, the converter itself
- public String convert(String sStarMath){
- String sExport="";
- buffer=new SimpleInputBuffer(sStarMath);
- nextToken();
- sExport=table(12.0F,Token.ALIGNC);
- return sExport.length()==0 ? " " : sExport; // don't return an empty formula!
- //System.out.println(sExport);
- }
-}
-
-
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/BeforeAfter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/BeforeAfter.java
deleted file mode 100644
index d6ea605a9cf9..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/BeforeAfter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/************************************************************************
- *
- * BeforeAfter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-08-26)
- *
- */
-
-package writer2latex.latex.style;
-
-/* Utility class to hold LaTeX code to put before/after other LaTeX code
- */
-public class BeforeAfter {
- private String sBefore="";
- private String sAfter="";
-
- public void add(String sBefore1, String sAfter1) {
- sBefore+=sBefore1; sAfter=sAfter1+sAfter;
- }
-
- public String getBefore() { return sBefore; }
- public String getAfter() { return sAfter; }
-
- public boolean isEmpty() { return sBefore.length()==0 && sAfter.length()==0; }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/CharStyleConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/CharStyleConverter.java
deleted file mode 100644
index 1ffda9f8f875..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/CharStyleConverter.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/************************************************************************
- *
- * CharStyleConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-11)
- *
- */
-
-package writer2latex.latex.style;
-
-import java.util.Hashtable;
-
-import writer2latex.util.*;
-import writer2latex.office.*;
-import writer2latex.latex.Context;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterPalette;
-
-/** This class creates LaTeX code from OOo character formatting
- Character formatting in OOo includes font, font effects/decorations and color.
- In addition it includes language/country information, this is however handled
- by the class <code>writer2latex.latex.style.I18n</code>
- */
-public class CharStyleConverter extends StyleConverter {
-
- // Cache of converted font declarations
- private Hashtable fontDecls = new Hashtable();
-
- // Which formatting should we export?
- private boolean bUseColor;
- private boolean bIgnoreHardFontsize;
- private boolean bIgnoreFontsize;
- private boolean bIgnoreFont;
- private boolean bIgnoreAll;
- private boolean bUseUlem;
- // Do we need actually use ulem.sty or \textsubscript?
- private boolean bNeedUlem = false;
- private boolean bNeedSubscript = false;
-
- /** <p>Constructs a new <code>CharStyleConverter</code>.</p>
- */
- public CharStyleConverter(WriterStyleCollection wsc, Config config, ConverterPalette palette) {
- super(wsc,config,palette);
-
- bUseColor = config.useColor();
- bUseUlem = config.useUlem();
-
- // No character formatting at all:
- bIgnoreAll = config.formatting()==Config.IGNORE_ALL;
- // No font family or size:
- bIgnoreFont = config.formatting()<=Config.IGNORE_MOST;
- // No fontsize:
- bIgnoreFontsize = config.formatting()<=Config.CONVERT_BASIC;
- // No hard fontsize
- bIgnoreHardFontsize = config.formatting()<=Config.CONVERT_MOST;
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (bUseColor) {
- pack.append("\\usepackage{color}").nl();
- }
- if (bNeedUlem) {
- pack.append("\\usepackage[normalem]{ulem}").nl();
- }
- if (bNeedSubscript) {
- decl.append("\\newcommand\\textsubscript[1]{\\ensuremath{{}_{\\text{#1}}}}").nl();
- }
- if (!styleNames.isEmpty()) {
- decl.append("% Text styles").nl().append(declarations);
- }
- }
-
- /** <p>Use a text style in LaTeX.</p>
- * @param <code>sName</code> the name of the text style
- * @param <code>ba</code> a <code>BeforeAfter</code> to put code into
- */
- public void applyTextStyle(String sName, BeforeAfter ba, Context context) {
- if (sName==null || bIgnoreAll) { return; }
-
- // Style already converted?
- if (styleMap.contains(sName)) {
- ba.add(styleMap.getBefore(sName),styleMap.getAfter(sName));
- context.updateFormattingFromStyle(wsc.getTextStyle(sName));
- // it's verbatim if specified as sich in the configuration
- StyleMap sm = config.getTextStyleMap();
- context.setVerbatim(sm.contains(sName) && sm.getVerbatim(sName));
- return;
- }
-
- // The style may already be declared in the configuration:
- StyleMap sm = config.getTextStyleMap();
- if (sm.contains(sName)) {
- styleMap.put(sName,sm.getBefore(sName),sm.getAfter(sName));
- applyTextStyle(sName,ba,context);
- return;
- }
-
- // Get the style, if it exists:
- StyleWithProperties style = wsc.getTextStyle(sName);
- if (style==null) {
- styleMap.put(sName,"","");
- applyTextStyle(sName,ba,context);
- return;
- }
-
- // Convert automatic style
- if (style.isAutomatic()) {
- palette.getI18n().applyLanguage(style,false,true,ba);
- applyFont(style,false,true,ba,context);
- applyFontEffects(style,true,ba);
- context.updateFormattingFromStyle(wsc.getTextStyle(sName));
- return;
- }
-
- // Convert soft style:
- // This must be converted relative to a blank context!
- BeforeAfter baText = new BeforeAfter();
- palette.getI18n().applyLanguage(style,false,true,baText);
- applyFont(style,false,true,baText,new Context());
- applyFontEffects(style,true,baText);
- // declare the text style (\newcommand)
- String sTeXName = styleNames.getExportName(sName);
- styleMap.put(sName,"\\textstyle"+sTeXName+"{","}");
- declarations.append("\\newcommand\\textstyle")
- .append(sTeXName).append("[1]{")
- .append(baText.getBefore()).append("#1").append(baText.getAfter())
- .append("}").nl();
- applyTextStyle(sName,ba,context);
- }
-
- // Get the font name from a char style
- public String getFontName(String sStyleName) {
- StyleWithProperties style = wsc.getTextStyle(sStyleName);
- if (style==null) { return null; }
- String sName = style.getProperty(XMLString.STYLE_FONT_NAME);
- if (sName==null) { return null; }
- FontDeclaration fd = wsc.getFontDeclaration(sName);
- if (fd==null) { return null; }
- return fd.getProperty(XMLString.FO_FONT_FAMILY);
- }
-
- /** <p>Apply hard character formatting (no inheritance).</p>
- * <p>This is used in sections and {foot|end}notes</p>
- * @param <code>style</code> the style to use
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to
- */
- public void applyHardCharFormatting(StyleWithProperties style, BeforeAfter ba) {
- palette.getI18n().applyLanguage(style,true,false,ba);
- applyFont(style,true,false,ba,new Context());
- if (!ba.isEmpty()) { ba.add(" ",""); }
- }
-
- /** <p>Apply all font attributes (family, series, shape, size and color).</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bDecl</code> true if declaration form is required
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- public void applyFont(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba, Context context) {
- // Note: if bDecl is true, nothing will be put in the "after" part of ba.
- if (style==null) { return; }
- applyNfssSize(style,bDecl,bInherit,ba,context);
- applyNfssFamily(style,bDecl,bInherit,ba,context);
- applyNfssSeries(style,bDecl,bInherit,ba,context);
- applyNfssShape(style,bDecl,bInherit,ba,context);
- applyColor(style,bDecl,bInherit,ba,context);
- }
-
- /** <p>Reset to normal font, size and color.</p>
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- public void applyNormalFont(BeforeAfter ba) {
- if (bUseColor) {
- ba.add("\\normalfont\\normalsize\\normalcolor","");
- }
- else {
- ba.add("\\normalfont\\normalsize","");
- }
- }
-
- /** <p>Apply default font attributes (family, series, shape, size and color).</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to add LaTeX code to.
- */
- public void applyDefaultFont(StyleWithProperties style, LaTeXDocumentPortion ldp) {
- if (style==null) { return; }
-
- String s = convertFontDeclaration(style.getProperty(XMLString.STYLE_FONT_NAME));
- if (s!=null){
- ldp.append("\\renewcommand\\familydefault{\\")
- .append(s).append("default}").nl();
- } // TODO: Else read props directly from the style
-
- s = nfssSeries(style.getProperty(XMLString.FO_FONT_WEIGHT));
- if (s!=null) {
- ldp.append("\\renewcommand\\seriesdefault{\\")
- .append(s).append("default}").nl();
- }
-
- s = nfssShape(style.getProperty(XMLString.FO_FONT_VARIANT),
- style.getProperty(XMLString.FO_FONT_STYLE));
- if (s!=null) {
- ldp.append("\\renewcommand\\shapedefault{\\")
- .append(s).append("default}").nl();
- }
-
- if (bUseColor) {
- s = color(style.getProperty(XMLString.FO_COLOR));
- if (s!=null) {
- ldp.append("\\renewcommand\\normalcolor{\\color")
- .append(s).append("}").nl();
- }
- }
- }
-
- /** <p>Apply font effects (position, underline, crossout, change case.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- public void applyFontEffects(StyleWithProperties style, boolean bInherit, BeforeAfter ba) {
- if (style==null) { return; }
- applyTextPosition(style, bInherit, ba);
- applyUnderline(style, bInherit, ba);
- applyCrossout(style, bInherit, ba);
- applyChangeCase(style, bInherit, ba);
- }
-
- /** <p>Apply font color.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bDecl</code> true if declaration form is required
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- public void applyColor(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba, Context context) {
- // Note: if bDecl is true, nothing will be put in the "after" part of ba.
- if (style==null || !bUseColor || bIgnoreAll) { return; }
- String sColor = color(style.getProperty(XMLString.FO_COLOR,bInherit));
- if (sColor==null) { return; }
- if (sColor.equals(color(context.getFontColor()))) { return; }
- if (bDecl) { ba.add("\\color"+sColor,""); }
- else { ba.add("\\textcolor"+sColor+"{","}"); }
- }
-
- /** <p>Apply a specific font color.</p>
- * @param <code>sColor</code> the rgb color to use
- * @param <code>bDecl</code> true if declaration form is required
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- public void applyThisColor(String sColor, boolean bDecl, BeforeAfter ba) {
- // Note: if bDecl is true, nothing will be put in the "after" part of ba.
- if (sColor==null || !bUseColor || bIgnoreAll) { return; }
- String s = color(sColor);
- if (s==null) { return; }
- if (bDecl) { ba.add("\\color"+s,""); }
- else { ba.add("\\textcolor"+s+"{","}"); }
- }
-
- // Remaining methods are private
-
- /** <p>Apply font family.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bDecl</code> true if declaration form is required
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- private void applyNfssFamily(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba, Context context) {
- // Note: if bDecl is true, nothing will be put in the "after" part of ba.
- if (style==null || bIgnoreFont) { return; }
- String sFontName=style.getProperty(XMLString.STYLE_FONT_NAME,bInherit);
- if (sFontName!=null){
- String sFamily = convertFontDeclaration(sFontName);
- if (sFamily==null) { return; }
- if (sFamily.equals(convertFontDeclaration(context.getFontName()))) { return; }
- if (bDecl) { ba.add("\\"+sFamily+"family",""); }
- else { ba.add("\\text"+sFamily+"{","}"); }
- } // TODO: Else read props directly from the style
- }
-
- /** <p>Apply font series.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bDecl</code> true if declaration form is required
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- private void applyNfssSeries(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba, Context context) {
- // Note: if bDecl is true, nothing will be put in the "after" part of ba.
- if (style==null) { return; }
- if (bIgnoreAll) { return; }
- String sSeries = nfssSeries(style.getProperty(XMLString.FO_FONT_WEIGHT,bInherit));
- if (sSeries==null) { return; }
- if (sSeries.equals(nfssSeries(context.getFontWeight()))) { return; }
- if (bDecl) { ba.add("\\"+sSeries+"series",""); }
- else { ba.add("\\text"+sSeries+"{","}"); }
- }
-
- /** <p>Apply font shape.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bDecl</code> true if declaration form is required
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- private void applyNfssShape(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba, Context context) {
- // Note: if bDecl is true, nothing will be put in the "after" part of ba.
- if (style==null) { return; }
- if (bIgnoreAll) { return; }
- String sShape = nfssShape(style.getProperty(XMLString.FO_FONT_VARIANT, bInherit),
- style.getProperty(XMLString.FO_FONT_STYLE, bInherit));
- if (sShape==null) { return; }
- if (sShape.equals(nfssShape(context.getFontVariant(),context.getFontStyle()))) { return; }
- if (bDecl) { ba.add("\\"+sShape+"shape",""); }
- else { ba.add("\\text"+sShape+"{","}"); }
- }
-
- /** <p>Apply font size.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bDecl</code> true if declaration form is required
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- private void applyNfssSize(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba, Context context) {
- // Note: if bDecl is true, nothing will be put in the "after" part of ba.
- if (style==null|| bIgnoreFontsize || (bIgnoreHardFontsize && style.isAutomatic())) { return; }
- if (style.getProperty(XMLString.FO_FONT_SIZE, bInherit)==null) { return; }
- String sSize = nfssSize(style.getAbsoluteProperty(XMLString.FO_FONT_SIZE));
- if (sSize==null) { return; }
- if (sSize.equals(nfssSize(context.getFontSize()))) { return; }
- if (bDecl) { ba.add(sSize,""); }
- else { ba.add("{"+sSize+" ","}"); }
- }
-
- // Remaining methods are not context-sensitive
-
- /** <p>Apply text position.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- private void applyTextPosition(StyleWithProperties style, boolean bInherit, BeforeAfter ba) {
- if (style==null) { return; }
- if (bIgnoreAll) { return; }
- String s = textPosition(style.getProperty(XMLString.STYLE_TEXT_POSITION, bInherit));
- if (s!=null) { ba.add(s+"{","}"); }
- }
-
- /** <p>Apply text underline.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- private void applyUnderline(StyleWithProperties style, boolean bInherit, BeforeAfter ba) {
- if (style==null || !bUseUlem) { return; }
- if (bIgnoreAll) { return; }
- String s = underline(style.getProperty(XMLString.STYLE_TEXT_UNDERLINE, bInherit));
- if (s!=null) { bNeedUlem = true; ba.add(s+"{","}"); }
- }
-
- /** <p>Apply text crossout.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- private void applyCrossout(StyleWithProperties style, boolean bInherit, BeforeAfter ba) {
- if (style==null || !bUseUlem) { return; }
- if (bIgnoreAll) { return; }
- String s = crossout(style.getProperty(XMLString.STYLE_TEXT_CROSSING_OUT, bInherit));
- if (s!=null) { bNeedUlem = true; ba.add(s+"{","}"); }
- }
-
- /** <p>Apply change case.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- private void applyChangeCase(StyleWithProperties style, boolean bInherit, BeforeAfter ba) {
- if (style==null) { return; }
- if (bIgnoreAll) { return; }
- String s = changeCase(style.getProperty(XMLString.FO_TEXT_TRANSFORM));
- if (s!=null) { ba.add(s+"{","}"); }
- }
-
- /** <p>Convert font declarations to LaTeX.</p>
- * <p>It returns a generic LaTeX font family (rm, tt, sf).</p>
- * <p>It returns null if the font declaration doesn't exist.</p>
- * @return <code>String</code> with a LaTeX generic fontfamily
- * @param <code>sName</code> the name of the font declaration
- */
- private String convertFontDeclaration(String sName) {
- FontDeclaration fd = wsc.getFontDeclaration(sName);
- if (fd==null) { return null; }
- if (!fontDecls.containsKey(sName)) {
- String sFontFamily = fd.getProperty(XMLString.FO_FONT_FAMILY);
- String sFontPitch = fd.getProperty(XMLString.STYLE_FONT_PITCH);
- String sFontFamilyGeneric = fd.getProperty(XMLString.STYLE_FONT_FAMILY_GENERIC);
- fontDecls.put(sName,nfssFamily(sFontFamily,sFontFamilyGeneric,sFontPitch));
- }
- return (String) fontDecls.get(sName);
- }
-
- // The remaining methods are static helpers to convert single style properties
-
- // Font change. These methods return the declaration form if the paramater
- // bDecl is true, and otherwise the command form
-
- private static final String nfssFamily(String sFontFamily, String sFontFamilyGeneric,
- String sFontPitch){
- // Note: Defaults to rm
- // TODO: What about decorative, script, system?
- if ("fixed".equals(sFontPitch)) return "tt";
- else if ("modern".equals(sFontFamilyGeneric)) return "tt";
- else if ("swiss".equals(sFontFamilyGeneric)) return "sf";
- else return "rm";
- }
-
- private static final String nfssSeries(String sFontWeight){
- if (sFontWeight==null) return null;
- if ("bold".equals(sFontWeight)) return "bf";
- else return "md";
- }
-
- private static final String nfssShape(String sFontVariant, String sFontStyle){
- if (sFontVariant==null && sFontStyle==null) return null;
- if ("small-caps".equals(sFontVariant)) return "sc";
- else if ("italic".equals(sFontStyle)) return "it";
- else if ("oblique".equals(sFontStyle)) return "sl";
- else return "up";
- }
-
- private static final String nfssSize(String sFontSize){
- if (sFontSize==null) return null;
- return "\\fontsize{"+sFontSize+"}{"+Misc.multiply("120%",sFontSize)+"}\\selectfont";
- }
-
- private static final String color(String sColor){
- if ("#000000".equalsIgnoreCase(sColor)) { return "{black}"; }
- else if ("#ff0000".equalsIgnoreCase(sColor)) { return "{red}"; }
- else if ("#00ff00".equalsIgnoreCase(sColor)) { return "{green}"; }
- else if ("#0000ff".equalsIgnoreCase(sColor)) { return "{blue}"; }
- else if ("#ffff00".equalsIgnoreCase(sColor)) { return "{yellow}"; }
- else if ("#ff00ff".equalsIgnoreCase(sColor)) { return "{magenta}"; }
- else if ("#00ffff".equalsIgnoreCase(sColor)) { return "{cyan}"; }
- //no white, since we don't have background colors:
- //else if ("#ffffff".equalsIgnoreCase(sColor)) { return "{white}"; }
- else {
- float sRed, sGreen, sBlue;
- if (sColor==null || sColor.length()!=7) return null;
- sRed=(float)Misc.getIntegerFromHex(sColor.substring(1,3),0)/255;
- sGreen=(float)Misc.getIntegerFromHex(sColor.substring(3,5),0)/255;
- sBlue=(float)Misc.getIntegerFromHex(sColor.substring(5,7),0)/255;
- // avoid very bright colors (since we don't have background colors):
- if (sRed+sGreen+sBlue>2.7) { return "{black}"; }
- else { return "[rgb]{"+sRed+","+sGreen+","+sBlue+"}"; }
- }
- }
-
- // other character formatting
-
- private final String textPosition(String sTextPosition){
- if (sTextPosition==null) return null;
- if (sTextPosition.startsWith("super")) return "\\textsuperscript";
- if (sTextPosition.startsWith("sub") || sTextPosition.startsWith("-")) {
- bNeedSubscript = true;
- return "\\textsubscript";
- }
- if (sTextPosition.startsWith("0%")) return null;
- return "\\textsuperscript";
- }
-
- private static final String underline(String sUnderline) {
- if (sUnderline==null) { return null; }
- if (sUnderline.equals("none")) { return null; }
- if (sUnderline.indexOf("wave")>=0) { return "\\uwave"; }
- return "\\uline";
- }
-
- private static final String crossout(String sCrossout) {
- if (sCrossout==null) { return null; }
- if (sCrossout.equals("X")) { return "\\xout"; }
- if (sCrossout.equals("slash")) { return "\\xout"; }
- return "\\sout";
- }
-
- private static final String changeCase(String sTextTransform){
- if ("lowercase".equals(sTextTransform)) return "\\MakeLowercase";
- if ("uppercase".equals(sTextTransform)) return "\\MakeUppercase";
- return null;
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/I18n.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/I18n.java
deleted file mode 100644
index 041c5ddaca72..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/I18n.java
+++ /dev/null
@@ -1,1100 +0,0 @@
-/************************************************************************
- *
- * I18n.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2005 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3j (2005-03-06)
- *
- */
-
-package writer2latex.latex.style;
-
-/* These classes takes care of i18n in Writer2LaTeX.
- In LaTeX, i18n is a mixture of inputencodings, fontencodings and babel languages.
- I18n thus manages these, and in particular implements a Unicode->LaTeX
- translation that can handle different inputencodings and fontencodings.
- The translation is table driven, using symbols.xml (embedded in the jar)
- Various sections of symbols.xml handles different cases:
- * common symbols in various font encodings such as T1, T2A, LGR etc.
- * input encodings such as ISO-8859-1 (latin-1), ISO-8859-7 (latin/greek) etc.
- * additional symbol fonts such as wasysym, dingbats etc.
- * font-specific symbols, eg. for 8-bit fonts/private use area
-
- TODO: Move UnicodeCharacter, UnicodeRow, UnicodeTable and UnicodeTableHandler
- as well as UnicodeStringParser to separate files!!
- (could be in a new package writer2latex.latex.unicode)
-*/
-
-import java.io.*;
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-import java.util.Enumeration;
-import org.xml.sax.*;
-import org.xml.sax.helpers.*;
-import javax.xml.parsers.*;
-
-import writer2latex.util.CSVList;
-import writer2latex.util.Config;
-import writer2latex.office.*;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterPalette;
-
-// Helper class: Parse a unicode string.
-// Note: Some 8-bit fonts have additional "spacer" characters that are used
-// for manual placement of accents. These are ignored between the base character
-// and the combining character, thus we are parsing according to the rule
-// <base char> <spacer char>* <combining char>?
-class UnicodeStringParser {
- private UnicodeTable table; // the table to use
- private String s; // the string
- private int i; // the current index
- private char c; // the current character
- private char cc; // the current combining character
-
- protected void reset(UnicodeTable table, String s) {
- this.table=table;
- this.s=s;
- i=0;
- }
-
- protected boolean next() {
- if (i>=s.length()) { return false; }
- // Pick up base character
- c = s.charAt(i++);
- if (table.getCharType(c)==UnicodeCharacter.COMBINING) {
- // Lonely combining character - combine with space
- cc = c;
- c = ' ';
- return true;
- }
-
- // Skip characters that should be ignored
- while (i<s.length() && table.getCharType(s.charAt(i))==UnicodeCharacter.IGNORE) { i++; }
- // Pick up combining character, if any
- if (i<s.length() && table.getCharType(s.charAt(i))==UnicodeCharacter.COMBINING) {
- cc = s.charAt(i++);
- }
- else {
- cc = '\u0000';
- }
-
- // Fix french spacing
- if (c=='\u00A0') { // non-breaking space
- if (i>1) {
- // replace with space if we are right after an opening guillemet
- if (s.charAt(i-2)=='\u00AB') { c=' '; }
- }
- if (i<s.length()) {
- // replace with space if we are right before a closing guillemet,
- // an em-dash or !, ?, : or ;
- char cr = s.charAt(i);
- if (cr=='\u00BB' || cr=='\u2014' || cr=='!' || cr=='?' || cr==':' || cr==';') {
- c=' ';
- }
- }
- }
-
- return true;
- }
-
- protected char getChar() { return c; }
-
- protected boolean hasCombiningChar() { return cc!='\u0000'; }
-
- protected char getCombiningChar() { return cc; }
-
-}
-
-// Helper class: A struct to hold the LaTeX representations of a unicode character
-class UnicodeCharacter implements Cloneable {
- final static int NORMAL = 0; // this is a normal character
- final static int COMBINING = 1; // this character should be ignored
- final static int IGNORE = 2; // this is a combining character
- final static int UNKNOWN = 3; // this character is unknown
-
- int nType; // The type of character
- String sMath; // LaTeX representation in math mode
- String sText; // LaTeX representation in text mode
- int nFontencs; // Valid font encoding(s) for the text mode representation
-
- protected Object clone() {
- UnicodeCharacter uc = new UnicodeCharacter();
- uc.nType = this.nType;
- uc.sMath = this.sMath;
- uc.sText = this.sText;
- uc.nFontencs = this.nFontencs;
- return uc;
- }
-}
-
-// Helper class: A row of 256 unicode characters
-class UnicodeRow implements Cloneable {
- UnicodeCharacter[] entries;
- UnicodeRow(){ entries=new UnicodeCharacter[256]; }
-
- protected Object clone() {
- UnicodeRow ur = new UnicodeRow();
- for (int i=0; i<256; i++) {
- if (this.entries[i]!=null) {
- ur.entries[i] = (UnicodeCharacter) this.entries[i].clone();
- }
- }
- return ur;
- }
-}
-
-// Helper class: Table of up to 65536 unicode characters
-class UnicodeTable {
- protected UnicodeRow[] table=new UnicodeRow[256];
- private UnicodeTable parent;
-
- // Constructor; creates a new table, possibly based on a parent
- // Note: The parent must be fully loaded before the child is created.
- public UnicodeTable(UnicodeTable parent){
- this.parent = parent;
- if (parent!=null) {
- // *Copy* the rows from the parent
- for (int i=0; i<256; i++) {
- table[i] = parent.table[i];
- }
- }
- }
-
- // Make sure the required entry exists
- private void createEntry(int nRow, int nCol) {
- if (table[nRow]==null) {
- table[nRow]=new UnicodeRow();
- }
- else if (parent!=null && table[nRow]==parent.table[nRow]) {
- // Before changing a row it must be *cloned*
- table[nRow] = (UnicodeRow) parent.table[nRow].clone();
- }
- if (table[nRow].entries[nCol]==null) {
- table[nRow].entries[nCol]=new UnicodeCharacter();
- }
- }
-
- // Addd a single character (type only), by number
- protected void addCharType(char c, int nType) {
- int nRow=c/256; int nCol=c%256;
- createEntry(nRow,nCol);
- table[nRow].entries[nCol].nType = nType;
- }
-
- // Addd a single character (type only), by name
- protected void addCharType(char c, String sType) {
- int nRow=c/256; int nCol=c%256;
- createEntry(nRow,nCol);
- if ("combining".equals(sType)) {
- table[nRow].entries[nCol].nType = UnicodeCharacter.COMBINING;
- }
- else if ("ignore".equals(sType)) {
- table[nRow].entries[nCol].nType = UnicodeCharacter.IGNORE;
- }
- else {
- table[nRow].entries[nCol].nType = UnicodeCharacter.NORMAL;
- }
- }
-
- // Add a single math character to the table
- protected void addMathChar(char c, String sLaTeX){
- int nRow=c/256; int nCol=c%256;
- createEntry(nRow,nCol);
- table[nRow].entries[nCol].sMath=sLaTeX;
- }
-
- // Add a single text character to the table
- protected void addTextChar(char c, String sLaTeX, int nFontencs){
- int nRow=c/256; int nCol=c%256;
- createEntry(nRow,nCol);
- table[nRow].entries[nCol].sText=sLaTeX;
- table[nRow].entries[nCol].nFontencs=nFontencs;
- }
-
- // Retrieve entry for a character (or null)
- private UnicodeCharacter getEntry(char c) {
- int nRow=c/256; int nCol=c%256;
- if (table[nRow]==null) return null;
- return table[nRow].entries[nCol];
- }
-
- // Get character type
- public int getCharType(char c) {
- UnicodeCharacter entry = getEntry(c);
- if (entry==null) return UnicodeCharacter.UNKNOWN;
- return entry.nType;
- }
-
- // Check to see if this math character exists?
- public boolean hasMathChar(char c) {
- UnicodeCharacter entry = getEntry(c);
- if (entry==null) return false;
- return entry.sMath!=null;
- }
-
- // Get math character (or null)
- public String getMathChar(char c) {
- UnicodeCharacter entry = getEntry(c);
- if (entry==null) return null;
- return entry.sMath;
- }
-
- // Check to see if this text character exists?
- public boolean hasTextChar(char c) {
- UnicodeCharacter entry = getEntry(c);
- if (entry==null) return false;
- return entry.sText!=null;
- }
-
- // Get text character (or null)
- public String getTextChar(char c) {
- UnicodeCharacter entry = getEntry(c);
- if (entry==null) return null;
- return entry.sText;
- }
-
- // Get font encoding(s) for text character (or null)
- public int getFontencs(char c) {
- UnicodeCharacter entry = getEntry(c);
- if (entry==null) return 0;
- return entry.nFontencs;
- }
-
- // Get number of defined characters
- public int getCharCount() {
- int nCount = 0;
- for (int nRow=0; nRow<256; nRow++) {
- if (table[nRow]!=null) {
- for (int nCol=0; nCol<256; nCol++) {
- UnicodeCharacter entry = table[nRow].entries[nCol];
- if (entry!=null) nCount++;
- }
- }
- }
- return nCount;
- }
-
-}
-
-// Helper classs: SAX handler to parse symbols.xml from jar
-class UnicodeTableHandler extends DefaultHandler{
- private Hashtable tableSet; // collection of all tables
- private UnicodeTable table; // the current table
- private String sSymbolSets;
- private boolean bGlobalReadThisSet;
- private boolean bReadThisSet;
- private int nGlobalFontencs = 0; // The global fontencodings for current symbol set
- private int nFontencs = 0; // The currently active fontencodings
- private boolean b8bit = false;
-
- UnicodeTableHandler(Hashtable tableSet, String sSymbolSets){
- this.sSymbolSets = sSymbolSets;
- this.tableSet = tableSet;
- }
-
- public void startElement(String nameSpace, String localName, String qName, Attributes attributes){
- if (qName.equals("symbols")) {
- //root element - create root table!
- table = new UnicodeTable(null);
- tableSet.put("root",table);
- }
- else if (qName.equals("symbol-set")) {
- // start a new symbol set; maybe we want to include it?
- bGlobalReadThisSet = sSymbolSets.indexOf(attributes.getValue("name")) >= 0;
- bReadThisSet = bGlobalReadThisSet;
- // Change global and current fontencodings
- nGlobalFontencs = I18n.readFontencs(attributes.getValue("fontenc"));
- nFontencs = nGlobalFontencs;
- }
- else if (qName.equals("special-symbol-set")) {
- // start a new special symbol set; this requires a new table
- table = new UnicodeTable((UnicodeTable) tableSet.get("root"));
- tableSet.put(attributes.getValue("name"),table);
-
- // Read it if it requires nothing, or something we read
- bGlobalReadThisSet = attributes.getValue("requires")==null ||
- sSymbolSets.indexOf(attributes.getValue("requires")) >= 0;
- bReadThisSet = bGlobalReadThisSet;
- b8bit = "true".equals(attributes.getValue("eight-bit"));
- // Change global and current fontencodings
- nGlobalFontencs = I18n.readFontencs(attributes.getValue("fontenc"));
- nFontencs = nGlobalFontencs;
- }
- else if (qName.equals("symbol-subset")) {
- // Do we requires something here?
- if (attributes.getValue("requires")!=null) {
- bReadThisSet = sSymbolSets.indexOf(attributes.getValue("requires")) >= 0;
- }
- // Change current fontencodings
- nFontencs = I18n.readFontencs(attributes.getValue("fontenc"));
- }
- else if (qName.equals("symbol")) {
- if (bReadThisSet) {
- char c=(char)Integer.parseInt(attributes.getValue("char"),16);
- String sEqChar=attributes.getValue("eq-char");
- if (sEqChar!=null) { // copy existing definitions, if any
- char eqc = (char)Integer.parseInt(sEqChar,16);
- if (table.getCharType(eqc)!=UnicodeCharacter.UNKNOWN) {
- table.addCharType(c,table.getCharType(eqc));
- }
- if (table.hasMathChar(eqc)) {
- table.addMathChar(c,table.getMathChar(eqc));
- }
- if (table.hasTextChar(eqc)) {
- table.addTextChar(c,table.getTextChar(eqc),table.getFontencs(eqc));
- }
- }
- else {
- String sType=attributes.getValue("char-type");
- String sMath=attributes.getValue("math");
- String sText=attributes.getValue("text");
- if (sType!=null) table.addCharType(c,sType);
- if (sMath!=null) table.addMathChar(c,sMath);
- if (sText!=null) table.addTextChar(c,sText,nFontencs);
- }
- }
- }
- else if (qName.equals("preserve-symbol")) {
- if (bReadThisSet) {
- String sMode=attributes.getValue("mode");
- char c=(char)Integer.parseInt(attributes.getValue("char"),16);
- table.addCharType(c,attributes.getValue("char-type"));
- if ("math".equals(sMode) || "both".equals(sMode)) {
- table.addMathChar(c,Character.toString(c));
- }
- if ("text".equals(sMode) || "both".equals(sMode)) {
- table.addTextChar(c,Character.toString(c),nFontencs);
- }
- }
- }
- else if (qName.equals("preserve-symbols")) {
- if (bReadThisSet) {
- String sMode=attributes.getValue("mode");
- String sType=attributes.getValue("char-type");
- char c1=(char)Integer.parseInt(attributes.getValue("first-char"),16);
- char c2=(char)Integer.parseInt(attributes.getValue("last-char"),16);
- boolean bMath = "math".equals(sMode) || "both".equals(sMode);
- boolean bText = "text".equals(sMode) || "both".equals(sMode);
- for (char c=c1; c<=c2; c++) {
- table.addCharType(c,sType);
- if (bMath) {
- table.addMathChar(c,Character.toString(c));
- }
- if (bText) {
- table.addTextChar(c,Character.toString(c),nFontencs);
- }
- }
- }
- }
- }
-
- public void endElement(String nameSpace, String localName, String qName){
- if (qName.equals("symbol-subset")) {
- // Revert to global setting of reading status
- bReadThisSet = bGlobalReadThisSet;
- // Revert to global fontencoding
- nFontencs = nGlobalFontencs;
- }
- else if (qName.equals("special-symbol-set")) {
- if (b8bit) {
- // Row 0 = Row 240 (F0)
- // Note: 8-bit fonts are supposed to be relocated to F000..F0FF
- // This may fail on import from msword, hence this hack
- table.table[0] = table.table[240];
- }
- b8bit = false;
- }
- }
-
-}
-
-// Finally the actual conversion class!
-public class I18n {
- // **** Inputencodings ****
- public static final int ASCII = 0;
- public static final int LATIN1 = 1; // ISO Latin 1 (ISO-8859-1)
- public static final int LATIN2 = 2; // ISO Latin 1 (ISO-8859-1)
- public static final int ISO_8859_7 = 3; // ISO latin/greek
- public static final int CP1250 = 4; // Microsoft Windows Eastern European
- public static final int CP1251 = 5; // Microsoft Windows Cyrillic
- public static final int KOI8_R = 6; // Latin/russian
- public static final int UTF8 = 7; // UTF-8
-
- // Read an inputencoding from a string
- public static final int readInputenc(String sInputenc) {
- if ("ascii".equals(sInputenc)) return ASCII;
- else if ("latin1".equals(sInputenc)) return LATIN1;
- else if ("latin2".equals(sInputenc)) return LATIN2;
- else if ("iso-8859-7".equals(sInputenc)) return ISO_8859_7;
- else if ("cp1250".equals(sInputenc)) return CP1250;
- else if ("cp1251".equals(sInputenc)) return CP1251;
- else if ("koi8-r".equals(sInputenc)) return KOI8_R;
- else if ("utf8".equals(sInputenc)) return UTF8;
- else return ASCII; // unknown = ascii
- }
-
- // Return the LaTeX name of an inputencoding
- public static final String writeInputenc(int nInputenc) {
- switch (nInputenc) {
- case ASCII : return "ascii";
- case LATIN1 : return "latin1";
- case LATIN2 : return "latin2";
- case ISO_8859_7 : return "iso-8859-7";
- case CP1250 : return "cp1250";
- case CP1251 : return "cp1251";
- case KOI8_R : return "koi8-r";
- case UTF8 : return "utf8";
- default : return "???";
- }
- }
-
- // Return the java i18n name of an inputencoding
- public static final String writeJavaEncoding(int nInputenc) {
- switch (nInputenc) {
- case ASCII : return "ASCII";
- case LATIN1 : return "ISO8859_1";
- case LATIN2 : return "ISO8859_2";
- case ISO_8859_7 : return "ISO8859_7";
- case CP1250 : return "Cp1250";
- case CP1251 : return "Cp1251";
- case KOI8_R : return "KOI8_R";
- case UTF8 : return "UTF-8";
- default : return "???";
- }
- }
-
- // **** Fontencodings ****
- public static final int OT1_ENC = 1;
- public static final int T1_ENC = 2;
- public static final int T2A_ENC = 4;
- public static final int T3_ENC = 8;
- public static final int LGR_ENC = 16;
- public static final int ANY_ENC = 31;
-
- // read set of font encodings from a string
- public static final int readFontencs(String sFontencs) {
- sFontencs = sFontencs.toUpperCase();
- if ("ANY".equals(sFontencs)) return ANY_ENC;
- int nFontencs = 0;
- int nOT1 = sFontencs.indexOf("OT1");
- int nT1 = sFontencs.indexOf("T1");
- int nT2A = sFontencs.indexOf("T2A");
- int nT3 = sFontencs.indexOf("T3");
- int nLGR = sFontencs.indexOf("LGR");
- if (nOT1>=0) nFontencs+=OT1_ENC;
- if (nT1==0 || (nT1>0 && nT1!=nOT1+1)) nFontencs+=T1_ENC;
- if (nT2A>=0) nFontencs+=T2A_ENC;
- if (nT3>=0) nFontencs+=T3_ENC;
- if (nLGR>=0) nFontencs+=LGR_ENC;
- return nFontencs;
- }
-
- // return string representation of a single font encoding
- public static final String writeFontenc(int nFontenc) {
- switch (nFontenc) {
- case OT1_ENC: return "OT1";
- case T1_ENC: return "T1";
- case T2A_ENC: return "T2A";
- case T3_ENC: return "T3";
- case LGR_ENC: return "LGR";
- }
- return null;
- }
-
- // check that a given set of font encodings contains a specific font encoding
- public static final boolean supportsFontenc(int nFontencs, int nFontenc) {
- return (nFontencs & nFontenc) != 0;
- }
-
- // get one fontencoding from a set of fontencodings
- public static final int getFontenc(int nFontencs) {
- if (supportsFontenc(nFontencs,T1_ENC)) return T1_ENC;
- if (supportsFontenc(nFontencs,T2A_ENC)) return T2A_ENC;
- if (supportsFontenc(nFontencs,T3_ENC)) return T3_ENC;
- if (supportsFontenc(nFontencs,LGR_ENC)) return LGR_ENC;
- return 0;
- }
-
- // get the font encoding for a specific iso language
- public static final int getFontenc(String sLang) {
- // Greek uses "local greek" encoding
- if ("el".equals(sLang)) return LGR_ENC;
- // Russian, ukrainian, bulgarian and serbian uses T2A encoding
- else if ("ru".equals(sLang)) return T2A_ENC;
- else if ("uk".equals(sLang)) return T2A_ENC;
- else if ("bg".equals(sLang)) return T2A_ENC;
- else if ("sr".equals(sLang)) return T2A_ENC;
- // Other languages uses T1 encoding
- else return T1_ENC;
- }
-
- // return cs for a fontencoding
- public static final String getFontencCs(int nFontenc) {
- switch (nFontenc) {
- case T1_ENC: return "\\textlatin"; // requires babel
- case T2A_ENC: return "\\textcyrillic"; // requires babel with russian, bulgarian or ukrainian option
- case T3_ENC: return "\\textipa"; // requires tipa.sty
- case LGR_ENC: return "\\textgreek"; // requires babel with greek option
- default: return null;
- }
- }
-
- // **** Languages ****
-
- // Convert iso language to babel language
- // todo: include iso country
- // todo: support automatic choice of inputenc (see comments)
- public static final String getBabelLanguage(String sLanguage) {
- if ("en".equals(sLanguage)) return "english"; // latin1
- else if ("bg".equals(sLanguage)) return "bulgarian"; // cp1251?
- else if ("cs".equals(sLanguage)) return "czech"; // latin2
- else if ("da".equals(sLanguage)) return "danish"; // latin1
- else if ("de".equals(sLanguage)) return "ngerman"; // latin1
- else if ("el".equals(sLanguage)) return "greek"; // iso-8859-7
- else if ("es".equals(sLanguage)) return "spanish"; // latin1
- else if ("fi".equals(sLanguage)) return "finnish"; // latin1 (latin9?)
- else if ("fr".equals(sLanguage)) return "french"; // latin1 (latin9?)
- else if ("ga".equals(sLanguage)) return "irish" ; // latin1
- else if ("hr".equals(sLanguage)) return "croatian"; // latin2
- else if ("hu".equals(sLanguage)) return "magyar"; // latin2
- else if ("is".equals(sLanguage)) return "icelandic"; // latin1
- else if ("it".equals(sLanguage)) return "italian"; // latin1
- else if ("nl".equals(sLanguage)) return "dutch"; // latin1
- else if ("no".equals(sLanguage)) return "norsk"; // latin1
- else if ("pl".equals(sLanguage)) return "polish"; // latin2
- else if ("pt".equals(sLanguage)) return "portuges"; // latin1
- else if ("ro".equals(sLanguage)) return "romanian"; // latin2
- else if ("ru".equals(sLanguage)) return "russian"; // cp1251?
- else if ("sk".equals(sLanguage)) return "slovak"; // latin2
- else if ("sl".equals(sLanguage)) return "slovene"; // latin2
- else if ("sr".equals(sLanguage)) return "serbian"; // cp1251?
- else if ("sv".equals(sLanguage)) return "swedish"; // latin1
- else if ("uk".equals(sLanguage)) return "ukrainian"; // cp1251?
- else return null; // unknown or unsupported language
- }
-
- // End of static part of I18n!
-
- // Global variables:
- private Hashtable tableSet; // all tables
- private UnicodeTable table; // currently active table (top of stack)
- private Stack tableStack; // stack of active tables
- private UnicodeStringParser ucparser; // Unicode string parser
- private String sDefaultLang = null; // Default language to use
- private int nDefaultFontenc = 0; // Fontenc for the default language
- private boolean bAlwaysUseDefaultLang = false; // Ignore sLang parameter to convert()
- private boolean bT2A = false; // do we use cyrillic letters?
- private boolean bGreek = false; // do we use greek letters?
- private boolean bPolytonicGreek = false; // do we use polytonic greek letters?
- private boolean bGreekMath;
- private String sMajorityLanguage = null; // cache result from method
- private Config config;
- private WriterStyleCollection wsc;
-
- // Constructor; loads symbol table based on the configuration
- public I18n(WriterStyleCollection wsc, Config config, ConverterPalette palette) {
- this.wsc = wsc;
- this.config = config;
- String sSymbols="ascii"; // always load common symbols
- if (config.getInputencoding()!=ASCII) {
- sSymbols+="|"+writeInputenc(config.getInputencoding());
- }
-
- if (config.useWasysym()) sSymbols+="|wasysym";
- if (config.useBbding()) sSymbols+="|bbding";
- if (config.useIfsym()) sSymbols+="|ifsym";
- if (config.usePifont()) sSymbols+="|dingbats";
- if (config.useEurosym()) sSymbols+="|eurosym";
- if (config.useTipa()) sSymbols+="tipa";
-
- readSymbols(sSymbols);
-
- bGreekMath = config.greekMath();
-
- bAlwaysUseDefaultLang = !config.multilingual();
-
-
- ucparser = new UnicodeStringParser();
- }
-
- // Constructor; loads specific symbols
- public I18n(String sSymbols) {
- readSymbols(sSymbols);
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- // inputenc TODO: Remove dirty, autogenerated
- if (config.getInputencoding()==I18n.UTF8){
- pack.append("\\usepackage[dirty,autogenerated]{ucs}").nl();
- }
- pack.append("\\usepackage[")
- .append(writeInputenc(config.getInputencoding()))
- .append("]{inputenc}").nl();
-
- // fontenc
- CSVList fontencs = new CSVList(',');
- if (bT2A) { fontencs.addValue("T2A"); }
- if (bGreek) { fontencs.addValue("LGR"); }
- if (config.useTipa()) { fontencs.addValue("T3"); }
- fontencs.addValue("T1");
- pack.append("\\usepackage[").append(fontencs.toString())
- .append("]{fontenc}").nl();
-
- // babel
- convertLanguageUsage(pack);
-
- if (config.useTipa()) {
- pack.append("\\usepackage[noenc]{tipa}").nl()
- .append("\\usepackage{tipx}").nl();
- }
-
- // Bbding: (Has to avoid some nameclashes.)
- if (config.useBbding()) {
- pack.append("\\usepackage{bbding}").nl()
- .append("\\let\\bbCross\\Cross\\let\\Cross\\undefined").nl()
- .append("\\let\\bbSquare\\Square\\let\\Square\\undefined").nl()
- .append("\\let\\bbTrianbleUp\\TriangleUp\\let\\TriangleUp\\undefined").nl()
- .append("\\let\\bbTrianlgeDown\\TriangleDown\\let\\TriangleDown\\undefined").nl();
- }
-
- if (config.useIfsym()) { pack.append("\\usepackage[geometry,weather,misc,clock]{ifsym}").nl(); }
-
- if (config.usePifont()) { pack.append("\\usepackage{pifont}").nl(); }
-
- if (config.useEurosym()) { pack.append("\\usepackage{eurosym}").nl(); }
-
- // wasysym must be loaded between amsmath and amsfonts!
- if (config.useWasysym()) {
- pack.append("\\usepackage{amsmath,wasysym,amssymb,amsfonts,textcomp}").nl();
- }
- else {
- pack.append("\\usepackage{amsmath,amssymb,amsfonts,textcomp}").nl();
- }
-
- // \textcyrillic command - deleted as babel defines it!
- //if (bT2A) {
- // pack.append("\\DeclareRobustCommand{\\textcyrillic}[1]{{\\fontencoding{T2A}\\selectfont\\def\\encodingdefault{T2A}#1}}").nl();
- //}
- }
-
- public void setDefaultLanguage(String sDefaultLang) {
- this.sDefaultLang = sDefaultLang;
- nDefaultFontenc = getFontenc(sDefaultLang);
- }
-
- /** <p>Apply language.</p>
- * @param <code>style</code> the OOo style to read attributesfrom
- * @param <code>bDecl</code> true if declaration form is required
- * @param <code>bInherit</code> true if inherited properties should be used
- * @param <code>ba</code> the <code>BeforeAfter</code> to add LaTeX code to.
- */
- public void applyLanguage(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba) {
- if (bAlwaysUseDefaultLang) { return; }
- if (style==null) { return; }
- String sLang = getBabelLanguage(style.getProperty(XMLString.FO_LANGUAGE,bInherit));
- if (sLang==null) { return; }
- if (bDecl) {
- ba.add("\\selectlanguage{"+sLang+"}","");
- //ba.add("\\begin{otherlanguage}{"+sLang+"}","\\end{otherlanguage}");
- }
- else {
- ba.add("\\foreignlanguage{"+sLang+"}{","}");
- }
- }
-
- // Return the iso language used in most paragaph styles (in a well-structured
- // document this will be the default language)
- // TODO: Base on content rather than style (move to converter!)
- public String getMajorityLanguage() {
- Hashtable langs = new Hashtable();
-
- // Read the default language from the default paragraph style
- String sDefaultLang = null;
- StyleWithProperties style = wsc.getDefaultParStyle();
- if (style!=null) {
- sDefaultLang = style.getProperty(XMLString.FO_LANGUAGE);
- }
-
- // Collect languages from paragraph styles
- Enumeration enumeration = wsc.getParStyles().getStylesEnumeration();
- while (enumeration.hasMoreElements()) {
- style = (StyleWithProperties) enumeration.nextElement();
- String sLang = style.getProperty(XMLString.FO_LANGUAGE);
- if (sLang==null) { sLang = sDefaultLang; }
- if (sLang!=null) {
- int nCount = 1;
- if (langs.containsKey(sLang)) {
- nCount = ((Integer) langs.get(sLang)).intValue()+1;
- }
- langs.put(sLang,new Integer(nCount));
- }
- }
-
- // Find the most common language
- int nMaxCount = 0;
- String sMajorityLanguage = null;
- enumeration = langs.keys();
- while (enumeration.hasMoreElements()) {
- String sLang = (String) enumeration.nextElement();
- int nCount = ((Integer) langs.get(sLang)).intValue();
- if (nCount>nMaxCount) {
- nMaxCount = nCount;
- sMajorityLanguage = sLang;
- }
- }
- this.sMajorityLanguage = sMajorityLanguage;
- return sMajorityLanguage;
- }
-
- private void convertLanguageUsage(LaTeXDocumentPortion ldp) {
- Vector languages = new Vector();
- String sDefaultLanguage = null;
- if (config.multilingual()) {
- // Collect languages from text styles
- Enumeration enumeration = wsc.getTextStyles().getStylesEnumeration();
- while (enumeration.hasMoreElements()) {
- StyleWithProperties style = (StyleWithProperties) enumeration.nextElement();
- String sLang = I18n.getBabelLanguage(style.getProperty(XMLString.FO_LANGUAGE));
- if (sLang!=null && !languages.contains(sLang)) { languages.add(sLang); }
- }
- // Collect languages from paragraph styles
- enumeration = wsc.getParStyles().getStylesEnumeration();
- while (enumeration.hasMoreElements()) {
- StyleWithProperties style = (StyleWithProperties) enumeration.nextElement();
- String sLang = I18n.getBabelLanguage(style.getProperty(XMLString.FO_LANGUAGE));
- if (sLang!=null && !languages.contains(sLang)) { languages.add(sLang); }
- }
- // Read the default language from the default paragraph style
- StyleWithProperties style = wsc.getDefaultParStyle();
- if (style!=null) {
- sDefaultLanguage = I18n.getBabelLanguage(style.getProperty(XMLString.FO_LANGUAGE));
- }
- }
- else { // the most common language is the only language
- sDefaultLanguage = I18n.getBabelLanguage(sMajorityLanguage==null ?
- getMajorityLanguage() : sMajorityLanguage);
- }
- // If the document contains "anonymous" greek letters we need greek in any case:
- if (this.greek() && !languages.contains("greek")) languages.add("greek");
- // If the document contains "anonymous cyrillic letters we need one of the
- // languages russian, ukrainian or bulgarian
- if (this.cyrillic() && !(languages.contains("ukrainian") ||
- languages.contains("ukrainian") || languages.contains("ukrainian"))) {
- languages.add("russian");
- }
- // Load babel with the used languages
- CSVList babelopt = new CSVList(",");
- Enumeration langenum = languages.elements();
- while (langenum.hasMoreElements()) {
- String sLang = (String) langenum.nextElement();
- if (!sLang.equals(sDefaultLanguage)) {
- if ("greek".equals(sLang) && this.polytonicGreek()) {
- sLang = "polutonikogreek";
- }
- babelopt.addValue(sLang);
- }
- }
- // The default language must be the last one
- if (sDefaultLanguage!=null) {
- if ("greek".equals(sDefaultLanguage) && this.polytonicGreek()) {
- babelopt.addValue("polutonikogreek");
- }
- else {
- babelopt.addValue(sDefaultLanguage);
- }
- }
- if (!babelopt.isEmpty()) {
- ldp.append("\\usepackage[")
- .append(babelopt.toString())
- .append("]{babel}").nl();
- }
- }
-
- // The parameter sSymbolsets should contain a sequence of all symbols sets to
- // include eg. "ascii|latin1|dingbats" to include the default symbols,
- // use latin1 inputencoding and support dingbats (pifont.sty).
- private void readSymbols(String sSymbols) {
- tableSet = new Hashtable();
- UnicodeTableHandler handler=new UnicodeTableHandler(tableSet, sSymbols);
- SAXParserFactory factory=SAXParserFactory.newInstance();
- InputStream is = this.getClass().getResourceAsStream("symbols.xml");
- try {
- SAXParser saxParser=factory.newSAXParser();
- saxParser.parse(is,handler);
- }
- catch (Throwable t){
- System.out.println("Oops - Unable to read symbols.xml");
- t.printStackTrace();
- }
- // put root table at top of stack
- tableStack = new Stack();
- tableStack.push((UnicodeTable) tableSet.get("root"));
- table = (UnicodeTable) tableSet.get("root");
- }
-
- // Did we use cyrillic?
- public boolean cyrillic() { return bT2A; }
-
- // Did we use greek?
- public boolean greek() { return bGreek; }
-
- // Did we use polytonic greek?
- public boolean polytonicGreek() { return bPolytonicGreek; }
-
- // Outside greek text, greek letters may be rendered in math mode,
- // if the user requires that in the configuration.
- private boolean greekMath(char c, int nFontenc) {
- return bGreekMath && nFontenc!=LGR_ENC && table.getFontencs(c)==LGR_ENC;
- }
-
- // Set cyrillic and greek flags
- private void setFlags(char c, int nFontenc) {
- if ((c>='\u1F00') && (c<='\u1FFF')) bPolytonicGreek = true;
- if (nFontenc==LGR_ENC) bGreek = true;
- if (nFontenc==T2A_ENC) bT2A = true;
- }
-
- // Missing symbol
- private String notFound(char c,int nFontenc) {
- //String sErrorMsg = "[Warning: Missing symbol " + Integer.toHexString(c).toUpperCase() +"]";
- String sErrorMsg = "["+Integer.toHexString(c).toUpperCase() +"?]";
- if (nFontenc==T1_ENC) return sErrorMsg;
- else return "\\textlatin{"+sErrorMsg+"}";
- }
-
- // convert a single math character
- private String convertMathChar(char c, int nFontenc) {
- if (table.hasMathChar(c)) {
- return table.getMathChar(c);
- }
- else if (table.hasTextChar(c)) { // use text mode as a fallback
- int nFontencs = table.getFontencs(c);
- if (supportsFontenc(nFontencs,nFontenc)) {
- // The text character is valid in the current font encoding
- setFlags(c,nFontenc);
- if (table.getCharType(c)==UnicodeCharacter.COMBINING) {
- return "\\text{" + table.getTextChar(c) +"{}}";
- }
- else {
- return "\\text{" + table.getTextChar(c) +"}";
- }
- }
- else {
- // The text character is valid in another font encoding
- int nFontenc1 = getFontenc(nFontencs);
- setFlags(c,nFontenc1);
- if (table.getCharType(c)==UnicodeCharacter.COMBINING) {
- return "\\text{" + getFontencCs(nFontenc1) + "{" + table.getTextChar(c) +"{}}}";
- }
- else {
- return "\\text{" + getFontencCs(nFontenc1) + "{" + table.getTextChar(c) +"}}";
- }
- }
- }
- else {
- return "\\text{" + notFound(c,nFontenc) + "}";
- }
- }
-
- // Convert a single character
- public String convert(char c, boolean bMathMode, String sLang){
- int nFontenc = bAlwaysUseDefaultLang ? nDefaultFontenc : getFontenc(sLang);
- if (bMathMode) {
- return convertMathChar(c,nFontenc);
- }
- else if (greekMath(c,nFontenc) || (table.hasMathChar(c) && !table.hasTextChar(c))) {
- return "$" + convertMathChar(c,nFontenc) + "$";
- }
- else if (table.hasTextChar(c)) {
- int nFontencs = table.getFontencs(c);
- if (supportsFontenc(nFontencs,nFontenc)) {
- // The text character is valid in the current font encoding
- setFlags(c,nFontenc);
- if (table.getCharType(c)==UnicodeCharacter.COMBINING) {
- return table.getTextChar(c)+"{}";
- }
- else {
- return table.getTextChar(c);
- }
- }
- else {
- // The text character is valid in another font encoding
- int nFontenc1 = getFontenc(nFontencs);
- setFlags(c,nFontenc1);
- if (table.getCharType(c)==UnicodeCharacter.COMBINING) {
- return getFontencCs(nFontenc1) + "{" + table.getTextChar(c) +"{}}";
- }
- else {
- return getFontencCs(nFontenc1) + "{" + table.getTextChar(c) +"}";
- }
- }
- }
- else {
- return notFound(c,nFontenc);
- }
- }
-
- // Convert a string of characters
- public String convert(String s, boolean bMathMode, String sLang){
- int nFontenc = bAlwaysUseDefaultLang ? nDefaultFontenc : getFontenc(sLang);
- int nCurFontenc = nFontenc;
- ucparser.reset(table,s);
- StringBuffer buf=new StringBuffer();
- while (ucparser.next()) {
- char c = ucparser.getChar();
- if (bMathMode) {
- buf.append(convertMathChar(c,nFontenc));
- }
- else if (greekMath(c,nFontenc) || (table.hasMathChar(c) && !table.hasTextChar(c))) {
- buf.append("$").append(convertMathChar(c,nFontenc)).append("$");
- }
- else if (table.hasTextChar(c)) {
- int nFontencs = table.getFontencs(c);
- if (supportsFontenc(nFontencs,nCurFontenc)) {
- // The text character is valid in the current font encoding
- // Note: Change of font encoding is greedy - change?
- setFlags(c,nCurFontenc);
- if (ucparser.hasCombiningChar()) {
- char cc = ucparser.getCombiningChar();
- if (supportsFontenc(table.getFontencs(cc),nCurFontenc)) {
- buf.append(table.getTextChar(cc)).append("{")
- .append(table.getTextChar(c)).append("}");
- }
- else { // ignore combining char if not valid in this font encoding
- buf.append(table.getTextChar(c));
- }
- }
- else {
- buf.append(table.getTextChar(c));
- }
- }
- else {
- // The text character is valid in another font encoding
- int nFontenc1 = getFontenc(nFontencs);
- setFlags(c,nFontenc1);
- if (nCurFontenc!=nFontenc) { // end "other font encoding"
- buf.append("}");
- }
- if (nFontenc1!=nFontenc) { // start "other font encoding"
- buf.append(getFontencCs(nFontenc1)).append("{");
- }
-
- if (ucparser.hasCombiningChar()) {
- char cc = ucparser.getCombiningChar();
- if (supportsFontenc(table.getFontencs(cc),nCurFontenc)) {
- buf.append(table.getTextChar(cc)).append("{")
- .append(table.getTextChar(c)).append("}");
- }
- else { // ignore combining char if not valid in this font encoding
- buf.append(table.getTextChar(c));
- }
- }
- else {
- buf.append(table.getTextChar(c));
- }
- nCurFontenc = nFontenc1;
- }
- }
- else {
- buf.append(notFound(c,nCurFontenc));
- }
- }
-
- if (nCurFontenc!=nFontenc) { // end unfinished "other font encoding"
- buf.append("}");
- }
-
- return buf.toString();
- }
-
- public void pushSpecialTable(String sName) {
- // If no name is specified we should keep the current table
- // Otherwise try to find the table, and use root if it's not available
- if (sName!=null) {
- table = (UnicodeTable) tableSet.get(sName);
- if (table==null) { table = (UnicodeTable) tableSet.get("root"); }
- }
- tableStack.push(table);
- }
-
- public void popSpecialTable() {
- tableStack.pop();
- table = (UnicodeTable) tableStack.peek();
- }
-
- public int getCharCount() { return table.getCharCount(); }
-
-}
-
-/*
- // Test app. to print out converted symbols
- // TODO: Rewrite to use LaTeXDocument
- public static void main(String[] args){
- UnicodeTable table;
- try {
- table=new UnicodeTable();
- int nRow=Integer.parseInt(args[0]);
- FileOutputStream f=new FileOutputStream("symbols.tex");
- OutputStreamWriter osw=new OutputStreamWriter(f,"ISO-8859-1");
- osw.write("\\documentclass[landscape]{article}\n");
- osw.write("\\setlength{\\oddsidemargin}{-1cm}\n");
- osw.write("\\setlength{\\topmargin}{-1cm}\n");
- osw.write("\\setlength{\\textwidth}{27cm}\n");
- osw.write("\\setlength{\\textheight}{19cm}\n");
- osw.write("\\usepackage[latin1]{inputenc}\n");
- osw.write("\\usepackage[T1]{fontenc}\n");
- osw.write("\\usepackage{amsmath,amsfonts,amssymb,textcomp}\n");
- osw.write("\\usepackage[english]{babel}");
- osw.write("\\usepackage{writer}\n");
- osw.write("\\begin{document}\n");
- osw.write("\\begin{center}\n");
- osw.write("\\section*{Row number "+nRow+"}\n");
- osw.write("\\begin{tabular}{|*{16}{c|}}\n\\hline\n");
- for (int i=0; i<16; i++){
- for (int j=0; j<16; j++){
- osw.write("\\small "+Integer.toHexString(256*nRow+16*i+j).toUpperCase());
- if (j<15) osw.write(" & ");
- }
- osw.write("\\\\\n");
- for (int j=0; j<16; j++){
- char c=(char) (256*nRow+16*i+j);
- String st=table.convert(c,false);
- String sm=table.convert(c,true);
- if (st.startsWith("[Warning")) osw.write("?");
- else osw.write(st);
- osw.write(" ");
- if (sm.startsWith("[Warning")) osw.write("?");
- else osw.write("$"+sm+"$");
- if (j<15) osw.write(" & ");
- }
- osw.write("\\\\\\hline\n");
- }
- osw.write("\\end{tabular}\n");
- osw.write("\\end{center}\n");
- osw.write("\\end{document}\n");
- osw.close();
- f.close();
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- }
- */
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/ListStyleConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/ListStyleConverter.java
deleted file mode 100644
index fc19ca5773fa..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/ListStyleConverter.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/************************************************************************
- *
- * ListStyleConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2006 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.4b (2006-11-03)
- *
- */
-
-package writer2latex.latex.style;
-
-import java.util.Hashtable;
-
-import writer2latex.util.*;
-import writer2latex.office.*;
-import writer2latex.latex.Context;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterPalette;
-
-/* This class creates LaTeX code from OOo list styles
- */
-public class ListStyleConverter extends StyleConverter {
- boolean bNeedSaveEnumCounter = false;
- private Hashtable listStyleLevelNames = new Hashtable();
-
- /** <p>Constructs a new <code>ListStyleConverter</code>.</p>
- */
- public ListStyleConverter(WriterStyleCollection wsc, Config config,
- ConverterPalette palette) {
- super(wsc,config,palette);
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (config.formatting()>=Config.CONVERT_MOST || !styleNames.isEmpty()) {
- decl.append("% List styles").nl();
- // May need an extra counter to handle continued numbering in lists
- if (bNeedSaveEnumCounter) {
- decl.append("\\newcounter{saveenum}").nl();
- }
- // If we export formatting, we need some hooks from lists to paragraphs:
- if (config.formatting()>=Config.CONVERT_MOST) {
- decl.append("\\newcommand\\writerlistleftskip{}").nl()
- .append("\\newcommand\\writerlistparindent{}").nl()
- .append("\\newcommand\\writerlistlabel{}").nl()
- .append("\\newcommand\\writerlistremovelabel{")
- .append("\\aftergroup\\let\\aftergroup\\writerlistparindent\\aftergroup\\relax")
- .append("\\aftergroup\\let\\aftergroup\\writerlistlabel\\aftergroup\\relax}").nl();
- }
- super.appendDeclarations(pack,decl);
- }
- }
-
- /** <p>Apply a list style to an ordered or unordered list.</p> */
- public void applyListStyle(String sStyleName, int nLevel, boolean bOrdered,
- boolean bContinue, BeforeAfter ba) {
- // Step 1. We may have a style map, this always takes precedence
- if (config.getListStyleMap().contains(sStyleName)) {
- ba.add(config.getListStyleMap().getBefore(sStyleName),
- config.getListStyleMap().getAfter(sStyleName));
- return;
- }
- // Step 2: The list style may not exist, or the user wants to ignore it.
- // In this case we create default lists
- ListStyle style = wsc.getListStyle(sStyleName);
- if (style!=null) {
- // if possible, let the style choose between ordered and unordered list
- bOrdered = style.isNumber(nLevel);
- }
- if (style==null || config.formatting()<=Config.IGNORE_MOST) {
- if (nLevel<=4) {
- if (bOrdered) {
- ba.add("\\begin{enumerate}","\\end{enumerate}");
- }
- else {
- ba.add("\\begin{itemize}","\\end{itemize}");
- }
- }
- return;
- }
- // Step 3: Export as default lists, but redefine labels
- if (config.formatting()==Config.CONVERT_BASIC) {
- if (nLevel==1) {
- if (!styleNames.containsName(sStyleName)) {
- createListStyleLabels(sStyleName);
- }
- ba.add("\\liststyle"+styleNames.getExportName(sStyleName)+"\n","");
- }
- if (nLevel<=4) {
- String sCounterName = ((String[]) listStyleLevelNames.get(sStyleName))[nLevel];
- if (bContinue && style.isNumber(nLevel)) {
- bNeedSaveEnumCounter = true;
- ba.add("\\setcounter{saveenum}{\\value{"+sCounterName+"}}\n","");
- }
- if (bOrdered) {
- ba.add("\\begin{enumerate}","\\end{enumerate}");
- }
- else {
- ba.add("\\begin{itemize}","\\end{itemize}");
- }
- if (bContinue && style.isNumber(nLevel)) {
- ba.add("\n\\setcounter{"+sCounterName+"}{\\value{saveenum}}","");
- }
- }
- return;
- }
- // Step 4: Export with formatting, as "Writer style" custom lists
- if (nLevel<=4) { // TODO: Max level should not be fixed
- if (!styleNames.containsName(sStyleName)) {
- createListStyle(sStyleName);
- }
- String sTeXName="list"+styleNames.getExportName(sStyleName)
- +"level"+Misc.int2roman(nLevel);
- if (!bContinue && style.isNumber(nLevel)) {
- ba.add("\\setcounter{"+sTeXName+"}{0}\n","");
- }
- ba.add("\\begin{"+sTeXName+"}","\\end{"+sTeXName+"}");
- }
- }
-
- /** <p>Apply a list style to a list item.</p> */
- public void applyListItemStyle(String sStyleName, int nLevel, boolean bHeader,
- boolean bRestart, int nStartValue, BeforeAfter ba) {
- // Step 1. We may have a style map, this always takes precedence
- if (config.getListItemStyleMap().contains(sStyleName)) {
- ba.add(config.getListItemStyleMap().getBefore(sStyleName),
- config.getListItemStyleMap().getAfter(sStyleName));
- return;
- }
- // Step 2: The list style may not exist, or the user wants to ignore it.
- // In this case we create default lists
- ListStyle style = wsc.getListStyle(sStyleName);
- if (style==null || config.formatting()<=Config.IGNORE_MOST) {
- if (nLevel<=4) {
- if (bHeader) { ba.add("\\item[] ",""); }
- else { ba.add("\\item ",""); }
- }
- return;
- }
- // Step 3: Export as default lists (with redefined labels)
- if (config.formatting()==Config.CONVERT_BASIC) {
- if (nLevel<=4) {
- if (bHeader) {
- ba.add("\\item[] ","");
- }
- else if (bRestart && style.isNumber(nLevel)) {
- ba.add("\n\\setcounter{enum"+Misc.int2roman(nLevel)
- +"}{"+(nStartValue-1)+"}\n\\item ","");
- }
- else {
- ba.add("\\item ","");
- }
- }
- return;
- }
- // Step 4: Export with formatting, as "Writer style" custom lists
- if (nLevel<=4 && !bHeader) { // TODO: Max level should not be fixed
- String sTeXName="list"+styleNames.getExportName(sStyleName)
- +"level"+Misc.int2roman(nLevel);
- if (bRestart && style.isNumber(nLevel)) {
- ba.add("\\setcounter{"+sTeXName+"}{"+(nStartValue-1)+"}\n","");
- }
- ba.add("\\item ","");
- }
- }
-
-
- /** <p>Create labels for default lists (enumerate/itemize) based on
- * a List Style
- */
- private void createListStyleLabels(String sStyleName) {
- String sTeXName = styleNames.getExportName(sStyleName);
- declarations.append("\\newcommand\\liststyle")
- .append(sTeXName).append("{%").nl();
- ListStyle style = wsc.getListStyle(sStyleName);
- int nEnum = 0;
- int nItem = 0;
- String sName[] = new String[5];
- for (int i=1; i<=4; i++) {
- if (style.isNumber(i)) { sName[i]="enum"+Misc.int2roman(++nEnum); }
- else { sName[i]="item"+Misc.int2roman(++nItem); }
- }
- listStyleLevelNames.put(sStyleName, sName);
- createLabels(style, sName, 4, false, true, false, declarations);
- declarations.append("}").nl();
- }
-
- /** <p>Create "Writer style" lists based on a List Style.
- <p>A list in writer is really a sequence of numbered paragraphs, so
- this is also how we implement it in LaTeX.
- The enivronment + redefined \item defines three hooks:
- \writerlistleftskip, \writerlistparindent, \writerlistlabel
- which are used by exported paragraph styles to apply numbering.
- */
- private void createListStyle(String sStyleName) {
- ListStyle style = wsc.getListStyle(sStyleName);
-
- // Create labels
- String sTeXName = styleNames.getExportName(sStyleName);
- String[] sLevelName = new String[5];
- for (int i=1; i<=4; i++) {
- sLevelName[i]="list"+sTeXName+"level"+Misc.int2roman(i);
- }
- createLabels(style,sLevelName,4,true,false,true,declarations);
-
- // Create environments
- for (int i=1; i<=4; i++) {
- String sSpaceBefore = getLength(style,i,XMLString.TEXT_SPACE_BEFORE);
- String sLabelWidth = getLength(style,i,XMLString.TEXT_MIN_LABEL_WIDTH);
- String sLabelDistance = getLength(style,i,XMLString.TEXT_MIN_LABEL_DISTANCE);
- declarations
- .append("\\newenvironment{")
- .append(sLevelName[i]).append("}{")
- .append("\\def\\writerlistleftskip{\\addtolength\\leftskip{")
- .append(Misc.add(sSpaceBefore,sLabelWidth)).append("}}")
- .append("\\def\\writerlistparindent{}")
- .append("\\def\\writerlistlabel{}");
- // Redefine \item
- declarations
- .append("\\def\\item{")
- .append("\\def\\writerlistparindent{\\setlength\\parindent{")
- .append("-").append(sLabelWidth).append("}}")
- .append("\\def\\writerlistlabel{");
- if (style.isNumber(i)) {
- declarations.append("\\stepcounter{")
- .append(sLevelName[i]).append("}");
- }
- declarations
- .append("\\label").append(sLevelName[i])
- .append("\\hspace{").append(sLabelDistance).append("}")
- .append("\\writerlistremovelabel}}}{}").nl();
- }
- }
-
- /** <p>Create LaTeX list labels from an OOo list style. Examples:</p>
- * <p>Bullets:</p>
- * <pre>\newcommand\labelliststylei{\textbullet}
- * \newcommand\labelliststyleii{*}
- * \newcommand\labelliststyleiii{\textstylebullet{>}}</pre>
- * <p>Numbering:</p>
- * <pre>\newcounter{liststylei}
- * \newcounter{liststyleii}[liststylei]
- * \newcounter{liststyleiii}[liststyleii]
- * \renewcommand\theliststylei{\Roman{liststylei}}
- * \renewcommand\theliststyleii{\Roman{liststylei}.\arabic{liststyleii}}
- * \renewcommand\theliststyleiii{\alph{liststyleiii}}
- * \newcommand\labelliststylei{\textstylelabel{\theliststylei .}}
- * \newcommand\labelliststyleii{\textstylelabel{\theliststyleii .}}
- * \newcommand\labelliststyleiii{\textstylelabel{\theliststyleiii )}}</pre>
- *
- * @param <code>style</code> the OOo list style to use
- * @param <code>sName</code> an array of label basenames to use
- * @param <code>nMaxLevel</code> the highest level in this numbering
- * @param <code>bDeclareCounters</code> true if counters should be declared (they may
- * exist already, eg. "section", "subsection"... or "enumi", "enumii"...
- * @param <code>bRenewLabels</code> true if labels should be defined with \renewcommand
- * @param <code>bUseTextStyle</code> true if labels should be formatted with the associated text style
- * (rather than \newcommand).
- * @param <code>ldp</code> the <code>LaTeXDocumentPortion</code> to add LaTeX code to.
- */
- private void createLabels(ListStyle style, String[] sName, int nMaxLevel,
- boolean bDeclareCounters, boolean bRenewLabels,
- boolean bUseTextStyle, LaTeXDocumentPortion ldp) {
- // Declare counters if required (eg. "\newcounter{countername1}[countername2]")
- if (bDeclareCounters) {
- int j = 0;
- for (int i=1; i<=nMaxLevel; i++) {
- if (style.isNumber(i)) {
- ldp.append("\\newcounter{").append(sName[i]).append("}");
- if (j>0) { ldp.append("[").append(sName[j]).append("]"); }
- ldp.nl();
- j = i;
- }
- }
- }
- // Create numbering for each level (eg. "\arabic{countername}")
- String[] sNumFormat = new String[nMaxLevel+1];
- for (int i=1; i<=nMaxLevel; i++) {
- String s = numFormat(style.getLevelProperty(i,XMLString.STYLE_NUM_FORMAT));
- if (s==null) { sNumFormat[i]=""; }
- else { sNumFormat[i] = s + "{" + sName[i] + "}"; }
- }
- // Create numberings (ie. define "\thecountername"):
- for (int i=1; i<=nMaxLevel; i++) {
- if (style.isNumber(i)) {
- ldp.append("\\renewcommand\\the").append(sName[i]).append("{");
- int nLevels = Misc.getPosInteger(style.getLevelProperty(i,XMLString.TEXT_DISPLAY_LEVELS),1);
- for (int j=i-nLevels+1; j<i; j++) {
- if (style.isNumber(j)) {
- ldp.append(sNumFormat[j]).append(".");
- }
- }
- ldp.append(sNumFormat[i]);
- ldp.append("}").nl();
- }
- }
- // Create labels (ie. define "\labelcountername"):
- for (int i=1; i<=nMaxLevel; i++) {
- ldp.append(bRenewLabels ? "\\renewcommand" : "\\newcommand")
- .append("\\label").append(sName[i]).append("{");
- // Apply text style if required
- BeforeAfter baText = new BeforeAfter();
- if (bUseTextStyle) {
- String sStyleName = style.getLevelProperty(i,XMLString.TEXT_STYLE_NAME);
- palette.getCharSc().applyTextStyle(sStyleName,baText,new Context());
- }
-
- // Create label content
- if (style.isNumber(i)) {
- String sPrefix = style.getLevelProperty(i,XMLString.STYLE_NUM_PREFIX);
- String sSuffix = style.getLevelProperty(i,XMLString.STYLE_NUM_SUFFIX);
- // Apply style
- ldp.append(baText.getBefore());
- if (sPrefix!=null) { ldp.append(sPrefix); }
- ldp.append("\\the").append(sName[i]);
- if (sSuffix!=null) { ldp.append(sSuffix); }
- ldp.append(baText.getAfter());
- }
- else if (style.isBullet(i)) {
- String sBullet = style.getLevelProperty(i,XMLString.TEXT_BULLET_CHAR);
- // Apply style
- ldp.append(baText.getBefore());
- if (sBullet!=null) {
- // Bullets are usually symbols, so this should be OK:
- ldp.append(palette.getI18n().convert(sBullet,false,"en"));
- }
- ldp.append(baText.getAfter());
- }
- else {
- // TODO: Support images!
- ldp.append("\\textbullet");
- }
-
- ldp.append("}").nl();
- }
- }
-
- /* Helper: Get a length property that defaults to 0cm. */
- private String getLength(ListStyle style,int nLevel,String sProperty) {
- String s = style.getLevelStyleProperty(nLevel,sProperty);
- if (s==null) { return "0cm"; }
- else { return s; }
- }
-
- /* Helper: Convert OOo number format to LaTeX number format */
- public static final String numFormat(String sFormat){
- if ("1".equals(sFormat)) { return "\\arabic"; }
- else if ("i".equals(sFormat)) { return "\\roman"; }
- else if ("I".equals(sFormat)) { return "\\Roman"; }
- else if ("a".equals(sFormat)) { return "\\alph"; }
- else if ("A".equals(sFormat)) { return "\\Alph"; }
- else { return null; }
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/NoteConfigurationConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/NoteConfigurationConverter.java
deleted file mode 100644
index 5d6a2e1a847f..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/NoteConfigurationConverter.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/************************************************************************
- *
- * NoteConfigurationConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-04)
- *
- */
-
-package writer2latex.latex.style;
-
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-import writer2latex.office.*;
-import writer2latex.latex.Context;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterPalette;
-
-/** <p>This class creates LaTeX code from OOo {foot|end}note configuration,
- * which includes numbering and formatting of the note.
- */
-public class NoteConfigurationConverter extends StyleConverter {
-
- /** <p>Constructs a new <code>NoteConfigurationConverter</code>.</p>
- */
- public NoteConfigurationConverter(WriterStyleCollection wsc, Config config, ConverterPalette palette) {
- super(wsc,config,palette);
- }
-
- /** <p>Convert footnotes configuration.</p>
- * <p>Note: All footnotes are formatted with the default style for footnotes.
- * (This doesn't conform with the file format specification, but in LaTeX
- * all footnotes are usually formatted in a fixed style.)</p>
- *
- * @param ldp the <code>LaTeXDocumentPortion</code> to add definitions to.
- */
- public void convertFootnotesConfiguration(LaTeXDocumentPortion ldp) {
- // Note: Continuation notices are not supported in LaTeX
- // TODO: Support text:footnotes-postion="document" (footnotes as endnotes)
- // TODO: Support text:start-numbering-at="page" (footnpag.sty/footmisc.sty)
- convertFootEndnotesConfiguration(wsc.getFootnotesConfiguration(),"foot",ldp);
- }
-
- /** <p>Convert endnotes configuration.</p>
- * <p>Note: This method automatically includes the package "endnotes.sty".</p>
- * <p>Note: All endnotes are formatted with the default style for endnotes.
- * (This doesn't conform with the file format specification, but in LaTeX
- * all endnotes are usually formatted in a fixed style.)</p>
- *
- * @param ldp the <code>LaTeXDocumentPortion</code> to add definitions to.
- */
- public void convertEndnotesConfiguration(LaTeXDocumentPortion ldp) {
- // Note: Continuation notices are not supported in LaTeX
- convertFootEndnotesConfiguration(wsc.getEndnotesConfiguration(),"end",ldp);
- }
-
- /** <p>Convert {foot|end}notes configuration.</p>
- * <p>Note: All {foot|end}notes are formatted with the default style for {foot|end}footnotes.
- * (This doesn't conform with the file format specification, but in LaTeX
- * all {foot|end}notes are usually formatted in a fixed style.)</p>
- *
- * @param ldp the <code>LaTeXDocumentPortion</code> to add definitions to.
- */
- private void convertFootEndnotesConfiguration(PropertySet notes, String sType, LaTeXDocumentPortion ldp) {
- if (config.formatting()<Config.CONVERT_BASIC) { return; }
- String sTypeShort = sType.equals("foot") ? "fn" : "en";
- if (notes==null) { return; }
- ldp.append("% ").append(sType).append("notes configuration").nl()
- .append("\\makeatletter").nl();
-
- // The numbering style is controlled by \the{foot|end}note
- String sFormat = notes.getProperty(XMLString.STYLE_NUM_FORMAT);
- if (sFormat!=null) {
- ldp.append("\\renewcommand\\the").append(sType).append("note{")
- .append(ListStyleConverter.numFormat(sFormat))
- .append("{").append(sType).append("note}}").nl();
- }
-
- // Number {foot|end}notes by sections
- if ("chapter".equals(notes.getProperty(XMLString.TEXT_START_NUMBERING_AT))) {
- ldp.append("\\@addtoreset{").append(sType).append("note}{section}").nl();
- }
-
- // Set start value offset (default 0)
- int nStartValue = Misc.getPosInteger(notes.getProperty(XMLString.TEXT_START_VALUE),0);
- if (nStartValue!=0) {
- ldp.append("\\setcounter{").append(sType).append("note}{"+nStartValue+"}").nl();
- }
-
- if (config.formatting()>=Config.CONVERT_MOST) {
- // The formatting of the {foot|end}note citation is controlled by \@make{fn|en}mark
- String sCitBodyStyle = notes.getProperty(XMLString.TEXT_CITATION_BODY_STYLE_NAME);
- if (sCitBodyStyle!=null && wsc.getTextStyle(sCitBodyStyle)!=null) {
- BeforeAfter baText = new BeforeAfter();
- palette.getCharSc().applyTextStyle(sCitBodyStyle,baText,new Context());
- ldp.append("\\renewcommand\\@make").append(sTypeShort).append("mark{\\mbox{")
- .append(baText.getBefore())
- .append("\\@the").append(sTypeShort).append("mark")
- .append(baText.getAfter())
- .append("}}").nl();
- }
-
- // The layout and formatting of the {foot|end}note is controlled by \@make{fn|en}text
- String sCitStyle = notes.getProperty(XMLString.TEXT_CITATION_STYLE_NAME);
- String sStyleName = notes.getProperty(XMLString.TEXT_DEFAULT_STYLE_NAME);
- if (sStyleName!=null) {
- BeforeAfter baText = new BeforeAfter();
- palette.getCharSc().applyTextStyle(sCitStyle,baText,new Context());
- ParStyle style = wsc.getParStyle(sStyleName);
- if (style!=null) {
- BeforeAfter baPar = new BeforeAfter();
- palette.getCharSc().applyHardCharFormatting(style,baPar);
- ldp.append("\\renewcommand\\@make").append(sTypeShort)
- .append("text[1]{\\noindent")
- .append(baText.getBefore())
- .append("\\@the").append(sTypeShort).append("mark\\ ")
- .append(baText.getAfter())
- .append(baPar.getBefore())
- .append("#1")
- .append(baPar.getAfter());
- ldp.append("}").nl();
- }
- }
- }
-
- ldp.append("\\makeatother").nl();
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/PageStyleConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/PageStyleConverter.java
deleted file mode 100644
index b715f00fa259..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/PageStyleConverter.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/************************************************************************
- *
- * PageStyleConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-25)
- *
- */
-
-package writer2latex.latex.style;
-
-import java.util.Enumeration;
-
-import org.w3c.dom.Element;
-
-import writer2latex.util.Misc;
-import writer2latex.util.Config;
-import writer2latex.office.*;
-import writer2latex.latex.Context;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterPalette;
-
-/* This class creates LaTeX code from OOo page masters/master pages
- */
-public class PageStyleConverter extends StyleConverter {
-
- // Name of first used master page, if any
- private String sMainMasterPage = null;
-
- // Value of attribute text:display of most recent text:chapter field
- // This is used to handle chaptermarks in headings
- private String sChapterField1 = null;
- private String sChapterField2 = null;
-
- /** <p>Constructs a new <code>PageMasterConverter</code>.</p>
- */
- public PageStyleConverter(WriterStyleCollection wsc, Config config,
- ConverterPalette palette) {
- super(wsc,config,palette);
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- // We currently use calc.sty for the geometry (todo: remove this dependency)
- if (config.pageFormatting()==Config.CONVERT_ALL) {
- pack.append("\\usepackage{calc}").nl();
- }
-
- // Determine which master page and page master to use first
- // If no page master was found when traversing the document, use the first
- // master page in styles.xml
- if (sMainMasterPage==null) {
- sMainMasterPage = wsc.getFirstMasterPageName();
- if (sMainMasterPage!=null) { styleNames.addName(sMainMasterPage); }
- }
- String sMainPageMaster = null;
- if (sMainMasterPage!=null) {
- MasterPage mpStyle = wsc.getMasterPage(sMainMasterPage);
- if (mpStyle!=null) {
- sMainPageMaster = mpStyle.getProperty(XMLString.STYLE_PAGE_MASTER_NAME);
- }
- }
-
- convertMasterPages(decl);
-
- BeforeAfter ba = new BeforeAfter();
- applyMasterPage(sMainMasterPage,ba);
- decl.append(ba.getBefore());
- }
-
- public void setChapterField1(String s) { sChapterField1 = s; }
-
- public void setChapterField2(String s) { sChapterField2 = s; }
-
- /** <p>Use a Master Page (pagestyle in LaTeX)</p>
- * @param sName name of the master page to use
- * @param ba the <code>BeforeAfter</code> to add code to.
- */
- public void applyMasterPage(String sName, BeforeAfter ba) {
- if (config.pageFormatting()==Config.IGNORE_ALL) return;
- MasterPage style = wsc.getMasterPage(sName);
- if (style==null) { return; }
- String sNextName = style.getProperty(XMLString.STYLE_NEXT_STYLE_NAME);
- MasterPage nextStyle = wsc.getMasterPage(sNextName);
- if (style==nextStyle || nextStyle==null) {
- ba.add("\\pagestyle{"+styleNames.getExportName(sName)+"}\n", "");
- }
- else {
- ba.add("\\pagestyle{"+styleNames.getExportName(sNextName)+"}\n"+
- "\\thispagestyle{"+styleNames.getExportName(sName)+"}\n","");
- }
- // todo: should warn the user if next master also contains a next-style-name;
- // LaTeX's page style mechanism cannot handle that
- }
-
- public void collectMasterPage(ParStyle style) {
- if (style==null || sMainMasterPage!=null) { return; }
- String s = style.getMasterPageName();
- if (s!=null && s.length()!=0) { sMainMasterPage = s; }
- }
-
- /*
- * Process header or footer contents
- */
- private void convertMasterPages(LaTeXDocumentPortion ldp) {
- if (config.pageFormatting()==Config.IGNORE_ALL) { return; }
-
- Context context = new Context();
- context.resetFormattingFromStyle(wsc.getDefaultParStyle());
- context.setInHeaderFooter(true);
-
- Enumeration styles = wsc.getMasterPages().getStylesEnumeration();
- ldp.append("% Pages styles (master pages)").nl()
- .append("\\makeatletter").nl();
- while (styles.hasMoreElements()) {
- MasterPage style = (MasterPage) styles.nextElement();
- String sName = style.getName();
- if (styleNames.containsName(sName)) {
- ldp.append("\\newcommand\\ps@")
- .append(styleNames.getExportName(sName))
- .append("{%").nl();
- sChapterField1 = null;
- sChapterField2 = null;
- // Header
- ldp.append("\\renewcommand\\@oddhead{");
- if (style.getHeader()!=null) {
- traverseHeaderFooter((Element)style.getHeader(),ldp,context);
- }
- ldp.append("}%").nl();
- ldp.append("\\renewcommand\\@evenhead{");
- if (style.getHeaderLeft()!=null) {
- traverseHeaderFooter((Element)style.getHeaderLeft(),ldp,context);
- }
- else if (style.getHeader()!=null) {
- ldp.append("\\@oddhead");
- }
- ldp.append("}%").nl();
- // Footer
- ldp.append("\\renewcommand\\@oddfoot{");
- if (style.getFooter()!=null) {
- traverseHeaderFooter((Element)style.getFooter(),ldp,context);
- }
- ldp.append("}%").nl();
- ldp.append("\\renewcommand\\@evenfoot{");
- if (style.getFooterLeft()!=null) {
- traverseHeaderFooter((Element)style.getFooterLeft(),ldp,context);
- }
- else if (style.getFooter()!=null) {
- ldp.append("\\@oddfoot");
- }
- ldp.append("}%").nl();
- // Sectionmark and subsectionmark
- if (sChapterField1!=null) {
- ldp.append("\\def\\sectionmark##1{\\markboth{");
- if ("name".equals(sChapterField1)) { ldp.append("##1"); }
- else if ("number".equals(sChapterField1) || "plain-number".equals(sChapterField1)) {
- ldp.append("\\thesection");
- }
- else { ldp.append("\\thesection ##1"); }
- ldp.append("}{}}").nl();
- }
- if (sChapterField2!=null) {
- if (sChapterField1==null) {
- ldp.append("\\def\\sectionmark##1{\\markboth{}{}}").nl();
- }
- ldp.append("\\def\\subsectionmark##1{\\markright{");
- if ("name".equals(sChapterField2)) { ldp.append("##1"); }
- else if ("number".equals(sChapterField2) || "plain-number".equals(sChapterField1)) {
- ldp.append("\\thesubsection");
- }
- else { ldp.append("\\thesubsection ##1"); }
- ldp.append("}{}}").nl();
- }
- // Convert PageMaster
- String sPageMaster = style.getProperty(XMLString.STYLE_PAGE_MASTER_NAME);
- convertPageMaster(sPageMaster,ldp);
-
- ldp.append("}").nl();
- }
- }
- ldp.append("\\makeatother").nl();
- }
-
- private void traverseHeaderFooter(Element node, LaTeXDocumentPortion ldp, Context context) {
- // get first paragraph; all other content is ignored
- Element par = Misc.getChildByTagName(node,XMLString.TEXT_P);
- if (par==null) { return; }
-
- String sStyleName = par.getAttribute(XMLString.TEXT_STYLE_NAME);
- BeforeAfter ba = new BeforeAfter();
- // Temp solution: Ignore hard formatting in header/footer (name clash problem)
- // only in package format. TODO: Find a better solution for 0.4!
- // TODO: Reenable this!!!!:
- /*if (palette.isPackage() && palette.getParSc().isAutomatic(sStyleName)) {
- palette.getCharSc().applyHardCharFormatting(sStyleName,ba);
- }*/
-
- if (par.hasChildNodes()) {
- ldp.append(ba.getBefore());
- palette.getInlineCv().traverseInlineText(par,ldp,context,false);
- ldp.append(ba.getAfter());
- }
-
- }
-
-
- /** <p>Convert a page master (pagesize, margins etc.)
- * @param sName name of the page master to use
- * @param ldp the <code>LaTeXDocumentPortion</code> to add code to.
- */
- private void convertPageMaster(String sName, LaTeXDocumentPortion ldp) {
- if (config.pageFormatting()!=Config.CONVERT_ALL) { return; }
- PageMaster style = wsc.getPageMaster(sName);
- if (style==null) { return; }
-
- String sHeadHeight = "0cm";
- String sHeadSep = "0cm";
- if (style.hasHeaderStyle()) {
- sHeadHeight = "12pt";
- sHeadSep = style.getHeaderProperty(XMLString.FO_MARGIN_BOTTOM);
- if (sHeadSep==null) { sHeadSep = "0cm"; }
- }
-
- String sFootHeight = "0cm";
- String sFootSep = "0cm";
- if (style.hasFooterStyle()) {
- sFootHeight = "12pt";
- sFootSep = style.getFooterProperty(XMLString.FO_MARGIN_TOP);
- if (sFootSep==null) { sFootSep = "0cm"; }
- }
-
- // Page dimensions
- ldp.append("\\setlength\\paperwidth{")
- .append(style.getAbsoluteProperty(XMLString.FO_PAGE_WIDTH))
- .append("}")
- .append("\\setlength\\paperheight{")
- .append(style.getAbsoluteProperty(XMLString.FO_PAGE_HEIGHT))
- .append("}");
- // PDF page dimensions, only if hyperref.sty is not loaded
- if (config.getBackend()==Config.PDFTEX && !config.useHyperref()) {
- ldp.append("\\setlength\\pdfpagewidth{")
- .append(style.getAbsoluteProperty(XMLString.FO_PAGE_WIDTH))
- .append("}")
- .append("\\setlength\\pdfpageheight{")
- .append(style.getAbsoluteProperty(XMLString.FO_PAGE_HEIGHT))
- .append("}");
- }
- // Page starts in upper left corner of paper!!
- ldp.append("\\setlength\\voffset{-1in}");
- ldp.append("\\setlength\\hoffset{-1in}");
- // Top margin
- ldp.append("\\setlength\\topmargin{")
- .append(style.getProperty(XMLString.FO_MARGIN_TOP))
- .append("}");
- // Header and footer
- ldp.append("\\setlength\\headheight{").append(sHeadHeight).append("}");
- ldp.append("\\setlength\\headsep{").append(sHeadSep).append("}");
- ldp.append("\\setlength\\footskip{")
- .append(sFootHeight).append("+").append(sFootSep).append("}");
- // Bottom margin is set indirectly via text height
- ldp.append("\\setlength\\textheight{")
- .append(style.getProperty(XMLString.FO_PAGE_HEIGHT))
- .append("-").append(style.getProperty(XMLString.FO_MARGIN_TOP))
- .append("-").append(style.getProperty(XMLString.FO_MARGIN_BOTTOM))
- .append("-").append(sHeadSep)
- .append("-").append(sHeadHeight)
- .append("-").append(sFootSep)
- .append("-").append(sFootHeight).append("}");
- // Left margin
- ldp.append("\\setlength\\oddsidemargin{")
- .append(style.getProperty(XMLString.FO_MARGIN_LEFT))
- .append("}");
- // Left margin for even (left) pages; only for mirrored page master
- if ("mirrored".equals(style.getPageUsage())) {
- ldp.append("\\setlength\\evensidemargin{")
- .append(style.getProperty(XMLString.FO_MARGIN_RIGHT))
- .append("}");
- }
- // Right margin is set indirectly via text width
- ldp.append("\\setlength\\textwidth{")
- .append(style.getProperty(XMLString.FO_PAGE_WIDTH))
- .append("-")
- .append(style.getProperty(XMLString.FO_MARGIN_LEFT))
- .append("-")
- .append(style.getProperty(XMLString.FO_MARGIN_RIGHT))
- .append("}").nl();
- // Set additional lengths
- //ldp.append("\\@colht\\textheight\\@colroom\\textheight\\vsize\\textheight").nl();
-
- // Define columns
- //if (style.getColCount()>1) { ldp.append("\\twocolumn").nl(); }
- //else { ldp.append("\\onecolumn").nl(); }
-
- // Page number
- String sNumFormat = style.getProperty(XMLString.STYLE_NUM_FORMAT);
- if (sNumFormat!=null) {
- ldp.append("\\renewcommand\\thepage{")
- .append(ListStyleConverter.numFormat(sNumFormat))
- .append("{page}}").nl();
- }
- String sPageNumber = style.getProperty(XMLString.STYLE_FIRST_PAGE_NUMBER);
- if (sPageNumber!=null && !sPageNumber.equals("continue")) {
- ldp.append("\\setcounter{page}{")
- .append(Integer.toString(Misc.getPosInteger(sPageNumber,0)))
- .append("}").nl();
- }
- // Footnote rule
- // TODO: Support alignment.
- String sBefore = style.getFootnoteProperty(XMLString.STYLE_DISTANCE_BEFORE_SEP);
- if (sBefore==null) { sBefore = "1mm"; }
- String sAfter = style.getFootnoteProperty(XMLString.STYLE_DISTANCE_AFTER_SEP);
- if (sAfter==null) { sAfter = "1mm"; }
- String sHeight = style.getFootnoteProperty(XMLString.STYLE_WIDTH);
- if (sHeight==null) { sHeight = "0.2mm"; }
- String sWidth = style.getFootnoteProperty(XMLString.STYLE_REL_WIDTH);
- if (sWidth==null) { sWidth = "25%"; }
- sWidth=Float.toString(Misc.getFloat(sWidth.substring(0,sWidth.length()-1),1)/100);
- BeforeAfter baColor = new BeforeAfter();
- palette.getCharSc().applyThisColor(style.getFootnoteProperty(XMLString.STYLE_COLOR),false,baColor);
-
- ldp.append("\\setlength{\\skip\\footins}{").append(sBefore).append("}");
- ldp.append("\\renewcommand\\footnoterule{\\vspace*{-").append(sHeight)
- .append("}\\noindent")
- .append(baColor.getBefore()).append("\\rule{").append(sWidth)
- .append("\\columnwidth}{").append(sHeight).append("}")
- .append(baColor.getAfter())
- .append("\\vspace*{").append(sAfter).append("}}").nl();
- }
-
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/ParStyleConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/ParStyleConverter.java
deleted file mode 100644
index e2d368f16412..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/ParStyleConverter.java
+++ /dev/null
@@ -1,566 +0,0 @@
-/************************************************************************
- *
- * ParStyleConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3i (2004-12-28)
- *
- */
-
-package writer2latex.latex.style;
-
-import java.util.Hashtable;
-
-import writer2latex.util.*;
-import writer2latex.office.*;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.HeadingMap;
-import writer2latex.latex.ConverterPalette;
-import writer2latex.latex.Context;
-
-/* This class creates LaTeX code from OOo paragraph styles
- */
-public class ParStyleConverter extends StyleConverter {
- private String[] sHeadingStyles = new String[11];
-
- /** <p>Constructs a new <code>ParStyleConverter</code>.</p>
- */
- public ParStyleConverter(WriterStyleCollection wsc, Config config,
- ConverterPalette palette) {
- super(wsc,config,palette);
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (config.formatting()>=Config.CONVERT_MOST) {
- // We typeset with \raggedbottom since OOo doesn't use rubber lengths
- // TODO: Maybe turn vertical spacing from OOo into rubber lengths?
- decl.append("\\raggedbottom").nl();
- }
-
- appendHeadingStyles(decl);
-
- if (config.formatting()>=Config.CONVERT_MOST) {
- decl.append("% Paragraph styles").nl();
- // First default paragraph style
- palette.getCharSc().applyDefaultFont(wsc.getDefaultParStyle(),decl);
- super.appendDeclarations(pack,decl);
- }
- }
-
- /** <p>Use a paragraph style in LaTeX.</p>
- * @param <code>sName</code> the name of the text style
- * @param <code>ba</code> a <code>BeforeAfter</code> to put code into
- * @param <code>context</code> the current context. This method will use and update the formatting context
- */
- public void applyParStyle(String sName, BeforeAfter ba, Context context) {
- applyParStyle(sName,ba,context,true);
- }
-
- private void applyParStyle(String sName, BeforeAfter ba, Context context, boolean bBreakInside) {
- // No style specified?
- if (sName==null) { return; }
-
- // Always end with a line break
- ba.add("","\n");
- // Apply the style
- if (!styleMap.contains(sName)) { createParStyle(sName); }
- String sBefore = styleMap.getBefore(sName);
- String sAfter = styleMap.getAfter(sName);
- ba.add(sBefore,sAfter);
- // Add line breaks inside?
- if (bBreakInside && styleMap.getLineBreak(sName)) {
- if (sBefore.length()>0) { ba.add("\n",""); }
- if (sAfter.length()>0 && !"}".equals(sAfter)) { ba.add("","\n"); }
- }
-
- // Register master page and update context
- ParStyle style = wsc.getParStyle(sName);
- if (style==null) { return; }
- palette.getPageSc().collectMasterPage(style);
- context.updateFormattingFromStyle(style);
- context.setVerbatim(styleMap.getVerbatim(sName));
- }
-
- /** <p>Convert a paragraph style to LaTeX. </p>
- * <p>A soft style is declared in <code>styleDeclarations</code> as
- * <code>\newenvironment...</code></p>
- * <p>A hard style is used by applying LaTeX code directly</p>
- * @param <code>sName</code> the OOo name of the style
- */
- private void createParStyle(String sName) {
- // A paragraph style should always be created relative to main context
- Context context = (Context) palette.getMainContext().clone();
- // The style may already be declared in the configuration:
- StyleMap sm = config.getParStyleMap();
- if (sm.contains(sName)) {
- styleMap.put(sName,sm.getBefore(sName),sm.getAfter(sName),
- sm.getLineBreak(sName),sm.getVerbatim(sName));
- return;
- }
- // Does the style exist?
- ParStyle style = wsc.getParStyle(sName);
- if (style==null) {
- styleMap.put(sName,"","");
- return;
- }
- // Convert the style!
- switch (config.formatting()) {
- case Config.CONVERT_MOST:
- if (style.isAutomatic()) {
- createAutomaticParStyle(style,context);
- return;
- }
- case Config.CONVERT_ALL:
- createSoftParStyle(style,context);
- return;
- case Config.CONVERT_BASIC:
- case Config.IGNORE_MOST:
- createSimpleParStyle(style,context);
- return;
- case Config.IGNORE_ALL:
- default:
- styleMap.put(sName,"","");
- }
- }
-
- private void createAutomaticParStyle(ParStyle style, Context context) {
- // Hard paragraph formatting from this style should be ignored
- // (because the user wants to ignore hard paragraph formatting
- // or there is a style map for the parent.)
- BeforeAfter ba = new BeforeAfter();
- BeforeAfter baPar = new BeforeAfter();
- BeforeAfter baText = new BeforeAfter();
-
- // Apply paragraph formatting from parent
- // If parent is verbatim, this is all
- String sParentName = style.getParentName();
- if (styleMap.getVerbatim(sParentName)) {
- styleMap.put(style.getName(),styleMap.getBefore(sParentName),styleMap.getAfter(sParentName),
- styleMap.getLineBreak(sParentName),styleMap.getVerbatim(sParentName));
- return;
- }
- applyParStyle(sParentName,baPar,context,false);
-
- // Apply hard formatting properties:
- applyPageBreak(style,false,ba);
- palette.getI18n().applyLanguage(style,true,false,baText);
- palette.getCharSc().applyFont(style,true,false,baText,context);
-
- // Assemble the bits. If there is any hard character formatting
- // we must group the contents.
- if (baPar.isEmpty() && !baText.isEmpty()) { ba.add("{","}"); }
- else { ba.add(baPar.getBefore(),baPar.getAfter()); }
- ba.add(baText.getBefore(),baText.getAfter());
- boolean bLineBreak = styleMap.getLineBreak(sParentName);
- if (!bLineBreak && !baText.isEmpty()) { ba.add(" ",""); }
- styleMap.put(style.getName(),ba.getBefore(),ba.getAfter(),bLineBreak,false);
- }
-
- private void createSimpleParStyle(ParStyle style, Context context) {
- // Export character formatting + alignment only
- if (style.isAutomatic() && config.getParStyleMap().contains(style.getParentName())) {
- createAutomaticParStyle(style,context);
- }
-
- BeforeAfter ba = new BeforeAfter();
- BeforeAfter baText = new BeforeAfter();
-
- // Apply hard formatting attributes
- // Note: Left justified text is exported as full justified text!
- applyPageBreak(style,false,ba);
- String sTextAlign = style.getProperty(XMLString.FO_TEXT_ALIGN,true);
- if ("center".equals(sTextAlign)) { baText.add("\\centering","\\par"); }
- else if ("end".equals(sTextAlign)) { baText.add("\\raggedleft","\\par"); }
- palette.getI18n().applyLanguage(style,true,true,baText);
- palette.getCharSc().applyFont(style,true,true,baText,context);
-
- // Assemble the bits. If there is any hard character formatting
- // or alignment we must group the contents.
- if (!baText.isEmpty()) { ba.add("{","}"); }
- ba.add(baText.getBefore(),baText.getAfter());
- styleMap.put(style.getName(),ba.getBefore(),ba.getAfter());
- }
-
- private void createSoftParStyle(ParStyle style, Context context) {
- // This style should be converted to an enviroment, except if
- // it's automatic and there is a config style map for the parent
- if (style.isAutomatic() && config.getParStyleMap().contains(style.getParentName())) {
- createAutomaticParStyle(style,context);
- }
-
- BeforeAfter ba = new BeforeAfter();
- applyParProperties(style,ba);
- ba.add("\\writerlistparindent\\writerlistleftskip","");
- palette.getI18n().applyLanguage(style,true,true,ba);
- ba.add("\\leavevmode","");
- palette.getCharSc().applyNormalFont(ba);
- palette.getCharSc().applyFont(style,true,true,ba,context);
- ba.add("\\writerlistlabel","");
- ba.add("\\ignorespaces","");
- // Declare the paragraph style (\newenvironment)
- String sTeXName = "style" + styleNames.getExportName(style.getName());
- styleMap.put(style.getName(),"\\begin{"+sTeXName+"}","\\end{"+sTeXName+"}");
- declarations.append("\\newenvironment{").append(sTeXName)
- .append("}{").append(ba.getBefore()).append("}{")
- .append(ba.getAfter()).append("}").nl();
- }
-
- /** <p>Use a paragraph style on a heading. If hard paragraph formatting
- * is applied to a heading, page break and font is converted - other
- * hard formatting is ignored.
- * <p>This method also collects name of heading style and master page
- * @param <code>nLevel</code> The level of this heading
- * @param <code>sStyleName</code> the name of the paragraph style to use
- * @param <code>baPage</code> a <code>BeforeAfter</code> to put page break code into
- * @param <code>baText</code> a <code>BeforeAfter</code> to put character formatting code into
- * @param <code>context</code> the current context. This method will use and update the formatting context
- */
- public void applyHardHeadingStyle(int nLevel, String sStyleName,
- BeforeAfter baPage, BeforeAfter baText, Context context) {
-
- // Get the style
- ParStyle style = wsc.getParStyle(sStyleName);
- if (style==null) { return; }
-
- // Register master page and heading style
- palette.getPageSc().collectMasterPage(style);
- if (sHeadingStyles[nLevel]==null) {
- sHeadingStyles[nLevel] = style.isAutomatic() ? style.getParentName() : sStyleName;
- }
-
- // Do conversion
- if (style.isAutomatic()) {
- applyPageBreak(style,false,baPage);
- palette.getCharSc().applyHardCharFormatting(style,baText);
- }
-
- // Update context
- context.updateFormattingFromStyle(style);
- }
-
- // utility method to get the font name from a char style
- public String getFontName(String sStyleName) {
- StyleWithProperties style = wsc.getParStyle(sStyleName);
- if (style==null) { return null; }
- String sName = style.getProperty(XMLString.STYLE_FONT_NAME);
- if (sName==null) { return null; }
- FontDeclaration fd = wsc.getFontDeclaration(sName);
- if (fd==null) { return null; }
- return fd.getProperty(XMLString.FO_FONT_FAMILY);
- }
-
- /** <p>Apply page break properties from a style.</p>
- * @param <code>style</code> the paragraph style to use
- * @param <code>bInherit</code> true if inheritance from parent style should be used
- * @param <code>ba</code> a <code>BeforeAfter</code> to put code into
- */
- public void applyPageBreak(ParStyle style, boolean bInherit, BeforeAfter ba) {
- if (style==null) { return; }
- if (style.isAutomatic() && config.ignoreHardPageBreaks()) { return; }
- // A page break can be a simple page break before or after...
- String s = style.getProperty(XMLString.FO_BREAK_BEFORE,bInherit);
- if ("page".equals(s)) { ba.add("\\clearpage",""); }
- s = style.getProperty(XMLString.FO_BREAK_AFTER,bInherit);
- if ("page".equals(s)) { ba.add("","\\clearpage"); }
- // ...or it can be a new master page
- String sMasterPage = style.getMasterPageName();
- if (sMasterPage==null || sMasterPage.length()==0) { return; }
- ba.add("\\clearpage","");
- palette.getPageSc().applyMasterPage(sMasterPage,ba);
- }
-
- // Remaining methods are private helpers
-
- /** <p>Apply line spacing from a style.</p>
- * @param <code>style</code> the paragraph style to use
- * @param <code>ba</code> a <code>BeforeAfter</code> to put code into
- */
- private void applyLineSpacing(ParStyle style, BeforeAfter ba) {
- if (style==null) { return; }
- String sLineHeight = style.getProperty(XMLString.FO_LINE_HEIGHT);
- if (sLineHeight==null || !sLineHeight.endsWith("%")) { return; }
- float fPercent=Misc.getFloat(sLineHeight.substring(0,sLineHeight.length()-1),1);
- ba.add("\\renewcommand\\baselinestretch{"+fPercent/120+"}","");
- }
-
- /** <p>Helper: Get a length property that
- * defaults to 0cm.
- */
- private String getLength(ParStyle style,String sProperty) {
- String s = style.getAbsoluteProperty(sProperty);
- if (s==null) { return "0cm"; }
- else { return s; }
- }
-
- /** <p>Helper: Create a horizontal border.</p>
- */
- private String createBorder(String sLeft, String sRight, String sTop,
- String sHeight, String sColor) {
- BeforeAfter baColor = new BeforeAfter();
- palette.getCharSc().applyThisColor(sColor,false,baColor);
- return "{\\setlength\\parindent{0pt}\\setlength\\leftskip{" + sLeft + "}"
- + "\\setlength\\baselineskip{0pt}\\setlength\\parskip{" + sHeight + "}"
- + baColor.getBefore()
- + "\\rule{\\textwidth-" + sLeft + "-" + sRight + "}{" + sHeight + "}"
- + baColor.getAfter()
- + "\\par}";
- }
-
- /** <p>Apply margin+alignment properties from a style.</p>
- * @param <code>style</code> the paragraph style to use
- * @param <code>ba</code> a <code>BeforeAfter</code> to put code into
- */
- private void applyMargins(ParStyle style, BeforeAfter ba) {
- // Read padding/margin/indentation properties:
- String sPaddingTop = getLength(style,XMLString.FO_PADDING_TOP);
- String sPaddingBottom = getLength(style,XMLString.FO_PADDING_BOTTOM);
- String sPaddingLeft = getLength(style,XMLString.FO_PADDING_LEFT);
- String sPaddingRight = getLength(style,XMLString.FO_PADDING_RIGHT);
- String sMarginTop = getLength(style,XMLString.FO_MARGIN_TOP);
- String sMarginBottom = getLength(style,XMLString.FO_MARGIN_BOTTOM);
- String sMarginLeft = getLength(style,XMLString.FO_MARGIN_LEFT);
- String sMarginRight = getLength(style,XMLString.FO_MARGIN_RIGHT);
- String sTextIndent;
- if ("true".equals(style.getProperty(XMLString.STYLE_AUTO_TEXT_INDENT))) {
- sTextIndent = "2em";
- }
- else {
- sTextIndent = getLength(style,XMLString.FO_TEXT_INDENT);
- }
- // Read alignment properties:
- boolean bRaggedLeft = false; // add 1fil to \leftskip
- boolean bRaggedRight = false; // add 1fil to \rightskip
- boolean bParFill = false; // add 1fil to \parfillskip
- String sTextAlign = style.getProperty(XMLString.FO_TEXT_ALIGN);
- if ("center".equals(sTextAlign)) {
- bRaggedLeft = true; bRaggedRight = true; // centered paragraph
- }
- else if ("start".equals(sTextAlign)) {
- bRaggedRight = true; bParFill = true; // left aligned paragraph
- }
- else if ("end".equals(sTextAlign)) {
- bRaggedLeft = true; // right aligned paragraph
- }
- else if (!"justify".equals(style.getProperty(XMLString.FO_TEXT_ALIGN_LAST))) {
- bParFill = true; // justified paragraph with ragged last line
- }
- // Create formatting:
- ba.add("\\setlength\\leftskip{"+sMarginLeft+(bRaggedLeft?" plus 1fil":"")+"}","");
- ba.add("\\setlength\\rightskip{"+sMarginRight+(bRaggedRight?" plus 1fil":"")+"}","");
- ba.add("\\setlength\\parindent{"+sTextIndent+"}","");
- ba.add("\\setlength\\parfillskip{"+(bParFill?"0pt plus 1fil":"0pt")+"}","");
- ba.add("\\setlength\\parskip{"+sMarginTop+"}","\\unskip\\vspace{"+sMarginBottom+"}");
- }
-
- private void applyAlignment(ParStyle style, boolean bIsSimple, boolean bInherit, BeforeAfter ba) {
- if (bIsSimple || style==null) { return; }
- String sTextAlign = style.getProperty(XMLString.FO_TEXT_ALIGN,bInherit);
- if ("center".equals(sTextAlign)) { ba.add("\\centering",""); }
- else if ("start".equals(sTextAlign)) { ba.add("\\raggedright",""); }
- else if ("end".equals(sTextAlign)) { ba.add("\\raggedleft",""); }
- }
-
-
- /** <p>Apply all paragraph properties.</p>
- * @param <code>style</code> the paragraph style to use
- * @param <code>ba</code> a <code>BeforeAfter</code> to put code into
- */
- private void applyParProperties(ParStyle style, BeforeAfter ba) {
- applyPageBreak(style,true,ba);
- ba.add("","\\par");
- applyLineSpacing(style,ba);
- applyMargins(style,ba);
- }
-
- /** <p>Convert heading styles and outline numbering to LaTeX.</p>
- * <p>An array of stylenames to use is required: The OOo writer file format
- * allows different paragraph styles to be applied to individual headings,
- * so this is not included in the styles.
- * LaTeX (and OOo Writer!) usually uses the same format for all headings.</p>
- * @param ldp the <code>LaTeXDocumentPortion</code> to add definitions to.
- */
- // TODO: use method from ListStyleConverter to create labels
- private void appendHeadingStyles(LaTeXDocumentPortion ldp) {
- // The user may not want to convert the formatting of headings
- if (config.formatting()<=Config.IGNORE_MOST) { return; }
-
- HeadingMap hm = config.getHeadingMap();
-
- // OK, we are going to convert. First find the max level for headings
- int nMaxLevel = 0;
- for (int i=1; i<=5; i++) { if (sHeadingStyles[i]!=null) { nMaxLevel=i; } }
- if (nMaxLevel==0) { return; } // no headings, nothing to do!
- if (nMaxLevel>hm.getMaxLevel()) { nMaxLevel = hm.getMaxLevel(); }
-
- boolean bOnlyNum = config.formatting()==Config.CONVERT_BASIC;
- if (bOnlyNum) {
- ldp.append("% Outline numbering").nl();
- }
- else {
- ldp.append("% Headings and outline numbering").nl()
- .append("\\makeatletter").nl();
- }
-
- // Paragraph style for headings:
- if (!bOnlyNum) {
- for (int i=1; i<=nMaxLevel; i++) {
- if (sHeadingStyles[i]!=null) {
- ParStyle style = wsc.getParStyle(sHeadingStyles[i]);
- if (style!=null) {
- BeforeAfter decl = new BeforeAfter();
- BeforeAfter comm = new BeforeAfter();
-
- applyPageBreak(style,true,decl);
-
- palette.getCharSc().applyNormalFont(decl);
- palette.getCharSc().applyFont(style,true,true,decl,new Context());
- applyAlignment(style,false,true,decl);
-
- palette.getI18n().applyLanguage(style,false,true,comm);
- palette.getCharSc().applyFontEffects(style,true,comm);
-
- String sMarginTop = getLength(style,XMLString.FO_MARGIN_TOP);
- String sMarginBottom = getLength(style,XMLString.FO_MARGIN_BOTTOM);
- String sMarginLeft = getLength(style,XMLString.FO_MARGIN_LEFT);
-
- String sSecName = hm.getName(i);
- if (!comm.isEmpty()) { // have to create a cs for this heading
- ldp.append("\\newcommand\\cs").append(sSecName).append("[1]{")
- .append(comm.getBefore()).append("#1").append(comm.getAfter())
- .append("}").nl();
- }
- ldp.append("\\renewcommand\\").append(sSecName)
- .append("{\\@startsection{").append(sSecName).append("}{"+hm.getLevel(i))
- .append("}{"+sMarginLeft+"}{");
- // Suppress indentation after heading? currently not..
- // ldp.append("-");
- ldp.append(sMarginTop)
- .append("}{").append(sMarginBottom).append("}{");
- // Note: decl.getAfter() may include a page break after, which we ignore
- ldp.append(decl.getBefore());
- if (!comm.isEmpty()) {
- ldp.append("\\cs").append(sSecName);
- }
- ldp.append("}}").nl();
- }
- }
- }
- }
-
- // redefine formatting of section counters
- // simplified if the user wants to ignore formatting
- if (!bOnlyNum) {
- ldp.append("\\renewcommand\\@seccntformat[1]{")
- .append("\\csname @textstyle#1\\endcsname{\\csname the#1\\endcsname}")
- .append("\\csname @distance#1\\endcsname}").nl();
- }
-
- // Collect numbering styles and set secnumdepth
- int nSecnumdepth = nMaxLevel;
- ListStyle outline = wsc.getOutlineStyle();
- String[] sNumFormat = new String[6];
- for (int i=nMaxLevel; i>=1; i--) {
- sNumFormat[i] = ListStyleConverter.numFormat(outline.getLevelProperty(i,
- XMLString.STYLE_NUM_FORMAT));
- if (sNumFormat[i]==null || "".equals(sNumFormat[i])) {
- nSecnumdepth = i-1;
- }
- }
- ldp.append("\\setcounter{secnumdepth}{"+nSecnumdepth+"}").nl();
-
- for (int i=1; i<=nMaxLevel; i++) {
- if (sNumFormat[i]==null || "".equals(sNumFormat[i])) {
- // no numbering at this level
- if (!bOnlyNum) {
- ldp.append("\\newcommand\\@distance")
- .append(hm.getName(i)).append("{}").nl()
- .append("\\newcommand\\@textstyle")
- .append(hm.getName(i)).append("[1]{#1}").nl();
- }
- }
- else {
- if (!bOnlyNum) {
- // Distance between label and text:
- String sDistance = outline.getLevelProperty(i,XMLString.TEXT_MIN_LABEL_DISTANCE);
- ldp.append("\\newcommand\\@distance")
- .append(hm.getName(i)).append("{");
- if (sDistance!=null) {
- ldp.append("\\hspace{").append(sDistance).append("{");
- }
- ldp.append("}").nl();
- // Textstyle to use for label:
- String sStyleName = outline.getLevelProperty(i,XMLString.TEXT_STYLE_NAME);
- BeforeAfter baText = new BeforeAfter();
- if (!bOnlyNum) {palette.getCharSc().applyTextStyle(sStyleName,baText,new Context()); }
- ldp.append("\\newcommand\\@textstyle")
- .append(hm.getName(i)).append("[1]{")
- .append(baText.getBefore())
- .append("#1")
- .append(baText.getAfter())
- .append("}").nl();
- }
-
- // The label:
- String sPrefix = outline.getLevelProperty(i,XMLString.STYLE_NUM_PREFIX);
- String sSuffix = outline.getLevelProperty(i,XMLString.STYLE_NUM_SUFFIX);
- int nLevels = Misc.getPosInteger(outline.getLevelProperty(i,
- XMLString.TEXT_DISPLAY_LEVELS),1);
- ldp.append("\\renewcommand\\the")
- .append(hm.getName(i))
- .append("{");
- StringBuffer labelbuf = new StringBuffer();
- if (sPrefix!=null) { labelbuf.append(sPrefix); }
- for (int j=i-nLevels+1; j<i; j++) {
- labelbuf.append(sNumFormat[j])
- .append("{").append(sectionName(j)).append("}")
- .append(".");
- }
- labelbuf.append(sNumFormat[i])
- .append("{").append(hm.getName(i)).append("}");
- if (sSuffix!=null) { labelbuf.append(sSuffix); }
- if (bOnlyNum) {
- ldp.append(labelbuf.toString().trim());
- }
- else {
- ldp.append(labelbuf.toString());
- }
- ldp.append("}").nl();
- }
-
- }
-
- if (!bOnlyNum) {
- ldp.append("\\makeatother").nl();
- }
- }
-
- static final String sectionName(int nLevel){
- switch (nLevel) {
- case 1: return "section";
- case 2: return "subsection";
- case 3: return "subsubsection";
- case 4: return "paragraph";
- case 5: return "subparagraph";
- default: return null;
- }
- }
-
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/SectionStyleConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/SectionStyleConverter.java
deleted file mode 100644
index f1cc97b0298e..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/SectionStyleConverter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/************************************************************************
- *
- * SectionStyleConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-25)
- *
- */
-
-package writer2latex.latex.style;
-
-import writer2latex.util.*;
-import writer2latex.office.*;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.Context;
-import writer2latex.latex.ConverterPalette;
-
-/** <p>This class creates LaTeX code from OOo section formatting.
- * <p>Currently this means number of columns only
- */
-public class SectionStyleConverter extends StyleConverter {
-
- // Do we need multicols.sty?
- private boolean bNeedMulticol = false;
-
- /** <p>Constructs a new <code>SectionStyleConverter</code>.</p>
- */
- public SectionStyleConverter(WriterStyleCollection wsc, Config config,
- ConverterPalette palette) {
- super(wsc,config,palette);
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (bNeedMulticol) { pack.append("\\usepackage{multicol}").nl(); }
- }
-
- public void applySectionStyle(String sStyleName, BeforeAfter ba, Context context) {
- SectionStyle style = wsc.getSectionStyle(sStyleName);
- // Don't nest multicols and require at least 2 columns
- if (context.isInMulticols() || style==null || style.getColCount()<2) { return; }
- int nCols = style.getColCount();
- bNeedMulticol = true;
- context.setInMulticols(true);
- ba.add("\\begin{multicols}{"+(nCols>10 ? 10 : nCols)+"}", "\\end{multicols}");
- }
-
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/StyleConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/StyleConverter.java
deleted file mode 100644
index 92cfdaf3cfca..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/StyleConverter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/************************************************************************
- *
- * StyleConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-09-16)
- *
- */
-
-package writer2latex.latex.style;
-
-import writer2latex.util.Config;
-import writer2latex.util.ExportNameCollection;
-import writer2latex.office.WriterStyleCollection;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterPalette;
-import writer2latex.latex.ConverterHelper;
-
-/**
- * <p>This is an abstract superclass for style converters.</p>
- */
-public abstract class StyleConverter extends ConverterHelper {
-
- protected WriterStyleCollection wsc;
- protected ExportNameCollection styleNames = new ExportNameCollection(false);
- protected StyleMap styleMap = new StyleMap();
- protected LaTeXDocumentPortion declarations = new LaTeXDocumentPortion(false);
-
- protected StyleConverter(WriterStyleCollection wsc, Config config, ConverterPalette palette) {
- super(config,palette);
- this.wsc = wsc;
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- decl.append(declarations);
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/StyleMap.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/StyleMap.java
deleted file mode 100644
index 68e63b23fa2f..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/StyleMap.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/************************************************************************
- *
- * StyleMap.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-28)
- *
- */
-
-package writer2latex.latex.style;
-
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-class StyleMapItem {
- String sBefore;
- String sAfter;
- String sNext;
- boolean bLineBreak;
- boolean bVerbatim;
-}
-
-public class StyleMap {
- private Hashtable items = new Hashtable();
-
- public void put(String sName, String sBefore, String sAfter, boolean bLineBreak, boolean bVerbatim) {
- StyleMapItem item = new StyleMapItem();
- item.sBefore = sBefore;
- item.sAfter = sAfter;
- item.sNext = ";;";
- item.bLineBreak = bLineBreak;
- item.bVerbatim = bVerbatim;
- items.put(sName,item);
- }
-
- public void put(String sName, String sBefore, String sAfter, String sNext) {
- StyleMapItem item = new StyleMapItem();
- item.sBefore = sBefore;
- item.sAfter = sAfter;
- item.sNext = ";"+sNext+";";
- item.bLineBreak = true;
- item.bVerbatim = false;
- items.put(sName,item);
- }
-
- public void put(String sName, String sBefore, String sAfter) {
- StyleMapItem item = new StyleMapItem();
- item.sBefore = sBefore;
- item.sAfter = sAfter;
- item.sNext = ";;";
- item.bLineBreak = true;
- item.bVerbatim = false;
- items.put(sName,item);
- }
-
- public boolean contains(String sName) {
- return sName!=null && items.containsKey(sName);
- }
-
- public String getBefore(String sName) {
- return ((StyleMapItem) items.get(sName)).sBefore;
- }
-
- public String getAfter(String sName) {
- return ((StyleMapItem) items.get(sName)).sAfter;
- }
-
- public String getNext(String sName) {
- String sNext = ((StyleMapItem) items.get(sName)).sNext;
- return sNext.substring(1,sNext.length()-1);
- }
-
- public boolean isNext(String sName, String sNext) {
- String sNext1 = ((StyleMapItem) items.get(sName)).sNext;
- return sNext1.indexOf(";"+sNext+";")>-1;
- }
-
- public boolean getLineBreak(String sName) {
- return contains(sName) && ((StyleMapItem) items.get(sName)).bLineBreak;
- }
-
- public boolean getVerbatim(String sName) {
- return contains(sName) && ((StyleMapItem) items.get(sName)).bVerbatim;
- }
-
- public Enumeration getNames() {
- return items.keys();
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/TableFormatter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/TableFormatter.java
deleted file mode 100644
index 7f6494fcf3bb..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/TableFormatter.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/************************************************************************
- *
- * TableFormatter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-08-26)
- *
- */
-
-package writer2latex.latex.style;
-
-import org.w3c.dom.Node;
-
-import writer2latex.util.*;
-import writer2latex.office.*;
-
-/**
- * <p>This class converts OOo table styles to LaTeX.</p>
- * <p> In OOo the table style is distributed on table, column and cell styles.
- * <p> In LaTeX we have to rearrange this information slightly, so this class
- * takes care of that.</p>
- */
-public class TableFormatter {
-
- private WriterStyleCollection wsc;
- private boolean bApplyCellFormat;
- private TableGridModel table;
- private boolean[][] bHBorder;
- private boolean[][] bVBorder;
- private boolean[] bGlobalVBorder;
- private String[] sColumnWidth;
- private boolean bIsLongtable;
- private boolean bIsSubtable;
-
- /** <p>Constructor: Create from a TableGridModel.</p>
- */
- public TableFormatter(WriterStyleCollection wsc, TableGridModel table,
- boolean bAllowLongtable, boolean bApplyCellFormat) {
- this.wsc = wsc;
- this.table = table;
- this.bApplyCellFormat = bApplyCellFormat;
- int nRowCount = table.getRowCount();
- int nColCount = table.getColCount();
-
- // Step 1: Initialize borders:
- bHBorder = new boolean[nRowCount+1][nColCount];
- for (int nRow=0; nRow<=nRowCount; nRow++) {
- for (int nCol=0; nCol<nColCount; nCol++) {
- bHBorder[nRow][nCol] = false;
- }
- }
- bVBorder = new boolean[nRowCount][nColCount+1];
- for (int nRow=0; nRow<nRowCount; nRow++) {
- for (int nCol=0; nCol<=nColCount; nCol++) {
- bVBorder[nRow][nCol] = false;
- }
- }
-
- // Step 2: Collect borders from cell styles:
- for (int nRow=0; nRow<nRowCount; nRow++) {
- int nCol = 0;
- while (nCol<nColCount) {
- Node cell = table.getCell(nRow,nCol);
- String sStyleName = Misc.getAttribute(cell,XMLString.TABLE_STYLE_NAME);
- StyleWithProperties style = wsc.getCellStyle(sStyleName);
- int nColSpan = Misc.getPosInteger(Misc.getAttribute(cell,
- XMLString.TABLE_NUMBER_COLUMNS_SPANNED),1);
- boolean bLeft = false;
- boolean bRight = false;
- boolean bTop = false;
- boolean bBottom = false;
- if (style!=null) {
- String sBorder = style.getProperty(XMLString.FO_BORDER);
- if (sBorder!=null && !"none".equals(sBorder)) {
- bLeft = true; bRight = true; bTop = true; bBottom = true;
- }
- sBorder = style.getProperty(XMLString.FO_BORDER_LEFT);
- if (sBorder!=null && !"none".equals(sBorder)) {
- bLeft = true;
- }
- sBorder = style.getProperty(XMLString.FO_BORDER_RIGHT);
- if (sBorder!=null && !"none".equals(sBorder)) {
- bRight = true;
- }
- sBorder = style.getProperty(XMLString.FO_BORDER_TOP);
- if (sBorder!=null && !"none".equals(sBorder)) {
- bTop = true;
- }
- sBorder = style.getProperty(XMLString.FO_BORDER_BOTTOM);
- if (sBorder!=null && !"none".equals(sBorder)) {
- bBottom = true;
- }
- }
- bVBorder[nRow][nCol] |= bLeft;
- bVBorder[nRow][nCol+nColSpan] |= bRight;
- do {
- bHBorder[nRow][nCol] |= bTop;
- bHBorder[nRow+1][nCol] |= bBottom;
- nCol++;
- } while (--nColSpan>0);
- }
- }
-
- // Step 3: Remove outer borders if this is a subtable
- bIsSubtable = XMLString.TABLE_SUB_TABLE.equals(table.getTableNode().getNodeName());
-/* if (bIsSubtable) {
- for (int nRow=0; nRow<nRowCount; nRow++) {
- bVBorder[nRow][0] = false; // outer left
- bVBorder[nRow][nColCount] = false; // outer right
- }
- for (int nCol=0; nCol<nColCount; nCol++) {
- bHBorder[0][nCol] = false; // outer top
- bHBorder[nRowCount][nCol] = false; // outer bottom
- }
- }*/
-
- // Step 4: Create global vertical borders based on simple majority
- // (in order to minimize the number of \multicolum{1} entries)
- bGlobalVBorder = new boolean[nColCount+1];
- for (int nCol=0; nCol<=nColCount; nCol++) {
- int nBalance = 0;
- for (int nRow=0; nRow<nRowCount; nRow++) {
- nBalance += bVBorder[nRow][nCol] ? 1 : -1;
- }
- bGlobalVBorder[nCol] = nBalance>0;
- }
-
- // Step 5: Read column style information
- sColumnWidth = new String[nColCount];
- for (int nCol=0; nCol<nColCount; nCol++) {
- StyleWithProperties colStyle
- = wsc.getColumnStyle(table.getCol(nCol).getStyleName());
- if (colStyle!=null) {
- sColumnWidth[nCol]
- = colStyle.getProperty(XMLString.STYLE_COLUMN_WIDTH);
- }
- if (sColumnWidth[nCol]==null) { // Emergency! should never happen!
- sColumnWidth[nCol]="2cm";
- }
- }
-
- // Step 6: Check to see, if this should be a longtable
- String sStyleName = Misc.getAttribute(table.getTableNode(),XMLString.TABLE_STYLE_NAME);
- StyleWithProperties style = wsc.getTableStyle(sStyleName);
- bIsLongtable = (!bIsSubtable) && bAllowLongtable &&
- !"false".equals(style.getProperty(XMLString.STYLE_MAY_BREAK_BETWEEN_ROWS));
-
- }
-
- /** is this a longtable? */
- public boolean isLongtable() { return bIsLongtable; }
-
- /** is this a subtable? (tbd: really belongs in TGM, move it there..) */
- public boolean isSubtable() { return bIsSubtable; }
-
- /**
- * <p>Create table environment based on table style.</p>
- * <p>Returns eg. "\begin{longtable}{p{2cm}|p{4cm}}", "\end{longtable}".</p>
- */
- public void applyTableStyle(BeforeAfter ba) {
- // Read formatting info from table style
- // Only supported properties are alignment and may-break-between-rows.
- String sStyleName = Misc.getAttribute(table.getTableNode(),XMLString.TABLE_STYLE_NAME);
- StyleWithProperties style = wsc.getTableStyle(sStyleName);
- char cAlign = 'c';
- if (style!=null && !bIsSubtable) {
- String s = style.getProperty(XMLString.TABLE_ALIGN);
- if ("left".equals(s)) { cAlign='l'; }
- else if ("right".equals(s)) { cAlign='r'; }
- }
-
- // Create table declaration
- if (bIsLongtable) {
- ba.add("\\begin{longtable}["+cAlign+"]", "\\end{longtable}");
- }
- else if (!bIsSubtable) {
- String s="center";
- switch (cAlign) {
- case 'c': s="center"; break;
- case 'r': s="flushright"; break;
- case 'l': s="flushleft";
- }
- ba.add("\\begin{"+s+"}\\begin{tabular}","\\end{tabular}\\end{"+s+"}");
- }
- else { // subtables should occupy the entire width, including padding!
- ba.add("\\hspace*{-\\tabcolsep}\\begin{tabular}",
- "\\end{tabular}\\hspace*{-\\tabcolsep}");
- }
-
- // columns
- ba.add("{","");
- if (bGlobalVBorder[0]) { ba.add("|",""); }
- int nColCount = table.getColCount();
- for (int nCol=0; nCol<nColCount; nCol++){
- // note: The column width in OOo includes padding, which we subtract
- ba.add("p{"+Misc.add(sColumnWidth[nCol],"-0.2cm")+"}","");
- if (bGlobalVBorder[nCol+1]) { ba.add("|",""); }
- }
- ba.add("}","");
- }
-
- /** <p>Create interrow material</p> */
- public String getInterrowMaterial(int nRow) {
- int nColCount = table.getColCount();
- int nCount = 0;
- for (int nCol=0; nCol<nColCount; nCol++) {
- if (bHBorder[nRow][nCol]) { nCount++; }
- }
- if (nCount==0) { // no borders at this row
- return "";
- }
- else if (nCount==nColCount) { // complete set of borders
- return "\\hline";
- }
- else { // individual borders for each column
- StringBuffer buf = new StringBuffer();
- boolean bInCline = false;
- for (int nCol=0; nCol<nColCount; nCol++) {
- if (bInCline && !bHBorder[nRow][nCol]) { // close \cline
- buf.append(nCol).append("}");
- bInCline = false;
- }
- else if (!bInCline && bHBorder[nRow][nCol]) { // open \cline
- buf.append("\\cline{").append(nCol+1).append("-");
- bInCline = true;
- }
- }
- if (bInCline) { buf.append(nColCount).append("}"); }
- return buf.toString();
- }
- }
-
- /** <p>Get material to put before and after a table cell.
- * In case of columnspan or different borders this will contain a \multicolumn command.
- * If bApplyCellFormat is true, there will be a minipage environment</p>
- */
- public void applyCellStyle(int nRow, int nCol, BeforeAfter ba) {
- Node cell = table.getCell(nRow,nCol);
- int nColSpan = Misc.getPosInteger(Misc.getAttribute(cell,
- XMLString.TABLE_NUMBER_COLUMNS_SPANNED),1);
- // Construct column declaration as needed
- boolean bNeedLeft = (nCol==0) && (bVBorder[nRow][0]!=bGlobalVBorder[0]);
- boolean bNeedRight = bVBorder[nRow][nCol+1]!=bGlobalVBorder[nCol+1];
- // calculate column width
- String sTotalColumnWidth = sColumnWidth[nCol];
- for (int i=nCol+1; i<nCol+nColSpan; i++) {
- sTotalColumnWidth = Misc.add(sTotalColumnWidth,sColumnWidth[i]);
- }
- sTotalColumnWidth = Misc.add(sTotalColumnWidth,"-0.2cm");
-
- if (bNeedLeft || bNeedRight || nColSpan>1) {
- ba.add("\\multicolumn{"+nColSpan+"}{","");
- if (nCol==0 && bVBorder[nRow][0]) { ba.add("|",""); }
- ba.add("p{"+sTotalColumnWidth+"}","");
- if (bVBorder[nRow][nCol+nColSpan]) { ba.add("|",""); }
- ba.add("}{","}");
- }
-
- if (bApplyCellFormat) {
- StyleWithProperties style = wsc.getCellStyle(Misc.getAttribute(cell,XMLString.TABLE_STYLE_NAME));
- String sValign = "c";
- if (style!=null) {
- String s = style.getProperty(XMLString.FO_VERTICAL_ALIGN);
- if ("".equals(s)) { sValign = "b"; } // seems that empty means top??
- else if ("top".equals(s)) { sValign = "b"; }
- else if ("bottom".equals(s)) { sValign = "t"; }
- }
-
- ba.add("\\begin{minipage}["+sValign+"]{"+sTotalColumnWidth+"}","\\end{minipage}");
- }
- }
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/TableStyleConverter.java b/xmerge/source/writer2latex/source/writer2latex/latex/style/TableStyleConverter.java
deleted file mode 100644
index 159996cd6a3a..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/TableStyleConverter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/************************************************************************
- *
- * TableStyleConverter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-09-17)
- *
- */
-
-package writer2latex.latex.style;
-
-import writer2latex.util.*;
-import writer2latex.office.*;
-import writer2latex.latex.LaTeXDocumentPortion;
-import writer2latex.latex.ConverterPalette;
-
-/** <p>This class creates LaTeX code from OOo table styles.
- */
-public class TableStyleConverter extends StyleConverter {
-
- private boolean bNeedLongtable = false;
- private boolean bContainsTables = false;
-
- /** <p>Constructs a new <code>TableStyleConverter</code>.</p>
- */
- public TableStyleConverter(WriterStyleCollection wsc, Config config,
- ConverterPalette palette) {
- super(wsc,config,palette);
- }
-
- public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl) {
- if (bNeedLongtable) { pack.append("\\usepackage{longtable}").nl(); }
- // Set padding for table cells (1mm is default in OOo!)
- // For vertical padding we can only specify a relative size
- if (bContainsTables) {
- decl.append("\\setlength\\tabcolsep{1mm}").nl();
- decl.append("\\renewcommand\\arraystretch{1.3}").nl();
- }
- }
-
- public TableFormatter getTableFormatter(TableGridModel table,
- boolean bAllowLongtable, boolean bApplyCellFormat) {
-
- TableFormatter formatter = new TableFormatter(wsc,table,bAllowLongtable,bApplyCellFormat);
- bContainsTables = true;
- bNeedLongtable |= formatter.isLongtable();
- return formatter;
- }
-
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/latex/style/symbols.xml b/xmerge/source/writer2latex/source/writer2latex/latex/style/symbols.xml
deleted file mode 100644
index 57ba32cb910c..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/latex/style/symbols.xml
+++ /dev/null
@@ -1,3154 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- This is a datafile used by Writer2LaTeX
- Version 0.4b (2006-11-03)
-
- The definitions for greek characters are contributed by interzone, info@interzone.gr
- and extended by Johannis Likos. Additional bugfixes by Alexej Kryukov
- The definitions 8-bit IPA fonts are contributed by Gavin McCullagh
-
- Some definitions, eg. cyrillic and tipa are taken from Dominique Unruhs ucs.sty
- Some definitions are taken from "The comprehensive LaTeX symbol list",
- maintained by Scott Pakin
- The mappings from Wingdings to unicode are taken from Alan Wood
- (http://www.alanwood.net/demos/wingdings.html)
--->
-<symbols>
-
-<!--
-****************************************
-PART I: Common symbols, ascii only
-****************************************
--->
-
-<symbol-set name="ascii" fontenc="any">
-<!-- control (temporary) -->
-<symbol char="A" text="" math=""/>
-
-<!-- Unicode block: Basic Latin -->
-<symbol char="0020" text=" " math=" "/>
-<symbol char="0021" text="!" math="!"/>
-<symbol char="0022" text="{\textquotedbl}"/>
-<symbol char="0023" text="\#" math="\#"/>
-<symbol char="0024" text="\$" math="\$"/>
-<symbol char="0025" text="\%" math="\%"/>
-<symbol char="0026" text="\&amp;" math="\&amp;"/>
-<symbol char="0027" text="{\textquotesingle}"/>
-<symbol char="0028" text="(" math="("/>
-<symbol char="0029" text=")" math=")"/>
-<symbol char="002A" text="*" math="*"/>
-<symbol char="002B" text="+" math="+"/>
-<symbol char="002C" text="," math=","/>
-<symbol char="002D" text="{}-" math="-"/>
-<symbol char="002E" text="." math="."/>
-<symbol char="002F" text="/" math="/"/>
-<symbol char="0030" text="0" math="0"/>
-<symbol char="0031" text="1" math="1"/>
-<symbol char="0032" text="2" math="2"/>
-<symbol char="0033" text="3" math="3"/>
-<symbol char="0034" text="4" math="4"/>
-<symbol char="0035" text="5" math="5"/>
-<symbol char="0036" text="6" math="6"/>
-<symbol char="0037" text="7" math="7"/>
-<symbol char="0038" text="8" math="8"/>
-<symbol char="0039" text="9" math="9"/>
-<symbol char="003A" text=":" math=":"/>
-<symbol char="003B" text=";" math=";"/>
-<symbol char="003C" text="{\textless}" math="&lt;"/>
-<symbol char="003D" text="=" math="="/>
-<symbol char="003E" text="{\textgreater}" math="&gt;"/>
-<symbol char="003F" text="?" math="?"/>
-<symbol char="0040" text="@" math="@"/>
-<symbol-subset fontenc="T1 T2A">
-<symbol char="0041" text="A" math="A"/>
-<symbol char="0042" text="B" math="B"/>
-<symbol char="0043" text="C" math="C"/>
-<symbol char="0044" text="D" math="D"/>
-<symbol char="0045" text="E" math="E"/>
-<symbol char="0046" text="F" math="F"/>
-<symbol char="0047" text="G" math="G"/>
-<symbol char="0048" text="H" math="H"/>
-<symbol char="0049" text="I" math="I"/>
-<symbol char="004A" text="J" math="J"/>
-<symbol char="004B" text="K" math="K"/>
-<symbol char="004C" text="L" math="L"/>
-<symbol char="004D" text="M" math="M"/>
-<symbol char="004E" text="N" math="N"/>
-<symbol char="004F" text="O" math="O"/>
-<symbol char="0050" text="P" math="P"/>
-<symbol char="0051" text="Q" math="Q"/>
-<symbol char="0052" text="R" math="R"/>
-<symbol char="0053" text="S" math="S"/>
-<symbol char="0054" text="T" math="T"/>
-<symbol char="0055" text="U" math="U"/>
-<symbol char="0056" text="V" math="V"/>
-<symbol char="0057" text="W" math="W"/>
-<symbol char="0058" text="X" math="X"/>
-<symbol char="0059" text="Y" math="Y"/>
-<symbol char="005A" text="Z" math="Z"/>
-</symbol-subset>
-<symbol char="005B" text="[" math="["/>
-<symbol char="005C" text="{\textbackslash}" math="{\backslash}"/>
-<symbol char="005D" text="]" math="]"/>
-<symbol char="005E" text="\^{}" math="\hat{}"/>
-<symbol char="005F" text="\_" math="\_"/>
-<symbol char="0060" text="{\textasciigrave}" math="\grave{}"/>
-<symbol-subset fontenc="T1 T2A">
-<symbol char="0061" text="a" math="a"/>
-<symbol char="0062" text="b" math="b"/>
-<symbol char="0063" text="c" math="c"/>
-<symbol char="0064" text="d" math="d"/>
-<symbol char="0065" text="e" math="e"/>
-<symbol char="0066" text="f" math="f"/>
-<symbol char="0067" text="g" math="g"/>
-<symbol char="0068" text="h" math="h"/>
-<symbol char="0069" text="i" math="i"/>
-<symbol char="006A" text="j" math="j"/>
-<symbol char="006B" text="k" math="k"/>
-<symbol char="006C" text="l" math="l"/>
-<symbol char="006D" text="m" math="m"/>
-<symbol char="006E" text="n" math="n"/>
-<symbol char="006F" text="o" math="o"/>
-<symbol char="0070" text="p" math="p"/>
-<symbol char="0071" text="q" math="q"/>
-<symbol char="0072" text="r" math="r"/>
-<symbol char="0073" text="s" math="s"/>
-<symbol char="0074" text="t" math="t"/>
-<symbol char="0075" text="u" math="u"/>
-<symbol char="0076" text="v" math="v"/>
-<symbol char="0077" text="w" math="w"/>
-<symbol char="0078" text="x" math="x"/>
-<symbol char="0079" text="y" math="y"/>
-<symbol char="007A" text="z" math="z"/>
-</symbol-subset>
-<symbol char="007B" text="\{" math="\{"/>
-<symbol char="007C" text="{\textbar}" math="|"/>
-<symbol char="007D" text="\}" math="\}"/>
-<symbol char="007E" text="\~{}" math="\tilde{}"/>
-<symbol char="007F" text="" math=""/>
-
-<!-- Unicode Block: Latin-1 Supplement -->
-<symbol char="00A0" text="~"/>
-<symbol-subset fontenc="T1">
-<symbol char="00A1" text="!`" />
-</symbol-subset>
-<symbol char="00A2" text="{\textcent}"/>
-<symbol char="00A3" text="{\pounds}" math="{\pounds}"/>
-<symbol char="00A4" text="{\textcurrency}"/>
-<symbol char="00A5" text="{\textyen}"/>
-<symbol char="00A6" text="{\textbrokenbar}"/>
-<symbol char="00A7" text="{\S}" math="{\S}"/>
-<symbol char="00A8" text="{\textasciidieresis}" math="\ddot{}"/>
-<symbol char="00A9" text="{\textcopyright}"/>
-<symbol char="00AA" text="{\textordfeminine}"/>
-<symbol char="00AB" text="{\guillemotleft}"/>
-<symbol char="00AC" text="{\textlnot}" math="{\lnot}"/>
-<symbol char="00AD" text="\-"/>
-<symbol char="00AE" text="{\textregistered}"/>
-<symbol char="00AF" text="{\textasciimacron}" math="\bar{}"/>
-<symbol char="00B0" text="{\textdegree}" math="{}^{\circ}"/>
-<symbol char="00B1" text="{\textpm}" math="{\pm}"/>
-<symbol char="00B2" text="{\texttwosuperior}" math="^2"/>
-<symbol char="00B3" text="{\textthreesuperior}" math="^3"/>
-<symbol char="00B4" text="{\textasciiacute}" math="\acute{}"/>
-<symbol char="00B5" text="{\textmu}" math="{\mu}"/>
-<symbol char="00B6" text="{\P}" math="{\P}"/>
-<symbol char="00B7" text="{\textperiodcentered}" math="{\cdot}"/>
-<symbol char="00B8" text="\c{}"/>
-<symbol char="00B9" text="{\textonesuperior}" math="^1"/>
-<symbol char="00BA" text="{\textordmasculine}"/>
-<symbol char="00BB" text="{\guillemotright}"/>
-<symbol char="00BC" text="{\textonequarter}" math="\frac14"/>
-<symbol char="00BD" text="{\textonehalf}" math="\frac12"/>
-<symbol char="00BE" text="{\textthreequarters}" math="\frac34"/>
-<symbol-subset fontenc="T1">
-<symbol char="00BF" text="?`"/>
-<symbol char="00C0" text="\`A" />
-<symbol char="00C1" text="\'A" />
-<symbol char="00C2" text="\^A" />
-<symbol char="00C3" text="\~A" />
-<symbol char="00C4" text='\"A' />
-<symbol char="00C5" text="{\AA}" />
-<symbol char="00C6" text="{\AE}" />
-<symbol char="00C7" text="\c{C}" />
-<symbol char="00C8" text="\`E" />
-<symbol char="00C9" text="\'E" />
-<symbol char="00CA" text="\^E" />
-<symbol char="00CB" text='\"E' />
-<symbol char="00CC" text="\`I" />
-<symbol char="00CD" text="\'I" />
-<symbol char="00CE" text="\^I" />
-<symbol char="00CF" text='\"I' />
-<symbol char="00D0" text="{\DH}" />
-<symbol char="00D1" text="\~N" />
-<symbol char="00D2" text="\`O" />
-<symbol char="00D3" text="\'O" />
-<symbol char="00D4" text="\^O" />
-<symbol char="00D5" text="\~O" />
-<symbol char="00D6" text='\"O' />
-</symbol-subset>
-<symbol char="00D7" text="{\texttimes}" math="{\times}" />
-<symbol-subset fontenc="T1">
-<symbol char="00D8" text="{\O}" />
-<symbol char="00D9" text="\`U" />
-<symbol char="00DA" text="\'U" />
-<symbol char="00DB" text="\^U" />
-<symbol char="00DC" text='\"U' />
-<symbol char="00DD" text="\'Y" />
-<symbol char="00DE" text="{\TH}" />
-<symbol char="00DF" text="{\ss}" />
-<symbol char="00E0" text="\`a" />
-<symbol char="00E1" text="\'a" />
-<symbol char="00E2" text="\^a" />
-<symbol char="00E3" text="\~a" />
-<symbol char="00E4" text='\"a' />
-<symbol char="00E5" text="{\aa}" />
-<symbol char="00E6" text="{\ae}" />
-<symbol char="00E7" text="\c{c}" />
-<symbol char="00E8" text="\`e" />
-<symbol char="00E9" text="\'e" />
-<symbol char="00EA" text="\^e" />
-<symbol char="00EB" text='\"e' />
-<symbol char="00EC" text="\`i" />
-<symbol char="00ED" text="\'i" />
-<symbol char="00EE" text="\^i" />
-<symbol char="00EF" text='\"i' />
-<symbol char="00F0" text="{\dh}" />
-<symbol char="00F1" text="\~n" />
-<symbol char="00F2" text="\`o" />
-<symbol char="00F3" text="\'o" />
-<symbol char="00F4" text="\^o" />
-<symbol char="00F5" text="\~o" />
-<symbol char="00F6" text='\"o' />
-</symbol-subset>
-<symbol char="00F7" text="{\textdiv}" math="{\div}" />
-<symbol-subset fontenc="T1">
-<symbol char="00F8" text="{\o}" />
-<symbol char="00F9" text="\`u" />
-<symbol char="00FA" text="\'u" />
-<symbol char="00FB" text="\^u" />
-<symbol char="00FC" text='\"u' />
-<symbol char="00FD" text="\'y" />
-<symbol char="00FE" text="{\th}" />
-<symbol char="00FF" text='\"y' />
-
-<!-- Unicode block: Latin Extended-A -->
-<symbol char="0100" text="\=A" />
-<symbol char="0101" text="\=a" />
-<symbol char="0102" text="\u{A}" />
-<symbol char="0103" text="\u{a}" />
-<symbol char="0104" text="\k{A}" />
-<symbol char="0105" text="\k{a}" />
-<symbol char="0106" text="\'C" />
-<symbol char="0107" text="\'c" />
-<symbol char="0108" text="\^C" />
-<symbol char="0109" text="\^c" />
-<symbol char="010A" text="\.C" />
-<symbol char="010B" text="\.c" />
-<symbol char="010C" text="\v{C}" />
-<symbol char="010D" text="\v{c}" />
-<symbol char="010E" text="\v{D}" />
-<symbol char="010F" text="\v{d}" />
-<symbol char="0110" text="{\DJ}" />
-<symbol char="0111" text="{\dj}" />
-<symbol char="0112" text="\=E" />
-<symbol char="0113" text="\=e" />
-<symbol char="0114" text="\u{E}" />
-<symbol char="0115" text="\u{e}" />
-<symbol char="0116" text="\.E" />
-<symbol char="0117" text="\.e" />
-<symbol char="0118" text="\k{E}" />
-<symbol char="0119" text="\k{e}" />
-<symbol char="011A" text="\v{E}" />
-<symbol char="011B" text="\v{e}" />
-<symbol char="011C" text="\^G" />
-<symbol char="011D" text="\^g" />
-<symbol char="011E" text="\u{G}" />
-<symbol char="011F" text="\u{g}" />
-<symbol char="0120" text="\.G" />
-<symbol char="0121" text="\.g" />
-<symbol char="0122" text="\c{G}" />
-<!-- missing: LATIN SMALL LETTER G WITH CEDILLA (latvian)
- would \c{g} be ok, or should the "dirty" version from ucs.sty be preferred?? -->
-<symbol char="0124" text="\^H" />
-<symbol char="0125" text="\^h" />
-<!-- missing: 126 LATIN CAPITAL LETTER H WITH STROKE (\textHbar in T4 encoding)
- 127 LATIN SMALL LETTER H WITH STROKE (\texthbar in T4 encoding, \textcrh in tipa) -->
-<symbol char="0128" text="\~I" />
-<symbol char="0129" text="\~\i" />
-<symbol char="012A" text="\=I" />
-<symbol char="012B" text="\=\i" />
-<symbol char="012C" text="\u{I}" />
-<symbol char="012D" text="\u{\i}" />
-<symbol char="012E" text="\k{I}" />
-<symbol char="012F" text="\k{i}" />
-<symbol char="0130" text="\.I" />
-<symbol char="0131" text="{\i}" />
-<symbol char="0132" text="{\IJ}" />
-<symbol char="0133" text="{\ij}" />
-<symbol char="0134" text="\^J" />
-<symbol char="0135" text="\^\j" />
-<symbol char="0136" text="\c{K}" />
-<symbol char="0137" text="\c{k}" />
-<!-- missing: 138 LATIN SMALL LETTER KRA (greenlandic) -->
-<symbol char="0139" text="\'L" />
-<symbol char="013A" text="\'l" />
-<symbol char="013B" text="\c{L}" />
-<symbol char="013C" text="\c{l}" />
-<symbol char="013D" text="\v{L}" />
-<symbol char="013E" text="\v{l}" />
-<!-- missing: 13F LATIN CAPITAL LETTER L WITH MIDDLE DOT
- 140 LATIN SMALL LETTER L WITH MIDDLE DOT
- the version from ucs.sty should be ok -->
-<symbol char="0141" text="{\L}" />
-<symbol char="0142" text="{\l}" />
-<symbol char="0143" text="\'N" />
-<symbol char="0144" text="\'n" />
-<symbol char="0145" text="\c{N}" />
-<symbol char="0146" text="\c{n}" />
-<symbol char="0147" text="\v{N}" />
-<symbol char="0148" text="\v{n}" />
-<!-- missing: 149 LATIN SMALL LETTER N PRECEDED BY APOSTROPHE (afrikaans) -->
-<symbol char="014A" text="{\NG}" />
-<symbol char="014B" text="{\ng}" />
-<symbol char="014C" text="\=O" />
-<symbol char="014D" text="\=o" />
-<symbol char="014E" text="\u{O}" />
-<symbol char="014F" text="\u{o}" />
-<symbol char="0150" text="\H{O}" />
-<symbol char="0151" text="\H{o}" />
-<symbol char="0152" text="{\OE}" />
-<symbol char="0153" text="{\oe}" />
-<symbol char="0154" text="\'R" />
-<symbol char="0155" text="\'r" />
-<symbol char="0156" text="\c{R}" />
-<symbol char="0157" text="\c{r}" />
-<symbol char="0158" text="\v{R}" />
-<symbol char="0159" text="\v{r}" />
-<symbol char="015A" text="\'S" />
-<symbol char="015B" text="\'s" />
-<symbol char="015C" text="\^S" />
-<symbol char="015D" text="\^s" />
-<symbol char="015E" text="\c{S}" />
-<symbol char="015F" text="\c{s}" />
-<symbol char="0160" text="\v{S}" />
-<symbol char="0161" text="\v{s}" />
-<symbol char="0162" text="\c{T}" />
-<symbol char="0163" text="\c{t}" />
-<symbol char="0164" text="\v{T}" />
-<symbol char="0165" text="\v{t}" />
-<!-- missing: 166 LATIN CAPITAL LETTER T WITH STROKE (\textTbar in T4 encoding)
- 167 LATIN SMALL LETTER T WITH STROKE (\texttbar in T4 encoding) -->
-<symbol char="0168" text="\~U" />
-<symbol char="0169" text="\~u" />
-<symbol char="016A" text="\=U" />
-<symbol char="016B" text="\=u" />
-<symbol char="016C" text="\u{U}" />
-<symbol char="016D" text="\u{u}" />
-<symbol char="016E" text="\r{U}" />
-<symbol char="016F" text="\r{u}" />
-<symbol char="0170" text="\H{U}" />
-<symbol char="0171" text="\H{u}" />
-<symbol char="0172" text="\k{U}" />
-<symbol char="0173" text="\k{u}" />
-<symbol char="0174" text="\^W" />
-<symbol char="0175" text="\^w" />
-<symbol char="0176" text="\^Y" />
-<symbol char="0177" text="\^y" />
-<symbol char="0178" text='\"Y' />
-<symbol char="0179" text="\'Z" />
-<symbol char="017A" text="\'z" />
-<symbol char="017B" text="\.Z" />
-<symbol char="017C" text="\.z" />
-<symbol char="017D" text="\v{Z}" />
-<symbol char="017E" text="\v{z}" />
-<!-- missing: 017F LATIN SMALL LETTER LONG S
- should be OK to replace with "s" -->
-</symbol-subset>
-
-<!-- Unicode block: Combining Diacritical Marks -->
-<symbol-subset fontenc="T1">
-<symbol char="0300" char-type="combining" text="\`" />
-<symbol char="0301" char-type="combining" text="\'" />
-<symbol char="0302" char-type="combining" text="\^" />
-<symbol char="0303" char-type="combining" text="\~" />
-<symbol char="0304" char-type="combining" text="\=" />
-<symbol char="0306" char-type="combining" text="\u" />
-<symbol char="0307" char-type="combining" text="\." />
-<symbol char="0308" char-type="combining" text='\"' />
-<symbol char="030B" char-type="combining" text="\H" />
-<symbol char="030C" char-type="combining" text="\v" />
-</symbol-subset>
-
-<!-- Unicode block: Greek and Coptic (math mode) -->
-<symbol char="0391" math="A" />
-<symbol char="0392" math="B" />
-<symbol char="0393" math="{\Gamma}" />
-<symbol char="0394" math="{\Delta}" />
-<symbol char="0395" math="E" />
-<symbol char="0396" math="Z" />
-<symbol char="0397" math="H" />
-<symbol char="0398" math="{\Theta}" />
-<symbol char="0399" math="I" />
-<symbol char="039A" math="K" />
-<symbol char="039B" math="{\Lambda}" />
-<symbol char="039C" math="M" />
-<symbol char="039D" math="N" />
-<symbol char="039E" math="{\Xi}" />
-<symbol char="039F" math="O" />
-<symbol char="03A0" math="{\Pi}" />
-<symbol char="03A1" math="P" />
-<symbol char="03A3" math="{\Sigma}" />
-<symbol char="03A4" math="T" />
-<symbol char="03A5" math="Y" />
-<symbol char="03A6" math="{\Phi}" />
-<symbol char="03A7" math="X" />
-<symbol char="03A8" math="{\Psi}" />
-<symbol char="03A9" math="{\Omega}" />
-<symbol char="03B1" math="{\alpha}" />
-<symbol char="03B2" math="{\beta}" />
-<symbol char="03B3" math="{\gamma}" />
-<symbol char="03B4" math="{\delta}" />
-<symbol char="03B5" math="{\varepsilon}" />
-<symbol char="03B6" math="{\zeta}" />
-<symbol char="03B7" math="{\eta}" />
-<symbol char="03B8" math="{\theta}" />
-<symbol char="03B9" math="{\iota}" />
-<symbol char="03BA" math="{\kappa}" />
-<symbol char="03BB" math="{\lambda}" />
-<symbol char="03BC" math="{\mu}" />
-<symbol char="03BD" math="{\nu}" />
-<symbol char="03BE" math="{\xi}" />
-<symbol char="03BF" math="o" />
-<symbol char="03C0" math="{\pi}" />
-<symbol char="03C1" math="{\rho}" />
-<symbol char="03C2" math="{\varsigma}" />
-<symbol char="03C3" math="{\sigma}" />
-<symbol char="03C4" math="{\tau}" />
-<symbol char="03C5" math="{\upsilon}" />
-<symbol char="03C6" math="{\varphi}" />
-<symbol char="03C7" math="{\chi}" />
-<symbol char="03C8" math="{\psi}" />
-<symbol char="03C9" math="{\omega}" />
-<symbol char="03D1" math="{\vartheta}" />
-<symbol char="03D5" math="{\varphi}" />
-<symbol char="03D6" math="{\varpi}" />
-<symbol char="03DB" math="{\varsigma}" />
-<symbol char="03F1" math="{\varrho}" />
-<symbol char="03F5" math="{\epsilon}" />
-
-<!-- Unicode block: Greek and coptic (text mode) -->
-<symbol-subset fontenc="LGR">
-<!-- "Based on ISO-8859-7 -->
-<symbol char="0374" text="{\anwtonos}" /> <!-- \char'376 -->
-<symbol char="0375" text="{\katwtonos}" /> <!-- \char'377 -->
-<symbol char="037A" text="|" /> <!-- iota subscriptum, \char'174 -->
-<symbol char="037E" text="?" /> <!-- greek question mark (;) -->
-<symbol char="0384" text="&apos;" /> <!-- tonos, \char'047 -->
-<symbol char="0385" text="&apos;&quot;" /> <!-- dieresis and tonos, \char'043 -->
-<symbol char="0386" text="'A" />
-<symbol char="0387" text=";" /> <!-- ano teleia, \char'046 -->
-<symbol char="0388" text="'E" />
-<symbol char="0389" text="'H" />
-<symbol char="038A" text="'I" />
-<symbol char="038C" text="'O" />
-<symbol char="038E" text="'U" />
-<symbol char="038F" text="'W" />
-<symbol char="0390" text='&apos;"i' />
-<symbol char="0391" text="A" />
-<symbol char="0392" text="B" />
-<symbol char="0393" text="G" />
-<symbol char="0394" text="D" />
-<symbol char="0395" text="E" />
-<symbol char="0396" text="Z" />
-<symbol char="0397" text="H" />
-<symbol char="0398" text="J" />
-<symbol char="0399" text="I" />
-<symbol char="039A" text="K" />
-<symbol char="039B" text="L" />
-<symbol char="039C" text="M" />
-<symbol char="039D" text="N" />
-<symbol char="039E" text="X" />
-<symbol char="039F" text="O" />
-<symbol char="03A0" text="P" />
-<symbol char="03A1" text="R" />
-<symbol char="03A3" text="S" />
-<symbol char="03A4" text="T" />
-<symbol char="03A5" text="U" />
-<symbol char="03A6" text="F" />
-<symbol char="03A7" text="Q" />
-<symbol char="03A8" text="Y" />
-<symbol char="03A9" text="W" />
-<symbol char="03AA" text='"I' />
-<symbol char="03AB" text='"U' />
-<symbol char="03AC" text="'a" />
-<symbol char="03AD" text="'e" />
-<symbol char="03AE" text="'h" />
-<symbol char="03AF" text="'i" />
-<symbol char="03B0" text='&apos;"u' />
-<symbol char="03B1" text="a" />
-<symbol char="03B2" text="b" />
-<symbol char="03B3" text="g" />
-<symbol char="03B4" text="d" />
-<symbol char="03B5" text="e" />
-<symbol char="03B6" text="z" />
-<symbol char="03B7" text="h" />
-<symbol char="03B8" text="j" />
-<symbol char="03B9" text="i" />
-<symbol char="03BA" text="k" />
-<symbol char="03BB" text="l" />
-<symbol char="03BC" text="m" />
-<symbol char="03BD" text="n" />
-<symbol char="03BE" text="x" />
-<symbol char="03BF" text="o" />
-<symbol char="03C0" text="p" />
-<symbol char="03C1" text="r" />
-<symbol char="03C2" text="c" /> <!-- GREEK SMALL LETTER FINAL SIGMA -->
-<symbol char="03C3" text="s" />
-<symbol char="03C4" text="t" />
-<symbol char="03C5" text="u" />
-<symbol char="03C6" text="f" />
-<symbol char="03C7" text="q" />
-<symbol char="03C8" text="y" />
-<symbol char="03C9" text="w" />
-<symbol char="03CA" text='"i' />
-<symbol char="03CB" text='"u' />
-<symbol char="03CC" text="'o" />
-<symbol char="03CD" text="'u" />
-<symbol char="03CE" text="'w" />
-<!-- variant letterforms and archaic letters -->
-<!-- todo: replace $\var...$ with ordinary text letter -->
-<symbol char="03D0" text="b" /> <!-- curled beta, uses ordinary beta -->
-<symbol char="03D1" text="j" /> <!-- GREEK THETA SYMBOL -->
-<symbol char="03D2" text="U" /> <!-- GREEK UPSILON WITH HOOK SYMBOL -->
-<symbol char="03D3" text="'U" /> <!-- GREEK UPSILON WITH ACUTE AND HOOK SYMBOL -->
-<symbol char="03D4" text='"U' /> <!-- GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL -->
-<symbol char="03D5" text="f" /> <!-- $\varphi$, uses ordinary phi, GREEK PHI SYMBOL -->
-<symbol char="03D6" text="$\varpi$" /> <!-- GREEK PI SYMBOL -->
-<symbol char="03DA" text="{\Stigma}" /> <!-- \char'007, GREEK LETTER STIGMA (math mode \Stigma) -->
-<symbol char="03DB" text="{\stigma}" /> <!-- \char'006, GREEK SMALL LETTER STIGMA (math mode \stigma) -->
-<symbol char="03DC" text="{\Digamma}" /> <!-- \char'303, GREEK LETTER DIGAMMA -->
-<symbol char="03DD" text="{\ddigamma}" /> <!-- \char'223, GREEK SMAL LETTER DIGAMMA -->
-<symbol char="03DE" text="{\qoppa}" />
-<symbol char="03DF" text="{\qoppa}" /> <!-- GREEK SMALL LETTER KOPPA -->
-<symbol char="03E0" text="{\sampi}" />
-<symbol char="03E1" text="{\sampi}" /> <!-- GREEK SMALL LETTER SAMPI -->
-<symbol char="03F0" text="k" /> <!-- GREEK KAPPA SYMBOL -->
-<symbol char="03F1" text="$\varrho$" /> <!-- GREEK RHO SYMBOL -->
-<symbol char="03F4" text="J" /> <!-- GREEK THETA SYMBOL -->
-<symbol char="03F5" text="$\in$" /> <!-- GREEK LUNATE EPSILON SYMBOL -->
-<symbol char="03F6" text="$\ni$" /> <!-- GREEK REVERSED LUNATE EPSILON SYMBOL -->
-</symbol-subset>
-
-<!-- Unicode block: Cyrillic -->
-<symbol-subset fontenc="T2A">
-<symbol char="0400" text="{\`\CYRE}" />
-<symbol char="0401" text="{\CYRYO}" />
-<symbol char="0402" text="{\CYRDJE}" />
-<symbol char="0403" text="{\'\CYRG}" /> <!-- should be \CYRGJE -->
-<symbol char="0404" text="{\CYRIE}" />
-<symbol char="0405" text="{\CYRDZE}" />
-<symbol char="0406" text="{\CYRII}" />
-<symbol char="0407" text="{\CYRYI}" />
-<symbol char="0408" text="{\CYRJE}" />
-<symbol char="0409" text="{\CYRLJE}" />
-<symbol char="040A" text="{\CYRNJE}" />
-<symbol char="040B" text="{\CYRTSHE}" />
-<symbol char="040C" text="{\'\CYRK}" /> <!-- should be \CYRKJE -->
-<symbol char="040D" text="{\`\CYRI}" />
-<symbol char="040E" text="{\CYRUSHRT}" />
-<symbol char="040F" text="{\CYRDZHE}" />
-<symbol char="0410" text="{\CYRA}" />
-<symbol char="0411" text="{\CYRB}" />
-<symbol char="0412" text="{\CYRV}" />
-<symbol char="0413" text="{\CYRG}" />
-<symbol char="0414" text="{\CYRD}" />
-<symbol char="0415" text="{\CYRE}" />
-<symbol char="0416" text="{\CYRZH}" />
-<symbol char="0417" text="{\CYRZ}" />
-<symbol char="0418" text="{\CYRI}" />
-<symbol char="0419" text="{\CYRISHRT}" />
-<symbol char="041A" text="{\CYRK}" />
-<symbol char="041B" text="{\CYRL}" />
-<symbol char="041C" text="{\CYRM}" />
-<symbol char="041D" text="{\CYRN}" />
-<symbol char="041E" text="{\CYRO}" />
-<symbol char="041F" text="{\CYRP}" />
-<symbol char="0420" text="{\CYRR}" />  
-<symbol char="0421" text="{\CYRS}" />
-<symbol char="0422" text="{\CYRT}" />
-<symbol char="0423" text="{\CYRU}" />
-<symbol char="0424" text="{\CYRF}" />
-<symbol char="0425" text="{\CYRH}" />
-<symbol char="0426" text="{\CYRC}" />
-<symbol char="0427" text="{\CYRCH}" />
-<symbol char="0428" text="{\CYRSH}" />
-<symbol char="0429" text="{\CYRSHCH}" />
-<symbol char="042A" text="{\CYRHRDSN}" />
-<symbol char="042B" text="{\CYRERY}" />
-<symbol char="042C" text="{\CYRSFTSN}" />
-<symbol char="042D" text="{\CYREREV}" />
-<symbol char="042E" text="{\CYRYU}" />
-<symbol char="042F" text="{\CYRYA}" />
-<symbol char="0430" text="{\cyra}" />
-<symbol char="0431" text="{\cyrb}" />
-<symbol char="0432" text="{\cyrv}" />
-<symbol char="0433" text="{\cyrg}" />
-<symbol char="0434" text="{\cyrd}" />
-<symbol char="0435" text="{\cyre}" />
-<symbol char="0436" text="{\cyrzh}" />
-<symbol char="0437" text="{\cyrz}" />
-<symbol char="0438" text="{\cyri}" />
-<symbol char="0439" text="{\cyrishrt}" />
-<symbol char="043A" text="{\cyrk}" />
-<symbol char="043B" text="{\cyrl}" />
-<symbol char="043C" text="{\cyrm}" />
-<symbol char="043D" text="{\cyrn}" />
-<symbol char="043E" text="{\cyro}" />
-<symbol char="043F" text="{\cyrp}" />
-<symbol char="0440" text="{\cyrr}" />
-<symbol char="0441" text="{\cyrs}" />
-<symbol char="0442" text="{\cyrt}" />
-<symbol char="0443" text="{\cyru}" />
-<symbol char="0444" text="{\cyrf}" />
-<symbol char="0445" text="{\cyrh}" />
-<symbol char="0446" text="{\cyrc}" />
-<symbol char="0447" text="{\cyrch}" />
-<symbol char="0448" text="{\cyrsh}" />
-<symbol char="0449" text="{\cyrshch}" />
-<symbol char="044A" text="{\cyrhrdsn}" />
-<symbol char="044B" text="{\cyrery}" />
-<symbol char="044C" text="{\cyrsftsn}" />
-<symbol char="044D" text="{\cyrerev}" />
-<symbol char="044E" text="{\cyryu}" />
-<symbol char="044F" text="{\cyrya}" />
-<symbol char="0450" text="{\`\cyre}" />
-<symbol char="0451" text="{\cyryo}" />
-<symbol char="0452" text="{\cyrdje}" />
-<symbol char="0453" text="{\'\cyrg}" /> <!-- should be \cyrgje -->
-<symbol char="0454" text="{\cyrie}" />
-<symbol char="0455" text="{\cyrdze}" />
-<symbol char="0456" text="{\cyrii}" />
-<symbol char="0457" text="{\cyryi}" />
-<symbol char="0458" text="{\cyrje}" />
-<symbol char="0459" text="{\cyrlje}" />
-<symbol char="045A" text="{\cyrnje}" />
-<symbol char="045B" text="{\cyrtshe}" />
-<symbol char="045C" text="{\'\cyrk}" /> <!-- should be \cyrkje -->
-<symbol char="045D" text="{\`\cyri}" />
-<symbol char="045E" text="{\cyrushrt}" />
-<symbol char="045F" text="{\cyrdzhe}" />
-<symbol char="0490" text="{\CYRGUP}" />
-<symbol char="0491" text="{\cyrgup}" />
-<symbol char="0492" text="{\CYRGHCRS}" />
-<symbol char="0493" text="{\cyrghcrs}" />
-<symbol char="0496" text="{\CYRZHDSC}" />
-<symbol char="0497" text="{\cyrzhdsc}" />
-<symbol char="0498" text="{\CYRZDSC}" />
-<symbol char="0499" text="{\cyrzdsc}" />
-<symbol char="049A" text="{\CYRKDSC}" />
-<symbol char="049B" text="{\cyrkdsc}" />
-<symbol char="049C" text="{\CYRKVCRS}" />
-<symbol char="049D" text="{\cyrkvcrs}" />
-<symbol char="04A0" text="{\CYRKBEAK}" />  
-<symbol char="04A1" text="{\cyrkbeak}" />
-<symbol char="04A2" text="{\CYRNDSC}" />
-<symbol char="04A3" text="{\cyrndsc}" />
-<symbol char="04A4" text="{\CYRNG}" />
-<symbol char="04A5" text="{\cyrng}" />
-<symbol char="04AA" text="{\CYRSDSC}" />
-<symbol char="04AB" text="{\cyrsdsc}" />
-<symbol char="04AE" text="{\CYRY}" />
-<symbol char="04AF" text="{\cyry}" />
-<symbol char="04B0" text="{\CYRYHCRS}" />
-<symbol char="04B1" text="{\cyryhcrs}" />
-<symbol char="04B2" text="{\CYRHDSC}" />
-<symbol char="04B3" text="{\cyrhdsc}" />
-<symbol char="04B6" text="{\CYRCHRDSC}" />
-<symbol char="04B7" text="{\cyrchrdsc}" />
-<symbol char="04B8" text="{\CYRCHVCRS}" />
-<symbol char="04B9" text="{\cyrchvcrs}" />
-<symbol char="04BA" text="{\CYRSHHA}" />
-<symbol char="04BB" text="{\cyrshha}" />
-<symbol char="04C0" text="{\CYRpalochka}" />
-<symbol char="04C1" text="{\U\CYRZH}" />
-<symbol char="04C2" text="{\U\cyrzh}" />
-<symbol char="04D0" text="{\U\CYRA}" />
-<symbol char="04D1" text="{\U\cyra}" />
-<symbol char="04D2" text='{\"\CYRA}' />
-<symbol char="04D3" text='{\"\cyra}' />
-<symbol char="04D4" text="{\CYRAE}" />
-<symbol char="04D5" text="{\cyrae}" />
-<symbol char="04D6" text="{\U\CYRE}" />
-<symbol char="04D7" text="{\U\cyre}" />
-<symbol char="04D8" text="{\CYRSCHWA}" />
-<symbol char="04D9" text="{\cyrschwa}" />
-<symbol char="04DA" text='{\"\CYRSCHWA}' />
-<symbol char="04DB" text='{\"\cyrschwa}' />
-<symbol char="04DC" text='{\"\CYRZH}' />
-<symbol char="04DD" text='{\"\cyrzh}' />
-<symbol char="04DE" text='{\"\CYRZ}' />
-<symbol char="04DF" text='{\"\cyrz}' />
-<symbol char="04E2" text="{\=\CYRI}" />
-<symbol char="04E3" text="{\=\cyri}" />
-<symbol char="04E4" text='{\"\CYRI}' />
-<symbol char="04E5" text='{\"\cyri}' />
-<symbol char="04E6" text='{\"\CYRO}' />
-<symbol char="04E7" text='{\"\cyro}' />
-<symbol char="04E8" text="{\CYROTLD}" />
-<symbol char="04E9" text="{\cyrotld}" />
-<symbol char="04EA" text='\"\CYROTLD}' />
-<symbol char="04EB" text='\"\cyrotld}' />
-<symbol char="04EC" text='\"\CYREREV}' />
-<symbol char="04ED" text='\"\cyrerev}' />
-<symbol char="04EE" text="{\=\CYRU}" />
-<symbol char="04EF" text="{\=\cyru}" />
-<symbol char="04F0" text='{\"\CYRU}' />
-<symbol char="04F1" text='{\"\cyru}' />
-<symbol char="04F2" text="{\H\CYRU}" />
-<symbol char="04F3" text="{\H\cyru}" />
-<symbol char="04F4" text='{\"\CYRCH}' />
-<symbol char="04F5" text='{\"\cyrch}' />
-<symbol char="04F8" text='{\"\CYRERY}' />
-<symbol char="04F9" text='{\"\cyrery}' />
-</symbol-subset>
-
-<!-- Unicode block: Greek extended (polytonic greek) -->
-<symbol-subset fontenc="LGR">
-<symbol char="1F00" text="&gt;a" />
-<symbol char="1F01" text="&lt;a" />
-<symbol char="1F02" text="&gt;`a" />
-<symbol char="1F03" text="&lt;`a" />
-<symbol char="1F04" text="&gt;'a" />
-<symbol char="1F05" text="&lt;'a" />
-<symbol char="1F06" text="&gt;~a" />
-<symbol char="1F07" text="&lt;~a" />
-<symbol char="1F08" text="&gt;A" />
-<symbol char="1F09" text="&lt;A" />
-<symbol char="1F0A" text="&gt;`A" />
-<symbol char="1F0B" text="&lt;`A" />
-<symbol char="1F0C" text="&gt;'A" />
-<symbol char="1F0D" text="&lt;'A" />
-<symbol char="1F0E" text="&gt;~A" />
-<symbol char="1F0F" text="&lt;~A" />
-<symbol char="1F10" text="&gt;e" />
-<symbol char="1F11" text="&lt;e" />
-<symbol char="1F12" text="&gt;`e" />
-<symbol char="1F13" text="&lt;`e" />
-<symbol char="1F14" text="&gt;'e" />
-<symbol char="1F15" text="&lt;'e" />
-<symbol char="1F18" text="&gt;E" />
-<symbol char="1F19" text="&lt;E" />
-<symbol char="1F1A" text="&gt;`E" />
-<symbol char="1F1B" text="&lt;`E" />
-<symbol char="1F1C" text="&gt;'E" />
-<symbol char="1F1D" text="&lt;'E" />
-<symbol char="1F20" text="&gt;h" />
-<symbol char="1F21" text="&lt;h" />
-<symbol char="1F22" text="&gt;`h" />
-<symbol char="1F23" text="&lt;`h" />
-<symbol char="1F24" text="&gt;'h" />
-<symbol char="1F25" text="&lt;'h" />
-<symbol char="1F26" text="&gt;~h" />
-<symbol char="1F27" text="&lt;~h" />
-<symbol char="1F28" text="&gt;H" />
-<symbol char="1F29" text="&lt;H" />
-<symbol char="1F2A" text="&gt;`H" />
-<symbol char="1F2B" text="&lt;`H" />
-<symbol char="1F2C" text="&gt;'H" />
-<symbol char="1F2D" text="&lt;'H" />
-<symbol char="1F2E" text="&gt;~H" />
-<symbol char="1F2F" text="&lt;~H" />
-<symbol char="1F30" text="&gt;i" />
-<symbol char="1F31" text="&lt;i" />
-<symbol char="1F32" text="&gt;`i" />
-<symbol char="1F33" text="&lt;`i" />
-<symbol char="1F34" text="&gt;'i" />
-<symbol char="1F35" text="&lt;'i" />
-<symbol char="1F36" text="&gt;~i" />
-<symbol char="1F37" text="&lt;~i" />
-<symbol char="1F38" text="&gt;I" />
-<symbol char="1F39" text="&lt;I" />
-<symbol char="1F3A" text="&gt;`I" />
-<symbol char="1F3B" text="&lt;`I" />
-<symbol char="1F3C" text="&gt;'I" />
-<symbol char="1F3D" text="&lt;'I" />
-<symbol char="1F3E" text="&gt;~I" />
-<symbol char="1F3F" text="&lt;~I" />
-<symbol char="1F40" text="&gt;o" />
-<symbol char="1F41" text="&lt;o" />
-<symbol char="1F42" text="&gt;`o" />
-<symbol char="1F43" text="&lt;`o" />
-<symbol char="1F44" text="&gt;'o" />
-<symbol char="1F45" text="&lt;'o" />
-<symbol char="1F48" text="&gt;O" />
-<symbol char="1F49" text="&lt;O" />
-<symbol char="1F4A" text="&gt;`O" />
-<symbol char="1F4B" text="&lt;`O" />
-<symbol char="1F4C" text="&gt;'O" />
-<symbol char="1F4D" text="&lt;'O" />
-<symbol char="1F50" text="&gt;u" />
-<symbol char="1F51" text="&lt;u" />
-<symbol char="1F52" text="&gt;`u" />
-<symbol char="1F53" text="&lt;`u" />
-<symbol char="1F54" text="&gt;'u" />
-<symbol char="1F55" text="&lt;'u" />
-<symbol char="1F56" text="&gt;~u" />
-<symbol char="1F57" text="&lt;~u" />
-<symbol char="1F59" text="&lt;U" />
-<symbol char="1F5B" text="&lt;`U" />
-<symbol char="1F5D" text="&lt;'U" />
-<symbol char="1F5F" text="&lt;~U" />
-<symbol char="1F60" text="&gt;w" />
-<symbol char="1F61" text="&lt;w" />
-<symbol char="1F62" text="&gt;`w" />
-<symbol char="1F63" text="&lt;`w" />
-<symbol char="1F64" text="&gt;'w" />
-<symbol char="1F65" text="&lt;'w" />
-<symbol char="1F66" text="&gt;~w" />
-<symbol char="1F67" text="&lt;~w" />
-<symbol char="1F68" text="&gt;W" />
-<symbol char="1F69" text="&lt;W" />
-<symbol char="1F6A" text="&gt;`W" />
-<symbol char="1F6B" text="&lt;`W" />
-<symbol char="1F6C" text="&gt;'W" />
-<symbol char="1F6D" text="&lt;'W" />
-<symbol char="1F6E" text="&gt;~W" />
-<symbol char="1F6F" text="&lt;~W" />
-<symbol char="1F70" text="`a" />
-<symbol char="1F71" text="'a" />
-<symbol char="1F72" text="`e" />
-<symbol char="1F73" text="'e" />
-<symbol char="1F74" text="`h" />
-<symbol char="1F75" text="'h" />
-<symbol char="1F76" text="`i" />
-<symbol char="1F77" text="'i" />
-<symbol char="1F78" text="`o" />
-<symbol char="1F79" text="'o" />
-<symbol char="1F7A" text="`u" />
-<symbol char="1F7B" text="'u" />
-<symbol char="1F7C" text="`w" />
-<symbol char="1F7D" text="'w" />
-<symbol char="1F80" text="&gt;a|" />
-<symbol char="1F81" text="&lt;a|" />
-<symbol char="1F82" text="&gt;`a|" />
-<symbol char="1F83" text="&lt;`a|" />
-<symbol char="1F84" text="&gt;'a|" />
-<symbol char="1F85" text="&lt;'a|" />
-<symbol char="1F86" text="&gt;~a|" />
-<symbol char="1F87" text="&lt;~a|" />
-<symbol char="1F88" text="&gt;A|" />
-<symbol char="1F89" text="&lt;A|" />
-<symbol char="1F8A" text="&gt;`A|" />
-<symbol char="1F8B" text="&lt;`A|" />
-<symbol char="1F8C" text="&gt;'A|" />
-<symbol char="1F8D" text="&lt;'A|" />
-<symbol char="1F8E" text="&gt;~A|" />
-<symbol char="1F8F" text="&lt;~A|" />
-<symbol char="1F90" text="&gt;h|" />
-<symbol char="1F91" text="&lt;h|" />
-<symbol char="1F92" text="&gt;`h|" />
-<symbol char="1F93" text="&lt;`h|" />
-<symbol char="1F94" text="&gt;'h|" />
-<symbol char="1F95" text="&lt;'h|" />
-<symbol char="1F96" text="&gt;~h|" />
-<symbol char="1F97" text="&lt;~h|" />
-<symbol char="1F98" text="&gt;H|" />
-<symbol char="1F99" text="&lt;H|" />
-<symbol char="1F9A" text="&gt;`H|" />
-<symbol char="1F9B" text="&lt;`H|" />
-<symbol char="1F9C" text="&gt;'H|" />
-<symbol char="1F9D" text="&lt;'H|" />
-<symbol char="1F9E" text="&gt;~H|" />
-<symbol char="1F9F" text="&lt;~H|" />
-<symbol char="1FA0" text="&gt;w|" />
-<symbol char="1FA1" text="&lt;w|" />
-<symbol char="1FA2" text="&gt;`w|" />
-<symbol char="1FA3" text="&lt;`w|" />
-<symbol char="1FA4" text="&gt;'w|" />
-<symbol char="1FA5" text="&lt;'w|" />
-<symbol char="1FA6" text="&gt;~w|" />
-<symbol char="1FA7" text="&lt;~w|" />
-<symbol char="1FA8" text="&gt;W|" />
-<symbol char="1FA9" text="&lt;W|" />
-<symbol char="1FAA" text="&gt;`W|" />
-<symbol char="1FAB" text="&lt;`W|" />
-<symbol char="1FAC" text="&gt;'W|" />
-<symbol char="1FAD" text="&lt;'W|" />
-<symbol char="1FAE" text="&gt;~W|" />
-<symbol char="1FAF" text="&lt;~W|" />
-<symbol char="1FB0" text="\u{a}" />
-<symbol char="1FB1" text="\={a}" />
-<symbol char="1FB2" text="`a|" />
-<symbol char="1FB3" text="a|" />
-<symbol char="1FB4" text="'a|" />
-<symbol char="1FB6" text="~a" />
-<symbol char="1FB7" text="~a|" />
-<symbol char="1FB8" text="\u{A}" />
-<symbol char="1FB9" text="\={A}" />
-<symbol char="1FBA" text="`A" />
-<symbol char="1FBB" text="'A" />
-<symbol char="1FBC" text="A|" />
-<symbol char="1FBD" text="&gt;" />
-<symbol char="1FBE" text="|" />
-<symbol char="1FBF" text="&gt;" />
-<symbol char="1FC0" text="~" />
-<symbol char="1FC1" text='~"' />
-<symbol char="1FC2" text="`h|" />
-<symbol char="1FC3" text="h|" />
-<symbol char="1FC4" text="'h|" />
-<symbol char="1FC6" text="~h" />
-<symbol char="1FC7" text="~h|" />
-<symbol char="1FC8" text="`E" />
-<symbol char="1FC9" text="'E" />
-<symbol char="1FCA" text="`H" />
-<symbol char="1FCB" text="'H" />
-<symbol char="1FCC" text="H|" />
-<symbol char="1FCD" text="&gt;`" />
-<symbol char="1FCE" text="&gt;'" />
-<symbol char="1FCF" text="&gt;~" />
-<symbol char="1FD0" text="\u{i}" />
-<symbol char="1FD1" text="\={i}" />
-<symbol char="1FD2" text='`"i' />
-<symbol char="1FD3" text='&apos;"i' />
-<symbol char="1FD6" text="~i" />
-<symbol char="1FD7" text='~"i' />
-<symbol char="1FD8" text="\u{I}" />
-<symbol char="1FD9" text="\={I}" />
-<symbol char="1FDA" text="`I" />
-<symbol char="1FDB" text="'I" />
-<symbol char="1FDD" text="&lt;`" />
-<symbol char="1FDE" text="&lt;'" />
-<symbol char="1FDF" text="&lt;~" />
-<symbol char="1FE0" text="\u{u}" />
-<symbol char="1FE1" text="\={u}" />
-<symbol char="1FE2" text='`"u' />
-<symbol char="1FE3" text='&apos;"u' />
-<symbol char="1FE4" text="&lt;r" />
-<symbol char="1FE5" text="&lt;r" />
-<symbol char="1FE6" text="~u" />
-<symbol char="1FE7" text='~"u' />
-<symbol char="1FE8" text="\u{U}" />
-<symbol char="1FE9" text="\={U}" />
-<symbol char="1FEA" text="`U" />
-<symbol char="1FEB" text="'U" />
-<symbol char="1FEC" text="&lt;R" />
-<symbol char="1FED" text='`"' />
-<symbol char="1FEE" text='&apos;"' />
-<symbol char="1FEF" text="`" />
-<symbol char="1FF2" text="`w|" />
-<symbol char="1FF3" text="w|" />
-<symbol char="1FF4" text="'w|" />
-<symbol char="1FF6" text="~w" />
-<symbol char="1FF7" text="~w|" />
-<symbol char="1FF8" text="`O" />
-<symbol char="1FF9" text="'O" />
-<symbol char="1FFA" text="`W" />
-<symbol char="1FFB" text="'W" />
-<symbol char="1FFC" text="W|" />
-<symbol char="1FFD" text="'" />
-<symbol char="1FFE" text="&lt;" />
-</symbol-subset> <!-- end of polytonic greek -->
-
-<!-- Unicode block: General Punctuation -->
-<symbol char="2000" text="{\enspace}" />
-<symbol char="2001" text="{\quad}" />
-<symbol char="2002" text="{\enspace}" />
-<symbol char="2003" text="{\quad}" />
-<symbol char="2004" text="\hspace{0.333em}" />
-<symbol char="2005" text="\hspace{0.25em}" />
-<symbol char="2006" text="\hspace{0.167em}" />
-<symbol char="2009" text="\hspace{0.2em}" />
-<symbol char="200A" text="{\thinspace}" />
-<symbol char="200C" text="\textcompwordmark" />
-<symbol char="200D" text="" />
-<symbol char="2010" text="{}-" />
-<symbol char="2011" text="\nobreakdash-" /> <!-- requires ams -->
-<symbol char="2012" text="{--}" />
-<symbol char="2013" text="{--}" />
-<symbol char="2014" text="{---}" />
-<symbol char="2015" text="{---}" />
-<symbol char="2016" text="{\textbardbl}" math="\|" />
-<symbol char="2018" text="`" />
-<symbol char="2019" text="'" />
-<symbol char="201A" text="{\quotesinglbase}" />
-<symbol char="201C" text="``" />
-<symbol char="201D" text="''" />
-<symbol char="201E" text="{\quotedblbase}" />
-<symbol char="2020" text="{\dag}" math="{\dag}" />
-<symbol char="2021" text="{\ddag}" math="{\ddag}" />
-<symbol char="2022" text="{\textbullet}" math="{\bullet}" />
-<symbol char="2024" text="." />
-<symbol char="2025" text=".." />
-<symbol char="2026" text="{\dots}" math="{\dots}" />
-<symbol char="2027" text="\-" /> <!-- wrong?? -->
-<symbol char="2030" text="{\textperthousand}" />
-<symbol char="2031" text="{\textpertenthousand}" />
-<symbol char="2039" text="{\guilsinglleft}" />
-<symbol char="203A" text="{\guilsinglright}" />
-<symbol char="203B" text="{\textreferencemark}" />
-<symbol char="203C" text="!!" />
-<symbol char="203D" text="{\textinterrobang}" />
-<symbol char="2044" text="/" math="/" />
-<symbol char="2048" text="?!" />
-<symbol char="2049" text="!?" />
-
-<!-- Unicode block: Currency symbols -->
-<symbol char="20A1" text="{\textcolonmonetary}" />
-<symbol char="20A4" text="{\textlira}" />
-<symbol char="20A6" text="{\textnaira}" />
-<symbol char="20A9" text="{\textwon}" />
-<symbol char="20AB" text="{\textdong}" />
-<symbol char="20AC" text="{\texteuro}" />
-<!-- unicode block: Letterlike symbols -->
-<symbol char="2100" text="a/c" />
-<symbol char="2101" text="a/s" />
-<symbol char="2102" math="\mathbb{C}" />
-<symbol char="2103" text="{\textcelsius}" />
-<symbol char="2105" text="c/o" />
-<symbol char="2106" text="c/u" />
-<symbol char="2107" math="\mathcal{E}" />
-<symbol-subset fontenc="T1">
-<symbol char="2109" text="\textdegree F" />
-</symbol-subset>
-<symbol char="210C" math="\mathfrak{H}" />
-<symbol char="210D" math="\mathbb{H}" />
-<symbol char="210E" math="h" />
-<symbol char="210F" math="{\hbar}" />
-<symbol char="2111" math="{\Im}" />
-<symbol char="2113" math="{\ell}" />
-<symbol char="2115" math="\mathbb{N}" />
-<symbol char="2116" text="{\textnumero}" />
-<symbol char="2118" math="{\wp}" />
-<symbol char="2119" math="\mathbb{P}" />
-<symbol char="211A" math="\mathbb{Q}" />
-<symbol char="211C" math="{\Re}" />
-<symbol char="211D" math="\mathbb{R}" />
-<symbol char="211E" text="{\textrecipe}" />
-<symbol char="2120" text="{\textservicemark}" />
-<symbol-subset fontenc="T1">
-<symbol char="2121" text="\textsc{tel}" />
-</symbol-subset>
-<symbol char="2122" text="{\texttrademark}" />
-<symbol char="2124" math="\mathbb{Z}" />
-<symbol char="2126" text="{\textohm}" math="{\Omega}"/>
-<symbol char="2127" text="{\textmho}" math="\mho"/>
-<symbol char="2128" math="\mathfrak{Z}" />
-<symbol-subset fontenc="T1">
-<symbol char="212A" text="K" /> <!--Kelvin-->
-<symbol char="212B" text="{\AA}" /> <!--Ångstrøm -->
-</symbol-subset>
-<symbol char="212D" math="\mathfrak{G}" />
-<symbol char="212E" text="{\textestimated}" />
-<symbol char="2132" math="{\Finv}" />
-<symbol char="2135" math="{\aleph}" />
-<symbol char="2136" math="{\beth}" />
-<symbol char="2137" math="{\gimel}" />
-<symbol char="2138" math="{\daleth}" />
-
-<!-- Unicode block: Number forms -->
-<symbol char="2153" math="\frac13"/>
-<symbol char="2154" math="\frac23"/>
-<symbol char="2155" math="\frac15"/>
-<symbol char="2156" math="\frac25"/>
-<symbol char="2157" math="\frac35"/>
-<symbol char="2158" math="\frac45"/>
-<symbol char="2159" math="\frac16"/>
-<symbol char="215A" math="\frac56"/>
-<symbol char="215B" math="\frac18"/>
-<symbol char="215C" math="\frac38"/>
-<symbol char="215D" math="\frac58"/>
-<symbol char="215E" math="\frac78"/>
-<symbol char="215F" math="\frac1{ }"/>
-<symbol-subset fontenc="T1">
-<symbol char="2160" text="I"/>
-<symbol char="2161" text="II"/>
-<symbol char="2162" text="III"/>
-<symbol char="2163" text="IV"/>
-<symbol char="2164" text="V"/>
-<symbol char="2165" text="VI"/>
-<symbol char="2166" text="VII"/>
-<symbol char="2167" text="VIII"/>
-<symbol char="2168" text="IX"/>
-<symbol char="2169" text="X"/>
-<symbol char="216A" text="XI"/>
-<symbol char="216B" text="XII"/>
-<symbol char="216C" text="L"/>
-<symbol char="216D" text="C"/>
-<symbol char="216E" text="D"/>
-<symbol char="216F" text="M"/>
-<symbol char="2170" text="i"/>
-<symbol char="2171" text="ii"/>
-<symbol char="2172" text="iii"/>
-<symbol char="2173" text="iv"/>
-<symbol char="2174" text="v"/>
-<symbol char="2175" text="vi"/>
-<symbol char="2176" text="vii"/>
-<symbol char="2177" text="viii"/>
-<symbol char="2178" text="ix"/>
-<symbol char="2179" text="x"/>
-<symbol char="217A" text="xi"/>
-<symbol char="217B" text="xii"/>
-<symbol char="217C" text="l"/>
-<symbol char="217D" text="c"/>
-<symbol char="217E" text="d"/>
-<symbol char="217F" text="m"/>
-</symbol-subset>
-
-<!-- Unicode block: Arrows -->
-<symbol char="2190" math="{\leftarrow}"/>
-<symbol char="2191" math="{\uparrow}"/>
-<symbol char="2192" math="{\rightarrow}"/>
-<symbol char="2193" math="{\downarrow}"/>
-<symbol char="2194" math="{\leftrightarrow}"/>
-<symbol char="2195" math="{\updownarrow}"/>
-<symbol char="2196" math="{\nwarrow}"/>
-<symbol char="2197" math="{\nearrow}"/>
-<symbol char="2198" math="{\searrow}"/>
-<symbol char="2199" math="{\searrow}"/>
-<symbol char="219A" math="{\nleftarrow}"/>
-<symbol char="219B" math="{\nrightarrow}"/>
-<symbol char="219D" math="{\leadsto}"/>
-<symbol char="219E" math="{\twoheadleftarrow}"/>
-<symbol char="21A0" math="{\twoheadrightarrow}"/>
-<symbol char="21A2" math="{\leftarrowtail}"/>
-<symbol char="21A3" math="{\rightarrowtail}"/>
-<symbol char="21A6" math="{\mapsto}"/>
-<symbol char="21A9" math="{\hookleftarrow}"/>
-<symbol char="21AA" math="{\hookrightarrow}"/>
-<symbol char="21AB" math="{\looparrowleft}"/>
-<symbol char="21AC" math="{\looparrowright}"/>
-<symbol char="21AD" math="{\leftrightsquigarrow}"/>
-<symbol char="21AE" math="{\nleftrightarrow}"/>
-<symbol char="21B0" math="{\Lsh}"/>
-<symbol char="21B1" math="{\Rsh}"/>
-<symbol char="21B6" math="{\curvearrowleft}"/>
-<symbol char="21B7" math="{\curvearrowright}"/>
-<symbol char="21BA" math="{\circlearrowleft}"/>
-<symbol char="21BB" math="{\circlearrowright}"/>
-<symbol char="21BC" math="{\leftharpoonup}"/>
-<symbol char="21BD" math="{\leftharpoondown}"/>
-<symbol char="21BE" math="{\upharpoonright}"/>
-<symbol char="21BF" math="{\upharpoonleft}"/>
-<symbol char="21C0" math="{\rightharpoonup}"/>
-<symbol char="21C1" math="{\rightharpoondown}"/>
-<symbol char="21C2" math="{\downharpoonright}"/>
-<symbol char="21C3" math="{\downharpoonleft}"/>
-<symbol char="21C4" math="{\rightleftarrows}"/>
-<symbol char="21C6" math="{\leftrightarrows}"/>
-<symbol char="21C7" math="{\leftleftarrows}"/>
-<symbol char="21C8" math="{\upuparrows}"/>
-<symbol char="21C9" math="{\rightrightarrows}"/>
-<symbol char="21CA" math="{\downdownarrows}"/>
-<symbol char="21CB" math="{\leftrightharpoons}"/>
-<symbol char="21CC" math="{\rightleftharpoons}"/>
-<symbol char="21CD" math="{\nLeftarrow}"/>
-<symbol char="21CE" math="{\nLeftrightarrow}"/>
-<symbol char="21CF" math="{\nRightarrow}"/>
-<symbol char="21D0" math="{\Leftarrow}"/>
-<symbol char="21D1" math="{\Uparrow}"/>
-<symbol char="21D2" math="{\Rightarrow}"/>
-<symbol char="21D3" math="{\Downarrow}"/>
-<symbol char="21D4" math="{\Leftrightarrow}"/>
-<symbol char="21D5" math="{\Updownarrow}"/>
-<symbol char="21DA" math="{\Lleftarrow}"/>
-<symbol char="21DD" math="{\rightsquigarrow}"/>
-<symbol char="21E0" math="{\dashleftarrow}"/>
-<symbol char="21E2" math="{\dashrightarrow}"/>
-
-<!-- Unicode block: Mathematical Operators -->
-<symbol char="2200" math="{\forall}"/>
-<symbol char="2201" math="{\complement}"/>
-<symbol char="2202" math="{\partial}"/>
-<symbol char="2203" math="{\exists}"/>
-<symbol char="2204" math="{\nexists}"/>
-<symbol char="2205" math="{\emptyset}"/>
-<symbol char="2206" math="{\Delta}"/>
-<symbol char="2207" math="{\nabla}"/>
-<symbol char="2208" math="{\in}"/>
-<symbol char="2209" math="{\notin}"/>
-<symbol char="220A" math="{\in}"/>
-<symbol char="220B" math="{\ni}"/>
-<symbol char="220C" math="{\not\ni}"/>
-<symbol char="220D" math="{\ni}"/>
-<symbol char="220E" math="{\blacksquare}"/>
-<symbol char="220F" math="{\prod}"/>
-<symbol char="2210" math="{\amalg}"/>
-<symbol char="2211" math="{\sum}"/>
-<symbol char="2212" math="-"/>
-<symbol char="2213" math="{\mp}"/>
-<symbol char="2214" math="{\dotplus}"/>
-<symbol char="2215" math="/"/>
-<symbol char="2216" math="{\setminus}"/>
-<symbol char="2217" math="{\ast}" text="{\textasteriskcentered}"/>
-<symbol char="2218" math="{\circ}" text="{\textopenbullet}"/>
-<symbol char="2219" math="{\bullet}" text="{\textbullet}"/>
-<symbol char="221A" math="{\surd}"/>
-<symbol char="221B" math="\sqrt[3]{}"/>
-<symbol char="221C" math="\sqrt[4]{}"/>
-<symbol char="221D" math="{\propto}"/>
-<symbol char="221E" math="{\infty}"/>
-<symbol char="2220" math="{\angle}"/>
-<symbol char="2221" math="{\measuredangle}"/>
-<symbol char="2222" math="{\sphericalangle}"/>
-<symbol char="2223" math="{\mid}" text="{\textbar}"/>
-<symbol char="2224" math="{\nmid}"/>
-<symbol char="2225" math="{\parallel}" text="{\textbardbl}"/>
-<symbol char="2226" math="{\nparallel}"/>
-<symbol char="2227" math="{\wedge}"/>
-<symbol char="2228" math="{\vee}"/>
-<symbol char="2229" math="{\cap}"/>
-<symbol char="222A" math="{\cup}"/>
-<symbol char="222B" math="{\int}"/>
-<symbol char="222C" math="{\iint}"/>
-<symbol char="222D" math="{\iiint}"/>
-<symbol char="222E" math="{\oint}"/>
-<symbol char="222F" math="{\oiint}"/>
-<symbol char="2230" math="{\oiiint}"/>
-<symbol char="2234" math="{\therefore}"/>
-<symbol char="2235" math="{\because}"/>
-<symbol char="2236" math=":"/>
-<symbol char="2237" math="::"/>
-<symbol char="2238" math="\stackrel{.}{-}"/>
-<symbol char="2239" math="-:"/>
-<symbol char="223C" math="{\sim}"/>
-<symbol char="223D" math="{\backsim}"/>
-<symbol char="2240" math="{\wr}"/>
-<symbol char="2241" math="{\nsim}"/>
-<symbol char="2243" math="{\simeq}"/>
-<symbol char="2244" math="{\not\simeq}"/>
-<symbol char="2245" math="{\cong}"/>
-<symbol char="2247" math="{\ncong}"/>
-<symbol char="2248" math="{\approx}"/>
-<symbol char="2249" math="{\not\approx}"/>
-<symbol char="224A" math="{\approxeq}"/>
-<symbol char="224D" math="{\asymp}"/>
-<symbol char="224E" math="{\Bumpeq}"/>
-<symbol char="224F" math="{\bumpeq}"/>
-<symbol char="2250" math="{\doteq}"/>
-<symbol char="2251" math="{\doteqdot}"/>
-<symbol char="2252" math="{\fallingdotseq}"/>
-<symbol char="2253" math="{\risingdotseq}"/>
-<symbol char="2254" math=":="/>
-<symbol char="2255" math="=:"/>
-<symbol char="2256" math="{\eqcirc}"/>
-<symbol char="2257" math="{\circeq}"/>
-<symbol char="2258" math="\stackrel{\frown}{=}"/>
-<symbol char="2259" math="\stackrel{\wedge}{=}"/>
-<symbol char="225A" math="\stackrel{\vee}{=}"/>
-<symbol char="225B" math="\stackrel{\star}{=}"/>
-<symbol char="225C" math="{\triangleq}"/>
-<symbol char="225D" math="{\defeq}"/>
-<symbol char="225E" math="\stackrel{\mathrm{m}}{=}"/>
-<symbol char="225F" math="\stackrel{?}{=}"/>
-<symbol char="2260" math="{\neq}"/>
-<symbol char="2261" math="{\equiv}"/>
-<symbol char="2262" math="{\not\equiv}"/>
-<symbol char="2264" math="{\leq}"/>
-<symbol char="2265" math="{\geq}"/>
-<symbol char="2266" math="{\leqq}"/>
-<symbol char="2267" math="{\geqq}"/>
-<symbol char="2268" math="{\lneqq}"/>
-<symbol char="2269" math="{\gneqq}"/>
-<symbol char="226A" math="{\ll}"/>
-<symbol char="226B" math="{\gg}"/>
-<symbol char="226C" math="{\between}"/>
-<symbol char="226D" math="{\not\asymp}"/>
-<symbol char="226E" math="{\nless}"/>
-<symbol char="226F" math="{\ngtr}"/>
-<symbol char="2270" math="{\nleq}"/>
-<symbol char="2271" math="{\ngeq}"/>
-<symbol char="2272" math="{\lesssim}"/>
-<symbol char="2273" math="{\gtrsim}"/>
-<symbol char="2274" math="{\not\lesssim}"/>
-<symbol char="2275" math="{\not\gtrsim}"/>
-<symbol char="2276" math="{\lessgtr}"/>
-<symbol char="2277" math="{\gtrless}"/>
-<symbol char="2278" math="{\not\lessgtr}"/>
-<symbol char="2279" math="{\not\gtrless}"/>
-<symbol char="227A" math="{\prec}"/>
-<symbol char="227B" math="{\succ}"/>
-<symbol char="227C" math="{\preccurlyeq}"/>
-<symbol char="227D" math="{\succcurlyeq}"/>
-<symbol char="227E" math="{\precsim}"/>
-<symbol char="227F" math="{\succsim}"/>
-<symbol char="2280" math="{\nsucc}"/>
-<symbol char="2281" math="{\nprec}"/>
-<symbol char="2282" math="{\subset}"/>
-<symbol char="2283" math="{\supset}"/>
-<symbol char="2284" math="{\not\subset}"/>
-<symbol char="2285" math="{\not\supset}"/>
-<symbol char="2286" math="{\subseteq}"/>
-<symbol char="2287" math="{\supseteq}"/>
-<symbol char="2288" math="{\nsubseteq}"/>
-<symbol char="2289" math="{\nsupseteq}"/>
-<symbol char="228A" math="{\subsetneq}"/>
-<symbol char="228B" math="{\supsetneq}"/>
-<symbol char="228E" math="{\uplus}"/>
-<symbol char="228F" math="{\sqsubset}"/>
-<symbol char="2290" math="{\sqsupset}"/>
-<symbol char="2291" math="{\sqsubseteq}"/>
-<symbol char="2292" math="{\sqsupseteq}"/>
-<symbol char="2293" math="{\sqcap}"/>
-<symbol char="2294" math="{\sqcup}"/>
-<symbol char="2295" math="{\oplus}"/>
-<symbol char="2296" math="{\ominus}"/>
-<symbol char="2297" math="{\otimes}"/>
-<symbol char="2298" math="{\oslash}"/>
-<symbol char="2299" math="{\odot}"/>
-<symbol char="229A" math="{\circledcirc}"/>
-<symbol char="229B" math="{\circledast}"/>
-<symbol char="229D" math="{\circleddash}"/>
-<symbol char="229E" math="{\boxplus}"/>
-<symbol char="229F" math="{\boxminus}"/>
-<symbol char="22A0" math="{\boxtimes}"/>
-<symbol char="22A1" math="{\boxdot}"/>
-<symbol char="22A2" math="{\vdash}"/>
-<symbol char="22A3" math="{\dashv}"/>
-<symbol char="22A4" math="{\bot}"/>
-<symbol char="22A5" math="{\perp}"/>
-<symbol char="22A6" math="{\vdash}"/>
-<symbol char="22A7" math="{\vDash}"/>
-<symbol char="22A8" math="{\models}"/>
-<symbol char="22A9" math="{\Vdash}"/>
-<symbol char="22AA" math="{\Vvdash}"/>
-<symbol char="22AC" math="{\nvdash}"/>
-<symbol char="22AD" math="{\nvDash}"/>
-<symbol char="22AE" math="{\not\Vdash}"/>
-<symbol char="22AF" math="{\nVdash}"/>
-<symbol char="22B2" math="{\lhd}"/>
-<symbol char="22B3" math="{\rhd}"/>
-<symbol char="22B4" math="{\unlhd}"/>
-<symbol char="22B5" math="{\unrhd}"/>
-<symbol char="22B6" math="{\multimapdotbothA}"/>
-<symbol char="22B7" math="{\multimapdotbothB}"/>
-<symbol char="22B8" math="{\multimap}"/>
-<symbol char="22BA" math="{\intercal}"/>
-<symbol char="22BB" math="{\veebar}"/>
-<symbol char="22BC" math="{\barwedge}"/>
-<symbol char="22C0" math="{\bigwedge}"/>
-<symbol char="22C1" math="{\bigvee}"/>
-<symbol char="22C2" math="{\bigcap}"/>
-<symbol char="22C3" math="{\bigcup}"/>
-<symbol char="22C4" math="{\diamond}"/>
-<symbol char="22C5" math="{\cdot}"/>
-<symbol char="22C6" math="{\star}"/>
-<symbol char="22C7" math="{\divideontimes}"/>
-<symbol char="22C8" math="{\bowtie}"/>
-<symbol char="22C9" math="{\ltimes}"/>
-<symbol char="22CA" math="{\rtimes}"/>
-<symbol char="22CB" math="{\leftthreetimes}"/>
-<symbol char="22CC" math="{\rightthreetimes}"/>
-<symbol char="22CD" math="{\backsimeq}"/>
-<symbol char="22CE" math="{\curlyvee}"/>
-<symbol char="22CF" math="{\curlywedge}"/>
-<symbol char="22D0" math="{\Subset}"/>
-<symbol char="22D1" math="{\Supset}"/>
-<symbol char="22D2" math="{\Cap}"/>
-<symbol char="22D3" math="{\Cup}"/>
-<symbol char="22D4" math="{\pitchfork}"/>
-<symbol char="22D6" math="{\lessdot}"/>
-<symbol char="22D7" math="{\gtrdot}"/>
-<symbol char="22D8" math="{\lll}"/>
-<symbol char="22D9" math="{\ggg}"/>
-<symbol char="22DA" math="{\lesseqgtr}"/>
-<symbol char="22DB" math="{\gtreqless}"/>
-<symbol char="22DC" math="{\eqslantless}"/>
-<symbol char="22DD" math="{\eqslantgtr}"/>
-<symbol char="22DE" math="{\curlyeqprec}"/>
-<symbol char="22DF" math="{\curlyeqsucc}"/>
-<symbol char="22E0" math="{\not\curlyeqprec}"/>
-<symbol char="22E1" math="{\not\curlyeqsucc}"/>
-<symbol char="22E2" math="{\not\sqsubseteq}"/>
-<symbol char="22E3" math="{\not\sqsupseteq}"/>
-<symbol char="22E6" math="{\lnsim}"/>
-<symbol char="22E7" math="{\gnsim}"/>
-<symbol char="22E8" math="{\precnsim}"/>
-<symbol char="22E9" math="{\succnsim}"/>
-<symbol char="22EA" math="{\ntriangleleft}"/>
-<symbol char="22EB" math="{\ntriangleright}"/>
-<symbol char="22EC" math="{\ntrianglelefteq}"/>
-<symbol char="22ED" math="{\ntrianglerighteq}"/>
-<symbol char="22EE" math="{\vdots}"/>
-<symbol char="22EF" math="{\cdots}"/>
-<symbol char="22F0" math="{\ddotsup}"/>
-<symbol char="22F1" math="{\ddots}"/>
-
-<!-- Unicode block: Geometric Shapes -->
-<symbol char="25A0" math="{\blacksquare}" />
-<symbol char="25A1" math="{\square}" />
-<symbol char="25AA" math="{\blacksquare}" />
-<symbol char="25AB" math="{\square}" />
-<symbol char="25B2" math="{\blacktriangle}" />
-<symbol char="25B3" math="{\bigtriangleup}" />
-<symbol char="25B4" math="{\blacktriangle}" />
-<symbol char="25B5" math="{\triangle}" />
-<symbol char="25B6" math="{\blacktriangleright}" />
-<symbol char="25B7" math="{\triangleright}" />
-<symbol char="25B8" math="{\blacktriangleright}" />
-<symbol char="25B9" math="{\triangleright}" />
-<symbol char="25BA" math="{\blacktriangleright}" />
-<symbol char="25BB" math="{\triangleright}" />
-<symbol char="25BC" math="{\blacktriangledown}" />
-<symbol char="25BD" math="{\bigtriangledown}" />
-<symbol char="25BE" math="{\blacktriangledown}" />
-<symbol char="25BF" math="{\triangledown}" />
-<symbol char="25C0" math="{\blacktriangleleft}" />
-<symbol char="25C1" math="{\triangleleft}" />
-<symbol char="25C2" math="{\blacktriangleleft}" />
-<symbol char="25C3" math="{\triangleleft}" />
-<symbol char="25C4" math="{\blacktriangleleft}" />
-<symbol char="25C5" math="{\triangleleft}" />
-<symbol char="25C6" math="{\blacklozenge}" />
-<symbol char="25C7" math="{\lozenge}" />
-<symbol char="25CA" math="{\lozenge}" />
-<symbol char="25CB" math="{\circ}" />
-<symbol char="25CF" math="{\bullet}" />
-<symbol char="25E6" math="{\circ}" />
-<symbol char="25EF" math="{\bigcirc}" />
-<symbol char="25FB" math="{\square}" />
-<symbol char="25FC" math="{\blacksquare}" />
-<symbol char="25FD" math="{\square}" />
-<symbol char="25FE" math="{\blacksquare}" />
-
-<!-- Unicode block: Miscellaneous symbols -->
-<symbol char="2660" math="{\spadesuit}" />
-<symbol char="2661" math="{\heartsuit}" />
-<symbol char="2662" math="{\diamondsuit}" />
-<symbol char="2663" math="{\clubsuit}" />
-<symbol char="2664" math="{\spadesuit}" />
-<symbol char="2665" math="{\heartsuit}" />
-<symbol char="2666" math="{\diamondsuit}" />
-<symbol char="2667" math="{\clubsuit}" />
-<symbol char="266A" text="{\textmusicalnote}" />
-<symbol char="266D" math="{\flat}" />
-<symbol char="266E" math="{\natural}" />
-<symbol char="266F" math="{\sharp}" />
-</symbol-set> <!-- end of ascii -->
-
-<!--
-********************************************************
-PART II: Support for various input encodings
-Note: These tables specifies which characters should
-be preserved by Writer2LaTeX. Java's OutputStreamWriter
-takes care of the mapping from unicode to 8 bit encoding
-********************************************************
--->
-
-<!-- Latin 1 input encoding (ISO-8859-1) -->
-<symbol-set name="latin1" fontenc="T1">
-<!-- Unicode block: Latin-1 supplement -->
-<preserve-symbol char="00A1" mode="text" />
-<symbol-subset fontenc="any">
-<preserve-symbols first-char="00A0" last-char="00AB" mode="text" />
-<preserve-symbol char="00A3" mode="math" />
-<preserve-symbol char="00A7" mode="math" />
-<preserve-symbol char="00AC" mode="math" />
-<preserve-symbols first-char="00AD" last-char="00B0" mode="text" />
-<preserve-symbols first-char="00B1" last-char="00B3" mode="math" />
-<preserve-symbol char="00B4" mode="text" />
-<preserve-symbol char="00B5" mode="math" />
-<preserve-symbol char="00B6" mode="both" />
-<preserve-symbol char="00B8" mode="text" />
-<preserve-symbol char="00B9" mode="math" />
-<preserve-symbols first-char="00BA" last-char="00BE" mode="text" />
-</symbol-subset>
-<preserve-symbols first-char="00BF" last-char="00D6" mode="text" />
-<preserve-symbol char="00D7" mode="math" />
-<preserve-symbols first-char="00D8" last-char="00F6" mode="text" />
-<preserve-symbol char="00F7" mode="math" />
-<preserve-symbols first-char="00F8" last-char="00FF" mode="text" />
-</symbol-set> <!-- end of latin1 -->
-
-<!-- latin2 input encoding (ISO-8859-2) -->
-<symbol-set name="latin2" fontenc="T1">
-<!-- ordered by position in latin2 rather than by unicode block -->
- <preserve-symbol char="00A0" mode="text" /> <!-- 00A0: NO-BREAK SPACE -->
- <preserve-symbol char="0104" mode="text" /> <!-- 00A1: LATIN CAPITAL LETTER A WITH OGONEK -->
- <preserve-symbol char="02D8" mode="text" /> <!-- 00A2: BREVE -->
- <preserve-symbol char="0141" mode="text" /> <!-- 00A3: LATIN CAPITAL LETTER L WITH STROKE -->
- <preserve-symbol char="00A4" mode="text" /> <!-- 00A4: CURRENCY SIGN -->
- <preserve-symbol char="013D" mode="text" /> <!-- 00A5: LATIN CAPITAL LETTER L WITH CARON -->
- <preserve-symbol char="015A" mode="text" /> <!-- 00A6: LATIN CAPITAL LETTER S WITH ACUTE -->
- <preserve-symbol char="00A7" mode="text" /> <!-- 00A7: SECTION SIGN -->
- <preserve-symbol char="00A8" mode="text" /> <!-- 00A8: DIAERESIS -->
- <preserve-symbol char="0160" mode="text" /> <!-- 00A9: LATIN CAPITAL LETTER S WITH CARON -->
- <preserve-symbol char="015E" mode="text" /> <!-- 00AA: LATIN CAPITAL LETTER S WITH CEDILLA -->
- <preserve-symbol char="0164" mode="text" /> <!-- 00AB: LATIN CAPITAL LETTER T WITH CARON -->
- <preserve-symbol char="0179" mode="text" /> <!-- 00AC: LATIN CAPITAL LETTER Z WITH ACUTE -->
- <preserve-symbol char="00AD" mode="text" /> <!-- 00AD: SOFT HYPHEN -->
- <preserve-symbol char="017D" mode="text" /> <!-- 00AE: LATIN CAPITAL LETTER Z WITH CARON -->
- <preserve-symbol char="017B" mode="text" /> <!-- 00AF: LATIN CAPITAL LETTER Z WITH DOT ABOVE -->
- <preserve-symbol char="00B0" mode="text" /> <!-- 00B0: DEGREE SIGN -->
- <preserve-symbol char="0105" mode="text" /> <!-- 00B1: LATIN SMALL LETTER A WITH OGONEK -->
- <preserve-symbol char="02DB" mode="text" /> <!-- 00B2: OGONEK -->
- <preserve-symbol char="0142" mode="text" /> <!-- 00B3: LATIN SMALL LETTER L WITH STROKE -->
- <preserve-symbol char="00B4" mode="text" /> <!-- 00B4: ACUTE ACCENT -->
- <preserve-symbol char="013E" mode="text" /> <!-- 00B5: LATIN SMALL LETTER L WITH CARON -->
- <preserve-symbol char="015B" mode="text" /> <!-- 00B6: LATIN SMALL LETTER S WITH ACUTE -->
- <preserve-symbol char="02C7" mode="text" /> <!-- 00B7: CARON -->
- <preserve-symbol char="00B8" mode="text" /> <!-- 00B8: CEDILLA -->
- <preserve-symbol char="0161" mode="text" /> <!-- 00B9: LATIN SMALL LETTER S WITH CARON -->
- <preserve-symbol char="015F" mode="text" /> <!-- 00BA: LATIN SMALL LETTER S WITH CEDILLA -->
- <preserve-symbol char="0165" mode="text" /> <!-- 00BB: LATIN SMALL LETTER T WITH CARON -->
- <preserve-symbol char="017A" mode="text" /> <!-- 00BC: LATIN SMALL LETTER Z WITH ACUTE -->
- <preserve-symbol char="02DD" mode="text" /> <!-- 00BD: DOUBLE ACUTE ACCENT -->
- <preserve-symbol char="017E" mode="text" /> <!-- 00BE: LATIN SMALL LETTER Z WITH CARON -->
- <preserve-symbol char="017C" mode="text" /> <!-- 00BF: LATIN SMALL LETTER Z WITH DOT ABOVE -->
- <preserve-symbol char="0154" mode="text" /> <!-- 00C0: LATIN CAPITAL LETTER R WITH ACUTE -->
- <preserve-symbol char="00C1" mode="text" /> <!-- 00C1: LATIN CAPITAL LETTER A WITH ACUTE -->
- <preserve-symbol char="00C2" mode="text" /> <!-- 00C2: LATIN CAPITAL LETTER A WITH CIRCUMFLEX -->
- <preserve-symbol char="0102" mode="text" /> <!-- 00C3: LATIN CAPITAL LETTER A WITH BREVE -->
- <preserve-symbol char="00C4" mode="text" /> <!-- 00C4: LATIN CAPITAL LETTER A WITH DIAERESIS -->
- <preserve-symbol char="0139" mode="text" /> <!-- 00C5: LATIN CAPITAL LETTER L WITH ACUTE -->
- <preserve-symbol char="0106" mode="text" /> <!-- 00C6: LATIN CAPITAL LETTER C WITH ACUTE -->
- <preserve-symbol char="00C7" mode="text" /> <!-- 00C7: LATIN CAPITAL LETTER C WITH CEDILLA -->
- <preserve-symbol char="010C" mode="text" /> <!-- 00C8: LATIN CAPITAL LETTER C WITH CARON -->
- <preserve-symbol char="00C9" mode="text" /> <!-- 00C9: LATIN CAPITAL LETTER E WITH ACUTE -->
- <preserve-symbol char="0118" mode="text" /> <!-- 00CA: LATIN CAPITAL LETTER E WITH OGONEK -->
- <preserve-symbol char="00CB" mode="text" /> <!-- 00CB: LATIN CAPITAL LETTER E WITH DIAERESIS -->
- <preserve-symbol char="011A" mode="text" /> <!-- 00CC: LATIN CAPITAL LETTER E WITH CARON -->
- <preserve-symbol char="00CD" mode="text" /> <!-- 00CD: LATIN CAPITAL LETTER I WITH ACUTE -->
- <preserve-symbol char="00CE" mode="text" /> <!-- 00CE: LATIN CAPITAL LETTER I WITH CIRCUMFLEX -->
- <preserve-symbol char="010E" mode="text" /> <!-- 00CF: LATIN CAPITAL LETTER D WITH CARON -->
- <preserve-symbol char="0110" mode="text" /> <!-- 00D0: LATIN CAPITAL LETTER D WITH STROKE -->
- <preserve-symbol char="0143" mode="text" /> <!-- 00D1: LATIN CAPITAL LETTER N WITH ACUTE -->
- <preserve-symbol char="0147" mode="text" /> <!-- 00D2: LATIN CAPITAL LETTER N WITH CARON -->
- <preserve-symbol char="00D3" mode="text" /> <!-- 00D3: LATIN CAPITAL LETTER O WITH ACUTE -->
- <preserve-symbol char="00D4" mode="text" /> <!-- 00D4: LATIN CAPITAL LETTER O WITH CIRCUMFLEX -->
- <preserve-symbol char="0150" mode="text" /> <!-- 00D5: LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -->
- <preserve-symbol char="00D6" mode="text" /> <!-- 00D6: LATIN CAPITAL LETTER O WITH DIAERESIS -->
- <preserve-symbol char="00D7" mode="math" /> <!-- 00D7: MULTIPLICATION SIGN -->
- <preserve-symbol char="0158" mode="text" /> <!-- 00D8: LATIN CAPITAL LETTER R WITH CARON -->
- <preserve-symbol char="016E" mode="text" /> <!-- 00D9: LATIN CAPITAL LETTER U WITH RING ABOVE -->
- <preserve-symbol char="00DA" mode="text" /> <!-- 00DA: LATIN CAPITAL LETTER U WITH ACUTE -->
- <preserve-symbol char="0170" mode="text" /> <!-- 00DB: LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -->
- <preserve-symbol char="00DC" mode="text" /> <!-- 00DC: LATIN CAPITAL LETTER U WITH DIAERESIS -->
- <preserve-symbol char="00DD" mode="text" /> <!-- 00DD: LATIN CAPITAL LETTER Y WITH ACUTE -->
- <preserve-symbol char="0162" mode="text" /> <!-- 00DE: LATIN CAPITAL LETTER T WITH CEDILLA -->
- <preserve-symbol char="00DF" mode="text" /> <!-- 00DF: LATIN SMALL LETTER SHARP S -->
- <preserve-symbol char="0155" mode="text" /> <!-- 00E0: LATIN SMALL LETTER R WITH ACUTE -->
- <preserve-symbol char="00E1" mode="text" /> <!-- 00E1: LATIN SMALL LETTER A WITH ACUTE -->
- <preserve-symbol char="00E2" mode="text" /> <!-- 00E2: LATIN SMALL LETTER A WITH CIRCUMFLEX -->
- <preserve-symbol char="0103" mode="text" /> <!-- 00E3: LATIN SMALL LETTER A WITH BREVE -->
- <preserve-symbol char="00E4" mode="text" /> <!-- 00E4: LATIN SMALL LETTER A WITH DIAERESIS -->
- <preserve-symbol char="013A" mode="text" /> <!-- 00E5: LATIN SMALL LETTER L WITH ACUTE -->
- <preserve-symbol char="0107" mode="text" /> <!-- 00E6: LATIN SMALL LETTER C WITH ACUTE -->
- <preserve-symbol char="00E7" mode="text" /> <!-- 00E7: LATIN SMALL LETTER C WITH CEDILLA -->
- <preserve-symbol char="010D" mode="text" /> <!-- 00E8: LATIN SMALL LETTER C WITH CARON -->
- <preserve-symbol char="00E9" mode="text" /> <!-- 00E9: LATIN SMALL LETTER E WITH ACUTE -->
- <preserve-symbol char="0119" mode="text" /> <!-- 00EA: LATIN SMALL LETTER E WITH OGONEK -->
- <preserve-symbol char="00EB" mode="text" /> <!-- 00EB: LATIN SMALL LETTER E WITH DIAERESIS -->
- <preserve-symbol char="011B" mode="text" /> <!-- 00EC: LATIN SMALL LETTER E WITH CARON -->
- <preserve-symbol char="00ED" mode="text" /> <!-- 00ED: LATIN SMALL LETTER I WITH ACUTE -->
- <preserve-symbol char="00EE" mode="text" /> <!-- 00EE: LATIN SMALL LETTER I WITH CIRCUMFLEX -->
- <preserve-symbol char="010F" mode="text" /> <!-- 00EF: LATIN SMALL LETTER D WITH CARON -->
- <preserve-symbol char="0111" mode="text" /> <!-- 00F0: LATIN SMALL LETTER D WITH STROKE -->
- <preserve-symbol char="0144" mode="text" /> <!-- 00F1: LATIN SMALL LETTER N WITH ACUTE -->
- <preserve-symbol char="0148" mode="text" /> <!-- 00F2: LATIN SMALL LETTER N WITH CARON -->
- <preserve-symbol char="00F3" mode="text" /> <!-- 00F3: LATIN SMALL LETTER O WITH ACUTE -->
- <preserve-symbol char="00F4" mode="text" /> <!-- 00F4: LATIN SMALL LETTER O WITH CIRCUMFLEX -->
- <preserve-symbol char="0151" mode="text" /> <!-- 00F5: LATIN SMALL LETTER O WITH DOUBLE ACUTE -->
- <preserve-symbol char="00F6" mode="text" /> <!-- 00F6: LATIN SMALL LETTER O WITH DIAERESIS -->
- <preserve-symbol char="00F7" mode="math" /> <!-- 00F7: DIVISION SIGN -->
- <preserve-symbol char="0159" mode="text" /> <!-- 00F8: LATIN SMALL LETTER R WITH CARON -->
- <preserve-symbol char="016F" mode="text" /> <!-- 00F9: LATIN SMALL LETTER U WITH RING ABOVE -->
- <preserve-symbol char="00FA" mode="text" /> <!-- 00FA: LATIN SMALL LETTER U WITH ACUTE -->
- <preserve-symbol char="0171" mode="text" /> <!-- 00FB: LATIN SMALL LETTER U WITH DOUBLE ACUTE -->
- <preserve-symbol char="00FC" mode="text" /> <!-- 00FC: LATIN SMALL LETTER U WITH DIAERESIS -->
- <preserve-symbol char="00FD" mode="text" /> <!-- 00FD: LATIN SMALL LETTER Y WITH ACUTE -->
- <preserve-symbol char="0163" mode="text" /> <!-- 00FE: LATIN SMALL LETTER T WITH CEDILLA -->
- <preserve-symbol char="02D9" mode="text" /> <!-- 00FF: DOT ABOVE -->
-</symbol-set> <!-- end of latin2 -->
-
-<!-- cp1250 encoding (Microsoft Windows Eastern European) -->
-<symbol-set name="cp1250" fontenc="T1">
- <!-- ordered by position in cp1250 rather than by unicode block -->
- <!--<preserve-symbol char="20AC" mode="text" />--><!-- 80 EURO SIGN -->
- <preserve-symbol char="201A" mode="text" /> <!-- 82 SINGLE LOW-9 QUOTATION MARK -->
- <preserve-symbol char="201E" mode="text" /> <!-- 84 DOUBLE LOW-9 QUOTATION MARK -->
- <preserve-symbol char="2026" mode="text" /> <!-- 85 HORIZONTAL ELLIPSIS -->
- <preserve-symbol char="2020" mode="text" /> <!-- 86 DAGGER -->
- <preserve-symbol char="2021" mode="text" /> <!-- 87 DOUBLE DAGGER -->
- <preserve-symbol char="2030" mode="text" /> <!-- 89 PER MILLE SIGN -->
- <preserve-symbol char="0160" mode="text" /> <!-- 8A LATIN CAPITAL LETTER S WITH CARON -->
- <preserve-symbol char="2039" mode="text" /> <!-- 8B SINGLE LEFT-POINTING ANGLE QUOTATION MARK -->
- <preserve-symbol char="015A" mode="text" /> <!-- 8C LATIN CAPITAL LETTER S WITH ACUTE -->
- <preserve-symbol char="0164" mode="text" /> <!-- 8D LATIN CAPITAL LETTER T WITH CARON -->
- <preserve-symbol char="017D" mode="text" /> <!-- 8E LATIN CAPITAL LETTER Z WITH CARON -->
- <preserve-symbol char="0179" mode="text" /> <!-- 8F LATIN CAPITAL LETTER Z WITH ACUTE -->
- <preserve-symbol char="2018" mode="text" /> <!-- 91 LEFT SINGLE QUOTATION MARK -->
- <preserve-symbol char="2019" mode="text" /> <!-- 92 RIGHT SINGLE QUOTATION MARK -->
- <preserve-symbol char="201C" mode="text" /> <!-- 93 LEFT DOUBLE QUOTATION MARK -->
- <preserve-symbol char="201D" mode="text" /> <!-- 94 RIGHT DOUBLE QUOTATION MARK -->
- <preserve-symbol char="2022" mode="text" /> <!-- 95 BULLET -->
- <preserve-symbol char="2013" mode="text" /> <!-- 96 EN DASH -->
- <preserve-symbol char="2014" mode="text" /> <!-- 97 EM DASH -->
- <preserve-symbol char="2122" mode="text" /> <!-- 99 TRADE MARK SIGN -->
- <preserve-symbol char="0161" mode="text" /> <!-- 9A LATIN SMALL LETTER S WITH CARON -->
- <preserve-symbol char="203A" mode="text" /> <!-- 9B SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -->
- <preserve-symbol char="015B" mode="text" /> <!-- 9C LATIN SMALL LETTER S WITH ACUTE -->
- <preserve-symbol char="0165" mode="text" /> <!-- 9D LATIN SMALL LETTER T WITH CARON -->
- <preserve-symbol char="017E" mode="text" /> <!-- 9E LATIN SMALL LETTER Z WITH CARON -->
- <preserve-symbol char="017A" mode="text" /> <!-- 9F LATIN SMALL LETTER Z WITH ACUTE -->
- <preserve-symbol char="00A0" mode="text" /> <!-- A0 NO-BREAK SPACE -->
- <preserve-symbol char="02C7" mode="text" /> <!-- A1 CARON -->
- <preserve-symbol char="02D8" mode="text" /> <!-- A2 BREVE -->
- <preserve-symbol char="0141" mode="text" /> <!-- A3 LATIN CAPITAL LETTER L WITH STROKE -->
- <preserve-symbol char="00A4" mode="text" /> <!-- A4 CURRENCY SIGN -->
- <preserve-symbol char="0104" mode="text" /> <!-- A5 LATIN CAPITAL LETTER A WITH OGONEK -->
- <preserve-symbol char="00A6" mode="text" /> <!-- A6 BROKEN BAR -->
- <preserve-symbol char="00A7" mode="text" /> <!-- A7 SECTION SIGN -->
- <preserve-symbol char="00A8" mode="text" /> <!-- A8 DIAERESIS -->
- <preserve-symbol char="00A9" mode="text" /> <!-- A9 COPYRIGHT SIGN -->
- <preserve-symbol char="015E" mode="text" /> <!-- AA LATIN CAPITAL LETTER S WITH CEDILLA -->
- <preserve-symbol char="00AB" mode="text" /> <!-- AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -->
- <preserve-symbol char="00AD" mode="text" /> <!-- AD SOFT HYPHEN -->
- <preserve-symbol char="00AE" mode="text" /> <!-- AE REGISTERED SIGN -->
- <preserve-symbol char="017B" mode="text" /> <!-- AF LATIN CAPITAL LETTER Z WITH DOT ABOVE -->
- <preserve-symbol char="00B0" mode="text" /> <!-- B0 DEGREE SIGN -->
- <preserve-symbol char="00B1" mode="math" /> <!-- B1 PLUS-MINUS SIGN -->
- <preserve-symbol char="02DB" mode="text" /> <!-- B2 OGONEK -->
- <preserve-symbol char="0142" mode="text" /> <!-- B3 LATIN SMALL LETTER L WITH STROKE -->
- <preserve-symbol char="00B4" mode="text" /> <!-- B4 ACUTE ACCENT -->
- <preserve-symbol char="00B5" mode="math" /> <!-- B5 MICRO SIGN -->
- <preserve-symbol char="00B6" mode="text" /> <!-- B6 PILCROW SIGN -->
- <preserve-symbol char="00B7" mode="text" /> <!-- B7 MIDDLE DOT -->
- <preserve-symbol char="00B8" mode="text" /> <!-- B8 CEDILLA -->
- <preserve-symbol char="0105" mode="text" /> <!-- B9 LATIN SMALL LETTER A WITH OGONEK -->
- <preserve-symbol char="015F" mode="text" /> <!-- BA LATIN SMALL LETTER S WITH CEDILLA -->
- <preserve-symbol char="00BB" mode="text" /> <!-- BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -->
- <preserve-symbol char="013D" mode="text" /> <!-- BC LATIN CAPITAL LETTER L WITH CARON -->
- <preserve-symbol char="02DD" mode="text" /> <!-- BD DOUBLE ACUTE ACCENT -->
- <preserve-symbol char="013E" mode="text" /> <!-- BE LATIN SMALL LETTER L WITH CARON -->
- <preserve-symbol char="017C" mode="text" /> <!-- BF LATIN SMALL LETTER Z WITH DOT ABOVE -->
- <preserve-symbol char="0154" mode="text" /> <!-- C0 LATIN CAPITAL LETTER R WITH ACUTE -->
- <preserve-symbol char="00C1" mode="text" /> <!-- C1 LATIN CAPITAL LETTER A WITH ACUTE -->
- <preserve-symbol char="00C2" mode="text" /> <!-- C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -->
- <preserve-symbol char="0102" mode="text" /> <!-- C3 LATIN CAPITAL LETTER A WITH BREVE -->
- <preserve-symbol char="00C4" mode="text" /> <!-- C4 LATIN CAPITAL LETTER A WITH DIAERESIS -->
- <preserve-symbol char="0139" mode="text" /> <!-- C5 LATIN CAPITAL LETTER L WITH ACUTE -->
- <preserve-symbol char="0106" mode="text" /> <!-- C6 LATIN CAPITAL LETTER C WITH ACUTE -->
- <preserve-symbol char="00C7" mode="text" /> <!-- C7 LATIN CAPITAL LETTER C WITH CEDILLA -->
- <preserve-symbol char="010C" mode="text" /> <!-- C8 LATIN CAPITAL LETTER C WITH CARON -->
- <preserve-symbol char="00C9" mode="text" /> <!-- C9 LATIN CAPITAL LETTER E WITH ACUTE -->
- <preserve-symbol char="0118" mode="text" /> <!-- CA LATIN CAPITAL LETTER E WITH OGONEK -->
- <preserve-symbol char="00CB" mode="text" /> <!-- CB LATIN CAPITAL LETTER E WITH DIAERESIS -->
- <preserve-symbol char="011A" mode="text" /> <!-- CC LATIN CAPITAL LETTER E WITH CARON -->
- <preserve-symbol char="00CD" mode="text" /> <!-- CD LATIN CAPITAL LETTER I WITH ACUTE -->
- <preserve-symbol char="00CE" mode="text" /> <!-- CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -->
- <preserve-symbol char="010E" mode="text" /> <!-- CF LATIN CAPITAL LETTER D WITH CARON -->
- <preserve-symbol char="0110" mode="text" /> <!-- D0 LATIN CAPITAL LETTER D WITH STROKE -->
- <preserve-symbol char="0143" mode="text" /> <!-- D1 LATIN CAPITAL LETTER N WITH ACUTE -->
- <preserve-symbol char="0147" mode="text" /> <!-- D2 LATIN CAPITAL LETTER N WITH CARON -->
- <preserve-symbol char="00D3" mode="text" /> <!-- D3 LATIN CAPITAL LETTER O WITH ACUTE -->
- <preserve-symbol char="00D4" mode="text" /> <!-- D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -->
- <preserve-symbol char="0150" mode="text" /> <!-- D5 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -->
- <preserve-symbol char="00D6" mode="text" /> <!-- D6 LATIN CAPITAL LETTER O WITH DIAERESIS -->
- <preserve-symbol char="00D7" mode="math" /> <!-- D7 MULTIPLICATION SIGN -->
- <preserve-symbol char="0158" mode="text" /> <!-- D8 LATIN CAPITAL LETTER R WITH CARON -->
- <preserve-symbol char="016E" mode="text" /> <!-- D9 LATIN CAPITAL LETTER U WITH RING ABOVE -->
- <preserve-symbol char="00DA" mode="text" /> <!-- DA LATIN CAPITAL LETTER U WITH ACUTE -->
- <preserve-symbol char="0170" mode="text" /> <!-- DB LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -->
- <preserve-symbol char="00DC" mode="text" /> <!-- DC LATIN CAPITAL LETTER U WITH DIAERESIS -->
- <preserve-symbol char="00DD" mode="text" /> <!-- DD LATIN CAPITAL LETTER Y WITH ACUTE -->
- <preserve-symbol char="0162" mode="text" /> <!-- DE LATIN CAPITAL LETTER T WITH CEDILLA -->
- <preserve-symbol char="00DF" mode="text" /> <!-- DF LATIN SMALL LETTER SHARP S -->
- <preserve-symbol char="0155" mode="text" /> <!-- E0 LATIN SMALL LETTER R WITH ACUTE -->
- <preserve-symbol char="00E1" mode="text" /> <!-- E1 LATIN SMALL LETTER A WITH ACUTE -->
- <preserve-symbol char="00E2" mode="text" /> <!-- E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -->
- <preserve-symbol char="0103" mode="text" /> <!-- E3 LATIN SMALL LETTER A WITH BREVE -->
- <preserve-symbol char="00E4" mode="text" /> <!-- E4 LATIN SMALL LETTER A WITH DIAERESIS -->
- <preserve-symbol char="013A" mode="text" /> <!-- E5 LATIN SMALL LETTER L WITH ACUTE -->
- <preserve-symbol char="0107" mode="text" /> <!-- E6 LATIN SMALL LETTER C WITH ACUTE -->
- <preserve-symbol char="00E7" mode="text" /> <!-- E7 LATIN SMALL LETTER C WITH CEDILLA -->
- <preserve-symbol char="010D" mode="text" /> <!-- E8 LATIN SMALL LETTER C WITH CARON -->
- <preserve-symbol char="00E9" mode="text" /> <!-- E9 LATIN SMALL LETTER E WITH ACUTE -->
- <preserve-symbol char="0119" mode="text" /> <!-- EA LATIN SMALL LETTER E WITH OGONEK -->
- <preserve-symbol char="00EB" mode="text" /> <!-- EB LATIN SMALL LETTER E WITH DIAERESIS -->
- <preserve-symbol char="011B" mode="text" /> <!-- EC LATIN SMALL LETTER E WITH CARON -->
- <preserve-symbol char="00ED" mode="text" /> <!-- ED LATIN SMALL LETTER I WITH ACUTE -->
- <preserve-symbol char="00EE" mode="text" /> <!-- EE LATIN SMALL LETTER I WITH CIRCUMFLEX -->
- <preserve-symbol char="010F" mode="text" /> <!-- EF LATIN SMALL LETTER D WITH CARON -->
- <preserve-symbol char="0111" mode="text" /> <!-- F0 LATIN SMALL LETTER D WITH STROKE -->
- <preserve-symbol char="0144" mode="text" /> <!-- F1 LATIN SMALL LETTER N WITH ACUTE -->
- <preserve-symbol char="0148" mode="text" /> <!-- F2 LATIN SMALL LETTER N WITH CARON -->
- <preserve-symbol char="00F3" mode="text" /> <!-- F3 LATIN SMALL LETTER O WITH ACUTE -->
- <preserve-symbol char="00F4" mode="text" /> <!-- F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -->
- <preserve-symbol char="0151" mode="text" /> <!-- F5 LATIN SMALL LETTER O WITH DOUBLE ACUTE -->
- <preserve-symbol char="00F6" mode="text" /> <!-- F6 LATIN SMALL LETTER O WITH DIAERESIS -->
- <preserve-symbol char="00F7" mode="math" /> <!-- F7 DIVISION SIGN -->
- <preserve-symbol char="0159" mode="text" /> <!-- F8 LATIN SMALL LETTER R WITH CARON -->
- <preserve-symbol char="016F" mode="text" /> <!-- F9 LATIN SMALL LETTER U WITH RING ABOVE -->
- <preserve-symbol char="00FA" mode="text" /> <!-- FA LATIN SMALL LETTER U WITH ACUTE -->
- <preserve-symbol char="0171" mode="text" /> <!-- FB LATIN SMALL LETTER U WITH DOUBLE ACUTE -->
- <preserve-symbol char="00FC" mode="text" /> <!-- FC LATIN SMALL LETTER U WITH DIAERESIS -->
- <preserve-symbol char="00FD" mode="text" /> <!-- FD LATIN SMALL LETTER Y WITH ACUTE -->
- <preserve-symbol char="0163" mode="text" /> <!-- FE LATIN SMALL LETTER T WITH CEDILLA -->
- <preserve-symbol char="02D9" mode="text" /> <!-- FF DOT ABOVE -->
-</symbol-set>
-
-<!-- cp1251 encoding (Microsoft Windows Cyrillic) -->
-<symbol-set name="cp1251" fontenc="T2A">
-<!-- ordered by position in cp1251 rather than by unicode block -->
-<!-- Based on table from ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/ -->
-<preserve-symbol char="0402" mode="text" /> <!-- 80 CYRILLIC CAPITAL LETTER DJE -->
-<preserve-symbol char="0403" mode="text" /> <!-- 81 CYRILLIC CAPITAL LETTER GJE -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="201A" mode="text" /> <!-- 82 SINGLE LOW-9 QUOTATION MARK -->
-</symbol-subset>
-<preserve-symbol char="0453" mode="text" /> <!-- 83 CYRILLIC SMALL LETTER GJE -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="201E" mode="text" /> <!-- 84 DOUBLE LOW-9 QUOTATION MARK -->
- <preserve-symbol char="2026" mode="text" /> <!-- 85 HORIZONTAL ELLIPSIS -->
- <preserve-symbol char="2020" mode="text" /> <!-- 86 DAGGER -->
- <preserve-symbol char="2021" mode="text" /> <!-- 87 DOUBLE DAGGER -->
- <preserve-symbol char="20AC" mode="text" /> <!-- 88 EURO SIGN -->
- <preserve-symbol char="2030" mode="text" /> <!-- 89 PER MILLE SIGN -->
-</symbol-subset>
-<preserve-symbol char="0409" mode="text" /> <!-- 8A CYRILLIC CAPITAL LETTER LJE -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="2039" mode="text" /> <!-- 8B SINGLE LEFT-POINTING ANGLE QUOTATION MARK -->
-</symbol-subset>
-<preserve-symbol char="040A" mode="text" /> <!-- 8C CYRILLIC CAPITAL LETTER NJE -->
-<preserve-symbol char="040C" mode="text" /> <!-- 8D CYRILLIC CAPITAL LETTER KJE -->
-<preserve-symbol char="040B" mode="text" /> <!-- 8E CYRILLIC CAPITAL LETTER TSHE -->
-<preserve-symbol char="040F" mode="text" /> <!-- 8F CYRILLIC CAPITAL LETTER DZHE -->
-<preserve-symbol char="0452" mode="text" /> <!-- 90 CYRILLIC SMALL LETTER DJE -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="2018" mode="text" /> <!-- 91 LEFT SINGLE QUOTATION MARK -->
- <preserve-symbol char="2019" mode="text" /> <!-- 92 RIGHT SINGLE QUOTATION MARK -->
- <preserve-symbol char="201C" mode="text" /> <!-- 93 LEFT DOUBLE QUOTATION MARK -->
- <preserve-symbol char="201D" mode="text" /> <!-- 94 RIGHT DOUBLE QUOTATION MARK -->
- <preserve-symbol char="2022" mode="text" /> <!-- 95 BULLET -->
- <preserve-symbol char="2013" mode="text" /> <!-- 96 EN DASH -->
- <preserve-symbol char="2014" mode="text" /> <!-- 97 EM DASH -->
- <preserve-symbol char="2122" mode="text" /> <!-- 99 TRADE MARK SIGN -->
-</symbol-subset>
-<preserve-symbol char="0459" mode="text" /> <!-- 9A CYRILLIC SMALL LETTER LJE -->
-<preserve-symbol char="203A" mode="text" /> <!-- 9B SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -->
-<preserve-symbol char="045A" mode="text" /> <!-- 9C CYRILLIC SMALL LETTER NJE -->
-<preserve-symbol char="045C" mode="text" /> <!-- 9D CYRILLIC SMALL LETTER KJE -->
-<preserve-symbol char="045B" mode="text" /> <!-- 9E CYRILLIC SMALL LETTER TSHE -->
-<preserve-symbol char="045F" mode="text" /> <!-- 9F CYRILLIC SMALL LETTER DZHE -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="00A0" mode="text" /> <!-- A0 NO-BREAK SPACE -->
-</symbol-subset>
-<preserve-symbol char="040E" mode="text" /> <!-- A1 CYRILLIC CAPITAL LETTER SHORT U -->
-<preserve-symbol char="045E" mode="text" /> <!-- A2 CYRILLIC SMALL LETTER SHORT U -->
-<preserve-symbol char="0408" mode="text" /> <!-- A3 CYRILLIC CAPITAL LETTER JE -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="00A4" mode="text" /> <!-- A4 CURRENCY SIGN -->
-</symbol-subset>
-<preserve-symbol char="0490" mode="text" /> <!-- A5 CYRILLIC CAPITAL LETTER GHE WITH UPTURN -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="00A6" mode="text" /> <!-- A6 BROKEN BAR -->
- <preserve-symbol char="00A7" mode="text" /> <!-- A7 SECTION SIGN -->
-</symbol-subset>
-<preserve-symbol char="0401" mode="text" /> <!-- A8 CYRILLIC CAPITAL LETTER IO -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="00A9" mode="text" /> <!-- A9 COPYRIGHT SIGN -->
-</symbol-subset>
-<preserve-symbol char="0404" mode="text" /> <!-- AA CYRILLIC CAPITAL LETTER UKRAINIAN IE -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="00AB" mode="text" /> <!-- AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -->
- <preserve-symbol char="00AC" mode="math" /> <!-- AC NOT SIGN -->
- <preserve-symbol char="00AD" mode="text" /> <!-- AD SOFT HYPHEN -->
- <preserve-symbol char="00AE" mode="text" /> <!-- AE REGISTERED SIGN -->
-</symbol-subset>
-<preserve-symbol char="0407" mode="text" /> <!-- AF CYRILLIC CAPITAL LETTER YI -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="00B0" mode="text" /> <!-- B0 DEGREE SIGN -->
- <preserve-symbol char="00B1" mode="math" /> <!-- B1 PLUS-MINUS SIGN -->
-</symbol-subset>
-<preserve-symbol char="0406" mode="text" /> <!-- B2 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I -->
-<preserve-symbol char="0456" mode="text" /> <!-- B3 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -->
-<preserve-symbol char="0491" mode="text" /> <!-- B4 CYRILLIC SMALL LETTER GHE WITH UPTURN -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="00B5" mode="math" /> <!-- B5 MICRO SIGN -->
- <preserve-symbol char="00B6" mode="text" /> <!-- B6 PILCROW SIGN -->
- <preserve-symbol char="00B7" mode="text" /> <!-- B7 MIDDLE DOT -->
-</symbol-subset>
-<preserve-symbol char="0451" mode="text" /> <!-- B8 CYRILLIC SMALL LETTER IO -->
-<symbol-subset fontenc="any">
- <preserve-symbol char="2116" mode="text" /> <!-- B9 NUMERO SIGN -->
-</symbol-subset>
-<preserve-symbol char="0454" mode="text" /> <!-- BA CYRILLIC SMALL LETTER UKRAINIAN IE -->
-<preserve-symbol char="00BB" mode="text" /> <!-- BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -->
-<preserve-symbol char="0458" mode="text" /> <!-- BC CYRILLIC SMALL LETTER JE -->
-<preserve-symbol char="0405" mode="text" /> <!-- BD CYRILLIC CAPITAL LETTER DZE -->
-<preserve-symbol char="0455" mode="text" /> <!-- BE CYRILLIC SMALL LETTER DZE -->
-<preserve-symbol char="0457" mode="text" /> <!-- BF CYRILLIC SMALL LETTER YI -->
-<preserve-symbol char="0410" mode="text" /> <!-- C0 CYRILLIC CAPITAL LETTER A -->
-<preserve-symbol char="0411" mode="text" /> <!-- C1 CYRILLIC CAPITAL LETTER BE -->
-<preserve-symbol char="0412" mode="text" /> <!-- C2 CYRILLIC CAPITAL LETTER VE -->
-<preserve-symbol char="0413" mode="text" /> <!-- C3 CYRILLIC CAPITAL LETTER GHE -->
-<preserve-symbol char="0414" mode="text" /> <!-- C4 CYRILLIC CAPITAL LETTER DE -->
-<preserve-symbol char="0415" mode="text" /> <!-- C5 CYRILLIC CAPITAL LETTER IE -->
-<preserve-symbol char="0416" mode="text" /> <!-- C6 CYRILLIC CAPITAL LETTER ZHE -->
-<preserve-symbol char="0417" mode="text" /> <!-- C7 CYRILLIC CAPITAL LETTER ZE -->
-<preserve-symbol char="0418" mode="text" /> <!-- C8 CYRILLIC CAPITAL LETTER I -->
-<preserve-symbol char="0419" mode="text" /> <!-- C9 CYRILLIC CAPITAL LETTER SHORT I -->
-<preserve-symbol char="041A" mode="text" /> <!-- CA CYRILLIC CAPITAL LETTER KA -->
-<preserve-symbol char="041B" mode="text" /> <!-- CB CYRILLIC CAPITAL LETTER EL -->
-<preserve-symbol char="041C" mode="text" /> <!-- CC CYRILLIC CAPITAL LETTER EM -->
-<preserve-symbol char="041D" mode="text" /> <!-- CD CYRILLIC CAPITAL LETTER EN -->
-<preserve-symbol char="041E" mode="text" /> <!-- CE CYRILLIC CAPITAL LETTER O -->
-<preserve-symbol char="041F" mode="text" /> <!-- CF CYRILLIC CAPITAL LETTER PE -->
-<preserve-symbol char="0420" mode="text" /> <!-- D0 CYRILLIC CAPITAL LETTER ER -->
-<preserve-symbol char="0421" mode="text" /> <!-- D1 CYRILLIC CAPITAL LETTER ES -->
-<preserve-symbol char="0422" mode="text" /> <!-- D2 CYRILLIC CAPITAL LETTER TE -->
-<preserve-symbol char="0423" mode="text" /> <!-- D3 CYRILLIC CAPITAL LETTER U -->
-<preserve-symbol char="0424" mode="text" /> <!-- D4 CYRILLIC CAPITAL LETTER EF -->
-<preserve-symbol char="0425" mode="text" /> <!-- D5 CYRILLIC CAPITAL LETTER HA -->
-<preserve-symbol char="0426" mode="text" /> <!-- D6 CYRILLIC CAPITAL LETTER TSE -->
-<preserve-symbol char="0427" mode="text" /> <!-- D7 CYRILLIC CAPITAL LETTER CHE -->
-<preserve-symbol char="0428" mode="text" /> <!-- D8 CYRILLIC CAPITAL LETTER SHA -->
-<preserve-symbol char="0429" mode="text" /> <!-- D9 CYRILLIC CAPITAL LETTER SHCHA -->
-<preserve-symbol char="042A" mode="text" /> <!-- DA CYRILLIC CAPITAL LETTER HARD SIGN -->
-<preserve-symbol char="042B" mode="text" /> <!-- DB CYRILLIC CAPITAL LETTER YERU -->
-<preserve-symbol char="042C" mode="text" /> <!-- DC CYRILLIC CAPITAL LETTER SOFT SIGN -->
-<preserve-symbol char="042D" mode="text" /> <!-- DD CYRILLIC CAPITAL LETTER E -->
-<preserve-symbol char="042E" mode="text" /> <!-- DE CYRILLIC CAPITAL LETTER YU -->
-<preserve-symbol char="042F" mode="text" /> <!-- DF CYRILLIC CAPITAL LETTER YA -->
-<preserve-symbol char="0430" mode="text" /> <!-- E0 CYRILLIC SMALL LETTER A -->
-<preserve-symbol char="0431" mode="text" /> <!-- E1 CYRILLIC SMALL LETTER BE -->
-<preserve-symbol char="0432" mode="text" /> <!-- E2 CYRILLIC SMALL LETTER VE -->
-<preserve-symbol char="0433" mode="text" /> <!-- E3 CYRILLIC SMALL LETTER GHE -->
-<preserve-symbol char="0434" mode="text" /> <!-- E4 CYRILLIC SMALL LETTER DE -->
-<preserve-symbol char="0435" mode="text" /> <!-- E5 CYRILLIC SMALL LETTER IE -->
-<preserve-symbol char="0436" mode="text" /> <!-- E6 CYRILLIC SMALL LETTER ZHE -->
-<preserve-symbol char="0437" mode="text" /> <!-- E7 CYRILLIC SMALL LETTER ZE -->
-<preserve-symbol char="0438" mode="text" /> <!-- E8 CYRILLIC SMALL LETTER I -->
-<preserve-symbol char="0439" mode="text" /> <!-- E9 CYRILLIC SMALL LETTER SHORT I -->
-<preserve-symbol char="043A" mode="text" /> <!-- EA CYRILLIC SMALL LETTER KA -->
-<preserve-symbol char="043B" mode="text" /> <!-- EB CYRILLIC SMALL LETTER EL -->
-<preserve-symbol char="043C" mode="text" /> <!-- EC CYRILLIC SMALL LETTER EM -->
-<preserve-symbol char="043D" mode="text" /> <!-- ED CYRILLIC SMALL LETTER EN -->
-<preserve-symbol char="043E" mode="text" /> <!-- EE CYRILLIC SMALL LETTER O -->
-<preserve-symbol char="043F" mode="text" /> <!-- EF CYRILLIC SMALL LETTER PE -->
-<preserve-symbol char="0440" mode="text" /> <!-- F0 CYRILLIC SMALL LETTER ER -->
-<preserve-symbol char="0441" mode="text" /> <!-- F1 CYRILLIC SMALL LETTER ES -->
-<preserve-symbol char="0442" mode="text" /> <!-- F2 CYRILLIC SMALL LETTER TE -->
-<preserve-symbol char="0443" mode="text" /> <!-- F3 CYRILLIC SMALL LETTER U -->
-<preserve-symbol char="0444" mode="text" /> <!-- F4 CYRILLIC SMALL LETTER EF -->
-<preserve-symbol char="0445" mode="text" /> <!-- F5 CYRILLIC SMALL LETTER HA -->
-<preserve-symbol char="0446" mode="text" /> <!-- F6 CYRILLIC SMALL LETTER TSE -->
-<preserve-symbol char="0447" mode="text" /> <!-- F7 CYRILLIC SMALL LETTER CHE -->
-<preserve-symbol char="0448" mode="text" /> <!-- F8 CYRILLIC SMALL LETTER SHA -->
-<preserve-symbol char="0449" mode="text" /> <!-- F9 CYRILLIC SMALL LETTER SHCHA -->
-<preserve-symbol char="044A" mode="text" /> <!-- FA CYRILLIC SMALL LETTER HARD SIGN -->
-<preserve-symbol char="044B" mode="text" /> <!-- FB CYRILLIC SMALL LETTER YERU -->
-<preserve-symbol char="044C" mode="text" /> <!-- FC CYRILLIC SMALL LETTER SOFT SIGN -->
-<preserve-symbol char="044D" mode="text" /> <!-- FD CYRILLIC SMALL LETTER E -->
-<preserve-symbol char="044E" mode="text" /> <!-- FE CYRILLIC SMALL LETTER YU -->
-<preserve-symbol char="044F" mode="text" /> <!-- FF CYRILLIC SMALL LETTER YA -->
-</symbol-set>
-
-<!-- koi8-r encoding (latin/russian) -->
-<symbol-set name="koi8-r" fontenc="T2A">
-<!-- Unicode block: Latin-1 supplement -->
-<symbol-subset fontenc="any">
-<preserve-symbol char="00A9" mode="text" /> <!-- copyright -->
-<preserve-symbol char="00B0" mode="text" /> <!-- degree -->
-<preserve-symbol char="00B2" mode="math" /> <!-- two superior -->
-<preserve-symbol char="00B7" mode="text" /> <!-- period centered -->
-<preserve-symbol char="00F7" mode="math" /> <!-- div -->
-</symbol-subset>
-<!-- Unicode block: Cyrillic -->
-<symbol char="0400" text="\`&#x415;" />
-<preserve-symbol char="0401" mode="text" />
-<symbol char="0403" text="\'&#x413;" />
-<symbol char="040C" text="\'&#x41A;" />
-<symbol char="040D" text="\`&#x418;" />
-<preserve-symbols first-char="0410" last-char="044F" mode="text" />
-<symbol char="0450" text="\`&#x435;" />
-<preserve-symbol char="0451" mode="text" />
-<symbol char="0453" text="\'&#x433;" />
-<symbol char="045C" text="\'&#x43A;" />
-<symbol char="045D" text="\`&#x438;" />
-<!-- Unicode block: Mathematical Operators -->
-<preserve-symbol char="2219" mode="math" /> <!-- bullet -->
-<preserve-symbol char="221A" mode="math" /> <!-- surd -->
-<preserve-symbol char="223C" mode="math" /> <!-- sim -->
-<preserve-symbol char="2264" mode="math" /> <!-- leq -->
-<preserve-symbol char="2265" mode="math" /> <!-- geq -->
-</symbol-set>
-
-<!-- Iso-8859-7 encoding (latin/greek) -->
-<symbol-set name="iso-8859-7" fontenc="LGR">
-<!-- Missing Characters. Will check and see...
-0374, 0375, 037a, 0384, 0385, 0387
-03D0 - 03F6
--->
-<preserve-symbol char="037E" mode="text" />
-<preserve-symbol char="0386" mode="text" />
-<preserve-symbols first-char="0388" last-char="038A" mode="text" />
-<preserve-symbol char="038C" mode="text" />
-<preserve-symbols first-char="038E" last-char="03A1" mode="text" />
-<preserve-symbols first-char="03A3" last-char="03CE" mode="text" />
-</symbol-set> <!-- end of iso-8859-7 -->
-
-<!-- utf8 input encoding (ucs.sty) -->
-<symbol-set name="utf8" fontenc="any">
-<!-- Note: uni-*.def refers to the datafiles used by ucs.sty -->
-<!-- Unicode block: Latin-1 supplement (in uni-0.def) -->
-<symbol-subset fontenc="T1">
-<preserve-symbol char="00A0" mode="text" />
-</symbol-subset>
-<symbol-subset fontenc="any">
-<preserve-symbols first-char="00A1" last-char="00BE" mode="text" />
-</symbol-subset>
-<symbol-subset fontenc="T1">
-<preserve-symbols first-char="00BF" last-char="00FF" mode="text" />
-<!-- Unicode block: Latin Extended-A (in uni-1.def) -->
-<preserve-symbols first-char="0100" last-char="0137" mode="text" />
-<preserve-symbols first-char="0139" last-char="0148" mode="text" />
-<preserve-symbols first-char="014A" last-char="0165" mode="text" />
-<preserve-symbols first-char="0168" last-char="01FF" mode="text" />
-</symbol-subset>
-<!-- Unicode block: Greek and Coptic (in uni-3.def, as a first approach we take the same as above) -->
-<symbol-subset fontenc="LGR">
-<preserve-symbol char="0386" mode="text" />
-<preserve-symbols first-char="0388" last-char="038A" mode="text" />
-<preserve-symbol char="038C" mode="text" />
-<preserve-symbols first-char="038E" last-char="03A1" mode="text" />
-<preserve-symbols first-char="03A3" last-char="03CE" mode="text" />
-</symbol-subset>
-<!-- Unicode block: Cyrillic (in uni-4.def, currently only T2A encoding) -->
-<symbol-subset fontenc="T2A">
-<preserve-symbols first-char="0400" last-char="045F" mode="text" />
-<preserve-symbols first-char="0490" last-char="0493" mode="text" />
-<preserve-symbols first-char="0496" last-char="049D" mode="text" />
-<preserve-symbols first-char="04A0" last-char="04A5" mode="text" />
-<preserve-symbols first-char="04AA" last-char="04AB" mode="text" />
-<preserve-symbols first-char="04AE" last-char="04B3" mode="text" />
-<preserve-symbols first-char="04B6" last-char="04BB" mode="text" />
-<preserve-symbols first-char="04C0" last-char="04C2" mode="text" />
-<preserve-symbols first-char="04D0" last-char="04DF" mode="text" />
-<preserve-symbols first-char="04E2" last-char="04F5" mode="text" />
-<preserve-symbols first-char="04F8" last-char="04F9" mode="text" />
-</symbol-subset>
-<!-- Unicode block: Greek Extended (in uni-31.def, we take them all - ok???) -->
-<symbol-subset fontenc="LGR">
-<preserve-symbols first-char="1F00" last-char="1FFE" mode="text" />
-</symbol-subset>
-<!-- Unicode block: General Punctuation -->
-<preserve-symbols first-char="2018" last-char="201A" mode="text" />
-<preserve-symbols first-char="201C" last-char="201E" mode="text" />
-<preserve-symbol char="2013" mode="text" />
-<preserve-symbol char="2014" mode="text" />
-<preserve-symbol char="2020" mode="text" />
-<preserve-symbol char="2021" mode="text" />
-<preserve-symbol char="2022" mode="text" />
-<preserve-symbol char="2026" mode="text" />
-<preserve-symbol char="2030" mode="text" />
-<preserve-symbol char="2039" mode="text" />
-<preserve-symbol char="203A" mode="text" />
-
-</symbol-set>
-<!-- end of utf8 input encoding -->
-
-<!--
-**************************************************
-PART III: Additional symbols
-These tables contain symbols from various packages
-**************************************************
--->
-
-<!-- support for Henrik Theiling's eurosym.sty (euro symbol with design
- following the official European Commision's definitions) -->
-<symbol-set name="eurosym" fontenc="any">
- <symbol char="20AC" text="{\euro}" /> <!-- same as \officialeuro -->
-</symbol-set>
-
-<!-- support for Ingo Klöckl's ifsym.sty (various symbols in metafont format) -->
-<symbol-set name="ifsym" fontenc="any">
-<!-- Unicode block: Geometric Shapes -->
-<symbol char="25A0" text="{\FilledBigSquare}" />
-<symbol char="25A1" text="{\BigSquare}" />
-<symbol char="25A3" text="\rlap{\FilledSmallSquare}{\BigSquare}" />
-<symbol char="25AA" text="{\FilledSmallSquare}" />
-<symbol char="25AB" text="{\SmallSquare}" />
-<symbol char="25AC" text="\textwide{\FilledBigSquare}" />
-<symbol char="25AD" text="\textwide{\BigSquare}" />
-<symbol char="25AE" text="\textnarrow{\FilledBigSquare}" />
-<symbol char="25AF" text="\textnarrow{\BigSquare}" />
-<symbol char="25B2" text="{\FilledBigTriangleUp}" />
-<symbol char="25B3" text="{\BigTriangleUp}" />
-<symbol char="25B4" text="{\FilledSmallTriangleUp}" />
-<symbol char="25B5" text="{\SmallTriangleUp}" />
-<symbol char="25B6" text="{\FilledBigTriangleRight}" />
-<symbol char="25B7" text="{\BigTriangleRight}" />
-<symbol char="25B8" text="{\FilledSmallTriangleRight}" />
-<symbol char="25B9" text="{\SmallTriangleRight}" />
-<symbol char="25BA" text="\textwide{\FilledBigTriangleRight}" />
-<symbol char="25BB" text="\textwide{\BigTriangleRight}" />
-<symbol char="25BC" text="{\FilledBigTriangleDown}" />
-<symbol char="25BD" text="{\BigTriangleDown}" />
-<symbol char="25BE" text="{\FilledSmallTriangleDown}" />
-<symbol char="25BF" text="{\SmallTriangleDown}" />
-<symbol char="25C0" text="{\FilledBigTriangleLeft}" />
-<symbol char="25C1" text="{\BigTriangleLeft}" />
-<symbol char="25C2" text="{\FilledSmallTriangleLeft}" />
-<symbol char="25C3" text="{\SmallTriangleLeft}" />
-<symbol char="25C4" text="\textwide{\FilledBigTriangleLeft}" />
-<symbol char="25C5" text="\textwide{\BigTriangleLeft}" />
-<symbol char="25C6" text="{\FilledBigDiamondshape}" />
-<symbol char="25C7" text="{\BigDiamondshape}" />
-<symbol char="25C8" text="\rlap{\FilledSmallDiamondshape}{\BigDiamondshape}" />
-<symbol char="25C9" text="\rlap{\FilledSmallCircle}{\BigCircle}" />
-<symbol char="25CA" text="\textnarrow{\BigDiamondshape}" />
-<symbol char="25CB" text="{\BigCircle}" />
-<symbol char="25CE" text="\rlap{\SmallCircle}{\BigCircle}" />
-<symbol char="25CF" text="{\FilledBigCircle}" />
-<symbol char="25E6" text="{\SmallCircle}" />
-<symbol char="25EB" text="\rlap{\BigVBar}{\BigSquare}" />
-<symbol char="25EF" text="{\BigCircle}" />
-<!-- Unicode block: Miscellaneous Symbols -->
-<symbol char="2601" text="{\FilledCloud}" />
-<symbol char="260E" text="{\Telephone}" />
-<symbol char="2622" text="{\Radiation}" />
-</symbol-set><!-- end of ifsym -->
-
-<!-- support for wasysym (various symbols in metafont format) -->
-<symbol-set name="wasysym" fontenc="any">
-<!-- Unicode block: Miscellaneous Technical -->
-<symbol char="2300" text="{\diameter}" />
-<!-- Unicode block: Geometric Shapes -->
-<symbol char="25D0" text="{\LEFTcircle}" />
-<symbol char="25D1" text="{\RIGHTcircle}" />
-<symbol char="25D6" text="{\LEFTCIRCLE}" />
-<symbol char="25D7" text="{\RIGHTCIRCLE}" />
-<!-- Unicode block: Miscellaneous Symbols -->
-<symbol char="2607" text="{\lightning}" />
-<symbol char="2609" text="{\astrosun}" />
-<symbol char="260A" text="{\ascnode}" />
-<symbol char="260B" text="{\descnode}" />
-<symbol char="260C" text="{\conjunction}" />
-<symbol char="260D" text="{\opposition}" />
-<symbol char="2610" text="{\Square}" />
-<symbol char="2611" text="{\CheckedBox}" />
-<symbol char="2612" text="{\XBox}" />
-<symbol char="2639" text="{\frownie}" />
-<symbol char="263A" text="{\smiley}" />
-<symbol char="263B" text="{\blacksmiley}" />
-<symbol char="263C" text="{\sun}" />
-<symbol char="263D" text="{\rightmoon}" />
-<symbol char="263E" text="{\leftmoon}" />
-<symbol char="263F" text="{\mercury}" />
-<symbol char="2640" text="{\venus}" />
-<symbol char="2641" text="{\earth}" />
-<symbol char="2642" text="{\mars}" />
-<symbol char="2643" text="{\jupiter}" />
-<symbol char="2644" text="{\saturn}" />
-<symbol char="2645" text="{\uranus}" />
-<symbol char="2646" text="{\neptune}" />
-<symbol char="2647" text="{\pluto}" />
-<symbol char="2648" text="{\aries}" />
-<symbol char="2649" text="{\taurus}" />
-<symbol char="264A" text="{\gemini}" />
-<symbol char="264B" text="{\cancer}" />
-<symbol char="264C" text="{\leo}" />
-<symbol char="264D" text="{\virgo}" />
-<symbol char="264E" text="{\libra}" />
-<symbol char="264F" text="{\scorpio}" />
-<symbol char="2650" text="{\sagittarius}" />
-<symbol char="2651" text="{\capricornus}" />
-<symbol char="2652" text="{\aquarius}" />
-<symbol char="2653" text="{\pisces}" />
-<symbol char="2669" text="{\quarternote}" />
-<symbol char="266B" text="{\twonotes}" />
-<!-- note: wasysym has some APL symbols as well -->
-</symbol-set><!--end of wasysym-->
-
-<!-- support for bbding (metafont clone of parts of Zapf dingbats)
- Note that three symbols are renamed because of name clashes -->
-<symbol-set name="bbding" fontenc="any">
-<!-- Unicode block: Geometric Shapes -->
-<symbol char="25A0" text="{\SquareSolid}" />
-<symbol char="25A1" text="{\bbSquare}" /> <!-- renamed! -->
-<symbol char="25B2" text="{\bbTriangleUp}" /> <!-- renamed! -->
-<symbol char="25BC" text="{\bbTriangleDown}" /> <!-- renamed! -->
-<symbol char="25C6" text="{\DiamonSolid}" />
-<symbol char="25CF" text="{\CircleSolid}" />
-<symbol char="25D6" text="{\HalfCircleLeft}" />
-<symbol char="25D7" text="{\HalfCircleRight}" />
-<!-- Unicode block: Miscellaneous Symbols -->
-<symbol char="2605" text="{\FiveStar}" />
-<symbol char="2606" text="{\FiveStarOpen}" />
-<symbol char="260E" text="{\Phone}" />
-<symbol char="261A" text="{\HandCuffLeft}" />
-<symbol char="261B" text="{\HandCuffRight}" />
-<symbol char="261C" text="{\HandLeft}" />
-<symbol char="261E" text="{\HandRight}" />
-<!-- Unicode block: Dingbats -->
-<symbol char="2701" text="{\ScissorRightBrokenBottom}" />
-<symbol char="2702" text="{\ScissorRight}" />
-<symbol char="2703" text="{\ScissorRightBrokenTop}" />
-<symbol char="2704" text="{\ScissorHollowRight}" />
-<symbol char="2706" text="{\PhoneHandset}" />
-<symbol char="2707" text="{\Tape}" />
-<symbol char="2708" text="{\Plane}" />
-<symbol char="2709" text="{\Envelope}" />
-<symbol char="270C" text="{\Peace}" />
-<symbol char="270D" text="{\HandPencilLeft}" />
-<symbol char="270E" text="{\PencilRightDown}" />
-<symbol char="270F" text="{\PencilRight}" />
-<symbol char="2710" text="{\PencilRightUp}" />
-<symbol char="2711" text="{\NibRight}" />
-<symbol char="2712" text="{\NibSolidRight}" />
-<symbol char="2713" text="{\Checkmark}" />
-<symbol char="2714" text="{\CheckmarkBold}" />
-<symbol char="2715" text="{\XSolid}" />
-<symbol char="2716" text="{\XSolidBold}" />
-<symbol char="2717" text="{\XSolidBrush}" />
-<!--<symbol char="2718" text="{\??}" /> -->
-<symbol char="2719" text="{\PlusOutline}" />
-<symbol char="271A" text="{\Plus}" />
-<symbol char="271B" text="{\PlusThinCenterOpen}" />
-<symbol char="271C" text="{\PlusCenterOpen}" />
-<symbol char="271D" text="{\bbCross}" /> <!-- renamed! -->
-<symbol char="271E" text="{\CrossOpenShadow}" />
-<symbol char="271F" text="{\CrossOutline}" />
-<symbol char="2720" text="{\CrossMaltese}" />
-<symbol char="2721" text="{\DavidStar}" />
-<symbol char="2722" text="{\FourAsterisk}" />
-<symbol char="2723" text="{\JackStar}" />
-<symbol char="2724" text="{\JackStarBold}" />
-<symbol char="2725" text="{\CrossClowerTips}" />
-<symbol char="2726" text="{\FourStar}" />
-<symbol char="2727" text="{\FourStarOpen}" />
-<symbol char="2729" text="{\FiveStarOpen}" />
-<symbol char="272A" text="{\FiveStarOpenCircled}" />
-<symbol char="272B" text="{\FiveStarCenterOpen}" />
-<symbol char="272C" text="{\FiveStarOpenDotted}" />
-<symbol char="272D" text="{\FiveStarOutline}" />
-<symbol char="272E" text="{\FiveStarOutlineHeavy}" />
-<symbol char="272F" text="{\FiveStarConvex}" />
-<symbol char="2730" text="{\FiveStarShadow}" />
-<symbol char="2731" text="{\AsteriskBold}" />
-<symbol char="2732" text="{\AsteriskCenterOpen}" />
-<!-- <symbol char="2733" text="{\??}" /> -->
-<symbol char="2734" text="{\EightStarTaper}" />
-<symbol char="2735" text="{\EightStarConvex}" />
-<symbol char="2736" text="{\SixStar}" />
-<symbol char="2737" text="{\EightStar}" />
-<symbol char="2738" text="{\EightStarBold}" />
-<symbol char="2739" text="{\TwelweStar}" />
-<symbol char="273A" text="{\SixteenStarLight}" />
-<symbol char="273B" text="{\SixFlowerPetalRemoved}" />
-<symbol char="273C" text="{\SixFlowerOpenCenter}" />
-<symbol char="273D" text="{\Asterisk}" />
-<symbol char="273E" text="{\SixFlowerAlternate}" />
-<symbol char="273F" text="{\FiveFlowerPetal}" />
-<symbol char="2740" text="{\FiveFlowerOpen}" />
-<symbol char="2741" text="{\EightFlowerPetal}" />
-<symbol char="2742" text="{\SunshineOpenCircled}" />
-<symbol char="2743" text="{\SixFlowerAltPetal}" />
-<symbol char="2744" text="{\SnowflakeChevron}" />
-<symbol char="2745" text="{\Snowflake}" />
-<symbol char="2746" text="{\SnowflakeChevronBold}" />
-<symbol char="2747" text="{\Sparkle}" />
-<symbol char="2748" text="{\SparkleBold}" />
-<symbol char="2749" text="{\AsteriskRoundedEnds}" />
-<symbol char="274A" text="{\EightFlowerPetalRemoved}" />
-<symbol char="274B" text="{\EightAsterisk}" />
-<symbol char="274D" text="{\CircleShadow}" />
-<symbol char="274F" text="{\SquareShadowBottomRight}" />
-<symbol char="2750" text="{\SquareShadowTopRight}" />
-<symbol char="2751" text="{\SquareCastShadowBottomRight}" />
-<symbol char="2752" text="{\SquareCastShadowTopRight}" />
-<symbol char="2756" text="{\OrnamentDiamondSolid}" />
-<symbol char="2758" text="{\RectangleThin}" />
-<symbol char="2759" text="{\Rectangle}" />
-<symbol char="275A" text="{\RectangleBold}" />
-<symbol char="27A0" text="{\ArrowBoldRightStrobe}" />
-<symbol char="27A5" text="{\ArrowBoldDownRight}" />
-<symbol char="27A6" text="{\ArrowBoldUpRight}" />
-<symbol char="27A7" text="{\ArrowBoldRightShort}" />
-<symbol char="27B2" text="{\ArrowBoldRightCircled}" />
-</symbol-set><!--end of bbding-->
-
-<!-- support for zapf dingbats (pifont.sty) -->
-<symbol-set name="dingbats" fontenc="any">
-<!-- Note: Most dingbats are located in 2700-27FF, but some are
- placed elsewhere because they fit in another category.
--->
-<!-- Unicode block: Arrows -->
-<symbol char="2192" text="\ding{213}" />
-<symbol char="2194" text="\ding{214}" />
-<symbol char="2195" text="\ding{215}" />
-<!-- Unicode block: Enclosed Alphanumericals -->
-<symbol char="2460" text="\ding{172}" />
-<symbol char="2461" text="\ding{173}" />
-<symbol char="2462" text="\ding{174}" />
-<symbol char="2463" text="\ding{175}" />
-<symbol char="2464" text="\ding{176}" />
-<symbol char="2465" text="\ding{177}" />
-<symbol char="2466" text="\ding{178}" />
-<symbol char="2467" text="\ding{179}" />
-<symbol char="2468" text="\ding{180}" />
-<symbol char="2469" text="\ding{181}" />
-<!-- Unicode block: Geometric Shapes -->
-<symbol char="25A0" text="\ding{110}" />
-<symbol char="25B2" text="\ding{115}" />
-<symbol char="25BC" text="\ding{116}" />
-<symbol char="25C6" text="\ding{117}" />
-<symbol char="25CF" text="\ding{108}" />
-<symbol char="25D7" text="\ding{119}" />
-<!-- Unicode block: Miscellaneous Symbols -->
-<symbol char="2605" text="\ding{72}" />
-<symbol char="260E" text="\ding{37}" />
-<symbol char="261B" text="\ding{42}" />
-<symbol char="261E" text="\ding{43}" />
-<!-- Unicode block: Dingbats -->
-<symbol char="2701" text="\ding{33}" />
-<symbol char="2702" text="\ding{34}" />
-<symbol char="2703" text="\ding{35}" />
-<symbol char="2704" text="\ding{36}" />
-<symbol char="2706" text="\ding{38}" />
-<symbol char="2707" text="\ding{39}" />
-<symbol char="2708" text="\ding{40}" />
-<symbol char="2709" text="\ding{41}" />
-<symbol char="270C" text="\ding{44}" />
-<symbol char="270D" text="\ding{45}" />
-<symbol char="270E" text="\ding{46}" />
-<symbol char="270F" text="\ding{47}" />
-<symbol char="2710" text="\ding{48}" />
-<symbol char="2711" text="\ding{49}" />
-<symbol char="2712" text="\ding{50}" />
-<symbol char="2713" text="\ding{51}" />
-<symbol char="2714" text="\ding{52}" />
-<symbol char="2715" text="\ding{53}" />
-<symbol char="2716" text="\ding{54}" />
-<symbol char="2717" text="\ding{55}" />
-<symbol char="2718" text="\ding{56}" />
-<symbol char="2719" text="\ding{57}" />
-<symbol char="271A" text="\ding{58}" />
-<symbol char="271B" text="\ding{59}" />
-<symbol char="271C" text="\ding{60}" />
-<symbol char="271D" text="\ding{61}" />
-<symbol char="271E" text="\ding{62}" />
-<symbol char="271F" text="\ding{63}" />
-<symbol char="2720" text="\ding{64}" />
-<symbol char="2721" text="\ding{65}" />
-<symbol char="2722" text="\ding{66}" />
-<symbol char="2723" text="\ding{67}" />
-<symbol char="2724" text="\ding{68}" />
-<symbol char="2725" text="\ding{69}" />
-<symbol char="2726" text="\ding{70}" />
-<symbol char="2727" text="\ding{71}" />
-<symbol char="2729" text="\ding{73}" />
-<symbol char="272A" text="\ding{74}" />
-<symbol char="272B" text="\ding{75}" />
-<symbol char="272C" text="\ding{76}" />
-<symbol char="272D" text="\ding{77}" />
-<symbol char="272E" text="\ding{78}" />
-<symbol char="272F" text="\ding{79}" />
-<symbol char="2730" text="\ding{80}" />
-<symbol char="2731" text="\ding{81}" />
-<symbol char="2732" text="\ding{82}" />
-<symbol char="2733" text="\ding{83}" />
-<symbol char="2734" text="\ding{84}" />
-<symbol char="2735" text="\ding{85}" />
-<symbol char="2736" text="\ding{86}" />
-<symbol char="2737" text="\ding{87}" />
-<symbol char="2738" text="\ding{88}" />
-<symbol char="2739" text="\ding{89}" />
-<symbol char="273A" text="\ding{90}" />
-<symbol char="273B" text="\ding{91}" />
-<symbol char="273C" text="\ding{92}" />
-<symbol char="273D" text="\ding{93}" />
-<symbol char="273E" text="\ding{94}" />
-<symbol char="273F" text="\ding{95}" />
-<symbol char="2740" text="\ding{96}" />
-<symbol char="2741" text="\ding{97}" />
-<symbol char="2742" text="\ding{98}" />
-<symbol char="2743" text="\ding{99}" />
-<symbol char="2744" text="\ding{100}" />
-<symbol char="2745" text="\ding{101}" />
-<symbol char="2746" text="\ding{102}" />
-<symbol char="2747" text="\ding{103}" />
-<symbol char="2748" text="\ding{104}" />
-<symbol char="2749" text="\ding{105}" />
-<symbol char="274A" text="\ding{106}" />
-<symbol char="274B" text="\ding{107}" />
-<symbol char="274D" text="\ding{109}" />
-<symbol char="274F" text="\ding{111}" />
-<symbol char="2750" text="\ding{112}" />
-<symbol char="2751" text="\ding{113}" />
-<symbol char="2752" text="\ding{114}" />
-<symbol char="2756" text="\ding{118}" />
-<symbol char="2758" text="\ding{120}" />
-<symbol char="2759" text="\ding{121}" />
-<symbol char="275A" text="\ding{122}" />
-<symbol char="275B" text="\ding{123}" />
-<symbol char="275C" text="\ding{124}" />
-<symbol char="275D" text="\ding{125}" />
-<symbol char="275E" text="\ding{126}" />
-<symbol char="2761" text="\ding{161}" />
-<symbol char="2762" text="\ding{162}" />
-<symbol char="2763" text="\ding{163}" />
-<symbol char="2764" text="\ding{164}" />
-<symbol char="2765" text="\ding{165}" />
-<symbol char="2766" text="\ding{166}" />
-<symbol char="2767" text="\ding{167}" />
-<symbol char="2776" text="\ding{182}" />
-<symbol char="2777" text="\ding{183}" />
-<symbol char="2778" text="\ding{184}" />
-<symbol char="2779" text="\ding{185}" />
-<symbol char="277A" text="\ding{186}" />
-<symbol char="277B" text="\ding{187}" />
-<symbol char="277C" text="\ding{188}" />
-<symbol char="277D" text="\ding{189}" />
-<symbol char="277E" text="\ding{190}" />
-<symbol char="277F" text="\ding{191}" />
-<symbol char="2780" text="\ding{192}" />
-<symbol char="2781" text="\ding{193}" />
-<symbol char="2782" text="\ding{194}" />
-<symbol char="2783" text="\ding{195}" />
-<symbol char="2784" text="\ding{196}" />
-<symbol char="2785" text="\ding{197}" />
-<symbol char="2786" text="\ding{198}" />
-<symbol char="2787" text="\ding{199}" />
-<symbol char="2788" text="\ding{200}" />
-<symbol char="2789" text="\ding{201}" />
-<symbol char="278A" text="\ding{202}" />
-<symbol char="278B" text="\ding{203}" />
-<symbol char="278C" text="\ding{204}" />
-<symbol char="278D" text="\ding{205}" />
-<symbol char="278E" text="\ding{206}" />
-<symbol char="278F" text="\ding{207}" />
-<symbol char="2790" text="\ding{208}" />
-<symbol char="2791" text="\ding{209}" />
-<symbol char="2792" text="\ding{210}" />
-<symbol char="2793" text="\ding{211}" />
-<symbol char="2794" text="\ding{212}" />
-<symbol char="2798" text="\ding{216}" />
-<symbol char="2799" text="\ding{217}" />
-<symbol char="279A" text="\ding{218}" />
-<symbol char="279B" text="\ding{219}" />
-<symbol char="279C" text="\ding{220}" />
-<symbol char="279D" text="\ding{221}" />
-<symbol char="279E" text="\ding{222}" />
-<symbol char="279F" text="\ding{223}" />
-<symbol char="27A0" text="\ding{224}" />
-<symbol char="27A1" text="\ding{225}" />
-<symbol char="27A2" text="\ding{226}" />
-<symbol char="27A3" text="\ding{227}" />
-<symbol char="27A4" text="\ding{228}" />
-<symbol char="27A5" text="\ding{229}" />
-<symbol char="27A6" text="\ding{230}" />
-<symbol char="27A7" text="\ding{231}" />
-<symbol char="27A8" text="\ding{232}" />
-<symbol char="27A9" text="\ding{233}" />
-<symbol char="27AA" text="\ding{234}" />
-<symbol char="27AB" text="\ding{235}" />
-<symbol char="27AC" text="\ding{236}" />
-<symbol char="27AD" text="\ding{237}" />
-<symbol char="27AE" text="\ding{238}" />
-<symbol char="27AF" text="\ding{239}" />
-<symbol char="27B1" text="\ding{241}" />
-<symbol char="27B2" text="\ding{242}" />
-<symbol char="27B3" text="\ding{243}" />
-<symbol char="27B4" text="\ding{244}" />
-<symbol char="27B5" text="\ding{245}" />
-<symbol char="27B6" text="\ding{246}" />
-<symbol char="27B7" text="\ding{247}" />
-<symbol char="27B8" text="\ding{248}" />
-<symbol char="27B9" text="\ding{249}" />
-<symbol char="27BA" text="\ding{250}" />
-<symbol char="27BB" text="\ding{251}" />
-<symbol char="27BC" text="\ding{252}" />
-<symbol char="27BD" text="\ding{253}" />
-<symbol char="27BE" text="\ding{254}" />
-</symbol-set> <!-- end of dingbats -->
-
-<!-- support for tipa phonetic symbols (tipa.sty) -->
-<symbol-set name="tipa" fontenc="any" >
- <!-- Unicode block: IPA extensions -->
- <symbol char="0250" text="{\textturna}" />
- <symbol char="0251" text="{\textscripta}" />
- <symbol char="0252" text="{\textturnscripta}" />
- <symbol char="0253" text="{\texthtb}" />
- <symbol char="0254" text="{\textopeno}" />
- <symbol char="0255" text="{\textctc}" />
- <symbol char="0256" text="{\textrtaild}" />
- <symbol char="0257" text="{\texthtd}" />
- <symbol char="0258" text="{\textreve}" />
- <symbol char="0259" text="{\textschwa}" />
- <symbol char="025A" text="{\textrhookschwa}" />
- <symbol char="025B" text="{\textepsilon}" />
- <symbol char="025C" text="{\textrevepsilon}" />
- <symbol char="025D" text="{\textrhookrevepsilon}" />
- <symbol char="025E" text="{\textcloserevepsilon}" />
- <symbol char="025F" text="{\textbardotlessj}" />
- <symbol char="0260" text="{\texthtg}" />
- <symbol char="0261" text="{\textscriptg}" />
- <symbol char="0262" text="{\textscg}" />
- <symbol char="0263" text="{\textgamma}" />
- <symbol char="0264" text="{\textramshorns}" />
- <symbol char="0265" text="{\textturnh}" />
- <symbol char="0266" text="{\texthth}" />
- <symbol char="0267" text="{\texththeng}" />
- <symbol char="0268" text="{\textbari}" />
- <symbol char="0269" text="{\textiota}" />
- <symbol char="026A" text="{\textsci}" />
- <symbol char="026B" text="{\textltilde}" />
- <symbol char="026C" text="{\textbeltl}" />
- <symbol char="026D" text="{\textrtaill}" />
- <symbol char="026E" text="{\textlyoghlig}" />
- <symbol char="026F" text="{\textturnm}" />
- <symbol char="0270" text="{\textturnmrleg}" />
- <symbol char="0271" text="{\textltailm}" />
- <symbol char="0272" text="{\textltailn}" />
- <symbol char="0273" text="{\textrtailn}" />
- <symbol char="0274" text="{\textscn}" />
- <symbol char="0275" text="{\textbaro}" />
- <symbol char="0276" text="{\textscoelig}" />
- <symbol char="0277" text="{\textcloseomega}" />
- <symbol char="0278" text="{\textphi}" />
- <symbol char="0279" text="{\textturnr}" />
- <symbol char="027A" text="{\textturnlonglegr}" />
- <symbol char="027B" text="{\textturnrrtail}" />
- <symbol char="027C" text="{\textlonglegr}" />
- <symbol char="027D" text="{\textrtailr}" />
- <symbol char="027E" text="{\textfishhookr}" />
- <symbol char="027F" text="{\textlhti}" />
- <symbol char="0280" text="{\textscr}" />
- <symbol char="0281" text="{\textinvscr}" />
- <symbol char="0282" text="{\textrtails}" />
- <symbol char="0283" text="{\textesh}" />
- <symbol char="0284" text="{\texthtbardotlessj}" />
- <symbol char="0285" text="{\textraisevibyi}" />
- <symbol char="0286" text="{\textctesh}" />
- <symbol char="0287" text="{\textturnt}" />
- <symbol char="0288" text="{\textrtailt}" />
- <symbol char="0289" text="{\textbaru}" />
- <symbol char="028A" text="{\textupsilon}" />
- <symbol char="028B" text="{\textscriptv}" />
- <symbol char="028C" text="{\textturnv}" />
- <symbol char="028D" text="{\textturnw}" />
- <symbol char="028E" text="{\textturny}" />
- <symbol char="028F" text="{\textscy}" />
- <symbol char="0290" text="{\textrtailz}" />
- <symbol char="0291" text="{\textctz}" />
- <symbol char="0292" text="{\textyogh}" />
- <symbol char="0293" text="{\textctyogh}" />
- <symbol char="0294" text="{\textglotstop}" />
- <symbol char="0295" text="{\textrevglotstop}" />
- <symbol char="0296" text="{\textinvglotstop}" />
- <symbol char="0297" text="{\textstretchc}" />
- <symbol char="0298" text="{\textbullseye}" />
- <symbol char="0299" text="{\textscb}" />
- <symbol char="029A" text="{\textcloseepsilon}" />
- <symbol char="029B" text="{\texthtscg}" />
- <symbol char="029C" text="{\textsch}" />
- <symbol char="029D" text="{\textctj}" />
- <symbol char="029E" text="{\textturnk}" />
- <symbol char="029F" text="{\textscl}" />
- <symbol char="02A0" text="{\texthtq}" />
- <symbol char="02A1" text="{\textbarglotstop}" />
- <symbol char="02A2" text="{\textbarrevglotstop}" />
- <symbol char="02A3" text="{\textdzlig}" />
- <symbol char="02A4" text="{\textdyoghlig}" />
- <symbol char="02A5" text="{\textdctzlig}" />
- <symbol char="02A6" text="{\texttslig}" />
- <symbol char="02A7" text="{\textteshlig}" />
- <symbol char="02A8" text="{\texttctclig}" />
-
- <symbol char="02B0" text="{\textsuperscript h}" />
- <symbol char="02B1" text="{\textsuperscript\texthth}" />
- <symbol char="02B2" text="{\textsuperscript j}" />
- <symbol char="02B3" text="{\textsuperscript r}" />
- <symbol char="02B4" text="{\textsuperscript\textturnr}" />
- <symbol char="02B5" text="{\textsuperscript\textturnrrtail}" />
- <symbol char="02B6" text="{\textsuperscript\textinvscr}" />
- <symbol char="02B7" text="{\textsuperscript w}" />
- <symbol char="02B8" text="{\textsuperscript y}" />
-
- <symbol char="02C6" text="{\^{}}" />
- <symbol char="02C7" text="{\v{}}" />
- <symbol char="02C8" text="{\textprimstress}" />
- <symbol char="02C9" text="{\={}}" />
- <symbol char="02CA" text="{\'{}}" />
- <symbol char="02CB" text="{\`{}}" />
-
- <symbol char="02CD" text="{\b{}}" />
-
- <symbol char="02D0" text="{\textlengthmark}" />
-
- <symbol char="02D8" text="{\u{}}" />
- <symbol char="02D9" text="{\.{}}" />
- <symbol char="02DA" text="{\r{}}" />
- <symbol char="02DB" text="{\k{}}" />
- <symbol char="02DC" text="{\~{}}" />
- <symbol char="02DD" text="{\H{}}" />
-
- <symbol char="02E5" text="{\tone5}" />
- <symbol char="02E6" text="{\tone4}" />
- <symbol char="02E7" text="{\tone3}" />
- <symbol char="02E8" text="{\tone2}" />
- <symbol char="02E9" text="{\tone1}" />
-</symbol-set>
-
-<!--
-******************************************************************
-PART IV: Font-specific symbols
-These tables contain symbols which are specific for certain fonts;
-usually in the private use area of unicode.
-This includes 8-bit fonts. These are normally relocated to the range
-F000-F0FF by OOo (part of private use area in unicode).
-If the attribute eight-bit is set to true, w2l will copy the
-definitions to the range 00-FF.
-******************************************************************
--->
-
-<!-- support for private use area of "OpenSymbol" (OOo symbol font) -->
-<special-symbol-set name="OpenSymbol" fontenc="any">
- <symbol char="E002" eq-char="2666" />
- <symbol char="E003" eq-char="25C6" />
- <symbol char="E005" eq-char="274D" />
- <symbol char="E006" eq-char="2794" />
- <symbol char="E007" eq-char="2713" />
- <symbol char="E008" eq-char="25CF" />
- <symbol char="E009" eq-char="274D" />
- <symbol char="E00A" eq-char="25FC" />
- <symbol char="E00B" eq-char="2752" />
- <symbol char="E00D" eq-char="2756" />
- <symbol char="E013" eq-char="2742" />
- <symbol char="E01B" eq-char="270D" />
- <symbol char="E01E" eq-char="2022" />
- <symbol char="E021" eq-char="00A9" />
- <symbol char="E024" eq-char="00AE" />
- <symbol char="E025" eq-char="21E8" />
- <symbol char="E026" eq-char="21E9" />
- <symbol char="E027" eq-char="21E6" />
- <symbol char="E028" eq-char="21E7" />
- <symbol char="E02B" eq-char="279E" />
- <symbol char="E032" eq-char="2741" />
- <symbol char="E036" eq-char="0028" />
- <symbol char="E037" eq-char="0029" />
- <symbol char="E03A" eq-char="20AC" />
- <symbol char="E080" eq-char="2030" />
- <symbol char="E081" eq-char="FE38" /> <!-- underbrace -->
- <symbol char="E082" eq-char="FE37" /> <!-- overbrace -->
- <symbol char="E083" eq-char="002B" />
- <symbol char="E084" eq-char="003C" />
- <symbol char="E085" eq-char="003E" />
- <symbol char="E086" eq-char="2264" />
- <symbol char="E087" eq-char="2265" />
- <symbol char="E089" eq-char="2208" />
- <symbol char="E08B" eq-char="2026" />
- <symbol char="E08C" eq-char="2192" />
- <symbol char="E090" eq-char="2225" />
- <symbol char="E091" eq-char="005E" />
- <symbol char="E092" eq-char="02C7" />
- <symbol char="E093" eq-char="02D8" />
- <symbol char="E094" eq-char="00B4" />
- <symbol char="E095" eq-char="0060" />
- <symbol char="E096" eq-char="02DC" /> <!-- or 007E -->
- <symbol char="E097" eq-char="00AF" />
- <symbol char="E098" eq-char="2192" /> <!-- or 20E1 -->
- <symbol char="E09B" eq-char="20DB" />
- <symbol char="E09E" eq-char="0028" />
- <symbol char="E09F" eq-char="0029" />
- <symbol char="E0A0" eq-char="2221" />
- <symbol char="E0AA" eq-char="2751" />
- <symbol char="E0AC" eq-char="0393" />
- <symbol char="E0AD" eq-char="0394" />
- <symbol char="E0AE" eq-char="0398" />
- <symbol char="E0AF" eq-char="039B" />
- <symbol char="E0B0" eq-char="039E" />
- <symbol char="E0B1" eq-char="03A0" />
- <symbol char="E0B2" eq-char="03A3" />
- <symbol char="E0B3" eq-char="03A5" />
- <symbol char="E0B4" eq-char="03A6" />
- <symbol char="E0B5" eq-char="03A8" />
- <symbol char="E0B6" eq-char="03A9" />
- <symbol char="E0B7" eq-char="03B1" />
- <symbol char="E0B8" eq-char="03B2" />
- <symbol char="E0B9" eq-char="03B3" />
- <symbol char="E0BA" eq-char="03B4" />
- <symbol char="E0BB" eq-char="03F5" />
- <symbol char="E0BC" eq-char="03B6" />
- <symbol char="E0BD" eq-char="03B7" />
- <symbol char="E0BE" eq-char="03B8" />
- <symbol char="E0BF" eq-char="03B9" />
- <symbol char="E0C0" eq-char="03BA" />
- <symbol char="E0C1" eq-char="03BB" />
- <symbol char="E0C2" eq-char="03BC" />
- <symbol char="E0C3" eq-char="03BD" />
- <symbol char="E0C4" eq-char="03BE" />
- <symbol char="E0C5" eq-char="03BF" />
- <symbol char="E0C6" eq-char="03C0" />
- <symbol char="E0C7" eq-char="03C1" />
- <symbol char="E0C8" eq-char="03C3" />
- <symbol char="E0C9" eq-char="03C4" />
- <symbol char="E0CA" eq-char="03C5" />
- <symbol char="E0CB" eq-char="03D5" />
- <symbol char="E0CC" eq-char="03C7" />
- <symbol char="E0CD" eq-char="03C8" />
- <symbol char="E0CE" eq-char="03C9" />
- <symbol char="E0CF" eq-char="03B5" />
- <symbol char="E0D0" eq-char="03D1" />
- <symbol char="E0D1" eq-char="03D6" />
- <symbol char="E0D3" eq-char="03C2" />
- <symbol char="E0D4" eq-char="03C6" />
- <symbol char="E0D5" eq-char="2202" />
- <symbol char="E0D9" eq-char="22A4" />
- <symbol char="E0DB" eq-char="2190" />
- <symbol char="E0DC" eq-char="2191" />
- <symbol char="E0DD" eq-char="2193" />
-</special-symbol-set>
-
-<!-- support for private use area of "StarSymbol" (StarOffice symbol font)
- StarSymbol is an extension of OpenSymbol -->
-<special-symbol-set name="StarSymbol" parent="OpenSymbol" fontenc="any">
- <!-- todo -->
-</special-symbol-set>
-
-<!-- support for the standard mswindows font "Symbol" -->
-<special-symbol-set name="Symbol" fontenc="any" eight-bit="true" >
- <symbol char="21" text="!" />
- <symbol char="22" math="{\forall}" />
- <symbol char="23" text="\#" />
- <symbol char="F024" math="{\exists}" />
- <symbol char="F025" text="\%" />
- <symbol char="F026" text="\&amp;" />
- <symbol char="F027" math="{\backepsilon}" />
- <symbol char="F028" text="(" />
- <symbol char="F029" text=")" />
- <symbol char="F02A" math="*" />
- <symbol char="F02B" math="+" />
- <symbol char="F02C" text="," />
- <symbol char="F02D" math="-" />
- <symbol char="F02E" text="." />
- <symbol char="F02F" math="/" />
- <symbol char="F030" text="0" />
- <symbol char="F031" text="1" />
- <symbol char="F032" text="2" />
- <symbol char="F033" text="3" />
- <symbol char="F034" text="4" />
- <symbol char="F035" text="5" />
- <symbol char="F036" text="6" />
- <symbol char="F037" text="7" />
- <symbol char="F038" text="8" />
- <symbol char="F039" text="9" />
- <symbol char="F03A" text=":" />
- <symbol char="F03B" text=";" />
- <symbol char="F03C" math="&lt;" />
- <symbol char="F03D" math="=" />
- <symbol char="F03E" math="&gt;" />
- <symbol char="F03F" text="?" />
- <symbol char="F040" math="{\cong}" />
- <symbol char="F041" math="A" />
- <symbol char="F042" math="B" />
- <symbol char="F043" math="X" />
- <symbol char="F044" math="{\Delta}" />
- <symbol char="F045" math="E" />
- <symbol char="F046" math="{\Phi}" />
- <symbol char="F047" math="{\Gamma}" />
- <symbol char="F048" math="H" />
- <symbol char="F049" math="I" />
- <symbol char="F04A" math="{\vartheta}" />
- <symbol char="F04B" math="K" />
- <symbol char="F04C" math="{\Lambda}" />
- <symbol char="F04D" math="M" />
- <symbol char="F04E" math="N" />
- <symbol char="F04F" math="O" />
- <symbol char="F050" math="{\Pi}" />
- <symbol char="F051" math="{\Theta}" />
- <symbol char="F052" math="P" />
- <symbol char="F053" math="{\Sigma}" />
- <symbol char="F054" math="T" />
- <symbol char="F055" math="Y" />
- <symbol char="F056" math="{\varsigma}" />
- <symbol char="F057" math="{\Omega}" />
- <symbol char="F058" math="{\Xi}" />
- <symbol char="F059" math="{\Psi}" />
- <symbol char="F05A" math="Z" />
- <symbol char="F05B" text="[" />
- <symbol char="F05C" math="{\therefore}" />
- <symbol char="F05D" text="]" />
- <symbol char="F05E" math="{\perp}" />
- <symbol char="F05F" text="\_" />
- <symbol char="F060" text="{\textasciimacron}" /> <!-- not sure? -->
- <symbol char="F061" math="{\alpha}" />
- <symbol char="F062" math="{\beta}" />
- <symbol char="F063" math="{\chi}" />
- <symbol char="F064" math="{\delta}" />
- <symbol char="F065" math="{\varepsilon}" />
- <symbol char="F066" math="{\phi}" />
- <symbol char="F067" math="{\gamma}" />
- <symbol char="F068" math="{\eta}" />
- <symbol char="F069" math="{\iota}" />
- <symbol char="F06A" math="{\varphi}" />
- <symbol char="F06B" math="{\kappa}" />
- <symbol char="F06C" math="{\lambda}" />
- <symbol char="F06D" math="{\mu}" />
- <symbol char="F06E" math="{\nu}" />
- <symbol char="F06F" math="o" />
- <symbol char="F070" math="{\pi}" />
- <symbol char="F071" math="{\theta}" />
- <symbol char="F072" math="{\varrho}" />
- <symbol char="F073" math="{\sigma}" />
- <symbol char="F074" math="{\tau}" />
- <symbol char="F075" math="{\upsilon}" />
- <symbol char="F076" math="{\varpi}" />
- <symbol char="F077" math="{\omega}" />
- <symbol char="F078" math="{\xi}" />
- <symbol char="F079" math="{\psi}" />
- <symbol char="F07A" math="{\zeta}" />
- <symbol char="F07B" text="\{" />
- <symbol char="F07C" text="{\textbar}" />
- <symbol char="F07D" text="\}" />
- <symbol char="F07E" text="\~{}" />
- <symbol char="F0A1" math="{\Upsilon}" />
- <symbol char="F0A2" text="'" />
- <symbol char="F0A3" math="{\leq}" />
- <symbol char="F0A4" math="/" />
- <symbol char="F0A5" math="{\infty}" />
- <symbol char="F0A6" math="f" />
- <symbol char="F0A7" math="{\clubsuit}" />
- <symbol char="F0A8" math="{\diamondsuit}" />
- <symbol char="F0A9" math="{\heartsuit}" />
- <symbol char="F0AA" math="{\spadesuit}" />
- <symbol char="F0AB" math="{\leftrightarrow}" />
- <symbol char="F0AC" math="{\leftarrow}" />
- <symbol char="F0AD" math="{\uparrow}" />
- <symbol char="F0AE" math="{\rightarrow}" />
- <symbol char="F0AF" math="{\downarrow}" />
- <symbol char="F0B0" text="{\textdegree}" />
- <symbol char="F0B1" math="{\pm}" />
- <symbol char="F0B2" text="{\textquotedbl}" />
- <symbol char="F0B3" math="{\geq}" />
- <symbol char="F0B4" math="{\times}" />
- <symbol char="F0B5" math="{\propto}" />
- <symbol char="F0B6" math="{\partial}" />
- <symbol char="F0B7" text="{\textbullet}" />
- <symbol char="F0B8" math="{\div}" />
- <symbol char="F0B9" math="{\neq}" />
- <symbol char="F0BA" math="{\equiv}" />
- <symbol char="F0BB" math="{\approx}" />
- <symbol char="F0BC" math="{\ldots}" />
- <symbol char="F0BD" math="{\mid}" />
- <symbol char="F0BE" text="{---}" />
- <!--<symbol char="F0BF" math="??" />-->
- <symbol char="F0C0" math="{\aleph}" />
- <symbol char="F0C1" math="{\Im}" />
- <symbol char="F0C2" math="{\Re}" />
- <symbol char="F0C3" math="{\wp}" />
- <symbol char="F0C4" math="{\otimes}" />
- <symbol char="F0C5" math="{\oplus}" />
- <symbol char="F0C6" math="{\varnothing}" />
- <symbol char="F0C7" math="{\cap}" />
- <symbol char="F0C8" math="{\cup}" />
- <symbol char="F0C9" math="{\supset}" />
- <symbol char="F0CA" math="{\supseteq}" />
- <symbol char="F0CB" math="{\not\subset}" />
- <symbol char="F0CC" math="{\subset}" />
- <symbol char="F0CD" math="{\subseteq}" />
- <symbol char="F0CE" math="{\in}" />
- <symbol char="F0CF" math="{\not\in}" />
- <symbol char="F0D0" math="{\angle}" />
- <symbol char="F0D1" math="{\nabla}" />
- <symbol char="F0D2" text="{\textregistered}" />
- <symbol char="F0D3" text="{\textcopyright}" />
- <symbol char="F0D4" text="{\texttrademark}" />
- <symbol char="F0D5" math="{\prod}" />
- <symbol char="F0D6" math="{\surd}" />
- <symbol char="F0D7" math="{\cdot}" />
- <symbol char="F0D8" math="{\lnot}" />
- <symbol char="F0D9" math="{\wedge}" />
- <symbol char="F0DA" math="{\vee}" />
- <symbol char="F0DB" math="{\Leftrightarrow}" />
- <symbol char="F0DC" math="{\Leftarrow}" />
- <symbol char="F0DD" math="{\Uparrow}" />
- <symbol char="F0DE" math="{\Rightarrow}" />
- <symbol char="F0DF" math="{\Downarrow}" />
- <symbol char="F0E0" math="{\Diamond}" />
- <symbol char="F0E1" math="{\langle}" />
- <symbol char="F0E2" text="{\textregistered}" />
- <symbol char="F0E3" text="{\textcopyright}" />
- <symbol char="F0E4" text="{\texttrademark}" />
- <symbol char="F0E5" math="{\sum}" />
- <symbol char="F0F1" math="{\rangle}" />
- <symbol char="F0F2" math="{\int}" />
-</special-symbol-set>
-
-<!-- support for the standard mswindows font "WingDings" -->
-<special-symbol-set name="Wingdings" fontenc="any" eight-bit="true" >
- <symbol char="F020" eq-char="0020" />
- <symbol char="F021" eq-char="270F" />
- <symbol char="F022" eq-char="2702" />
- <symbol char="F023" eq-char="2701" />
- <symbol char="F028" eq-char="260E" />
- <symbol char="F029" eq-char="2706" />
- <symbol char="F02A" eq-char="2709" />
- <symbol char="F036" eq-char="231B" />
- <symbol char="F037" eq-char="2328" />
- <symbol char="F03E" eq-char="2707" />
- <symbol char="F03F" eq-char="270D" />
- <symbol char="F041" eq-char="270C" />
- <symbol char="F045" eq-char="261C" />
- <symbol char="F046" eq-char="261E" />
- <symbol char="F047" eq-char="261D" />
- <symbol char="F048" eq-char="261F" />
- <symbol char="F04A" eq-char="263A" />
- <symbol char="F04C" eq-char="2639" />
- <symbol char="F04E" eq-char="2620" />
- <symbol char="F051" eq-char="2708" />
- <symbol char="F052" eq-char="263C" />
- <symbol char="F054" eq-char="2744" />
- <symbol char="F056" eq-char="271E" />
- <symbol char="F058" eq-char="2720" />
- <symbol char="F059" eq-char="2721" />
- <symbol char="F05A" eq-char="262A" />
- <symbol char="F05B" eq-char="262F" />
- <symbol char="F05C" eq-char="0950" />
- <symbol char="F05D" eq-char="2638" />
- <symbol char="F05E" eq-char="2648" />
- <symbol char="F05F" eq-char="2649" />
- <symbol char="F060" eq-char="264A" />
- <symbol char="F061" eq-char="264B" />
- <symbol char="F062" eq-char="264C" />
- <symbol char="F063" eq-char="264D" />
- <symbol char="F064" eq-char="264E" />
- <symbol char="F065" eq-char="264F" />
- <symbol char="F066" eq-char="2650" />
- <symbol char="F067" eq-char="2651" />
- <symbol char="F068" eq-char="2652" />
- <symbol char="F069" eq-char="2653" />
- <symbol char="F06A" eq-char="0026" />
- <symbol char="F06B" eq-char="0026" />
- <symbol char="F06C" eq-char="25CF" />
- <symbol char="F06D" eq-char="274D" />
- <symbol char="F06E" eq-char="25A0" />
- <symbol char="F06F" eq-char="25A1" />
- <symbol char="F071" eq-char="2751" />
- <symbol char="F072" eq-char="2752" />
- <symbol char="F074" eq-char="2666" />
- <symbol char="F075" eq-char="25C6" />
- <symbol char="F076" eq-char="2756" />
- <symbol char="F078" eq-char="2327" />
- <symbol char="F079" eq-char="2353" />
- <symbol char="F07A" eq-char="2318" />
- <symbol char="F07B" eq-char="2740" />
- <symbol char="F07C" eq-char="273F" />
- <symbol char="F07D" eq-char="275D" />
- <symbol char="F07E" eq-char="275E" />
- <symbol char="F07F" eq-char="25AF" />
- <symbol char="F080" eq-char="24EA" />
- <symbol char="F081" eq-char="2460" />
- <symbol char="F082" eq-char="2461" />
- <symbol char="F083" eq-char="2462" />
- <symbol char="F084" eq-char="2463" />
- <symbol char="F085" eq-char="2464" />
- <symbol char="F086" eq-char="2465" />
- <symbol char="F087" eq-char="2466" />
- <symbol char="F088" eq-char="2467" />
- <symbol char="F089" eq-char="2468" />
- <symbol char="F08A" eq-char="2469" />
- <symbol char="F08B" eq-char="24FF" />
- <symbol char="F08C" eq-char="2776" />
- <symbol char="F08D" eq-char="2777" />
- <symbol char="F08E" eq-char="2778" />
- <symbol char="F08F" eq-char="2779" />
- <symbol char="F090" eq-char="277A" />
- <symbol char="F091" eq-char="277B" />
- <symbol char="F092" eq-char="277C" />
- <symbol char="F093" eq-char="277D" />
- <symbol char="F094" eq-char="277E" />
- <symbol char="F095" eq-char="277F" />
- <symbol char="F09E" eq-char="00B7" />
- <symbol char="F09F" eq-char="2022" />
- <symbol char="F0A0" eq-char="25AA" />
- <symbol char="F0A1" eq-char="25CB" />
- <symbol char="F0A4" eq-char="25C9" />
- <symbol char="F0A5" eq-char="25CE" />
- <symbol char="F0A7" eq-char="25AA" />
- <symbol char="F0A8" eq-char="25FB" />
- <symbol char="F0AA" eq-char="2726" />
- <symbol char="F0AB" eq-char="2605" />
- <symbol char="F0AC" eq-char="2736" />
- <symbol char="F0AD" eq-char="2734" />
- <symbol char="F0AE" eq-char="2739" />
- <symbol char="F0AF" eq-char="2735" />
- <symbol char="F0B1" eq-char="2316" />
- <symbol char="F0B2" eq-char="2727" />
- <symbol char="F0B3" eq-char="2311" />
- <symbol char="F0B5" eq-char="272A" />
- <symbol char="F0B6" eq-char="2730" />
- <symbol-subset requires="ifsym" fontenc="any">
- <symbol char="F0B7" text="\showclock{1}{0}" />
- <symbol char="F0B8" text="\showclock{2}{0}" />
- <symbol char="F0B9" text="\showclock{3}{0}" />
- <symbol char="F0BA" text="\showclock{4}{0}" />
- <symbol char="F0BB" text="\showclock{5}{0}" />
- <symbol char="F0BC" text="\showclock{6}{0}" />
- <symbol char="F0BD" text="\showclock{7}{0}" />
- <symbol char="F0BE" text="\showclock{8}{0}" />
- <symbol char="F0BF" text="\showclock{9}{0}" />
- <symbol char="F0C0" text="\showclock{10}{0}" />
- <symbol char="F0C1" text="\showclock{11}{0}" />
- <symbol char="F0C2" text="\showclock{0}{0}" />
- </symbol-subset>
- <symbol char="F0D5" eq-char="232B" />
- <symbol char="F0D6" eq-char="2326" />
- <symbol char="F0D8" eq-char="27A2" />
- <symbol char="F0DC" eq-char="27B2" />
- <symbol char="F0E8" eq-char="2794" />
- <symbol char="F0EF" eq-char="21E6" />
- <symbol char="F0F0" eq-char="21E8" />
- <symbol char="F0F1" eq-char="21E7" />
- <symbol char="F0F2" eq-char="21E9" />
- <symbol char="F0F3" eq-char="2B04" />
- <symbol char="F0F4" eq-char="21F3" />
- <symbol char="F0F5" eq-char="2B00" />
- <symbol char="F0F6" eq-char="2B01" />
- <symbol char="F0F7" eq-char="2B03" />
- <symbol char="F0F8" eq-char="2B02" />
- <symbol char="F0F9" eq-char="25AD" />
- <symbol char="F0FA" eq-char="25AB" />
- <symbol char="F0FB" eq-char="2717" />
- <symbol char="F0FC" eq-char="2713" />
- <symbol char="F0FD" eq-char="2612" />
- <symbol char="F0FE" eq-char="2611" />
-</special-symbol-set>
-
-<!-- support for phonetic font "IPAKielSeven" -->
-<special-symbol-set name="IPAKielSeven" requires="tipa" fontenc="T3" eight-bit="true">
- <symbol char="F041" text="A" />
- <symbol char="F042" text="B" />
- <symbol char="F043" text="\c{c}" />
- <symbol char="F044" text="D" />
- <symbol char="F045" text="\textschwa " />
- <symbol char="F046" text="F" />
- <symbol char="F047" text="\;G" />
- <symbol char="F048" text="H" />
- <symbol char="F049" text="I" />
- <symbol char="F04a" text="J" />
- <symbol char="F04b" text="\j" />
- <symbol char="F04c" text="\textlyoghlig " />
- <symbol char="F04d" text="M" />
- <symbol char="F04e" text="N" />
- <symbol char="F04f" text="O" />
- <symbol char="F050" text="\textclosereversepsilon " />
- <symbol char="F051" text="\textnormal{?}" />
- <symbol char="F052" text="\;R" />
- <symbol char="F053" text="S" />
- <symbol char="F054" text="T" />
- <symbol char="F055" text="\textturnm " />
- <symbol char="F056" text="G" />
- <symbol char="F057" text="\;W" />
- <symbol char="F058" text="X" />
- <symbol char="F059" text="Y" />
- <symbol char="F05a" text="Z" />
- <symbol char="F041" text="a" />
- <symbol char="F062" text="b" />
- <symbol char="F063" text="c" />
- <symbol char="F064" text="d" />
- <symbol char="F065" text="e" />
- <symbol char="F066" text="f" />
- <symbol char="F067" text="g" />
- <symbol char="F068" text="h" />
- <symbol char="F069" text="i" />
- <symbol char="F06a" text="j" />
- <symbol char="F06b" text="k" />
- <symbol char="F06c" text="l" />
- <symbol char="F06d" text="m" />
- <symbol char="F06e" text="n" />
- <symbol char="F06f" text="o" />
- <symbol char="F070" text="p" />
- <symbol char="F071" text="q" />
- <symbol char="F072" text="r" />
- <symbol char="F073" text="s" />
- <symbol char="F074" text="t" />
- <symbol char="F075" text="u" />
- <symbol char="F076" text="v" />
- <symbol char="F077" text="w" />
- <symbol char="F078" text="x" />
- <symbol char="F079" text="y" />
- <symbol char="F07a" text="z" />
- <symbol char="F081" text="\textturnscripta " />
- <symbol char="F0f5" text="\;B" />
- <symbol char="F082" text="C" />
- <symbol char="F0eb" text="\texthtd " />
- <symbol char="F0ab" text="\textreve " />
- <symbol char="F0ec" text="\texthtscg " />
- <symbol char="F0fd" text="\;H" />
- <symbol char="F0ee" text="\textsuperscript{h}" />
- <symbol char="F0f6" text="\textbari " />
- <symbol char="F0ef" text="\textbardotlessj " />
- <symbol char="F0f0" text="\:l" />
- <symbol char="F0f1" text="\textbeltl " />
- <symbol char="F0e5" text="\textturnmrleg " />
- <symbol char="F0f7" text="\textsuperscript{n}" />
- <symbol char="F0af" text="\textturnv " />
- <symbol char="F0b8" text="\textrevepsilon " />
- <symbol char="F0ce" text="\textscoelig " />
- <symbol char="F0e4" text="\textinvscr " />
- <symbol char="F0ea" text="\texththeng " />
- <symbol char="F0cb" text="\textsuper{\texttheta}" />
- <symbol char="F0ac" text="\textbaru " />
- <symbol char="F0d7" text="\textsuperscript{\textgamma}" />
- <symbol char="F0b9" text="\textsc{\texttheta}" />
- <symbol char="F0ca" text="\textundercross " />
- <symbol char="F09d" text="\textsuperscript{u}" />
- <symbol char="F0fc" text="\textctz " />
- <symbol char="F08c" text="\textturna " />
- <symbol char="F0ba" text="\texthtb " />
- <symbol char="F08d" text="\textbottomtiebar " />
- <symbol char="F0d9" text="\textrtaild " />
- <symbol char="F0e3" text="\o " />
- <symbol char="F0f4" text="\texthtg " />
- <symbol char="F0a9" text="\textcrh " />
- <symbol char="F0fa" text="\texthtbardotlessj " />
- <symbol char="F092" text="i" />
- <symbol char="F0c6" text="\textsuperscript{j}" />
- <symbol char="F0fb" text="\textscl " />
- <symbol char="F0c2" text="\textsuperscript{l}" />
- <symbol char="F04d" text="\textltailm " />
- <symbol char="F0d0" text="\textscn " />
- <symbol char="F0bf" text="\textramshorns " />
- <symbol char="F0d3" text="\textepsilon " />
- <symbol char="F0cf" text="\ae " />
- <symbol char="F0a8" text="\textturnr " />
- <symbol char="F0a7" text="\textrtails " />
- <symbol char="F0e6" text="\textrtailt " />
- <symbol char="F0e7" text="\textupsilon " />
- <symbol char="F0c3" text="\textscriptv " />
- <symbol char="F085" text="\textturnw " />
- <symbol char="F0c5" text="\textsuperscript{x}" />
- <symbol char="F0b4" text="\textturny " />
- <symbol char="F0bd" text="\textrtailz " />
- <symbol char="F096" text="\textpipe " />
- <symbol char="F031" text="\textsubbridge{}" />
- <symbol char="F032" text="\textsubbar{}" />
- <symbol char="F033" text="\textsubwedge{}" />
- <symbol char="F034" text="\textsubsquare " />
- <symbol char="F035" text="\textadvancing{}" />
- <symbol char="F036" text="\textraising{}" />
- <symbol char="F037" text="\c{}" />
- <symbol char="F038" text="\textsubarch{]}" />
- <symbol char="F039" text="\textsubring{}" />
- <symbol char="F030" text="\textsubtilde{}" />
- <symbol char="F02d" text="-" />
- <symbol char="F03d" text="\textrtailn " />
- <symbol char="F084" text="\textdoublepipe " />
- <symbol char="F021" text="\'{}" />
- <symbol char="F040" text="\={}" />
- <symbol char="F023" text="\v{}" />
- <symbol char="F024" text="\^{}" />
- <symbol char="F02a" text="\u{}" />
- <symbol char="F028" text="\r{}" />
- <symbol char="F029" text="\~{}" />
- <symbol char="F05f" text="\H{}" />
- <symbol char="F02b" text="\textovercross{}" />
- <symbol char="F07e" text="\`{}" />
- <symbol char="F0a1" text="\texttoptiebar{}" />
- <symbol char="F0e1" text="\&quot;{}" />
- <symbol char="F0d1" text="\H*{}" />
- <symbol char="F0b1" text="\rhoticity " />
- <symbol char="F060" text="\textsecstress{}" />
- <symbol char="F0c1" text="\textinvsubbridge{}" />
- <symbol char="F0aa" text="\textsubplus{}" />
- <symbol char="F0a3" text="\textseagull{}" />
- <symbol char="F0a2" text="\textsubdot{}" />
- <symbol char="F0b0" text="\textretracting{}" />
- <symbol char="F0a4" text="\textlowering{}" />
- <symbol char="F0a6" text="\textpolhook{}" />
- <symbol char="F0a5" text="\textbottomtiebar{}" />
- <symbol char="F0bb" text="\textsubumlaut{}" />
- <symbol char="F0bc" text="\textbar{}" />
- <symbol char="F0f3" text="=" />
- <symbol char="F0ad" text="\textltailn " />
- <symbol char="F02c" text="," />
- <symbol char="F02e" text="." />
- <symbol char="F02f" text="\textglotstop " />
- <symbol char="F05b" text="[" />
- <symbol char="F05d" text="]" />
- <symbol char="F03b" text=";" />
- <symbol char="F027" text="'" />
- <symbol char="F05c" text="/" />
- <symbol char="F03c" text="!" />
- <symbol char="F03e" text="\textbullseye " />
- <symbol char="F03f" text="\textrevglotstop " />
- <symbol char="F07b" text="\oe " />
- <symbol char="F07d" text="\textcorner " />
- <symbol char="F03a" text="\textltilde " />
- <symbol char="F022" text="\textprimstress " />
- <symbol char="F07c" text="\textfishhookr " />
- <symbol char="F0f8" text="\textdoublebarpipe " />
- <symbol char="F0f9" text="\textvertline " />
- <symbol char="F0c0" text="\textbarrevglotstop " />
- <symbol char="F0ff" text="\" />
- <symbol char="F0d5" text="\textturnrrtail " />
- <symbol char="F0f2" text="\texthalflength " />
- <symbol char="F0ae" text="\textsecstress " />
- <symbol char="F0c8" text="\textturnlonglegr " />
- <symbol char="F0f8" text="\textdoublevertline " />
- <symbol char="F0f9" text="\textsuperscript{\textrevglotstop}" />
- <symbol char="F0c0" text="\textbarglotstop " />
- <symbol char="F0ff" text="(" />
- <symbol char="F0d5" text=")" />
- <symbol char="F0f2" text="\textlengthmark " />
- <symbol char="F0ae" text="`" />
- <symbol char="F0c8" text="\textrtailr " />
-</special-symbol-set>
-
-<!-- support for phonetic font "IPAExtras" -->
-<special-symbol-set name="IPAExtras" requires="tipa" fontenc="T3">
- <symbol char="F041" text="\textturncelig " />
- <symbol char="F0ee" text="\textsuperscript{h}" />
- <symbol char="F0f6" text="\textiota " />
- <symbol char="F061" text="\ensuremath{\alpha}" />
- <symbol char="F062" text="\={}" />
- <symbol char="F063" text="\texthtc " />
- <symbol char="F064" text="\textsuperimposetilde{d}" />
- <symbol char="F065" text="\textrhookschwa " />
- <symbol char="F066" text="\textbardotlessj " />
- <symbol char="F067" text="\textg " />
- <symbol char="F068" text="\textturnh " />
- <symbol char="F069" text="\textiota " />
- <symbol char="F06a" text="\^{j}\textrthook " />
- <symbol char="F06b" text="\texthtk " />
- <symbol char="F06e" text="\textnrleg " />
- <symbol char="F06f" text="\textcloseomega " />
- <symbol char="F070" text="\texthtp " />
- <symbol char="F071" text="\texthtq " />
- <symbol char="F072" text="\textlonglegr " />
- <symbol char="F074" text="\texthtt " />
- <symbol char="F075" text="\textscriptv " />
- <symbol char="F076" text="\textacute " />
- <symbol char="F077" text="\.{}" />
- <symbol char="F078" text="\ensuremath{^{^{\infty}}}" />
- <symbol char="F07a" text="\v{z}" />
-</special-symbol-set>
-
-</symbols>
-
-
-
-<!--
-These symbols have been replaced by simpler versions (eg. c/o and \frac13)
-Should maybe be reintroduced later (via an option).
-<symbol char="2100" text="\textvulgarfrac{a}{c}" />
-<symbol char="2101" text="\textvulgarfrac{a}{s}" />
-<symbol char="2105" text="\textvulgarfrac{c}{o}" />
-<symbol char="2106" text="\textvulgarfrac{c}{u}" />
-<symbol char="2153" text="\textvulgarfrac13"/>
-<symbol char="2154" text="\textvulgarfrac23"/>
-<symbol char="2155" text="\textvulgarfrac15"/>
-<symbol char="2156" text="\textvulgarfrac25"/>
-<symbol char="2157" text="\textvulgarfrac35"/>
-<symbol char="2158" text="\textvulgarfrac45"/>
-<symbol char="2159" text="\textvulgarfrac16"/>
-<symbol char="215A" text="\textvulgarfrac56"/>
-<symbol char="215B" text="\textvulgarfrac18"/>
-<symbol char="215C" text="\textvulgarfrac38"/>
-<symbol char="215D" text="\textvulgarfrac58"/>
-<symbol char="215E" text="\textvulgarfrac78"/>
-<symbol char="215F" text="\textvulgarfrac1{ }"/>
--->
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/BibMark.java b/xmerge/source/writer2latex/source/writer2latex/office/BibMark.java
deleted file mode 100644
index db75676e5e7b..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/BibMark.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/************************************************************************
- *
- * BibMark.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3 (2003-07-30)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-
-import writer2latex.util.*;
-import writer2latex.office.*;
-
-/**
- * <p>This class represents a single bibliography-mark.</p>
- */
-public final class BibMark {
- // Available fields
- public static final int ADDRESS = 0;
- public static final int ANNOTE = 1;
- public static final int AUTHOR = 2;
- public static final int BOOKTITLE = 3;
- public static final int CHAPTER = 4;
- // public static final int CROSSREF = 5; // BibTeX, missing in OOo
- public static final int EDITION = 6;
- public static final int EDITOR = 7;
- public static final int HOWPUBLISHED = 8;
- public static final int INSTITUTION = 9;
- public static final int JOURNAL = 10;
- // public static final int KEY = 11; // BibTeX, missing in OOo
- public static final int MONTH = 12;
- public static final int NOTE = 13;
- public static final int NUMBER = 14;
- public static final int ORGANIZATIONS = 15; // BibTeX: organization
- public static final int PAGES = 16;
- public static final int PUBLISHER = 17;
- public static final int SCHOOL = 18;
- public static final int SERIES = 19;
- public static final int TITLE = 20 ;
- public static final int REPORT_TYPE = 21; // BibTeX: report
- public static final int VOLUME = 22;
- public static final int YEAR = 23;
- // remaining fields are not standard in BibTeX
- public static final int URL = 24;
- public static final int CUSTOM1 = 25;
- public static final int CUSTOM2 = 26;
- public static final int CUSTOM3 = 27;
- public static final int CUSTOM4 = 28;
- public static final int CUSTOM5 = 29;
- public static final int ISBN = 30;
- public static final int FIELD_COUNT = 31;
-
-
- // Private data
- private String sIdentifier;
- private String sEntryType;
- private String[] fields = new String[FIELD_COUNT];
-
- /**
- * <p>Create a new BibMark from scratch.</p>
- */
- public BibMark(String sIdentifier, String sEntryType) {
- this.sIdentifier = sIdentifier;
- this.sEntryType = sEntryType;
- }
-
- /**
- * <p>Create a new BibMark from a text:bibliography-mark node.</p>
- */
- public BibMark(Node node) {
- sIdentifier = Misc.getAttribute(node,XMLString.TEXT_IDENTIFIER);
- sEntryType = Misc.getAttribute(node,XMLString.TEXT_BIBLIOGRAPHY_TYPE);
- if (sEntryType==null) { // bug in OOo 1.0!
- sEntryType = Misc.getAttribute(node,XMLString.TEXT_BIBILIOGRAPHIC_TYPE);
- }
- fields[ADDRESS] = Misc.getAttribute(node,XMLString.TEXT_ADDRESS);
- fields[ANNOTE] = Misc.getAttribute(node,XMLString.TEXT_ANNOTE);
- fields[AUTHOR] = Misc.getAttribute(node,XMLString.TEXT_AUTHOR);
- fields[BOOKTITLE] = Misc.getAttribute(node,XMLString.TEXT_BOOKTITLE);
- fields[CHAPTER] = Misc.getAttribute(node,XMLString.TEXT_CHAPTER);
- fields[EDITION] = Misc.getAttribute(node,XMLString.TEXT_EDITION);
- fields[EDITOR] = Misc.getAttribute(node,XMLString.TEXT_EDITOR);
- fields[HOWPUBLISHED] = Misc.getAttribute(node,XMLString.TEXT_HOWPUBLISHED);
- fields[INSTITUTION] = Misc.getAttribute(node,XMLString.TEXT_INSTITUTION);
- fields[JOURNAL] = Misc.getAttribute(node,XMLString.TEXT_JOURNAL);
- fields[MONTH] = Misc.getAttribute(node,XMLString.TEXT_MONTH);
- fields[NOTE] = Misc.getAttribute(node,XMLString.TEXT_NOTE);
- fields[NUMBER] = Misc.getAttribute(node,XMLString.TEXT_NUMBER);
- fields[ORGANIZATIONS] = Misc.getAttribute(node,XMLString.TEXT_ORGANIZATIONS);
- fields[PAGES] = Misc.getAttribute(node,XMLString.TEXT_PAGES);
- fields[PUBLISHER] = Misc.getAttribute(node,XMLString.TEXT_PUBLISHER);
- fields[SCHOOL] = Misc.getAttribute(node,XMLString.TEXT_SCHOOL);
- fields[SERIES] = Misc.getAttribute(node,XMLString.TEXT_SERIES);
- fields[TITLE] = Misc.getAttribute(node,XMLString.TEXT_TITLE);
- fields[REPORT_TYPE] = Misc.getAttribute(node,XMLString.TEXT_REPORT_TYPE);
- fields[VOLUME] = Misc.getAttribute(node,XMLString.TEXT_VOLUME);
- fields[YEAR] = Misc.getAttribute(node,XMLString.TEXT_YEAR);
- fields[URL] = Misc.getAttribute(node,XMLString.TEXT_URL);
- fields[CUSTOM1] = Misc.getAttribute(node,XMLString.TEXT_CUSTOM1);
- fields[CUSTOM2] = Misc.getAttribute(node,XMLString.TEXT_CUSTOM2);
- fields[CUSTOM3] = Misc.getAttribute(node,XMLString.TEXT_CUSTOM3);
- fields[CUSTOM4] = Misc.getAttribute(node,XMLString.TEXT_CUSTOM4);
- fields[CUSTOM5] = Misc.getAttribute(node,XMLString.TEXT_CUSTOM5);
- fields[ISBN] = Misc.getAttribute(node,XMLString.TEXT_ISBN);
- }
-
- /**
- * <p>Get the identifier.</p>
- */
- public String getIdentifier() { return sIdentifier; }
-
- /**
- * <p>Get the entry type.</p>
- */
- public String getEntryType() { return sEntryType; }
-
- /**
- * <p>Set a specific field.</p>
- */
- public void setField(int nField,String sValue) { fields[nField] = sValue; }
-
- /**
- * <p>Return a specific field.</p>
- */
- public String getField(int nField) { return fields[nField]; }
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/FontDeclaration.java b/xmerge/source/writer2latex/source/writer2latex/office/FontDeclaration.java
deleted file mode 100644
index c68faa28f0a1..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/FontDeclaration.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/************************************************************************
- *
- * FontDeclaration.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.2 (2002-10-31)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-
-/** <p> Class representing a font declaration in OOo </p>
- */
-public class FontDeclaration extends OfficeStyle {
- private PropertySet properties = new PropertySet();
-
- public void loadStyleFromDOM(Node node) {
- super.loadStyleFromDOM(node);
- properties.loadFromDOM(node);
- }
-
- public String getProperty(String sProperty){
- return properties.getProperty(sProperty);
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/ImageLoader.java b/xmerge/source/writer2latex/source/writer2latex/office/ImageLoader.java
deleted file mode 100644
index 17fee98a92e0..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/ImageLoader.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/************************************************************************
- *
- * ImageLoader.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-10-22)
- *
- */
-
-package writer2latex.office;
-
-import java.io.IOException;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import org.openoffice.xmerge.converter.xml.EmbeddedBinaryObject;
-import org.openoffice.xmerge.converter.xml.OfficeDocument;
-
-import writer2latex.util.*;
-import writer2latex.xmerge.*;
-
-/**
- * <p>This class extracts images from an OOo file.
- * The images are returned as BinaryGraphicsDocument.</p>
- */
-public final class ImageLoader {
- private OfficeDocument oooDoc;
- private String sOutFileName;
- private int nImageCount = 0; // used to generate filenames
- private boolean bExtractEPS; // should EPS be extracted from SVM?
-
- public ImageLoader(OfficeDocument oooDoc, String sOutFileName, boolean bExtractEPS) {
- this.oooDoc = oooDoc;
- this.sOutFileName = sOutFileName;
- this.bExtractEPS = bExtractEPS;
- }
-
- public BinaryGraphicsDocument getImage(Node node) {
- // node must be a draw:image element.
- // variables to hold data about the image:
- String sMIME = null;
- String sExt = null;
- byte[] blob = null;
-
- String sHref = Misc.getAttribute(node,XMLString.XLINK_HREF);
- if (sHref==null) {
- // Image must be contained in an office:binary-element as base64:
- Node obd = Misc.getChildByTagName(node,XMLString.OFFICE_BINARY_DATA);
- if (obd!=null) {
- StringBuffer buf = new StringBuffer();
- NodeList nl = obd.getChildNodes();
- int nLen = nl.getLength();
- for (int i=0; i<nLen; i++) {
- if (nl.item(i).getNodeType()==Node.TEXT_NODE) {
- buf.append(nl.item(i).getNodeValue());
- }
- }
- // TODO: Use another base64 decoder. This one is "nonstandard"
- /*try {
- blob = new sun.misc.BASE64Decoder().decodeBuffer(buf.toString());
- } catch (IOException e) {
- System.out.println("Oops - error converting base64");
- }
- sMIME = MIMETypes.getMagicMIMEType(blob);
- sExt = MIMETypes.getFileExtension(sMIME);*/
- // Temp: Because of issues with xmerge, we kill the result
- blob = null;
- // TODO: Report to Issuezilla
- }
- }
- else if (sHref.startsWith("#")) {
- // Image is embedded in package:
- sHref = sHref.substring(1);
- if (sHref.startsWith("./")) { sHref = sHref.substring(2); }
- if (oooDoc.getEmbeddedObject(sHref) instanceof EmbeddedBinaryObject) {
- EmbeddedBinaryObject object
- = (EmbeddedBinaryObject) oooDoc.getEmbeddedObject(sHref);
- blob = object.getBinaryData();
- sMIME = object.getType();
- sExt = MIMETypes.getFileExtension(sMIME);
- }
- }
- else {
- // This is a linked image
- // TODO: Download the image from the url in sHref
- }
-
- if (blob==null) { return null; }
-
- // Assign a name (without extension)
- String sName = sOutFileName+"-img"+(++nImageCount);
-
- BinaryGraphicsDocument bgd = null;
-
- if (bExtractEPS && MIMETypes.SVM.equals(MIMETypes.getMagicMIMEType(blob))) {
- // Look for postscript:
- int[] offlen = new int[2];
- if (SVMReader.readSVM(blob,offlen)) {
- bgd = new BinaryGraphicsDocument(sName,
- MIMETypes.EPS_EXT,MIMETypes.EPS);
- bgd.read(blob,offlen[0],offlen[1]);
- }
- }
-
- if (bgd==null) {
- bgd = new BinaryGraphicsDocument(sName,sExt,sMIME);
- bgd.read(blob);
- }
-
- return bgd;
- }
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/IndexMark.java b/xmerge/source/writer2latex/source/writer2latex/office/IndexMark.java
deleted file mode 100644
index a92059952a52..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/IndexMark.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/************************************************************************
- *
- * IndexMark.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.1 (2004-01-02)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-
-import writer2latex.util.*;
-
-/**
- * <p>This class contains static methods to read an index-mark.</p>
- */
-public final class IndexMark {
-
- // Node must be text:alphabetical-index-mark or text:alphabetical-index-mark-start
- public final static String getIndexValue(Node node) {
- if (XMLString.TEXT_ALPHABETICAL_INDEX_MARK.equals(node.getNodeName())) {
- return Misc.getAttribute(node,XMLString.TEXT_STRING_VALUE);
- }
- else {
- return collectMark(node);
- }
- }
-
- // Node must be text:alphabetical-index-mark or text:alphabetical-index-mark-start
- public final static String getKey1(Node node) {
- return Misc.getAttribute(node,XMLString.TEXT_KEY1);
- }
-
- // Node must be text:alphabetical-index-mark or text:alphabetical-index-mark-start
- public final static String getKey2(Node node) {
- return Misc.getAttribute(node,XMLString.TEXT_KEY2);
- }
-
- // Collect a mark
- private final static Node getRightNode(Node node) {
- Node nextNode;
- do {nextNode = node.getNextSibling();
- if (nextNode!=null) { return nextNode; }
- node = node.getParentNode();
- } while (node!=null);
- return null;
- }
-
- private final static String collectMark(Node node) {
- StringBuffer buf = new StringBuffer();
- String sId = Misc.getAttribute(node,XMLString.TEXT_ID);
- node = getRightNode(node);
- while (node!=null) {
- if (node.getNodeType()==Node.TEXT_NODE) {
- buf.append(node.getNodeValue());
- node = getRightNode(node);
- }
- else if (node.getNodeType()==Node.ELEMENT_NODE) {
- boolean bReady = false;
- String sNodeName = node.getNodeName();
- if (sId.equals(Misc.getAttribute(node,XMLString.TEXT_ID))) {
- node = null; // found the end mark
- bReady = true;
- }
- else if (sNodeName.startsWith("text:")
- && !sNodeName.equals(XMLString.TEXT_FOOTNOTE)
- && !sNodeName.equals(XMLString.TEXT_ENDNOTE)) {
- if (node.hasChildNodes()) {
- node = node.getFirstChild(); bReady=true;
- }
- }
- if (!bReady) { node=getRightNode(node); };
- }
- }
- return buf.toString();
- }
-
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/ListCounter.java b/xmerge/source/writer2latex/source/writer2latex/office/ListCounter.java
deleted file mode 100644
index 4a00da3a93b1..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/ListCounter.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/************************************************************************
- *
- * ListCounter.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.2 (2003-03-12)
- *
- */
-
-package writer2latex.office;
-
-import writer2latex.util.*;
-
-/**
- * <p>This class produces labels for OOo lists/outlines (for xhtml
- * and text, which cannot produce them on their own).</p>
- *
- */
-public class ListCounter {
- private int nCounter[] = new int[11];
- private String sNumFormat[] = new String[11];
- private ListStyle style;
- private int nLevel=1; // current level
-
- public ListCounter(ListStyle style) {
- this.style = style;
- for (int i=1; i<=10; i++) {
- sNumFormat[i] = style.getLevelProperty(i,XMLString.STYLE_NUM_FORMAT);
- }
- }
-
- public ListCounter step(int nLevel) {
- nCounter[nLevel]++;
- if (nLevel<10) { nCounter[nLevel+1]=0; }
- this.nLevel = nLevel;
- return this;
- }
-
- public String getLabel() {
- if (sNumFormat[nLevel]==null) return "*";
- int nLevels = Misc.getPosInteger(style.getLevelProperty(nLevel,
- XMLString.TEXT_DISPLAY_LEVELS),1);
- String sPrefix = style.getLevelProperty(nLevel,XMLString.STYLE_NUM_PREFIX);
- String sSuffix = style.getLevelProperty(nLevel,XMLString.STYLE_NUM_SUFFIX);
- String sLabel="";
- if (sPrefix!=null) { sLabel+=sPrefix; }
- for (int j=nLevel-nLevels+1; j<nLevel; j++) {
- sLabel+=formatNumber(nCounter[j],sNumFormat[j],true)+".";
- }
- // TODO: Lettersync
- sLabel+=formatNumber(nCounter[nLevel],sNumFormat[nLevel],true);
- if (sSuffix!=null) { sLabel+=sSuffix; }
- return sLabel;
- }
-
- // Utility method to generate number
- private String formatNumber(int number,String sStyle,boolean bLetterSync) {
- if ("a".equals(sStyle)) { return Misc.int2alph(number,bLetterSync); }
- else if ("A".equals(sStyle)) { return Misc.int2Alph(number,bLetterSync); }
- else if ("i".equals(sStyle)) { return Misc.int2roman(number); }
- else if ("I".equals(sStyle)) { return Misc.int2Roman(number); }
- else if ("1".equals(sStyle)) { return Misc.int2arabic(number); }
- else return "";
- }
-
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/ListStyle.java b/xmerge/source/writer2latex/source/writer2latex/office/ListStyle.java
deleted file mode 100644
index fef8357c00bf..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/ListStyle.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/************************************************************************
- *
- * ListStyle.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3 (2004-02-16)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import writer2latex.util.Misc;
-
-/** <p> Class representing a list style (including outline numbering) in OOo Writer </p> */
-public class ListStyle extends OfficeStyle {
- // the file format doesn't specify a maximum nesting level, but OOo
- // currently supports 10
- private static final int MAX_LEVEL = 10;
- private PropertySet[] level;
- private PropertySet[] levelStyle;
-
- public ListStyle() {
- level = new PropertySet[MAX_LEVEL+1];
- levelStyle = new PropertySet[MAX_LEVEL+1];
- for (int i=1; i<=MAX_LEVEL; i++) {
- level[i] = new PropertySet();
- levelStyle[i] = new PropertySet();
- }
- }
-
- public String getLevelType(int i) {
- if (i>=1 && i<=MAX_LEVEL) {
- return level[i].getName();
- }
- else {
- return null;
- }
- }
-
- public boolean isNumber(int i) {
- return XMLString.TEXT_LIST_LEVEL_STYLE_NUMBER.equals(level[i].getName());
- }
-
- public boolean isBullet(int i) {
- return XMLString.TEXT_LIST_LEVEL_STYLE_BULLET.equals(level[i].getName());
- }
-
- public boolean isImage(int i) {
- return XMLString.TEXT_LIST_LEVEL_STYLE_IMAGE.equals(level[i].getName());
- }
-
- public String getLevelProperty(int i, String sName) {
- if (i>=1 && i<=MAX_LEVEL) {
- return level[i].getProperty(sName);
- }
- else {
- return null;
- }
- }
-
- public String getLevelStyleProperty(int i, String sName) {
- if (i>=1 && i<=MAX_LEVEL) {
- return levelStyle[i].getProperty(sName);
- }
- else {
- return null;
- }
- }
-
- public void loadStyleFromDOM(Node node) {
- super.loadStyleFromDOM(node);
- // Collect level information from child elements:
- if (node.hasChildNodes()){
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++ ) {
- Node child=nl.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE){
- String sLevel = Misc.getAttribute(child,XMLString.TEXT_LEVEL);
- if (sLevel!=null) {
- int nLevel = Misc.getPosInteger(sLevel,1);
- if (nLevel>=1 && nLevel<=MAX_LEVEL) {
- level[nLevel].loadFromDOM(child);
- // Also include style:properties
- if (child.hasChildNodes()){
- NodeList nl2 = child.getChildNodes();
- int nLen2 = nl2.getLength();
- for (int i2 = 0; i2 < nLen2; i2++ ) {
- Node child2=nl2.item(i2);
- if (child2.getNodeType()==Node.ELEMENT_NODE){
- if (child2.getNodeName().equals(XMLString.STYLE_PROPERTIES)) {
- levelStyle[nLevel].loadFromDOM(child2);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/MIMETypes.java b/xmerge/source/writer2latex/source/writer2latex/office/MIMETypes.java
deleted file mode 100644
index 97c3deea5876..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/MIMETypes.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/************************************************************************
- *
- * MIMETypes.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3b (2004-02-26)
- *
- */
-
-package writer2latex.office;
-
-/* Some helpers to handle the MIME types used by OOo
- */
-
-public final class MIMETypes{
- // OOo MIME types, taken from
- // http://framework.openoffice.org/documentation/mimetypes/mimetypes.html
- public static final String WRITER="application/vnd.sun.xml.writer";
- public static final String CALC="application/vnd.sun.xml.calc";
- public static final String IMPRESS="application/vnd.sun.xml.impress";
- public static final String DRAW="application/vnd.sun.xml.draw";
- public static final String CHART="application/vnd.sun.xml.chart";
- public static final String MATH="application/vnd.sun.xml.math";
- // Various graphics formats
- public static final String PNG="image/png";
- public static final String JPEG="image/jpeg";
- public static final String EPS="image/x-eps"; // or application/postscript?
- public static final String SVM="(starview metafile)"; // no MIME type defined!
- // Desitination formats
- public static final String XHTML="text/html";
- public static final String XHTML_MATHML="application/xhtml+xml";
- public static final String XHTML_MATHML_XSL="application/xml";
- public static final String LATEX="application/x-latex";
- public static final String BIBTEX="application/x-bibtex";
- public static final String TEXT="text";
-
- // Magic signatures for some binary graphics files
- public static final byte[] PNG_SIG = { (byte) 0x89, 0x50, 0x4e, 0x47 }; // .PNG
- public static final byte[] JPEG_SIG = { (byte) 0xff, (byte) 0xd8, (byte) 0xff, (byte) 0xe0 };
- public static final byte[] EPS_SIG = { 0x25, 0x21 }; // %!
- public static final byte[] SVM_SIG = { 0x56, 0x43, 0x4c, 0x4d, 0x54, 0x46 }; // VCLMTF
-
- // Preferred file extensions for some graphics files
- public static final String PNG_EXT = ".png";
- public static final String JPEG_EXT = ".jpg"; // this is the default in graphicx.sty
- public static final String EPS_EXT = ".eps";
- public static final String SVM_EXT = ".svm";
-
- private static final boolean isType(byte[] blob, byte[] sig) {
- int n = sig.length;
- for (int i=0; i<n; i++) {
- if (blob[i]!=sig[i]) { return false; }
- }
- return true;
- }
-
- public static final String getMagicMIMEType(byte[] blob) {
- if (isType(blob,PNG_SIG)) { return PNG; }
- if (isType(blob,JPEG_SIG)) { return JPEG; }
- if (isType(blob,EPS_SIG)) { return EPS; }
- if (isType(blob,SVM_SIG)) { return SVM; }
- return "";
- }
-
- public static final String getFileExtension(String sMIME) {
- if (PNG.equals(sMIME)) { return PNG_EXT; }
- if (JPEG.equals(sMIME)) { return JPEG_EXT; }
- if (EPS.equals(sMIME)) { return EPS_EXT; }
- if (SVM.equals(sMIME)) { return SVM_EXT; }
- return "";
- }
-
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/MasterPage.java b/xmerge/source/writer2latex/source/writer2latex/office/MasterPage.java
deleted file mode 100644
index 5f590f3f227f..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/MasterPage.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/************************************************************************
- *
- * MasterPage.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.2 (2002-12-15)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import writer2latex.util.Misc;
-
-/** <p> Class representing a master page in OOo Writer </p> */
-public class MasterPage extends OfficeStyle {
- private PropertySet properties = new PropertySet();
- private Node header = null;
- private Node headerLeft = null;
- private Node footer = null;
- private Node footerLeft = null;
-
- public String getProperty(String sPropName) {
- return properties.getProperty(sPropName);
- }
-
- public Node getHeader() { return header; }
- public Node getHeaderLeft() { return headerLeft; }
- public Node getFooter() { return footer; }
- public Node getFooterLeft() { return footerLeft; }
-
- public void loadStyleFromDOM(Node node) {
- super.loadStyleFromDOM(node);
- properties.loadFromDOM(node);
- header = Misc.getChildByTagName(node,XMLString.STYLE_HEADER);
- headerLeft = Misc.getChildByTagName(node,XMLString.STYLE_HEADER_LEFT);
- footer = Misc.getChildByTagName(node,XMLString.STYLE_FOOTER);
- footerLeft = Misc.getChildByTagName(node,XMLString.STYLE_FOOTER_LEFT);
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/MetaData.java b/xmerge/source/writer2latex/source/writer2latex/office/MetaData.java
deleted file mode 100644
index 446613ab362b..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/MetaData.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/************************************************************************
- *
- * MetaData.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3c (2004-06-06)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import writer2latex.util.*;
-import writer2latex.office.*;
-
-import org.openoffice.xmerge.converter.xml.OfficeDocument;
-
-/**
- * <p>This class represents the metadata of an OOo Writer document.</p>
- */
-public class MetaData {
- // Dublin Core
- private String sTitle = null;
- private String sCreator = null;
- private String sInitialCreator = null;
- private String sDate = null;
- private String sDescription = null;
- private String sLanguage = null;
- private String sSubject = null;
- // Keywords
- private String sKeywords = null;
-
- /** <p>Construct a new instance from an OOo Writer document.</p>
- * @param <code>oooDoc</code> is the OOo document
- */
- public MetaData(OfficeDocument oooDoc) {
- // get the DOM (either package or flat)
- Document dom = oooDoc.getMetaDOM();
- if (dom==null) { dom = oooDoc.getContentDOM(); }
-
- // get the office:meta element
- NodeList list = dom.getElementsByTagName(XMLString.OFFICE_META);
- if (list.getLength() == 0) { return; } // oops, no metadata - fails silently
- Node meta = list.item(0);
- if (!meta.hasChildNodes()) { return; }
-
- // traverse the metadata
- list = meta.getChildNodes();
- int nLen = list.getLength();
- for (int i=0; i<nLen; i++) {
- Node child = list.item(i);
- String sName = child.getNodeName();
- if (XMLString.DC_TITLE.equals(sName)) {
- sTitle = getContent(child);
- }
- if (XMLString.DC_CREATOR.equals(sName)) {
- sCreator = getContent(child);
- }
- if (XMLString.DC_DATE.equals(sName)) {
- sDate = getContent(child);
- }
- if (XMLString.DC_DESCRIPTION.equals(sName)) {
- sDescription = getContent(child);
- }
- if (XMLString.DC_LANGUAGE.equals(sName)) {
- sLanguage = getContent(child);
- }
- if (XMLString.DC_SUBJECT.equals(sName)) {
- sSubject = getContent(child);
- }
- if (XMLString.META_INITIAL_CREATOR.equals(sName)) {
- sInitialCreator = getContent(child);
- }
- if (XMLString.META_KEYWORDS.equals(sName)) {
- // The keywords are contained in meta:keyword elements
- if (child.hasChildNodes()) {
- CSVList keywords = new CSVList(", ");
- // traverse the keywords
- NodeList keywordList = child.getChildNodes();
- int nWordCount = keywordList.getLength();
- for (int j=0; j<nWordCount; j++) {
- Node grandchild = keywordList.item(j);
- if (XMLString.META_KEYWORD.equals(grandchild.getNodeName())){
- keywords.addValue(getContent(grandchild));
- }
- }
- sKeywords = keywords.toString();
- }
- }
- }
- }
-
- /** <p> Get the title of this document (may be null)</p>
- * @return the title of the document
- */
- public String getTitle() { return sTitle; }
-
- /** <p> Get the creator of this document (may be null)</p>
- * @return the creator of the document (or the initial creator if none is specified)
- */
- public String getCreator() { return sCreator==null ? sInitialCreator : sCreator; }
-
- /** <p> Get the initial creator of this document (may be null)</p>
- * @return the initial creator of the document
- */
- public String getInitialCreator() { return sInitialCreator; }
-
- /** <p> Get the date of this document (may be null)</p>
- * @return the date of the document
- */
- public String getDate() { return sDate; }
-
- /** <p> Get the description of this document (may be null)</p>
- * @return the description of the document
- */
- public String getDescription() { return sDescription; }
-
- /** <p> Get the language of this document (may be null)</p>
- * @return the language of the document
- */
- public String getLanguage() { return sLanguage; }
-
- /** <p> Get the subject of this document (may be null)</p>
- * @return the subject of the document
- */
- public String getSubject() { return sSubject; }
-
- /** <p> Get the keywords of this document as a comma separated list (may be null)</p>
- * @return the keywords of the document
- */
- public String getKeywords() { return sKeywords; }
-
- private String getContent(Node node) {
- if (!node.hasChildNodes()) { return null; }
- String s="";
- NodeList list = node.getChildNodes();
- int nLen = list.getLength();
- for (int i=0; i<nLen; i++) {
- if (list.item(i).getNodeType()==Node.TEXT_NODE) {
- s+= list.item(i).getNodeValue();
- }
- }
- return s;
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/OfficeStyle.java b/xmerge/source/writer2latex/source/writer2latex/office/OfficeStyle.java
deleted file mode 100644
index fdda294b5d86..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/OfficeStyle.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/************************************************************************
- *
- * OfficeStyle.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3 (2003-07-01)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import writer2latex.util.Misc;
-
-/** <p> Abstract class representing a style in OOo </p> */
-public abstract class OfficeStyle {
- protected String sName;
- protected OfficeStyleFamily family;
- protected String sParentName;
- protected boolean bAutomatic;
-
- public String getName() { return sName; }
-
- public String getParentName() { return sParentName; }
-
- public OfficeStyleFamily getFamily() { return family; }
-
- public boolean isAutomatic() { return bAutomatic; }
-
- public void loadStyleFromDOM(Node node){
- sParentName = Misc.getAttribute(node,XMLString.STYLE_PARENT_STYLE_NAME);
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/OfficeStyleFamily.java b/xmerge/source/writer2latex/source/writer2latex/office/OfficeStyleFamily.java
deleted file mode 100644
index 6220c92efc81..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/OfficeStyleFamily.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/************************************************************************
- *
- * OfficeStyleFamily.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.1 (2003-11-21)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import java.util.Hashtable;
-import java.util.Enumeration;
-import writer2latex.util.Misc;
-
-/** <p> Class representing a style family in OOo </p> */
-public class OfficeStyleFamily{
- private Hashtable styles = new Hashtable();
- private Class styleClass;
-
- private OfficeStyle defaultStyle = null;
-
- public OfficeStyleFamily(Class styleClass) {
- // styleClass must be a descendant of OfficeStyle
- this.styleClass = styleClass;
- }
-
- public void setDefaultStyle(OfficeStyle style) {
- defaultStyle = style;
- }
-
- public OfficeStyle getDefaultStyle() {
- return defaultStyle;
- }
-
- public OfficeStyle getStyle(String sName) {
- if (sName==null) { return null; }
- else { return (OfficeStyle) styles.get(sName); }
- }
-
- public Enumeration getStylesEnumeration(){
- return styles.elements();
- }
-
- public void loadStyleFromDOM(Node node, boolean bAutomatic) {
- String sName = Misc.getAttribute(node,XMLString.STYLE_NAME);
- if (sName!=null) {
- try {
- OfficeStyle style = (OfficeStyle) styleClass.newInstance();
- style.sName=sName;
- style.family=this;
- style.bAutomatic=bAutomatic;
- style.loadStyleFromDOM(node);
- styles.put(sName,style);
- }
- catch (InstantiationException e) {
- e.printStackTrace();
- }
- catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/PageMaster.java b/xmerge/source/writer2latex/source/writer2latex/office/PageMaster.java
deleted file mode 100644
index 35880f6bd042..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/PageMaster.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/************************************************************************
- *
- * PageMaster.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.2 (2003-01-16)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import writer2latex.util.Misc;
-
-/** <p> Class representing a page master in OOo Writer </p> */
-public class PageMaster extends SectionStyle {
- private String sPageUsage = null;
-
- private boolean bHasFootnoteSep = false;
- private PropertySet footnoteSep = new PropertySet();
-
- private boolean bHasHeaderStyle = false;
- private PropertySet headerStyle = new PropertySet();
-
- private boolean bHasFooterStyle = false;
- private PropertySet footerStyle = new PropertySet();
-
-
- public String getPageUsage() {
- return sPageUsage;
- }
-
- public boolean hasFootnoteSep() { return bHasFootnoteSep; }
-
- public String getFootnoteProperty(String sPropName) {
- return footnoteSep.getProperty(sPropName);
- }
-
- public boolean hasHeaderStyle() { return bHasHeaderStyle; }
-
- public String getHeaderProperty(String sPropName) {
- return headerStyle.getProperty(sPropName);
- }
-
- public boolean hasFooterStyle() { return bHasFooterStyle; }
-
- public String getFooterProperty(String sPropName) {
- return footerStyle.getProperty(sPropName);
- }
-
- public void loadStyleFromDOM(Node node) {
- super.loadStyleFromDOM(node);
- sPageUsage = Misc.getAttribute(node,XMLString.STYLE_PAGE_USAGE);
-
- Node hsNode = Misc.getChildByTagName(node,XMLString.STYLE_HEADER_STYLE);
- if (hsNode!=null) {
- bHasHeaderStyle = true;
- Node hsProperties = Misc.getChildByTagName(hsNode,XMLString.STYLE_PROPERTIES);
- if (hsProperties!=null) { headerStyle.loadFromDOM(hsProperties); }
- }
-
- Node fsNode = Misc.getChildByTagName(node,XMLString.STYLE_FOOTER_STYLE);
- if (fsNode!=null) {
- bHasFooterStyle = true;
- Node fsProperties = Misc.getChildByTagName(fsNode,XMLString.STYLE_PROPERTIES);
- if (fsProperties!=null) { footerStyle.loadFromDOM(fsProperties); }
- }
-
- Node properties = Misc.getChildByTagName(node,XMLString.STYLE_PROPERTIES);
- if (properties!=null) {
- Node fnsNode = Misc.getChildByTagName(properties,XMLString.STYLE_FOOTNOTE_SEP);
- if (fnsNode!=null) {
- bHasFootnoteSep = true;
- footnoteSep.loadFromDOM(fnsNode);
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/ParStyle.java b/xmerge/source/writer2latex/source/writer2latex/office/ParStyle.java
deleted file mode 100644
index 7bea5b15316b..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/ParStyle.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/************************************************************************
- *
- * ParStyle.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.2 (2002-12-28)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import writer2latex.util.Misc;
-
-/** <p> Class representing a paragraph style in OOo Writer </p> */
-public class ParStyle extends StyleWithProperties {
- private String sMasterPageName = null;
-
- public String getMasterPageName() {
- return sMasterPageName;
- }
-
- public void loadStyleFromDOM(Node node) {
- super.loadStyleFromDOM(node);
- sMasterPageName = Misc.getAttribute(node,XMLString.STYLE_MASTER_PAGE_NAME);
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/PropertySet.java b/xmerge/source/writer2latex/source/writer2latex/office/PropertySet.java
deleted file mode 100644
index 9047e8355864..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/PropertySet.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/************************************************************************
- *
- * PropertySet.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3 (2003-07-01)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NamedNodeMap;
-import java.util.Hashtable;
-
-/** <p> Class representing a set of style properties in OOo (actually this
- is simply the set of attributes of an element). </p>
- */
-public class PropertySet {
- private Hashtable properties = new Hashtable();
- private String sName;
-
- public PropertySet() {
- properties = new Hashtable();
- sName="";
- }
-
- public String getProperty(String sPropName) {
- if (sPropName!=null) {
- String sValue = (String) properties.get(sPropName);
- if (sValue!=null && sValue.endsWith("inch")) {
- // Cut of inch to in
- return sValue.substring(0,sValue.length()-2);
- }
- else {
- return sValue;
- }
- }
- else {
- return null;
- }
- }
-
- public String getName() { return sName; }
-
- public void loadFromDOM(Node node) {
- sName = node.getNodeName();
- // read the attributes of the node, if any
- if (node!=null) {
- NamedNodeMap attrNodes = node.getAttributes();
- if (attrNodes!=null) {
- int nLen = attrNodes.getLength();
- for (int i=0; i<nLen; i++){
- Node attr = attrNodes.item(i);
- properties.put(attr.getNodeName(),attr.getNodeValue());
- }
- }
- }
- }
-
- public void setProperty(String sProperty, String sValue){
- properties.put(sProperty,sValue);
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/SVMReader.java b/xmerge/source/writer2latex/source/writer2latex/office/SVMReader.java
deleted file mode 100644
index f2dd2fd991e2..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/SVMReader.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/************************************************************************
- *
- * SVMReader.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2004 by Urban Widmark
- *
- * All Rights Reserved.
- *
- * Version 0.3.3b (2004-02-26)
- *
- */
-
-package writer2latex.office;
-
-/** This class contains a static method to extract EPS data from an SVM file */
-public final class SVMReader {
-
- /* Notes on SVM file format:
-
- Relevant OO 1.1.0 Source Files include:
- tools/source/stream/vcompat.cxx
- vcl/source/gdi/gdimtf.cxx
- vcl/inc/gdimtf.hxx
- vcl/source/gdi/metaact.cxx
- vcl/inc/metaact.hxx
- vcl/source/gdi/mapmod.cxx
- vcl/inc/mapmod.hxx
- tools/source/generic/fract.cxx
- tools/inc/fract.hxx
- tools/source/generic/gen.cxx
- tools/inc/gen.hxx
-
- VersionCompat (6 bytes)
- version - 2 bytes
- totalsize - 4 bytes
-
- Point (Pair) (8 bytes)
- X - 4 bytes (long)
- Y - 4 bytes (long)
-
- Fraction (8 bytes)
- nNumerator - 4 bytes (long)
- nDenominator - 4 bytes (long)
-
- MapMode (6 + 2 + 8 + 8 + 8 + 1 = 33 bytes)
- VersionCompat
- meUnit - UINT16
- maOrigin - Point
- maScaleX - Fraction
- maScaleY - Fraction
- mbSimple - BOOL (1 byte)
-
- Size (Pair) (8 bytes)
- width - 4 bytes (long)
- height - 4 bytes (long)
-
- GfxLink (16 or 57 bytes)
- VersionCompat
- nType - 2 bytes
- nSize - 4 bytes
- nUserId - 4 bytes
- aSize - Size (version >=2)
- aMapMode - MapMode (version >=2)
-
- MetaEPSAction
- VersionCompat
- maGfxLink - GfxLink
- data[maGfxLink.nSize] - bytes
- maPoint - Point
- maSize - Size
- maSubst - GDIMetaFile (alternative image?)
-
- SVM file
- "VCLMTF"
- Compat - VersionCompat
- nStmCompressMode - UINT32
- aPrefMapMode - MapMode
- aPrefSize - Size
- count - UINT32
- action[count] - MetaAction
-
-
- Example header from an EPS image included in a Writer document:
- 00000000: 5643 4c4d 5446 0100 3100 0000 0000 0000 VCLMTF..1.......
- 00000010: 0100 1b00 0000 0800 0000 0000 0000 0000 ................
- 00000020: 0100 0000 0100 0000 0100 0000 0100 0000 ................
- 00000030: 0169 0100 00fd 0000 0001 0000 008f 0001 .i..............
- 00000040: 0096 3200 0002 0033 0000 0001 003f 3000 ..2....3.....?0.
- 00000050: 0000 0000 0000 0000 0000 0000 0001 001b ................
- 00000060: 0000 000a 0000 0000 0000 0000 0001 0000 ................
- 00000070: 0001 0000 0001 0000 0001 0000 0001 2521 ..............%!
-
- 5643 4c4d 5446 "VCLMTF" 0
-
- 0100 version 6
- 3100 0000 totalsize
-
- 0000 0000 compress 12
-
- 0100 aPrefMapMode.version 16
- 1b00 0000 aPrefMapMode.totalsize
- 0800 aPrefMapMode.meUnit
- 0000 0000 aPrefMapMode.maOrigin
- 0000 0000
- 0100 0000 aPrefMapMode.maScaleX
- 0100 0000
- 0100 0000 aPrefMapMode.maScaleY
- 0100 0000
- 01 aPrefMapMode.mbSimple
-
- 6901 0000 aPrefSize 49
- fd00 0000
-
- 0100 0000 nCount 57
-
- 8f00 type == META_EPS_ACTION 61
-
- 0100 version
- 9632 0000 totalsize
-
- 0200 version
- 3300 0000 totalsize
-
- 0100 nType
- 3f30 0000 nSize 75
- 0000 0000 nUserId
-
- 0000 0000 aSize
- 0000 0000
-
- 0100
- 1b00 0000
- 0a00
-
- 0000 0000
- 0000 0000
- 0100 0000
- 0100 0000
- 0100 0000
- 0100 0000
- 01
-
- Beginning of EPS data:
-
- 2521
-
- Note that maPoint/maSize/maSubst are all after the EPS file.
-
- */
-
- /** Determine if this SVM contains an EPS document and retrieve start and
- * end positions if so.
- *
- * @param blob byte array containing SVM file
- * @param offlen integer array to retrieve the offset into the SVM file
- * (offlen[0]) and the length (offlen[1]) of the EPS
- * document. If the method returns false, the array
- * will be unchanged.
- *
- * @return returns true if the SVM contains an EPS document
- */
- public static final boolean readSVM(byte[] blob, int[] offlen) {
- int pos = 57;
- int nCount = getInt(blob, pos);
- pos += 4;
-
- for (int i=0; i<nCount; i++) {
- int type = getShort(blob, pos);
- pos += 2;
-
- // We only understand META_EPS_ACTION
- if (type != 143)
- return false;
-
- pos += 6;
- int version = getShort(blob, pos);
- pos += 6; // version + totalsize
- pos += 2; // nType
-
- // This is the size of the EPS data.
- int size = getInt(blob, pos);
- pos += 8;
-
- if (version >= 2)
- pos += 41;
-
- for (int j=0; j<MIMETypes.EPS_SIG.length; j++)
- if (MIMETypes.EPS_SIG[j] != blob[pos + j])
- return false;
-
- offlen[0] = pos;
- offlen[1] = size;
-
- // For now we only understand files where the EPS entry is
- // the first MetaAction
- break;
- }
-
- return true;
- }
-
- private static int getInt(byte[] blob, int pos)
- {
- return
- ((blob[pos+0] & 0xff) << 0) +
- ((blob[pos+1] & 0xff) << 8) +
- ((blob[pos+2] & 0xff) << 16) +
- ((blob[pos+3] & 0xff) << 24);
- }
-
- private static int getShort(byte[] blob, int pos)
- {
- return
- ((blob[pos+0] & 0xff) << 0) +
- ((blob[pos+1] & 0xff) << 8);
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/SectionStyle.java b/xmerge/source/writer2latex/source/writer2latex/office/SectionStyle.java
deleted file mode 100644
index 0f856c8e6645..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/SectionStyle.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/************************************************************************
- *
- * SectionStyle.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.2 (2002-10-24)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import writer2latex.util.Misc;
-
-/** <p> Class representing a section style in OOo Writer </p> */
-public class SectionStyle extends StyleWithProperties {
- // TODO: check the documentation, maybe there are no props to read...
- private int nColCount = 0;
-
- public int getColCount() { return nColCount; }
-
- public void loadStyleFromDOM(Node node) {
- // TODO: StyleWithProperties should have a protected method
- // loadStyleFromDOMinner - BETA style...
- super.loadStyleFromDOM(node);
- Node properties = Misc.getChildByTagName(node,XMLString.STYLE_PROPERTIES);
- if (properties!=null) {
- Node columns = Misc.getChildByTagName(properties,XMLString.STYLE_COLUMNS);
- if (columns!=null) {
- nColCount = Misc.getPosInteger(Misc.getAttribute(columns,
- XMLString.FO_COLUMN_COUNT),1);
- // TODO: read individual columns
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/StyleWithProperties.java b/xmerge/source/writer2latex/source/writer2latex/office/StyleWithProperties.java
deleted file mode 100644
index c7d3b450bf88..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/StyleWithProperties.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/************************************************************************
- *
- * StyleWithProperties.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-10-22)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NamedNodeMap;
-import java.util.Hashtable;
-import writer2latex.util.Misc;
-
-/** <p> Class representing a style in OOo which contains a style:properties
- * element </p>
- */
-public class StyleWithProperties extends OfficeStyle {
- private Hashtable properties = new Hashtable();
-
- public void loadStyleFromDOM(Node node) {
- super.loadStyleFromDOM(node);
- // read the properties of the style, if any
- if (node.hasChildNodes()){
- Node properties = Misc.getChildByTagName(node,XMLString.STYLE_PROPERTIES);
- if (properties!=null) {
- NamedNodeMap attrNodes = properties.getAttributes();
- if (attrNodes!=null) {
- int nLen = attrNodes.getLength();
- for (int i=0; i<nLen; i++){
- Node attr = attrNodes.item(i);
- setProperty(attr.getNodeName(),attr.getNodeValue());
- }
- }
- }
- }
- }
-
- public void setProperty(String sProperty, String sValue){
- properties.put(sProperty,sValue);
- }
-
- public String getProperty(String sProperty, boolean bInherit){
- if (bInherit) {
- return getProperty(sProperty);
- }
- else if (properties.containsKey(sProperty)){
- String sValue = (String) properties.get(sProperty);
- return Misc.truncateLength(sValue);
- }
- // no value;
- return null;
- }
-
- public String getProperty(String sProperty){
- if (properties.containsKey(sProperty)){
- String sValue = (String) properties.get(sProperty);
- return Misc.truncateLength(sValue);
- }
- else if (sParentName!=null){ // inherit from parent
- StyleWithProperties parentStyle
- = (StyleWithProperties) family.getStyle(sParentName);
- if (parentStyle!=null) {
- return parentStyle.getProperty(sProperty);
- }
- }
- // no value;
- return null;
- }
-
- public String getAbsoluteProperty(String sProperty){
- if (properties.containsKey(sProperty)){
- String sValue=(String) properties.get(sProperty);
- if (sValue.endsWith("%")) {
- StyleWithProperties parentStyle
- = (StyleWithProperties) family.getStyle(sParentName);
- if (parentStyle!=null) {
- String sParentValue = parentStyle.getAbsoluteProperty(sProperty);
- if (sParentValue!=null) { return Misc.multiply(sValue,sParentValue); }
- }
- else if (getFamily()!=null && getFamily().getDefaultStyle()!=null) {
- StyleWithProperties style = (StyleWithProperties) getFamily().getDefaultStyle();
- String sDefaultValue=(String) style.getProperty(sProperty);
- if (sValue !=null) { return Misc.multiply(sValue,sDefaultValue); }
- }
- }
- else {
- return Misc.truncateLength(sValue);
- }
- }
- else if (sParentName!=null){
- StyleWithProperties parentStyle
- = (StyleWithProperties) family.getStyle(sParentName);
- if (parentStyle!=null) {
- return parentStyle.getAbsoluteProperty(sProperty);
- }
- }
- else if (getFamily()!=null && getFamily().getDefaultStyle()!=null) {
- StyleWithProperties style = (StyleWithProperties) getFamily().getDefaultStyle();
- String sValue=(String) style.getProperty(sProperty);
- if (sValue !=null) { return sValue; }
- }
- // no value!
- return null;
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/TableGridModel.java b/xmerge/source/writer2latex/source/writer2latex/office/TableGridModel.java
deleted file mode 100644
index a58d843c1880..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/TableGridModel.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/************************************************************************
- *
- * TableGridModel.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-09-30)
- *
- */
-
-package writer2latex.office;
-
-import java.util.LinkedList;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import writer2latex.util.Misc;
-
-/**
- * <p> This class represents a table in an OOo XML document - presented
- * as an n by m grid.</p>
- */
-public class TableGridModel {
- private Node tableNode;
- private LinkedList cols = new LinkedList();
- private LinkedList rows = new LinkedList();
- private LinkedList cells = new LinkedList();
- private int nMaxCols = 0; // real number of columns (count to last non-empty)
-
- /**
- * <p> Reads the table from a table:table node </p>
- */
- public TableGridModel(Node node) {
- tableNode = node;
- if (!node.hasChildNodes()) { return; } // empty table!
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++) {
- Node child = nl.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String sName = child.getNodeName();
- if (sName.equals(XMLString.TABLE_TABLE_COLUMN)) {
- readTableColumn(child,false,false);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_COLUMNS)) {
- readTableColumns(child,false,false);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_COLUMN_GROUP)) {
- readTableColumnGroup(child,false,false);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_HEADER_COLUMNS)) {
- readTableHeaderColumns(child,false,false);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_ROW)) {
- readTableRow(child,false,false);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_ROWS)) {
- readTableRows(child,false,false);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_ROW_GROUP)) {
- readTableRowGroup(child,false,false);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_HEADER_ROWS)) {
- readTableHeaderRows(child,false,false);
- }
- }
- }
-
- // Now determine the actual number of columns
- int nRows = cells.size();
- for (int nRow=0; nRow<nRows; nRow++) {
- LinkedList row = (LinkedList) cells.get(nRow);
- int nCols = row.size();
- int nMaxCol = 0;
- for (int nCol=0; nCol<nCols; nCol++) {
- Element cell = (Element) row.get(nCol);
- if (cell.hasChildNodes()) {
- nMaxCol = nCol + Misc.getPosInteger(cell.getAttribute(
- XMLString.TABLE_NUMBER_COLUMNS_SPANNED),1);
- if (nMaxCol>nMaxCols) { nMaxCols = nMaxCol; }
- }
- }
- }
-
- }
-
- private void readTableColumn(Node node, boolean bHeader, boolean bDisplay) {
- int nRepeat = Misc.getPosInteger(Misc.getAttribute(node,
- XMLString.TABLE_NUMBER_COLUMNS_REPEATED),1);
- while (nRepeat-->0) {
- cols.add(new TableLine(node,bHeader,bDisplay));
- }
- }
-
- private void readTableColumns(Node node, boolean bHeader, boolean bDisplay) {
- if (!node.hasChildNodes()) { return; } // no columns here!
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++) {
- Node child = nl.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String sName = child.getNodeName();
- if (sName.equals(XMLString.TABLE_TABLE_COLUMN)) {
- readTableColumn(child,bHeader,bDisplay);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_COLUMN_GROUP)) {
- readTableColumnGroup(child,bHeader,bDisplay);
- }
- }
- }
- }
-
- private void readTableColumnGroup(Node node, boolean bHeader, boolean bDisplay) {
- bDisplay = !"false".equals(Misc.getAttribute(node,XMLString.TABLE_DISPLAY));
- if (!node.hasChildNodes()) { return; } // no columns here!
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++) {
- Node child = nl.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String sName = child.getNodeName();
- if (sName.equals(XMLString.TABLE_TABLE_HEADER_COLUMNS)) {
- readTableHeaderColumns(child,bHeader,bDisplay);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_COLUMN)) {
- readTableColumn(child,bHeader,bDisplay);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_COLUMN_GROUP)) {
- readTableColumnGroup(child,bHeader,bDisplay);
- }
- }
- }
- }
-
- private void readTableHeaderColumns(Node node, boolean bHeader, boolean bDisplay) {
- readTableColumns(node,true,bDisplay);
- }
-
- private void readTableRow(Node node, boolean bHeader, boolean bDisplay) {
- int nRepeat = Misc.getPosInteger(Misc.getAttribute(node,
- XMLString.TABLE_NUMBER_ROWS_REPEATED),1);
- while (nRepeat-->0) {
- rows.add(new TableLine(node,bHeader,bDisplay));
- }
- // Read the cells in the row
- LinkedList row = new LinkedList();
- if (node.hasChildNodes()) {
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++) {
- Node child = nl.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- Element cell = (Element) child;
- String sName = cell.getTagName();
- if (sName.equals(XMLString.TABLE_TABLE_CELL)) {
- nRepeat = Misc.getPosInteger(cell.getAttribute(
- XMLString.TABLE_NUMBER_COLUMNS_REPEATED),1);
- while (nRepeat-->0) { row.add(cell); }
- }
- else if (sName.equals(XMLString.TABLE_COVERED_TABLE_CELL)) {
- nRepeat = Misc.getPosInteger(cell.getAttribute(
- XMLString.TABLE_NUMBER_COLUMNS_REPEATED),1);
- while (nRepeat-->0) { row.add(cell); }
- }
- }
- }
- }
- cells.add(row);
- }
-
- private void readTableRows(Node node, boolean bHeader, boolean bDisplay) {
- if (!node.hasChildNodes()) { return; } // no rows here!
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++) {
- Node child = nl.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String sName = child.getNodeName();
- if (sName.equals(XMLString.TABLE_TABLE_ROW)) {
- readTableRow(child,bHeader,bDisplay);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_ROW_GROUP)) {
- readTableRowGroup(child,bHeader,bDisplay);
- }
- }
- }
- }
-
- private void readTableRowGroup(Node node, boolean bHeader, boolean bDisplay) {
- bDisplay = !"false".equals(Misc.getAttribute(node,XMLString.TABLE_DISPLAY));
- if (!node.hasChildNodes()) { return; } // no rows here!
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++) {
- Node child = nl.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- String sName = child.getNodeName();
- if (sName.equals(XMLString.TABLE_TABLE_HEADER_ROWS)) {
- readTableHeaderRows(child,bHeader,bDisplay);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_ROW)) {
- readTableRow(child,bHeader,bDisplay);
- }
- else if (sName.equals(XMLString.TABLE_TABLE_ROW_GROUP)) {
- readTableRowGroup(child,bHeader,bDisplay);
- }
- }
- }
- }
-
- private void readTableHeaderRows(Node node, boolean bHeader, boolean bDisplay) {
- readTableRows(node,true,bDisplay);
- }
-
- public int getColCount() { return cols.size(); }
-
- public int getMaxColCount() { return nMaxCols; }
-
- public int getRowCount() { return rows.size(); }
-
- public Node getTableNode() { return tableNode; }
-
- public Node getCell(int nRow, int nCol) {
- if (nRow<0 || nRow>=cells.size()) { return null; }
- LinkedList row = (LinkedList) cells.get(nRow);
- if (nCol<0 || nCol>=row.size()) { return null; }
- return (Node) row.get(nCol);
- }
-
- public TableLine getRow(int nRow) {
- if (nRow<0 || nRow>=rows.size()) { return null; }
- return (TableLine) rows.get(nRow);
- }
-
- public TableLine getCol(int nCol) {
- if (nCol<0 || nCol>=cols.size()) { return null; }
- return (TableLine) cols.get(nCol);
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/TableLine.java b/xmerge/source/writer2latex/source/writer2latex/office/TableLine.java
deleted file mode 100644
index eb70c810e0c6..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/TableLine.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/************************************************************************
- *
- * TableLine.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.2 (2002-10-24)
- *
- */
-
-package writer2latex.office;
-
-import org.w3c.dom.Node;
-import writer2latex.util.Misc;
-
-/**
- * <p> This class represents the properties of a row or column in a table</p>
- */
-public class TableLine {
- private String sStyleName;
- private String sVisibility;
- private String sDefaultCellStyleName;
- private boolean bDisplay;
- private boolean bHeader;
-
- public TableLine(Node node, boolean bHeader, boolean bDisplay) {
- // Node must be table:table-column or table:table-row
- sStyleName = Misc.getAttribute(node,XMLString.TABLE_STYLE_NAME);
- sVisibility = Misc.getAttribute(node,XMLString.TABLE_VISIBILITY);
- if (sVisibility==null) { sVisibility = "visible"; }
- sDefaultCellStyleName = Misc.getAttribute(node,XMLString.TABLE_DEFAULT_CELL_STYLE_NAME);
- this.bDisplay = bDisplay;
- this.bHeader = bHeader;
- }
-
- public String getStyleName() { return sStyleName; }
-
- public String getVisibility() { return sVisibility; }
-
- public String getDefaultCellStyleName() { return sDefaultCellStyleName; }
-
- public boolean isDisplay() { return bDisplay; }
-
- public boolean isHeader() { return bHeader; }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/WriterStyleCollection.java b/xmerge/source/writer2latex/source/writer2latex/office/WriterStyleCollection.java
deleted file mode 100644
index 505860eacdd8..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/WriterStyleCollection.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/************************************************************************
- *
- * WriterStyleCollection.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-09-26)
- *
- */
-
-package writer2latex.office;
-
-import java.util.Hashtable;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Document;
-import writer2latex.util.Misc;
-
-/** <p> Class representing the collection of all the styles (read only) in
- * an OOo Writer document - slightly misnaned since it also covers Calc documents :-)</p>
- */
-public class WriterStyleCollection {
-
- // Font declarations
- private OfficeStyleFamily font = new OfficeStyleFamily(FontDeclaration.class);
-
- // Styles
- private OfficeStyleFamily text = new OfficeStyleFamily(StyleWithProperties.class);
- private OfficeStyleFamily par = new OfficeStyleFamily(ParStyle.class);
- private OfficeStyleFamily section = new OfficeStyleFamily(SectionStyle.class);
- private OfficeStyleFamily table = new OfficeStyleFamily(StyleWithProperties.class);
- private OfficeStyleFamily column = new OfficeStyleFamily(StyleWithProperties.class);
- private OfficeStyleFamily row = new OfficeStyleFamily(StyleWithProperties.class);
- private OfficeStyleFamily cell = new OfficeStyleFamily(StyleWithProperties.class);
- private OfficeStyleFamily frame = new OfficeStyleFamily(StyleWithProperties.class);
- private OfficeStyleFamily list = new OfficeStyleFamily(ListStyle.class);
- private OfficeStyleFamily pageMaster = new OfficeStyleFamily(PageMaster.class);
- private OfficeStyleFamily masterPage = new OfficeStyleFamily(MasterPage.class);
- private String sFirstMasterPageName = null;
-
- // Document-wide styles
- private ListStyle outline = new ListStyle();
- private PropertySet footnotes = null;
- private PropertySet endnotes = null;
-
- public OfficeStyleFamily getFontDeclarations() { return font; }
- public FontDeclaration getFontDeclaration(String sName) {
- return (FontDeclaration) font.getStyle(sName);
- }
-
- public OfficeStyleFamily getTextStyles() { return text; }
- public StyleWithProperties getTextStyle(String sName) {
- return (StyleWithProperties) text.getStyle(sName);
- }
-
- public OfficeStyleFamily getParStyles() { return par; }
- public ParStyle getParStyle(String sName) {
- return (ParStyle) par.getStyle(sName);
- }
- public ParStyle getDefaultParStyle() {
- return (ParStyle) par.getDefaultStyle();
- }
-
- public OfficeStyleFamily getSectionStyles() { return section; }
- public SectionStyle getSectionStyle(String sName) {
- return (SectionStyle) section.getStyle(sName);
- }
-
- public OfficeStyleFamily getTableStyles() { return table; }
- public StyleWithProperties getTableStyle(String sName) {
- return (StyleWithProperties) table.getStyle(sName);
- }
- public OfficeStyleFamily getColumnStyles() { return column; }
- public StyleWithProperties getColumnStyle(String sName) {
- return (StyleWithProperties) column.getStyle(sName);
- }
-
- public OfficeStyleFamily getRowStyles() { return row; }
- public StyleWithProperties getRowStyle(String sName) {
- return (StyleWithProperties) row.getStyle(sName);
- }
-
- public OfficeStyleFamily getCellStyles() { return cell; }
- public StyleWithProperties getCellStyle(String sName) {
- return (StyleWithProperties) cell.getStyle(sName);
- }
- public StyleWithProperties getDefaultCellStyle() {
- return (StyleWithProperties) cell.getDefaultStyle();
- }
-
- public OfficeStyleFamily getFrameStyles() { return frame; }
- public StyleWithProperties getFrameStyle(String sName) {
- return (StyleWithProperties) frame.getStyle(sName);
- }
- public StyleWithProperties getDefaultFrameStyle() {
- return (StyleWithProperties) frame.getDefaultStyle();
- }
-
- public OfficeStyleFamily getListStyles() { return list; }
- public ListStyle getListStyle(String sName) {
- return (ListStyle) list.getStyle(sName);
- }
-
- public OfficeStyleFamily getPageMasters() { return pageMaster; }
- public PageMaster getPageMaster(String sName) {
- return (PageMaster) pageMaster.getStyle(sName);
- }
-
- public OfficeStyleFamily getMasterPages() { return masterPage; }
- public MasterPage getMasterPage(String sName) {
- return (MasterPage) masterPage.getStyle(sName);
- }
- public String getFirstMasterPageName() {
- return sFirstMasterPageName;
- }
-
- public ListStyle getOutlineStyle() { return outline; }
-
- public PropertySet getFootnotesConfiguration() { return footnotes; }
-
- public PropertySet getEndnotesConfiguration() { return endnotes; }
-
- private void loadStylesFromDOM(Node node, boolean bAllParagraphsAreSoft) {
- // node should be office:master-styles, office:styles or office:automatic-styles
- boolean bAutomatic = XMLString.OFFICE_AUTOMATIC_STYLES.equals(node.getNodeName());
- if (node.hasChildNodes()){
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++ ) {
- Node child=nl.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE){
- if (child.getNodeName().equals(XMLString.STYLE_STYLE)){
- String sFamily = Misc.getAttribute(child,XMLString.STYLE_FAMILY);
- if ("text".equals(sFamily)){
- text.loadStyleFromDOM(child,bAutomatic);
- }
- else if ("paragraph".equals(sFamily)){
- par.loadStyleFromDOM(child,bAutomatic && !bAllParagraphsAreSoft);
- }
- else if ("section".equals(sFamily)){
- section.loadStyleFromDOM(child,bAutomatic);
- }
- else if ("table".equals(sFamily)){
- table.loadStyleFromDOM(child,bAutomatic);
- }
- else if ("table-column".equals(sFamily)){
- column.loadStyleFromDOM(child,bAutomatic);
- }
- else if ("table-row".equals(sFamily)){
- row.loadStyleFromDOM(child,bAutomatic);
- }
- else if ("table-cell".equals(sFamily)){
- cell.loadStyleFromDOM(child,bAutomatic);
- }
- else if ("graphics".equals(sFamily)){
- frame.loadStyleFromDOM(child,bAutomatic);
- }
- }
- else if (child.getNodeName().equals(XMLString.STYLE_PAGE_MASTER)) {
- pageMaster.loadStyleFromDOM(child,bAutomatic);
- }
- else if (child.getNodeName().equals(XMLString.STYLE_MASTER_PAGE)) {
- masterPage.loadStyleFromDOM(child,bAutomatic);
- if (sFirstMasterPageName==null) {
- sFirstMasterPageName = Misc.getAttribute(child,XMLString.STYLE_NAME);
- }
- }
- else if (child.getNodeName().equals(XMLString.TEXT_LIST_STYLE)) {
- list.loadStyleFromDOM(child,bAutomatic);
- }
- else if (child.getNodeName().equals(XMLString.TEXT_OUTLINE_STYLE)) {
- outline.loadStyleFromDOM(child);
- }
- else if (child.getNodeName().equals(XMLString.STYLE_DEFAULT_STYLE)){
- String sFamily = Misc.getAttribute(child,XMLString.STYLE_FAMILY);
- if ("paragraph".equals(sFamily)) {
- ParStyle defaultPar = new ParStyle();
- defaultPar.loadStyleFromDOM(child);
- par.setDefaultStyle(defaultPar);
- }
- else if ("graphics".equals(sFamily)) {
- StyleWithProperties defaultFrame = new StyleWithProperties();
- defaultFrame.loadStyleFromDOM(child);
- frame.setDefaultStyle(defaultFrame);
- }
- else if ("table-cell".equals(sFamily)) {
- StyleWithProperties defaultCell = new StyleWithProperties();
- defaultCell.loadStyleFromDOM(child);
- cell.setDefaultStyle(defaultCell);
- }
- }
- }
- }
- }
- }
-
- public void loadStylesFromDOM(Document stylesDOM, Document contentDOM){
- loadStylesFromDOM(stylesDOM, contentDOM, false);
- }
-
- public void loadStylesFromDOM(Document stylesDOM, Document contentDOM, boolean bAllParagraphsAreSoft){
- // Flat xml: stylesDOM will be null and contentDOM contain everything
- // This is only the case for old versions of xmerge; newer versions
- // creates DOM for styles, content, meta and settings.
- NodeList list;
-
- // font declarations:
- if (stylesDOM==null) {
- list = contentDOM.getElementsByTagName(XMLString.OFFICE_FONT_DECLS);
- }
- else {
- list = stylesDOM.getElementsByTagName(XMLString.OFFICE_FONT_DECLS);
- }
- if (list.getLength()!=0) {
- Node node = list.item(0);
- if (node.hasChildNodes()){
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i = 0; i < nLen; i++ ) {
- Node child = nl.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE){
- if (child.getNodeName().equals(XMLString.STYLE_FONT_DECL)){
- font.loadStyleFromDOM(child,false);
- }
- }
- }
- }
- }
-
- // soft formatting:
- if (stylesDOM==null) {
- list = contentDOM.getElementsByTagName(XMLString.OFFICE_STYLES);
- }
- else {
- list = stylesDOM.getElementsByTagName(XMLString.OFFICE_STYLES);
- }
- if (list.getLength()!=0) {
- loadStylesFromDOM(list.item(0),bAllParagraphsAreSoft);
- }
-
- // master styles:
- if (stylesDOM==null) {
- list = contentDOM.getElementsByTagName(XMLString.OFFICE_MASTER_STYLES);
- }
- else {
- list = stylesDOM.getElementsByTagName(XMLString.OFFICE_MASTER_STYLES);
- }
- if (list.getLength()!=0) {
- loadStylesFromDOM(list.item(0),bAllParagraphsAreSoft);
- }
-
- // hard formatting:
- // Load from styles.xml first. Problem: There may be name clashes
- // with automatic styles from content.xml
- if (stylesDOM!=null) {
- list = stylesDOM.getElementsByTagName(XMLString.OFFICE_AUTOMATIC_STYLES);
- if (list.getLength()!=0) {
- loadStylesFromDOM(list.item(0),bAllParagraphsAreSoft);
- }
- }
- list = contentDOM.getElementsByTagName(XMLString.OFFICE_AUTOMATIC_STYLES);
- if (list.getLength()!=0) {
- loadStylesFromDOM(list.item(0),bAllParagraphsAreSoft);
- }
-
- // footnotes configuration:
- if (stylesDOM==null) {
- list = contentDOM.getElementsByTagName(XMLString.TEXT_FOOTNOTES_CONFIGURATION);
- }
- else {
- list = stylesDOM.getElementsByTagName(XMLString.TEXT_FOOTNOTES_CONFIGURATION);
- }
- if (list.getLength()!=0) {
- footnotes = new PropertySet();
- footnotes.loadFromDOM(list.item(0));
- }
-
- // endnotes configuration:
- if (stylesDOM==null) {
- list = contentDOM.getElementsByTagName(XMLString.TEXT_ENDNOTES_CONFIGURATION);
- }
- else {
- list = stylesDOM.getElementsByTagName(XMLString.TEXT_ENDNOTES_CONFIGURATION);
- }
- if (list.getLength()!=0) {
- endnotes = new PropertySet();
- endnotes.loadFromDOM(list.item(0));
- }
-
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/office/XMLString.java b/xmerge/source/writer2latex/source/writer2latex/office/XMLString.java
deleted file mode 100644
index fa2e45de7e4c..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/office/XMLString.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/************************************************************************
- *
- * XMLString.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2005 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3j (2005-03-07)
- *
- */
-
-package writer2latex.office;
-
-/* XML strings (tags and attributes) in the OOo XML namespaces
- * typosafe but not typesafe :-)
- */
-
-public class XMLString {
- // draw namespace - elements
- public static final String DRAW_PAGE="draw:page";
- public static final String DRAW_A="draw:a";
- public static final String DRAW_IMAGE="draw:image";
- public static final String DRAW_OBJECT="draw:object";
- public static final String DRAW_TEXT_BOX="draw:text-box";
- // draw namespace - attributes
- public static final String DRAW_NAME="draw:name";
- public static final String DRAW_STYLE_NAME="draw:style-name";
- // dc namespace - elements
- public static final String DC_CREATOR="dc:creator";
- public static final String DC_DATE="dc:date";
- public static final String DC_DESCRIPTION="dc:description";
- public static final String DC_LANGUAGE="dc:language";
- public static final String DC_SUBJECT="dc:subject";
- public static final String DC_TITLE="dc:title";
- // meta namespace - elements
- public static final String META_INITIAL_CREATOR="meta:initial-creator";
- public static final String META_KEYWORDS="meta:keywords";
- public static final String META_KEYWORD="meta:keyword";
- // manifest namespace
- public static final String MANIFEST_FILE_ENTRY="manifest:file-entry";
- public static final String MANIFEST_MEDIA_TYPE="manifest:media-type";
- public static final String MANIFEST_FULL_PATH="manifest:full-path";
- // office namespace - elements
- public static final String OFFICE_DOCUMENT_CONTENT="office:document-content";
- public static final String OFFICE_MASTER_STYLES="office:master-styles";
- public static final String OFFICE_STYLES="office:styles";
- public static final String OFFICE_AUTOMATIC_STYLES="office:automatic-styles";
- public static final String OFFICE_FONT_DECLS="office:font-decls";
- public static final String OFFICE_BODY="office:body";
- public static final String OFFICE_ANNOTATION="office:annotation";
- public static final String OFFICE_BINARY_DATA="office:binary-data";
- public static final String OFFICE_META="office:meta";
-
- // style namespace - elements
- public static final String STYLE_PAGE_MASTER="style:page-master";
- public static final String STYLE_MASTER_PAGE="style:master-page";
- public static final String STYLE_FONT_DECL="style:font-decl";
- public static final String STYLE_STYLE="style:style";
- public static final String STYLE_DEFAULT_STYLE="style:default-style";
- public static final String STYLE_PROPERTIES="style:properties";
- public static final String STYLE_COLUMNS="style:columns";
- public static final String STYLE_HEADER="style:header";
- public static final String STYLE_HEADER_LEFT="style:header-left";
- public static final String STYLE_FOOTER="style:footer";
- public static final String STYLE_FOOTER_LEFT="style:footer-left";
- public static final String STYLE_FOOTNOTE_SEP="style:footnote-sep";
- public static final String STYLE_HEADER_STYLE="style:header-style";
- public static final String STYLE_FOOTER_STYLE="style:footer-style";
- // style namespace - attributes
- public static final String STYLE_NEXT_STYLE_NAME="style:next-style-name";
- public static final String STYLE_PAGE_MASTER_NAME="style:page-master-name";
- public static final String STYLE_MASTER_PAGE_NAME="style:master-page-name";
- public static final String STYLE_PAGE_USAGE="style:page-usage";
- //public static final String STYLE_FONT_FAMILY="style:font-family";
- public static final String STYLE_FONT_FAMILY_COMPLEX="style:font-family-complex";
- public static final String STYLE_FONT_NAME="style:font-name";
- public static final String STYLE_FONT_NAME_COMPLEX="style:font-name-complex";
- public static final String STYLE_FONT_PITCH="style:font-pitch";
- public static final String STYLE_FONT_FAMILY_GENERIC="style:font-family-generic";
- public static final String STYLE_TEXT_BACKGROUND_COLOR="style:text-background-color";
- public static final String STYLE_TEXT_CROSSING_OUT="style:text-crossing-out";
- public static final String STYLE_TEXT_UNDERLINE="style:text-underline";
- public static final String STYLE_TEXT_BLINKING="style:text-blinking";
- public static final String STYLE_AUTO_TEXT_INDENT="style:auto-text-indent";
- public static final String STYLE_TEXT_ALIGN_SOURCE="style:text-align-source";
- public static final String STYLE_NAME="style:name";
- public static final String STYLE_PARENT_STYLE_NAME="style:parent-style-name";
- public static final String STYLE_FAMILY="style:family";
- public static final String STYLE_TEXT_POSITION="style:text-position";
- public static final String STYLE_NUM_PREFIX="style:num-prefix";
- public static final String STYLE_NUM_SUFFIX="style:num-suffix";
- public static final String STYLE_NUM_FORMAT="style:num-format";
- public static final String STYLE_MAY_BREAK_BETWEEN_ROWS="style:may-break-between-rows";
- public static final String STYLE_HORIZONTAL_POS="style:horizontal-pos";
- public static final String STYLE_WRAP="style:wrap";
- public static final String STYLE_COLUMN_WIDTH="style:column-width";
- public static final String STYLE_ROW_HEIGHT="style:row-height";
- public static final String STYLE_MIN_ROW_HEIGHT="style:min-row-height";
- public static final String STYLE_FIRST_PAGE_NUMBER="style:first-page-number";
- public static final String STYLE_DISTANCE_BEFORE_SEP="style:distance-before-sep";
- public static final String STYLE_DISTANCE_AFTER_SEP="style:distance-after-sep";
- public static final String STYLE_WIDTH="style:width";
- public static final String STYLE_REL_WIDTH="style:rel-width";
- public static final String STYLE_COLOR="style:color";
- public static final String STYLE_WRITING_MODE="style:writing-mode";
-
- // table namespace - elements
- public static final String TABLE_TABLE="table:table";
- public static final String TABLE_SUB_TABLE="table:sub-table";
- public static final String TABLE_TABLE_COLUMN="table:table-column";
- public static final String TABLE_TABLE_COLUMNS="table:table-columns";
- public static final String TABLE_TABLE_COLUMN_GROUP="table:table-column-group";
- public static final String TABLE_TABLE_HEADER_COLUMNS="table:table-header-columns";
- public static final String TABLE_TABLE_ROW="table:table-row";
- public static final String TABLE_TABLE_ROWS="table:table-rows";
- public static final String TABLE_TABLE_ROW_GROUP="table:table-row-group";
- public static final String TABLE_TABLE_HEADER_ROWS="table:table-header-rows";
- public static final String TABLE_TABLE_CELL="table:table-cell";
- public static final String TABLE_COVERED_TABLE_CELL="table:covered-table-cell";
- // table namespace - attributes
- public static final String TABLE_NAME="table:name";
- public static final String TABLE_STYLE_NAME="table:style-name";
- public static final String TABLE_VISIBILITY="table:visibility";
- public static final String TABLE_DISPLAY="table:display";
- public static final String TABLE_DEFAULT_CELL_STYLE_NAME="table:default-cell-style-name";
- public static final String TABLE_VALUE_TYPE="table:value-type";
- public static final String TABLE_NUMBER_COLUMNS_REPEATED="table:number-columns-repeated";
- public static final String TABLE_NUMBER_ROWS_REPEATED="table:number-rows-repeated";
- public static final String TABLE_NUMBER_ROWS_SPANNED="table:number-rows-spanned";
- public static final String TABLE_NUMBER_COLUMNS_SPANNED="table:number-columns-spanned";
- public static final String TABLE_ALIGN="table:align";
-
- // text namespace - elements (declarations)
- public static final String TEXT_="text:";
- public static final String TEXT_FOOTNOTES_CONFIGURATION="text:footnotes-configuration";
- public static final String TEXT_ENDNOTES_CONFIGURATION="text:endnotes-configuration";
- public static final String TEXT_SEQUENCE_DECLS="text:sequence_decls";
- public static final String TEXT_SEQUENCE_DECL="text:sequence_decl";
- public static final String TEXT_OUTLINE_STYLE="text:outline-style";
- public static final String TEXT_LIST_STYLE="text:list-style";
- public static final String TEXT_LIST_LEVEL_STYLE_NUMBER="text:list-level-style-number";
- public static final String TEXT_LIST_LEVEL_STYLE_BULLET="text:list-level-style-bullet";
- public static final String TEXT_LIST_LEVEL_STYLE_IMAGE="text:list-level-style-image";
- // text namespace - elements (block text)
- public static final String TEXT_SECTION="text:section";
- public static final String TEXT_P="text:p";
- public static final String TEXT_H="text:h";
- public static final String TEXT_ORDERED_LIST="text:ordered-list";
- public static final String TEXT_UNORDERED_LIST="text:unordered-list";
- public static final String TEXT_LIST_ITEM="text:list-item";
- public static final String TEXT_LIST_HEADER="text:list-header";
- public static final String TEXT_ALPHABETICAL_INDEX="text:alphabetical-index";
- public static final String TEXT_ALPHABETICAL_INDEX_SOURCE="text:alphabetical-index-source";
- public static final String TEXT_ALPHABETICAL_INDEX_ENTRY_TEMPLATE="text:alphabetical-index-entry-template";
- public static final String TEXT_TABLE_OF_CONTENT="text:table-of-content";
- public static final String TEXT_TABLE_OF_CONTENT_SOURCE="text:table-of-content-source";
- public static final String TEXT_TABLE_OF_CONTENT_ENTRY_TEMPLATE="text:table-of-content-entry-template";
- public static final String TEXT_ILLUSTRATION_INDEX="text:illustration-index";
- public static final String TEXT_TABLE_INDEX="text:table-index";
- public static final String TEXT_OBJECT_INDEX="text:object-index";
- public static final String TEXT_USER_INDEX="text:user-index";
- public static final String TEXT_BIBLIOGRAPHY="text:bibliography";
- public static final String TEXT_INDEX_TITLE_TEMPLATE="text:index-title-template";
- public static final String TEXT_INDEX_BODY="text:index-body";
- public static final String TEXT_INDEX_TITLE="text:index-title";
- public static final String TEXT_INDEX_SOURCE="text:index-source";
- // text namespace - elements (inline text)
- public static final String TEXT_SPAN="text:span";
- public static final String TEXT_FOOTNOTE="text:footnote";
- public static final String TEXT_ENDNOTE="text:endnote";
- public static final String TEXT_FOOTNOTE_CITATION="text:footnote-citation";
- public static final String TEXT_FOOTNOTE_BODY="text:footnote-body";
- public static final String TEXT_ENDNOTE_CITATION="text:endnote-citation";
- public static final String TEXT_ENDNOTE_BODY="text:endnote-body";
- public static final String TEXT_S="text:s";
- public static final String TEXT_TAB_STOP="text:tab-stop";
- public static final String TEXT_A="text:a";
- public static final String TEXT_LINE_BREAK="text:line-break";
- public static final String TEXT_PAGE_NUMBER="text:page-number";
- public static final String TEXT_PAGE_COUNT="text:page-count";
- public static final String TEXT_CHAPTER="text:chapter";
- public static final String TEXT_SEQUENCE="text:sequence";
- public static final String TEXT_SEQUENCE_REF="text:sequence-ref";
- public static final String TEXT_BIBLIOGRAPHY_MARK="text:bibliography-mark";
- public static final String TEXT_ALPHABETICAL_INDEX_MARK="text:alphabetical-index-mark";
- public static final String TEXT_ALPHABETICAL_INDEX_MARK_START="text:alphabetical-index-mark-start";
- public static final String TEXT_ALPHABETICAL_INDEX_MARK_END="text:alphabetical-index-mark-end";
- public static final String TEXT_REFERENCE_MARK="text:reference-mark";
- public static final String TEXT_REFERENCE_MARK_START="text:reference-mark-start";
- public static final String TEXT_REFERENCE_REF="text:reference-ref";
- public static final String TEXT_BOOKMARK="text:bookmark";
- public static final String TEXT_BOOKMARK_START="text:bookmark-start";
- public static final String TEXT_BOOKMARK_REF="text:bookmark-ref";
- public static final String TEXT_FOOTNOTE_REF="text:footnote-ref";
- public static final String TEXT_ENDNOTE_REF="text:endnote-ref";
- // text namespace - attributes
- public static final String TEXT_OUTLINE_LEVEL="text:outline-level";
- public static final String TEXT_STRING_VALUE="text:string-value";
- public static final String TEXT_KEY1="text:key1";
- public static final String TEXT_KEY2="text:key2";
- public static final String TEXT_LEVEL="text:level";
- public static final String TEXT_SPACE_BEFORE="text:space-before";
- public static final String TEXT_MIN_LABEL_WIDTH="text:min-label-width";
- public static final String TEXT_MIN_LABEL_DISTANCE="text:min-label-distance";
- public static final String TEXT_STYLE_NAME="text:style-name";
- public static final String TEXT_VISITED_STYLE_NAME="text:visited-style-name";
- public static final String TEXT_DISPLAY_LEVELS="text:display-levels";
- public static final String TEXT_CONTINUE_NUMBERING="text:continue-numbering";
- public static final String TEXT_C="text:c";
- public static final String TEXT_ID="text:id";
- public static final String TEXT_LABEL="text:label";
- public static final String TEXT_NAME="text:name";
- public static final String TEXT_REFERENCE_FORMAT="text:reference-format";
- public static final String TEXT_REF_NAME="text:ref-name";
- public static final String TEXT_CITATION_BODY_STYLE_NAME="text:citation-body-style-name";
- public static final String TEXT_CITATION_STYLE_NAME="text:citation-style-name";
- public static final String TEXT_DEFAULT_STYLE_NAME="text:default-style-name";
- public static final String TEXT_START_VALUE="text:start-value";
- public static final String TEXT_START_NUMBERING_AT="text:start-numbering-at";
- public static final String TEXT_RESTART_NUMBERING="text:restart-numbering";
- public static final String TEXT_ANCHOR_TYPE="text:anchor-type";
- public static final String TEXT_BULLET_CHAR="text:bullet-char";
- public static final String TEXT_DISPLAY="text:display";
-
- public static final String TEXT_IDENTIFIER="text:identifier";
- public static final String TEXT_BIBLIOGRAPHY_TYPE="text:bibliography-type";
- public static final String TEXT_BIBILIOGRAPHIC_TYPE="text:bibiliographic-type"; // bug in OOo 1.0
- public static final String TEXT_ADDRESS="text:address";
- public static final String TEXT_ANNOTE="text:annote";
- public static final String TEXT_AUTHOR="text:author";
- public static final String TEXT_BOOKTITLE="text:booktitle";
- //public static final String TEXT_CHAPTER="text:chapter";
- public static final String TEXT_EDITION="text:edition";
- public static final String TEXT_EDITOR="text:editor";
- public static final String TEXT_HOWPUBLISHED="text:howpublished";
- public static final String TEXT_INSTITUTION="text:institution";
- public static final String TEXT_JOURNAL="text:journal";
- public static final String TEXT_MONTH="text:month";
- public static final String TEXT_NOTE="text:note";
- public static final String TEXT_NUMBER="text:number";
- public static final String TEXT_ORGANIZATIONS="text:organizations";
- public static final String TEXT_PAGES="text:pages";
- public static final String TEXT_PUBLISHER="text:publisher";
- public static final String TEXT_SCHOOL="text:school";
- public static final String TEXT_SERIES="text:series";
- public static final String TEXT_TITLE="text:title";
- public static final String TEXT_REPORT_TYPE="text:report-type";
- public static final String TEXT_VOLUME="text:volume";
- public static final String TEXT_YEAR="text:year";
- public static final String TEXT_URL="text:url";
- public static final String TEXT_CUSTOM1="text:custom1";
- public static final String TEXT_CUSTOM2="text:custom2";
- public static final String TEXT_CUSTOM3="text:custom3";
- public static final String TEXT_CUSTOM4="text:custom4";
- public static final String TEXT_CUSTOM5="text:custom5";
- public static final String TEXT_ISBN="text:isbn";
-
- // fo namespace
- public static final String FO_LANGUAGE="fo:language";
- public static final String FO_COUNTRY="fo:country";
- public static final String FO_TEXT_SHADOW="fo:text-shadow";
- public static final String FO_COLOR="fo:color";
- public static final String FO_BACKGROUND_COLOR="fo:background-color";
- public static final String FO_TEXT_TRANSFORM="fo:text-transform";
- public static final String FO_FONT_FAMILY="fo:font-family";
- public static final String FO_FONT_SIZE="fo:font-size";
- public static final String FO_FONT_WEIGHT="fo:font-weight";
- public static final String FO_FONT_VARIANT="fo:font-variant";
- public static final String FO_FONT_STYLE="fo:font-style";
- public static final String FO_LETTER_SPACING="fo:letter-spacing";
- public static final String FO_VERTICAL_ALIGN="fo:vertical-align";
- public static final String FO_TEXT_ALIGN="fo:text-align";
- public static final String FO_TEXT_ALIGN_LAST="fo:text-align-last";
- public static final String FO_BREAK_BEFORE="fo:break-before";
- public static final String FO_BREAK_AFTER="fo:break-after";
- public static final String FO_MARGIN_LEFT="fo:margin-left";
- public static final String FO_MARGIN_RIGHT="fo:margin-right";
- public static final String FO_MARGIN_TOP="fo:margin-top";
- public static final String FO_MARGIN_BOTTOM="fo:margin-bottom";
- public static final String FO_PAGE_WIDTH="fo:page-width";
- public static final String FO_PAGE_HEIGHT="fo:page-height";
- public static final String FO_BORDER="fo:border";
- public static final String FO_BORDER_LEFT="fo:border-left";
- public static final String FO_BORDER_RIGHT="fo:border-right";
- public static final String FO_BORDER_TOP="fo:border-top";
- public static final String FO_BORDER_BOTTOM="fo:border-bottom";
- public static final String FO_PADDING="fo:padding";
- public static final String FO_PADDING_LEFT="fo:padding-left";
- public static final String FO_PADDING_RIGHT="fo:padding-right";
- public static final String FO_PADDING_TOP="fo:padding-top";
- public static final String FO_PADDING_BOTTOM="fo:padding-bottom";
- public static final String FO_LINE_HEIGHT="fo:line-height";
- public static final String FO_TEXT_INDENT="fo:text-indent";
- public static final String FO_WRAP_OPTION="fo:wrap-option";
- public static final String FO_COLUMN_COUNT="fo:column-count";
-
- // svg namespace
- public static final String SVG_X="svg:x";
- public static final String SVG_Y="svg:y";
- public static final String SVG_HEIGHT="svg:height";
- public static final String SVG_WIDTH="svg:width";
- // xlink namespace
- public static final String XLINK_HREF="xlink:href";
- // math namespace
- public static final String MATH_MATH="math:math";
- public static final String MATH_SEMANTICS="math:semantics";
- public static final String MATH_ANNOTATION="math:annotation";
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/util/CSVList.java b/xmerge/source/writer2latex/source/writer2latex/util/CSVList.java
deleted file mode 100644
index d5bf68d0f7d0..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/util/CSVList.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/************************************************************************
- *
- * CSVList.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-08-10)
- *
- */
-
-package writer2latex.util;
-
-// Create a list of values separated by commas or another seperation character
-public class CSVList{
- private String sSep;
- private String sNameValueSep;
- private boolean bEmpty = true;
- private StringBuffer buf = new StringBuffer();
-
- public CSVList(String sSep, String sNameValueSep) {
- this.sSep=sSep;
- this.sNameValueSep=sNameValueSep;
- }
-
- public CSVList(String sSep) {
- this(sSep,":");
- }
-
- public CSVList(char cSep) {
- this(Character.toString(cSep),":");
- }
-
- public void addValue(String sVal){
- if (sVal==null) { return; }
- if (bEmpty) { bEmpty=false; } else { buf.append(sSep); }
- buf.append(sVal);
- }
-
- public void addValue(String sName, String sVal) {
- if (sName==null) { return; }
- if (bEmpty) { bEmpty=false; } else { buf.append(sSep); }
- buf.append(sName).append(sNameValueSep).append(sVal);
- }
-
- public String toString() {
- return buf.toString();
- }
-
- public boolean isEmpty() {
- return bEmpty;
- }
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/util/Config.java b/xmerge/source/writer2latex/source/writer2latex/util/Config.java
deleted file mode 100644
index f0eff3ad101a..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/util/Config.java
+++ /dev/null
@@ -1,576 +0,0 @@
-/************************************************************************
- *
- * Config.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3i (2004-12-28)
- *
- */
-
-package writer2latex.util;
-
-/* Configuration
-*/
-
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.util.LinkedList;
-import java.io.*;
-import java.net.URI;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Element;
-import org.w3c.dom.DOMImplementation;
-
-import writer2latex.xmerge.NewDOMDocument;
-import writer2latex.latex.style.I18n;
-import writer2latex.latex.style.StyleMap;
-import writer2latex.latex.HeadingMap;
-//import writer2latex.xhtml.XhtmlStyleMap;
-//import writer2latex.xhtml.XhtmlDocument;
-
-// The mother of all options; reads and writes string values
-class Option {
- protected String sValue;
- private String sName;
-
- void setString(String sValue) { this.sValue = sValue; }
-
- String getString() { return sValue; }
-
- String getName() { return sName; }
-
- Option(String sName, String sDefaultValue) {
- this.sName = sName;
- setString(sDefaultValue);
- }
-}
-
-// A simple variant is a BooleanOption, which interprets the values as booleans
-class BooleanOption extends Option {
- boolean bValue;
-
- boolean getValue() { return bValue; }
-
- void setString(String sValue) {
- super.setString(sValue);
- bValue = "true".equals(sValue);
- }
-
- BooleanOption(String sName, String sDefaultValue) {
- super(sName,sDefaultValue);
- }
-}
-
-// Next is the IntegerOption, which must always be subclassed (must override setString)
-abstract class IntegerOption extends Option {
- int nValue;
-
- int getValue() { return nValue; }
-
- IntegerOption(String sName, String sDefaultValue) {
- super(sName,sDefaultValue);
- }
-}
-
-public class Config {
- public static final int GENERIC = 0;
- public static final int DVIPS = 1;
- public static final int PDFTEX = 2;
-
- // Formatting (must be ordered)
- public static final int IGNORE_ALL = 0;
- public static final int IGNORE_MOST = 1;
- public static final int CONVERT_BASIC = 2;
- public static final int CONVERT_MOST = 3;
- public static final int CONVERT_ALL = 4;
- // Page formatting
- public static final int CONVERT_HEADER_FOOTER = 5;
-
- private static final int CREATE_USER_CONFIG = 0;
- private static final int BACKEND = 1;
- private static final int NO_PREAMBLE = 2;
- private static final int DOCUMENTCLASS = 3;
- private static final int GLOBAL_OPTIONS = 4;
- private static final int INPUTENCODING = 5;
- private static final int MULTILINGUAL = 6;
- private static final int GREEK_MATH = 7;
- private static final int USE_OOOMATH = 8;
- private static final int USE_PIFONT = 9;
- private static final int USE_IFSYM = 10;
- private static final int USE_WASYSYM = 11;
- private static final int USE_BBDING = 12;
- private static final int USE_EUROSYM = 13;
- private static final int USE_TIPA = 14;
- private static final int USE_COLOR = 15;
- private static final int USE_HYPERREF = 16;
- private static final int USE_ENDNOTES = 17;
- private static final int USE_ULEM = 18;
- private static final int USE_LASTPAGE = 19;
- private static final int USE_BIBTEX = 20;
- private static final int BIBTEX_STYLE = 21;
- private static final int FORMATTING = 22;
- private static final int PAGE_FORMATTING = 23;
- private static final int IGNORE_HARD_PAGE_BREAKS = 24;
- private static final int IGNORE_HARD_LINE_BREAKS = 25;
- private static final int IGNORE_EMPTY_PARAGRAPHS = 26;
- private static final int IGNORE_DOUBLE_SPACES = 27;
- private static final int DEBUG = 28;
-// private static final int XHTML_NO_DOCTYPE = 28;
-// private static final int XHTML_CUSTOM_STYLESHEET = 29;
-// private static final int XHTML_IGNORE_STYLES = 30;
-// private static final int XHTML_USE_DUBLIN_CORE = 31;
-// private static final int XHTML_CONVERT_TO_PX = 32;
-// private static final int XHTML_SCALING = 33;
-// private static final int XHTML_COLUMN_SCALING = 34;
-// private static final int XHTML_SPLIT_LEVEL = 35;
-// private static final int XHTML_CALC_SPLIT = 36;
-
- // due to XHTML code removal, changed count from 37 to 29
- // usage of enum (java 5) otherwise initialized array is recommended
- private static final int OPTION_COUNT = 29;
- Option[] options = new Option[OPTION_COUNT];
-
- protected boolean bDebug = false;
-
- protected LinkedList customPreamble = new LinkedList();
- protected StyleMap par = new StyleMap();
- protected StyleMap parBlock = new StyleMap();
- protected StyleMap text = new StyleMap();
- protected StyleMap list = new StyleMap();
- protected StyleMap listItem = new StyleMap();
- protected HeadingMap headingMap = new HeadingMap(5);
-// protected XhtmlStyleMap xpar = new XhtmlStyleMap();
-// protected XhtmlStyleMap xtext = new XhtmlStyleMap();
-// protected XhtmlStyleMap xframe = new XhtmlStyleMap();
-// protected XhtmlStyleMap xlist = new XhtmlStyleMap();
-// protected XhtmlStyleMap xattr = new XhtmlStyleMap();
- protected Hashtable mathSymbols = new Hashtable();
-
- public Config() {
- // create options with default values
- options[CREATE_USER_CONFIG] = new BooleanOption("create_user_config","true");
- options[NO_PREAMBLE] = new BooleanOption("no_preamble","false");
- options[DOCUMENTCLASS] = new Option("documentclass","article");
- options[GLOBAL_OPTIONS] = new Option("global_options","");
- options[BACKEND] = new IntegerOption("backend","generic") {
- void setString(String sValue) {
- super.setString(sValue);
- if ("generic".equals(sValue)) nValue = GENERIC;
- else if ("dvips".equals(sValue)) nValue = DVIPS;
- else if ("pdftex".equals(sValue)) nValue = PDFTEX;
- }
- };
- options[INPUTENCODING] = new IntegerOption("inputencoding",I18n.writeInputenc(I18n.ASCII)) {
- void setString(String sValue) {
- super.setString(sValue);
- nValue = I18n.readInputenc(sValue);
- }
- };
- options[MULTILINGUAL] = new BooleanOption("multilingual","true");
- options[GREEK_MATH] = new BooleanOption("greek_math","true");
- options[USE_OOOMATH] = new BooleanOption("use_ooomath","false");
- options[USE_PIFONT] = new BooleanOption("use_pifont","false");
- options[USE_IFSYM] = new BooleanOption("use_ifsym","false");
- options[USE_WASYSYM] = new BooleanOption("use_wasysym","false");
- options[USE_BBDING] = new BooleanOption("use_bbding","false");
- options[USE_EUROSYM] = new BooleanOption("use_eurosym","false");
- options[USE_TIPA] = new BooleanOption("use_tipa","false");
- options[USE_COLOR] = new BooleanOption("use_color","true");
- options[USE_HYPERREF] = new BooleanOption("use_hyperref","true");
- options[USE_ENDNOTES] = new BooleanOption("use_endnotes","false");
- options[USE_ULEM] = new BooleanOption("use_ulem","false");
- options[USE_LASTPAGE] = new BooleanOption("use_lastpage","false");
- options[USE_BIBTEX] = new BooleanOption("use_bibtex","false");
- options[BIBTEX_STYLE] = new Option("bibtex_style","plain");
- options[FORMATTING] = new IntegerOption("formatting","convert_basic") {
- void setString(String sValue) {
- super.setString(sValue);
- if ("convert_all".equals(sValue)) nValue = CONVERT_ALL;
- else if ("convert_most".equals(sValue)) nValue = CONVERT_MOST;
- else if ("convert_basic".equals(sValue)) nValue = CONVERT_BASIC;
- else if ("ignore_most".equals(sValue)) nValue = IGNORE_MOST;
- else if ("ignore_all".equals(sValue)) nValue = IGNORE_ALL;
- }
- };
- options[PAGE_FORMATTING] = new IntegerOption("page_formatting","convert_all") {
- void setString(String sValue) {
- super.setString(sValue);
- if ("convert_all".equals(sValue)) nValue = CONVERT_ALL;
- else if ("convert_header_footer".equals(sValue)) nValue = CONVERT_HEADER_FOOTER;
- else if ("ignore_all".equals(sValue)) nValue = IGNORE_ALL;
- }
- };
- options[IGNORE_HARD_PAGE_BREAKS] = new BooleanOption("ignore_hard_page_breaks","false");
- options[IGNORE_HARD_LINE_BREAKS] = new BooleanOption("ignore_hard_line_breaks","false");
- options[IGNORE_EMPTY_PARAGRAPHS] = new BooleanOption("ignore_empty_paragraphs","false");
- options[IGNORE_DOUBLE_SPACES] = new BooleanOption("ignore_double_spaces","false");
-
-// options[XHTML_NO_DOCTYPE] = new BooleanOption("xhtml_no_doctype","false");
-// options[XHTML_CUSTOM_STYLESHEET] = new Option("xhtml_custom_stylesheet","");
-// options[XHTML_IGNORE_STYLES] = new BooleanOption("xhtml_ignore_styles","false");
-// options[XHTML_USE_DUBLIN_CORE] = new BooleanOption("xhtml_use_dublin_core","true");
-// options[XHTML_CONVERT_TO_PX] = new BooleanOption("xhtml_convert_to_px","true");
-// options[XHTML_SCALING] = new Option("xhtml_scaling","100%");
-// options[XHTML_COLUMN_SCALING] = new Option("xhtml_column_scaling","100%");
-// options[XHTML_SPLIT_LEVEL] = new IntegerOption("xhtml_split_level","0") {
-// void setString(String sValue) {
-// super.setString(sValue);
-// nValue = Misc.getPosInteger(sValue,0);
-// }
-// };
-// options[XHTML_CALC_SPLIT] = new BooleanOption("xhtml_calc_split","false");
- options[DEBUG] = new BooleanOption("debug","false");
- // Headings for article class:
- headingMap.setLevelData(1,"section",1);
- headingMap.setLevelData(2,"subsection",2);
- headingMap.setLevelData(3,"subsubsection",3);
- headingMap.setLevelData(4,"paragraph",4);
- headingMap.setLevelData(5,"subparagraph",5);
- // read system wide default configuration, if available
- // TODO: Is there a more elegant approach to find the jar file name???
- //String s = this.getClass().getResource("symbols.xml").toString();
- String s = this.getClass().getResource("Config.class").toString();
- String sPath = s.substring(s.indexOf("file:"),s.indexOf("writer2latex.jar!"));
- String sDefaultConfig = sPath+"writer2latex.xml";
- try {
- File f = new File(new URI(sDefaultConfig));
- if (f.exists()) read(f.getPath());
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- // read user configuration, if available
- String sUserConfig = System.getProperty("user.home")
- + System.getProperty("file.separator") + "writer2latex.xml";
- File f = new File(sUserConfig);
- if (f.exists()) read(sUserConfig);
- else if (createUserConfig()) write(sUserConfig);
- }
-
- public void read(String sFileName) {
- NewDOMDocument doc = new NewDOMDocument(sFileName,".xml");
- try {
- doc.read(new FileInputStream(sFileName));
- } catch(IOException e) {
- System.out.println("Oops - I cannot read the configuration file "+sFileName);
- e.printStackTrace();
- return; // give up and continue without the configuration
- }
- Document dom = doc.getContentDOM();
- if (dom==null) {
- System.out.println("Oops - I cannot understand the contents of the configuration file "+sFileName);
- return; // give up and continue without the configuration
- }
- Node root = dom.getDocumentElement();
- if (!root.hasChildNodes()) { return; }
- NodeList nl = root.getChildNodes();
- int nLen = nl.getLength();
- for (int i=0; i<nLen; i++) {
- Node child = nl.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE) {
- String sChildName = child.getNodeName();
- if (sChildName.equals("option")) {
- String sName = Misc.getAttribute(child,"name");
- String sValue = Misc.getAttribute(child,"value");
- for (int j=0; j<OPTION_COUNT; j++) {
- if (options[j].getName().equals(sName)) {
- options[j].setString(sValue);
- break;
- }
- }
- }
- else if (sChildName.equals("style-map")) {
- String sName = Misc.getAttribute(child,"name");
- String sClass = Misc.getAttribute(child,"class");
- String sBefore = Misc.getAttribute(child,"before");
- String sAfter = Misc.getAttribute(child,"after");
- boolean bLineBreak = !"false".equals(Misc.getAttribute(child,"line-break"));
- boolean bVerbatim = "true".equals(Misc.getAttribute(child,"verbatim"));
- if ("paragraph".equals(sClass)) {
- par.put(sName,sBefore,sAfter,bLineBreak,bVerbatim);
- }
- if ("paragraph-block".equals(sClass)) {
- String sNext = Misc.getAttribute(child,"next");
- parBlock.put(sName,sBefore,sAfter,sNext);
- }
- else if ("text".equals(sClass)) {
- text.put(sName,sBefore,sAfter,false,bVerbatim);
- }
- else if ("list".equals(sClass)) {
- list.put(sName,sBefore,sAfter);
- }
- else if ("listitem".equals(sClass)) {
- listItem.put(sName,sBefore,sAfter);
- }
- }
- else if (sChildName.equals("heading-map")) {
- readHeadingMap(child);
- }
- else if (sChildName.equals("custom-preamble")) {
- if (child.hasChildNodes()) {
- NodeList subNl = child.getChildNodes();
- int nSubLen = subNl.getLength();
- for (int j=0; j<nSubLen; j++) {
- Node subChild = subNl.item(j);
- if (subChild.getNodeType()==Node.TEXT_NODE) {
- customPreamble.add(subChild.getNodeValue());
- }
- }
- }
- }
-// else if (sChildName.equals("xhtml-style-map")) {
-// String sName = Misc.getAttribute(child,"name");
-// String sClass = Misc.getAttribute(child,"class");
-// String sBlockElement = Misc.getAttribute(child,"block-element");
-// if (sBlockElement==null) { sBlockElement=""; }
-// String sBlockCss = Misc.getAttribute(child,"block-css");
-// if (sBlockCss==null) { sBlockCss="(none)"; }
-// String sElement = Misc.getAttribute(child,"element");
-// if (sElement==null) { sElement=""; }
-// String sCss = Misc.getAttribute(child,"css");
-// if (sCss==null) { sCss="(none)"; }
-// if ("paragraph".equals(sClass)) {
-// xpar.put(sName,sBlockElement,sBlockCss,sElement,sCss);
-// }
-// else if ("text".equals(sClass)) {
-// xtext.put(sName,sBlockElement,sBlockCss,sElement,sCss);
-// }
-// else if ("frame".equals(sClass)) {
-// xframe.put(sName,sBlockElement,sBlockCss,sElement,sCss);
-// }
-// else if ("list".equals(sClass)) {
-// xlist.put(sName,sBlockElement,sBlockCss,sElement,sCss);
-// }
-// else if ("attribute".equals(sClass)) {
-// xattr.put(sName,sBlockElement,sBlockCss,sElement,sCss);
-// }
-// }
- else if (sChildName.equals("math-symbol-map")) {
- String sName = Misc.getAttribute(child,"name");
- String sLatex = Misc.getAttribute(child,"latex");
- mathSymbols.put(sName,sLatex);
- }
- }
- }
- }
-
- public void readHeadingMap(Node node) {
- int nMaxLevel = Misc.getPosInteger(Misc.getAttribute(node,"max-level"),0);
- headingMap.reset(nMaxLevel);
- NodeList nl = node.getChildNodes();
- int nLen = nl.getLength();
- for (int i=0; i<nLen; i++) {
- Node child = nl.item(i);
- if (child.getNodeType()==Node.ELEMENT_NODE) {
- String sChildName = child.getNodeName();
- if (sChildName.equals("heading-level-map")) {
- int nWriterLevel = Misc.getPosInteger(Misc.getAttribute(child,"writer-level"),1);
- String sName = Misc.getAttribute(child,"name");
- int nLevel = Misc.getPosInteger(Misc.getAttribute(child,"level"),0);
- headingMap.setLevelData(nWriterLevel,sName,nLevel);
- }
- }
- }
- }
-
- public void write(String sFileName) {
- NewDOMDocument doc = new NewDOMDocument(sFileName,".xml");
- Document dom = null;
- try {
- DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = builderFactory.newDocumentBuilder();
- DOMImplementation domImpl = builder.getDOMImplementation();
- dom = domImpl.createDocument("","config",null);
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
- Element rootElement = dom.getDocumentElement();
-
- for (int i=0; i<OPTION_COUNT; i++) {
- Element optionNode = dom.createElement("option");
- optionNode.setAttribute("name",options[i].getName());
- optionNode.setAttribute("value",options[i].getString());
- rootElement.appendChild(optionNode);
- }
-
- // Write math symbol map
- Enumeration msEnum = mathSymbols.keys();
- while (msEnum.hasMoreElements()) {
- String sName = (String) msEnum.nextElement();
- String sLatex = (String) mathSymbols.get(sName);
- Element msNode = dom.createElement("math-symbol-map");
- msNode.setAttribute("name",sName);
- msNode.setAttribute("latex",sLatex);
- rootElement.appendChild(msNode);
- }
-
- writeStyleMap(dom,par,"paragraph");
- writeStyleMap(dom,parBlock,"paragraph-block");
- writeStyleMap(dom,text,"text");
- writeStyleMap(dom,list,"list");
- writeStyleMap(dom,listItem,"listitem");
-
- Element hmNode = dom.createElement("heading-map");
- hmNode.setAttribute("max-level",Integer.toString(headingMap.getMaxLevel()));
- rootElement.appendChild(hmNode);
- for (int i=1; i<=headingMap.getMaxLevel(); i++) {
- Element hlmNode = dom.createElement("heading-level-map");
- hlmNode.setAttribute("writer-level",Integer.toString(i));
- hlmNode.setAttribute("name",headingMap.getName(i));
- hlmNode.setAttribute("level",Integer.toString(headingMap.getLevel(i)));
- hmNode.appendChild(hlmNode);
- }
-
-
-// writeXStyleMap(dom,xpar,"paragraph");
-// writeXStyleMap(dom,xtext,"text");
-// writeXStyleMap(dom,xlist,"list");
-// writeXStyleMap(dom,xframe,"frame");
-// writeXStyleMap(dom,xframe,"attribute");
-
- writeContent(dom,customPreamble,"custom-preamble");
-
- doc.setContentDOM(dom);
- try {
- doc.write(new FileOutputStream(sFileName));
- } catch(IOException e) {
- System.out.println("Oops - problem writing the configuration");
- e.printStackTrace();
- }
- }
-
- // Common options
- public boolean createUserConfig() { return ((BooleanOption) options[CREATE_USER_CONFIG]).getValue(); }
- public boolean debug() { return ((BooleanOption) options[DEBUG]).getValue(); }
-
- // General options
- public String getDocumentclass() { return options[DOCUMENTCLASS].getString(); }
- public String getGlobalOptions() { return options[GLOBAL_OPTIONS].getString(); }
- public int getBackend() { return ((IntegerOption) options[BACKEND]).getValue(); }
- public int getInputencoding() { return ((IntegerOption) options[INPUTENCODING]).getValue(); }
- public boolean multilingual() { return ((BooleanOption) options[MULTILINGUAL]).getValue(); }
- public boolean greekMath() { return ((BooleanOption) options[GREEK_MATH]).getValue(); }
-
- // Package options
- public boolean noPreamble() { return ((BooleanOption) options[NO_PREAMBLE]).getValue(); }
- public boolean useOoomath() { return ((BooleanOption) options[USE_OOOMATH]).getValue(); }
- public boolean usePifont() { return ((BooleanOption) options[USE_PIFONT]).getValue(); }
- public boolean useIfsym() { return ((BooleanOption) options[USE_IFSYM]).getValue(); }
- public boolean useWasysym() { return ((BooleanOption) options[USE_WASYSYM]).getValue(); }
- public boolean useBbding() { return ((BooleanOption) options[USE_BBDING]).getValue(); }
- public boolean useEurosym() { return ((BooleanOption) options[USE_EUROSYM]).getValue(); }
- public boolean useTipa() { return ((BooleanOption) options[USE_TIPA]).getValue(); }
- public boolean useColor() { return ((BooleanOption) options[USE_COLOR]).getValue(); }
- public boolean useHyperref() { return ((BooleanOption) options[USE_HYPERREF]).getValue(); }
- public boolean useEndnotes() { return ((BooleanOption) options[USE_ENDNOTES]).getValue(); }
- public boolean useUlem() { return ((BooleanOption) options[USE_ULEM]).getValue(); }
- public boolean useLastpage() { return ((BooleanOption) options[USE_LASTPAGE]).getValue(); }
- public boolean useBibtex() { return ((BooleanOption) options[USE_BIBTEX]).getValue(); }
- public String bibtexStyle() { return options[BIBTEX_STYLE].getString(); }
-
- // Formatting options
- public int formatting() { return ((IntegerOption) options[FORMATTING]).getValue(); }
- public int pageFormatting() { return ((IntegerOption) options[PAGE_FORMATTING]).getValue(); }
- public boolean ignoreHardPageBreaks() { return ((BooleanOption) options[IGNORE_HARD_PAGE_BREAKS]).getValue(); }
- public boolean ignoreHardLineBreaks() { return ((BooleanOption) options[IGNORE_HARD_LINE_BREAKS]).getValue(); }
- public boolean ignoreEmptyParagraphs() { return ((BooleanOption) options[IGNORE_EMPTY_PARAGRAPHS]).getValue(); }
- public boolean ignoreDoubleSpaces() { return ((BooleanOption) options[IGNORE_DOUBLE_SPACES]).getValue(); }
-
-// // XHTML options
-// public boolean xhtmlNoDoctype() { return ((BooleanOption) options[XHTML_NO_DOCTYPE]).getValue(); }
-// public String xhtmlCustomStylesheet() { return options[XHTML_CUSTOM_STYLESHEET].getString(); }
-// public boolean xhtmlIgnoreStyles() { return ((BooleanOption) options[XHTML_IGNORE_STYLES]).getValue(); }
-// public boolean xhtmlUseDublinCore() { return ((BooleanOption) options[XHTML_USE_DUBLIN_CORE]).getValue(); }
-// public boolean xhtmlConvertToPx() { return ((BooleanOption) options[XHTML_CONVERT_TO_PX]).getValue(); }
-// public String getXhtmlScaling() { return options[XHTML_SCALING].getString(); }
-// public String getXhtmlColumnScaling() { return options[XHTML_COLUMN_SCALING].getString(); }
-// public int getXhtmlSplitLevel() { return ((IntegerOption) options[XHTML_SPLIT_LEVEL]).getValue(); }
-// public boolean xhtmlCalcSplit() { return ((BooleanOption) options[XHTML_CALC_SPLIT]).getValue(); }
-
- public Hashtable getMathSymbols() { return mathSymbols; }
-
- public StyleMap getParStyleMap() { return par; }
- public StyleMap getParBlockStyleMap() { return parBlock; }
- public StyleMap getTextStyleMap() { return text; }
- public StyleMap getListStyleMap() { return list; }
- public StyleMap getListItemStyleMap() { return listItem; }
- public HeadingMap getHeadingMap() { return headingMap; }
- public LinkedList getCustomPreamble() { return customPreamble; }
-
-// public XhtmlStyleMap getXParStyleMap() { return xpar; }
-// public XhtmlStyleMap getXTextStyleMap() { return xtext; }
-// public XhtmlStyleMap getXFrameStyleMap() { return xframe; }
-// public XhtmlStyleMap getXListStyleMap() { return xlist; }
-// public XhtmlStyleMap getXAttrStyleMap() { return xattr; }
-
- private void writeStyleMap(Document dom, StyleMap sm, String sClass) {
- Enumeration smEnum = sm.getNames();
- while (smEnum.hasMoreElements()) {
- String sName = (String) smEnum.nextElement();
- Element smNode = dom.createElement("style-map");
- smNode.setAttribute("name",sName);
- smNode.setAttribute("class",sClass);
- smNode.setAttribute("before",sm.getBefore(sName));
- smNode.setAttribute("after",sm.getAfter(sName));
- if (sm.getNext(sName)!=null) {
- smNode.setAttribute("next",sm.getNext(sName));
- }
- if (!sm.getLineBreak(sName)) {
- smNode.setAttribute("line-break","false");
- }
- if (sm.getVerbatim(sName)) {
- smNode.setAttribute("verbatim","true");
- }
- dom.getDocumentElement().appendChild(smNode);
- }
- }
-
-// private void writeXStyleMap(Document dom, XhtmlStyleMap sm, String sClass) {
-// Enumeration smEnum = sm.getNames();
-// while (smEnum.hasMoreElements()) {
-// String sName = (String) smEnum.nextElement();
-// Element smNode = dom.createElement("xhtml-style-map");
-// smNode.setAttribute("name",sName);
-// smNode.setAttribute("class",sClass);
-// smNode.setAttribute("element",sm.getElement(sName));
-// smNode.setAttribute("css",sm.getCss(sName));
-// String sBlockElement = sm.getBlockElement(sName);
-// if (sBlockElement!=null) { smNode.setAttribute("block-element",sm.getCss(sBlockElement)); }
-// String sBlockCss = sm.getBlockCss(sName);
-// if (sBlockCss!=null) { smNode.setAttribute("block-css",sm.getCss(sBlockCss)); }
-// dom.getDocumentElement().appendChild(smNode);
-// }
-// }
- private void writeContent(Document dom, LinkedList list, String sElement) {
- Element node = dom.createElement(sElement);
- int nLen = list.size();
- for (int i=0; i<nLen; i++) {
- node.appendChild( dom.createTextNode( (String) list.get(i) ) );
- }
- dom.getDocumentElement().appendChild(node);
- }
-
-}
-
diff --git a/xmerge/source/writer2latex/source/writer2latex/util/ExportNameCollection.java b/xmerge/source/writer2latex/source/writer2latex/util/ExportNameCollection.java
deleted file mode 100644
index 0b21455c9662..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/util/ExportNameCollection.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/************************************************************************
- *
- * ExportNameCollection.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3f (2004-09-14)
- *
- */
-
-package writer2latex.util;
-
-import java.util.Hashtable;
-
-// Collection of export names
-// Used for mapping named collections to simpler names (only A-Z, a-z and 0-9)
-public class ExportNameCollection{
- private Hashtable exportNames = new Hashtable();
- private String sPrefix;
- private boolean bAcceptNumbers;
-
- public ExportNameCollection(String sPrefix, boolean b) {
- this.sPrefix=sPrefix;
- bAcceptNumbers = b;
- }
-
- public ExportNameCollection(boolean b) {
- this("",b);
- }
-
- public void addName(String sName){
- if (containsName(sName)) { return; }
- StringBuffer outbuf=new StringBuffer();
- SimpleInputBuffer inbuf=new SimpleInputBuffer(sName);
-
- // Don't start with a digit
- if (bAcceptNumbers && inbuf.peekChar()>='0' && inbuf.peekChar()<='9') {
- outbuf.append('a');
- }
-
- char c;
- // convert numbers to roman numbers and discard unwanted characters
- while ((c=inbuf.peekChar())!='\0'){
- if ((c>='a' && c<='z') || (c>='A' && c<='Z')) {
- outbuf.append(inbuf.getChar());
- }
- else if (c>='0' && c<='9'){
- if (bAcceptNumbers) {
- outbuf.append(inbuf.getInteger());
- }
- else {
- outbuf.append(Misc.int2roman(
- Integer.parseInt(inbuf.getInteger())));
- }
- }
- else {
- inbuf.getChar(); // ignore this character
- }
- }
- String sExportName=outbuf.toString();
- // the result may exist in the collecion; add a's at the end
- while (exportNames.containsValue(sExportName)){
- sExportName+="a";
- }
- exportNames.put(sName,sExportName);
- }
-
- public String getExportName(String sName) {
- // add the name, if it does not exist
- if (!containsName(sName)) { addName(sName); }
- return sPrefix + (String) exportNames.get(sName);
- }
-
- public boolean containsName(String sName) {
- return exportNames.containsKey(sName);
- }
-
- public boolean isEmpty() {
- return exportNames.size()==0;
- }
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/util/L10n.java b/xmerge/source/writer2latex/source/writer2latex/util/L10n.java
deleted file mode 100644
index 0f22c83f707c..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/util/L10n.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/************************************************************************
- *
- * L10n.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-10-22)
- *
- */
-
-package writer2latex.util;
-
-// This class handles localized strings
-public class L10n {
- public final static int FIRST = 0;
- public final static int PREVIOUS = 1;
- public final static int NEXT = 2;
- public final static int LAST = 3;
- public final static int CONTENTS = 4;
- public final static int INDEX = 5;
-
- private String sLocale="en-US";
-
- public void setLocale(String sLocale) {
- if (sLocale!=null) { this.sLocale = sLocale;}
- }
-
- public String get(int nString) {
- if (sLocale.startsWith("da")) { // danish
- switch (nString) {
- case FIRST : return "F\u00F8rste";
- case PREVIOUS : return "Forrige";
- case NEXT : return "N\u00E6ste";
- case LAST : return "Sidste";
- case CONTENTS : return "Indhold";
- case INDEX : return "Stikord";
- }
- }
- if (sLocale.startsWith("hr")) { // croatian
- switch (nString) {
- case FIRST : return "Prvi";
- case PREVIOUS : return "Prethodan";
- case NEXT : return "slijede\u0107i";
- case LAST : return "Zadnji";
- case CONTENTS : return "Sadr\u017Eaj";
- case INDEX : return "Indeks";
- }
- }
- else { // english - default
- switch (nString) {
- case FIRST : return "First";
- case PREVIOUS : return "Previous";
- case NEXT : return "Next";
- case LAST: return "Last";
- case CONTENTS : return "Contents";
- case INDEX : return "Index";
- }
- }
- return "???";
- }
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/util/Misc.java b/xmerge/source/writer2latex/source/writer2latex/util/Misc.java
deleted file mode 100644
index 41776ec5a259..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/util/Misc.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/************************************************************************
- *
- * Misc.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-30)
- *
- */
-
-package writer2latex.util;
-
-import java.lang.Math;
-import java.util.Hashtable;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.NamedNodeMap;
-
-// This class contains some usefull, but unrelated static methods
-public class Misc{
-
- public static final int[] doubleIntArray(int[] array) {
- int n = array.length;
- int[] newArray = new int[2*n];
- for (int i=0; i<n; i++) { newArray[i] = array[i]; }
- return newArray;
- }
-
- public static final String int2roman(int number) {
- StringBuffer roman=new StringBuffer();
- while (number>=1000) { roman.append('m'); number-=1000; }
- if (number>=900) { roman.append("cm"); number-=900; }
- if (number>=500) { roman.append('d'); number-=500; }
- if (number>=400) { roman.append("cd"); number-=400; }
- while (number>=100) { roman.append('c'); number-=100; }
- if (number>=90) { roman.append("xc"); number-=90; }
- if (number>=50) { roman.append('l'); number-=50; }
- if (number>=40) { roman.append("xl"); number-=40; }
- while (number>=10) { roman.append('x'); number-=10; }
- if (number>=9) { roman.append("ix"); number-=9; }
- if (number>=5) { roman.append('v'); number-=5; }
- if (number>=4) { roman.append("iv"); number-=4; }
- while (number>=1) { roman.append('i'); number-=1; }
- return roman.toString();
- }
-
- public static final String int2Roman(int number) {
- return int2roman(number).toUpperCase();
- }
-
- public static final String int2arabic(int number) {
- return new Integer(number).toString();
- }
-
- public static final String int2alph(int number, boolean bLetterSync) {
- // TODO: Handle overflow/lettersync
- return new Character((char) (number+96)).toString();
- }
-
- public static final String int2Alph(int number, boolean bLetterSync) {
- return int2alph(number,bLetterSync).toUpperCase();
- }
-
- public static final int getPosInteger(String sInteger, int nDefault){
- int n;
- try {
- n=Integer.parseInt(sInteger);
- }
- catch (NumberFormatException e) {
- return nDefault;
- }
- return n>0 ? n : nDefault;
- }
-
- public static final float getFloat(String sFloat, float fDefault){
- float f;
- try {
- f=Float.parseFloat(sFloat);
- }
- catch (NumberFormatException e) {
- return fDefault;
- }
- return f;
- }
-
- public static final int getIntegerFromHex(String sHex, int nDefault){
- int n;
- try {
- n=Integer.parseInt(sHex,16);
- }
- catch (NumberFormatException e) {
- return nDefault;
- }
- return n;
- }
-
- public static String truncateLength(String sValue) {
- if (sValue.endsWith("inch")) {
- // Cut of inch to in
- return sValue.substring(0,sValue.length()-2);
- }
- else {
- return sValue;
- }
- }
-
- // Return units per inch for some unit
- private static final float getUpi(String sUnit) {
- if ("in".equals(sUnit)) { return 1.0F; }
- else if ("mm".equals(sUnit)) { return 25.4F; }
- else if ("cm".equals(sUnit)) { return 2.54F; }
- else if ("pc".equals(sUnit)) { return 6F; }
- else { return 72; } // pt or unknown
- }
-
- // Convert a length to px assuming 96ppi (cf. css spec)
- // Exception: Never return less than 1px
- public static final String length2px(String sLength) {
- float fLength=getFloat(sLength.substring(0,sLength.length()-2),1);
- String sUnit=sLength.substring(sLength.length()-2);
- float fPixels = 96.0F/getUpi(sUnit)*fLength;
- if (Math.abs(fPixels)<0.01) {
- return "0";
- }
- else if (fPixels>0) {
- return Float.toString(fPixels<1 ? 1 : fPixels)+"px";
- }
- else {
- return Float.toString(fPixels>-1 ? -1 : fPixels)+"px";
- }
- }
-
- public static final String multiply(String sPercent, String sLength){
- float fPercent=getFloat(sPercent.substring(0,sPercent.length()-1),1);
- float fLength=getFloat(sLength.substring(0,sLength.length()-2),1);
- String sUnit=sLength.substring(sLength.length()-2);
- return Float.toString(fPercent*fLength/100)+sUnit;
- }
-
- public static final String add(String sLength1, String sLength2){
- float fLength1=getFloat(sLength1.substring(0,sLength1.length()-2),1);
- String sUnit1=sLength1.substring(sLength1.length()-2);
- float fLength2=getFloat(sLength2.substring(0,sLength2.length()-2),1);
- String sUnit2=sLength2.substring(sLength2.length()-2);
- // Use unit from sLength1:
- return Float.toString(fLength1+getUpi(sUnit1)/getUpi(sUnit2)*fLength2)+sUnit1;
- }
-
- /*
- * Utility method to make sure the document name is stripped of any file
- * extensions before use.
- * (this is copied verbatim from PocketWord.java in xmerge)
- */
- public static final String trimDocumentName(String name,String extension) {
- String temp = name.toLowerCase();
-
- if (temp.endsWith(extension)) {
- // strip the extension
- int nlen = name.length();
- int endIndex = nlen - extension.length();
- name = name.substring(0,endIndex);
- }
-
- return name;
- }
-
- public static final String removeExtension(String sName) {
- int n = sName.lastIndexOf(".");
- if (n<0) { return sName; }
- return sName.substring(0,n);
- }
-
- /*
- * Utility method to retrieve a Node attribute.
- */
- public static final String getAttribute (Node node, String attribute) {
- NamedNodeMap attrNodes = node.getAttributes();
-
- if (attrNodes != null) {
- Node attr = attrNodes.getNamedItem(attribute);
- if (attr != null) {
- return attr.getNodeValue();
- }
- }
-
- return null;
- }
-
- /* utility method to get the first child with a given tagname */
- public static final Element getChildByTagName(Node node, String sTagName){
- if (node.hasChildNodes()){
- NodeList nl=node.getChildNodes();
- int nLen=nl.getLength();
- for (int i=0; i<nLen; i++){
- Node child = nl.item(i);
- if (child.getNodeType() == Node.ELEMENT_NODE &&
- child.getNodeName().equals(sTagName)){
- return (Element) child;
- }
- }
- }
- return null;
- }
-
-
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/util/SimpleInputBuffer.java b/xmerge/source/writer2latex/source/writer2latex/util/SimpleInputBuffer.java
deleted file mode 100644
index 219cb296dfdc..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/util/SimpleInputBuffer.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/************************************************************************
- *
- * SimpleInputBuffer.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-11-21)
- *
- */
-
-package writer2latex.util;
-
-// Simple string input buffer
-public class SimpleInputBuffer{
-
- private String sContent;
- private int nIndex, nLen;
-
- private static boolean isEndOrLineEnd(char cChar){
- switch (cChar){
- case '\0':
- case '\n':
- case '\r':
- return true;
- default:
- return false;
- }
- }
-
- private static boolean isDigitOrDot(char cChar){
- return (cChar>='0' && cChar<='9') || cChar=='.';
- }
-
- private static boolean isDigitOrDotOrComma(char cChar) {
- return isDigitOrDot(cChar) || cChar==',';
- }
-
- public SimpleInputBuffer(String sContent){
- this.sContent=sContent;
- nLen=sContent.length();
- nIndex=0;
- }
-
- public int getIndex(){return nIndex;}
-
- public char peekChar(){
- return nIndex<nLen ? sContent.charAt(nIndex) : '\0';
- }
-
- public char peekFollowingChar(){
- return nIndex+1<nLen ? sContent.charAt(nIndex+1) : '\0';
- }
-
- public char getChar(){
- return nIndex<nLen ? sContent.charAt(nIndex++) : '\0';
- }
-
- public String getIdentifier(){
- int nStart=nIndex;
- while (nIndex<nLen && (Character.isLetter(sContent.charAt(nIndex)) ||
- isDigitOrDot(sContent.charAt(nIndex))))
- nIndex++;
- return sContent.substring(nStart,nIndex);
- }
-
- public String getNumber(){
- int nStart=nIndex;
- while (nIndex<nLen && isDigitOrDotOrComma(sContent.charAt(nIndex)))
- nIndex++;
- return sContent.substring(nStart,nIndex);
- }
-
- public String getInteger(){
- int nStart=nIndex;
- while (nIndex<nLen && sContent.charAt(nIndex)>='0' && sContent.charAt(nIndex)<='9'){
- nIndex++;
- }
- return sContent.substring(nStart,nIndex);
- }
-}
diff --git a/xmerge/source/writer2latex/source/writer2latex/xmerge/BinaryGraphicsDocument.java b/xmerge/source/writer2latex/source/writer2latex/xmerge/BinaryGraphicsDocument.java
deleted file mode 100644
index e4d6e47798df..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/xmerge/BinaryGraphicsDocument.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/************************************************************************
- *
- * BinaryGraphicsDocument.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2003 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.2 (2003-02-27)
- *
- */
-
-package writer2latex.xmerge;
-
-import java.io.OutputStream;
-import java.io.InputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import org.openoffice.xmerge.Document;
-
-/**
- * <p>Class representing a binary graphics document.
- * This class is used for representing graphics documents that are <i>not</i>
- * interpreted in any way, but simply copied verbatim from the source format
- * to the target format.</p>
- *
- * <p><code>GraphicsDocument</code> is used to create new graphics documents.</p>
- *
- */
-public class BinaryGraphicsDocument implements Document {
-
- private final static int BUFFERSIZE = 1024;
-
- private String docName;
-
- private byte[] data;
- private int nOff;
- private int nLen;
-
- private String sFileExtension;
- private String sMimeType;
-
- /**
- * <p>Constructs a new graphics document.</p>
- *
- * <p>This new document does not contain any information. Document data must
- * either be added using appropriate methods, or an existing file can be
- * {@link #read(InputStream) read} from an <code>InputStream</code>.</p>
- *
- * @param name The name of the <code>GraphicsDocument</code>.
- */
- public BinaryGraphicsDocument(String name, String sFileExtension, String sMimeType) {
- this.sFileExtension = sFileExtension;
- this.sMimeType = sMimeType;
- docName = trimDocumentName(name);
- }
-
-
- /**
- * <p>This method reads <code>byte</code> data from the InputStream.</p>
- *
- * @param is InputStream containing a binary data file.
- *
- * @throws IOException In case of any I/O errors.
- */
- public void read(InputStream docData) throws IOException {
-
- if (docData == null) {
- throw new IOException ("No input stream to convert");
- }
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- int len = 0;
- byte buffer[] = new byte[BUFFERSIZE];
- while ((len = docData.read(buffer)) > 0) {
- baos.write(buffer, 0, len);
- }
- data = baos.toByteArray();
- }
-
- public void read(byte[] data) {
- read(data,0,data.length);
- }
-
- public void read(byte[] data, int nOff, int nLen) {
- this.data = data;
- this.nOff = nOff;
- this.nLen = nLen;
- }
-
- /*
- * Utility method to make sure the document name is stripped of any file
- * extensions before use.
- */
- private String trimDocumentName(String name) {
- String temp = name.toLowerCase();
-
- if (temp.endsWith(getFileExtension())) {
- // strip the extension
- int nlen = name.length();
- int endIndex = nlen - getFileExtension().length();
- name = name.substring(0,endIndex);
- }
-
- return name;
- }
-
- /**
- * <p>Returns the <code>Document</code> name with no file extension.</p>
- *
- * @return The <code>Document</code> name with no file extension.
- */
- public String getName() {
- return docName;
- }
-
- /**
- * <p>Returns the <code>Document</code> name with file extension.</p>
- *
- * @return The <code>Document</code> name with file extension.
- */
- public String getFileName() {
- return new String(docName + getFileExtension());
- }
-
-
- /**
- * <p>Writes out the <code>Document</code> content to the specified
- * <code>OutputStream</code>.</p>
- *
- * <p>This method may not be thread-safe.
- * Implementations may or may not synchronize this
- * method. User code (i.e. caller) must make sure that
- * calls to this method are thread-safe.</p>
- *
- * @param os <code>OutputStream</code> to write out the
- * <code>Document</code> content.
- *
- * @throws IOException If any I/O error occurs.
- */
- public void write(OutputStream os) throws IOException {
- os.write(data, nOff, nLen);
- }
-
- /**
- * Returns the file extension for this type of
- * <code>Document</code>.
- *
- * @return The file extension of <code>Document</code>.
- */
- public String getFileExtension(){ return sFileExtension; }
-
- /**
- * Method to return the MIME type of the document.
- *
- * @return String The document's MIME type.
- */
- public String getDocumentMIMEType(){ return sMimeType; }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/source/writer2latex/xmerge/NewDOMDocument.java b/xmerge/source/writer2latex/source/writer2latex/xmerge/NewDOMDocument.java
deleted file mode 100644
index 3fb54ae3f50b..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/xmerge/NewDOMDocument.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/************************************************************************
- *
- * NewDOMDocument.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-10-30)
- *
- */
-
-package writer2latex.xmerge;
-
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Node;
-import org.w3c.dom.NamedNodeMap;
-
-import org.openoffice.xmerge.converter.dom.DOMDocument;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.IOException;
-
-/**
- * An extension of <code>DOMDocument</code>
- * that overrides the write method.
- * (This method fails with the version of xerces shipped with jre 1.5)
- */
-public class NewDOMDocument extends DOMDocument {
-
- /** Constructor
- */
- public NewDOMDocument(String sFileName, String sExtension) {
- super(sFileName,sExtension);
- }
-
- /**
- * Write out content to the supplied <code>OutputStream</code>.
- * (with pretty printing)
- * @param os XML <code>OutputStream</code>.
- * @throws IOException If any I/O error occurs.
- */
- public void write(OutputStream os) throws IOException {
- OutputStreamWriter osw = new OutputStreamWriter(os,"UTF-8");
- osw.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
- write(getContentDOM().getDocumentElement(),0,osw);
- osw.flush();
- osw.close();
- }
-
- // Write nodes; we only need element, text and comment nodes
- private void write(Node node, int nLevel, OutputStreamWriter osw) throws IOException {
- short nType = node.getNodeType();
- switch (nType) {
- case Node.ELEMENT_NODE:
- if (node.hasChildNodes()) {
- // Block pretty print from this node?
- NodeList list = node.getChildNodes();
- int nLen = list.getLength();
- boolean bBlockPrettyPrint = false;
- if (nLevel>=0) {
- for (int i = 0; i < nLen; i++) {
- bBlockPrettyPrint |= list.item(i).getNodeType()==Node.TEXT_NODE;
- }
- }
- // Print start tag
- if (nLevel>=0) { writeSpaces(nLevel,osw); }
- osw.write("<"+node.getNodeName());
- writeAttributes(node,osw);
- osw.write(">");
- if (nLevel>=0 && !bBlockPrettyPrint) { osw.write("\n"); }
- // Print children
- for (int i = 0; i < nLen; i++) {
- int nNextLevel;
- if (bBlockPrettyPrint || nLevel<0) { nNextLevel=-1; }
- else { nNextLevel=nLevel+1; }
- write(list.item(i),nNextLevel,osw);
- }
- // Print end tag
- if (nLevel>=0 && !bBlockPrettyPrint) { writeSpaces(nLevel,osw); }
- osw.write("</"+node.getNodeName()+">");
- if (nLevel>=0) { osw.write("\n"); }
- }
- else { // empty element
- if (nLevel>=0) { writeSpaces(nLevel,osw); }
- osw.write("<"+node.getNodeName());
- writeAttributes(node,osw);
- osw.write(" />");
- if (nLevel>=0) { osw.write("\n"); }
- }
- break;
- case Node.TEXT_NODE:
- write(node.getNodeValue(),osw);
- break;
- case Node.COMMENT_NODE:
- if (nLevel>=0) { writeSpaces(nLevel,osw); }
- osw.write("<!-- ");
- write(node.getNodeValue(),osw);
- osw.write(" -->");
- if (nLevel>=0) { osw.write("\n"); }
- }
- }
-
- private void writeAttributes(Node node, OutputStreamWriter osw) throws IOException {
- NamedNodeMap attr = node.getAttributes();
- int nLen = attr.getLength();
- for (int i=0; i<nLen; i++) {
- Node item = attr.item(i);
- osw.write(" ");
- write(item.getNodeName(),osw);
- osw.write("=\"");
- write(item.getNodeValue(),osw);
- osw.write("\"");
- }
- }
-
- private void writeSpaces(int nCount, OutputStreamWriter osw) throws IOException {
- for (int i=0; i<nCount; i++) { osw.write(" "); }
- }
-
- private void write(String s, OutputStreamWriter osw) throws IOException {
- int nLen = s.length();
- char c;
- for (int i=0; i<nLen; i++) {
- c = s.charAt(i);
- switch (c) {
- case ('<'): osw.write("&lt;"); break;
- case ('>'): osw.write("&gt;"); break;
- case ('&'): osw.write("&amp;"); break;
- case ('"'): osw.write("&quot;"); break;
- case ('\''): osw.write( "&apos;"); break;
- default: osw.write(c);
- }
- }
- }
-
-}
-
-
-
-
-
-
-
-
diff --git a/xmerge/source/writer2latex/source/writer2latex/xmerge/SxiDocument.java b/xmerge/source/writer2latex/source/writer2latex/xmerge/SxiDocument.java
deleted file mode 100644
index 6101535f3abf..000000000000
--- a/xmerge/source/writer2latex/source/writer2latex/xmerge/SxiDocument.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/************************************************************************
- *
- * SxiDocument.java
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * Copyright: 2002-2004 by Henrik Just
- *
- * All Rights Reserved.
- *
- * Version 0.3.3g (2004-10-19)
- *
- *
- ************************************************************************/
-
-package writer2latex.xmerge;
-
-import org.w3c.dom.Document;
-import org.openoffice.xmerge.converter.xml.OfficeDocument;
-
-import writer2latex.office.MIMETypes;
-
-/**
- * This class is an implementation of <code>OfficeDocument</code> for
- * the SXI format.
- * (The implementation is based on the class
- * org.openoffice.xmerge.converter.xml.sxc.SxcDocument.)
- */
-public class SxiDocument extends OfficeDocument {
-
- /**
- * Constructor with arguments to set <code>name</code>.
- *
- * @param name The name of the <code>Document</code>
- */
- public SxiDocument(String name) {
- super(name);
- }
-
-
- /**
- * Constructor with arguments to set <code>name</code>, the
- * <code>namespaceAware</code> flag, and the <code>validating</code>
- * flag.
- *
- * @param name The name of the <code>Document</code>.
- * @param namespaceAware The value of the <code>namespaceAware</code>
- * flag.
- * @param validating The value of the <code>validating</code> flag.
- */
- public SxiDocument(String name, boolean namespaceAware, boolean validating) {
-
- super(name, namespaceAware, validating);
- }
-
- /**
- * Returns the Office file extension for the SXI format.
- *
- * @return The Office file extension for the SXI format.
- */
- protected String getFileExtension() {
- return ".sxi";
- }
-
- /**
- * Returns the Office attribute for the SXC format.
- *
- * @return The Office attribute for the SXC format.
- */
- protected String getOfficeClassAttribute() {
- return "presentation";
- }
-
- /**
- * Method to return the MIME type of the document.
- *
- * @return String The document's MIME type.
- */
- protected final String getDocumentMimeType() {
- return MIMETypes.IMPRESS;
- }
-
-} \ No newline at end of file
diff --git a/xmerge/source/writer2latex/uno-config/META-INF/manifest.xml b/xmerge/source/writer2latex/uno-config/META-INF/manifest.xml
deleted file mode 100644
index e244859afe6d..000000000000
--- a/xmerge/source/writer2latex/uno-config/META-INF/manifest.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
-<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
- manifest:full-path="writer2latex_filters.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
- manifest:full-path="writer2latex_types.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-typelibrary;type=Java"
- manifest:full-path="writer2latex.jar"/>
-</manifest:manifest>
diff --git a/xmerge/source/writer2latex/uno-config/writer2latex_filters.xcu b/xmerge/source/writer2latex/uno-config/writer2latex_filters.xcu
deleted file mode 100644
index f2b5d9c60d9e..000000000000
--- a/xmerge/source/writer2latex/uno-config/writer2latex_filters.xcu
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ATTENTION: This configuration is only for stand-alone testing purpose. Find the correct configuration beyond the filter module 'source/config/fragments/' -->
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Filter" oor:package="org.openoffice.TypeDetection">
- <node oor:name="Filters">
- <node oor:name="LaTeX_Writer" oor:op="replace">
- <prop oor:name="FileFormatVersion"><value>0</value></prop>
- <prop oor:name="Type"><value>LaTeX</value></prop>
- <prop oor:name="DocumentService"><value>com.sun.star.text.TextDocument</value></prop>
- <prop oor:name="UIComponent"/>
- <prop oor:name="UserData"><value>com.sun.star.documentconversion.XMergeBridge writer2latex.jar com.sun.star.comp.Writer.XMLImporter com.sun.star.comp.Writer.XMLExporter staroffice/sxw application/x-latex</value></prop>
- <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
- <prop oor:name="TemplateName"/>
- <prop oor:name="UIName">
- <value xml:lang="x-default">LaTeX 2e</value>
- </prop>
- <prop oor:name="Flags"><value>EXPORT ALIEN 3RDPARTYFILTER</value></prop>
- </node>
- <node oor:name="BibTeX_Writer" oor:op="replace">
- <prop oor:name="FileFormatVersion"><value>0</value></prop>
- <prop oor:name="Type"><value>BibTeX</value></prop>
- <prop oor:name="DocumentService"><value>com.sun.star.text.TextDocument</value></prop>
- <prop oor:name="UIComponent"/>
- <prop oor:name="UserData"><value>com.sun.star.documentconversion.XMergeBridge writer2latex.jar com.sun.star.comp.Writer.XMLImporter com.sun.star.comp.Writer.XMLExporter staroffice/sxw application/x-bibtex</value></prop>
- <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
- <prop oor:name="TemplateName"/>
- <prop oor:name="UIName">
- <value xml:lang="x-default">BibTeX</value>
- </prop>
- <prop oor:name="Flags"><value>EXPORT ALIEN 3RDPARTYFILTER</value></prop>
- </node>
- </node>
-</oor:component-data> \ No newline at end of file
diff --git a/xmerge/source/writer2latex/uno-config/writer2latex_types.xcu b/xmerge/source/writer2latex/uno-config/writer2latex_types.xcu
deleted file mode 100644
index 291aa9ffe164..000000000000
--- a/xmerge/source/writer2latex/uno-config/writer2latex_types.xcu
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ATTENTION: This configuration is only for stand-alone testing purpose. Find the correct configuration beyond the filter module 'source/config/fragments/' -->
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Types" oor:package="org.openoffice.TypeDetection">
- <node oor:name="Types">
- <node oor:name="LaTeX" oor:op="replace">
- <prop oor:name="DetectService"/>
- <prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>tex</value></prop>
- <prop oor:name="MediaType"/>
- <prop oor:name="Preferred"><value>false</value></prop>
- <prop oor:name="PreferredFilter"><value>LaTeX_Writer</value></prop>
- <prop oor:name="UIName">
- <value>LaTeX 2e</value>
- </prop>
- <prop oor:name="ClipboardFormat"/>
- </node>
- <node oor:name="BibTeX" oor:op="replace">
- <prop oor:name="DetectService"/>
- <prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>bib</value></prop>
- <prop oor:name="MediaType"/>
- <prop oor:name="Preferred"><value>false</value></prop>
- <prop oor:name="PreferredFilter"><value>BibTeX_Writer</value></prop>
- <prop oor:name="UIName">
- <value>BibTeX</value>
- </prop>
- <prop oor:name="ClipboardFormat"/>
- </node>
- </node>
-</oor:component-data> \ No newline at end of file