writer2latex.latex.i18n

Class I18n

public abstract class I18n extends Object

This abstract class takes care of i18n in the LaTeX export. Since i18n is handled quite differently in LaTeX "Classic" and XeTeX, we use two different classes
Field Summary
protected booleanbAlwaysUseDefaultLang
protected booleanbGreekMath
protected LaTeXConfigconfig
protected HashSetlanguages
protected StringsDefaultLanguage
protected ReplacementTriestringReplace
Constructor Summary
I18n(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)
Construct a new I18n as ConverterHelper
Method Summary
abstract voidappendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)
Add declarations to the preamble to load the required packages
abstract voidapplyLanguage(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba)
Apply a language language
abstract Stringconvert(String s, boolean bMathMode, String sLang)
Convert a string of characters into LaTeX
abstract voidpopSpecialTable()
Pop a font from the font stack
abstract voidpushSpecialTable(String sName)
Push a font to the font stack

Field Detail

bAlwaysUseDefaultLang

protected boolean bAlwaysUseDefaultLang

bGreekMath

protected boolean bGreekMath

config

protected LaTeXConfig config

languages

protected HashSet languages

sDefaultLanguage

protected String sDefaultLanguage

stringReplace

protected ReplacementTrie stringReplace

Constructor Detail

I18n

public I18n(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)
Construct a new I18n as ConverterHelper

Parameters: ofr the OfficeReader to get language information from config the configuration which determines the symbols to use palette the ConverterPalette (unused)

Method Detail

appendDeclarations

public abstract void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)
Add declarations to the preamble to load the required packages

Parameters: pack usepackage declarations decl other declarations

applyLanguage

public abstract void applyLanguage(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba)
Apply a language language

Parameters: style the OOo style to read attributesfrom bDecl true if declaration form is required bInherit true if inherited properties should be used ba the BeforeAfter to add LaTeX code to.

convert

public abstract String convert(String s, boolean bMathMode, String sLang)
Convert a string of characters into LaTeX

Parameters: s the source string bMathMode true if the string should be rendered in math mode sLang the iso language of the string

Returns: the LaTeX string

popSpecialTable

public abstract void popSpecialTable()
Pop a font from the font stack

pushSpecialTable

public abstract void pushSpecialTable(String sName)
Push a font to the font stack

Parameters: sName the name of the font