Properties

$latex_special_chars_dictionary

$latex_special_chars_dictionary : array

An associative array of regular expressions that match latex code and utf8 representations of the respective symbol they represent

As PHP does not allow the initialization of static variables from static member methods we have to initialize this array to null. You may thus never use this variable directly, instead use the getter method below.

Type

array — An associative array of regular expressions that match latex code and utf8 representations of the respective symbol they represent

$latex_clean_up_dictionary

$latex_clean_up_dictionary : 

LaTeX cleanup dictionary

After we have performed the above replacements in the following function we clean up remaining special characters accoding to the following list.

Type

$latex_special_chars_reverse_dictionary

$latex_special_chars_reverse_dictionary : 

Associative array of utf8 representations and their respective LaTeX representations.

In some cases we need to generate LaTeX code from utf-8 encoded strings containing special characters. This array helps in doing this.

Type

— Dictionary of special characters and their LaTeX representations.

$utf8_to_ascii_dictionary

$utf8_to_ascii_dictionary : 

Associative array of utf8 representations and their closest ascii characters.

In some cases we need to generate ascii strings from utf-8 encoded strings containing special characters. This array helps in doing this.

Type

— Dictionary of special character to closes ascii versions.

Methods

get_latex_special_chars_dictionary()

get_latex_special_chars_dictionary() 

Get the $latex_special_chars_dictionary.

We are dealing with a lot of LaTeX code in wich special characters are LaTeX encoded. On our website we want to display them in a pretty way. The following is a (more or less complete) mapping of LaTeX encodigs into utf-8 characters whenever such a character is available. This list must only contain latex macros that contain a \ as for preformance reasons replacing is stopped once all \ have been eliminated. Also there is a negative look must be added when using this dictionary to prevent replacements in cases such as \v{a}.

get_latex_clean_up_dictionary()

get_latex_clean_up_dictionary() 

Get the $latex_clean_up_dictionary.

get_latex_special_chars_reverse_dictionary()

get_latex_special_chars_reverse_dictionary() 

Get the $latex_special_chars_reverse_dictionary.

get_utf8_to_ascii_dictionary()

get_utf8_to_ascii_dictionary() 

Get the $utf8_to_ascii_dictionary.

expand_cite_to_html()

expand_cite_to_html(string  $text, string  $bbl) 

Expand \cite{} commands to html code.

The resulting html code makes every \cite a clickable hyperlink to the correspnding entry in the bibliograhy.

Parameters

string $text

The text in which \cite commands are to be expanded

string $bbl

The bbl code of the bibliography that contains the corresponding bibliography entries.

normalize_whitespace_and_linebreak_characters()

normalize_whitespace_and_linebreak_characters(string  $text, boolean  $single_line = true, boolean  $remove_extra_newlines = false) 

Normalized white space and line break characters.

Parameters

string $text

LaTeX text to normalize.

boolean $single_line

Whether to output a single-line text.

boolean $remove_extra_newlines

If true, single newlines are replaced by space and any number of more than two successive newlines are replaced by exactly two newlines.

remove_font_changing_commands()

remove_font_changing_commands(string  $text) 

Remove font changing commands.

Parameters

string $text

LaTeX text to remove font commands from.

extract_bibliographies()

extract_bibliographies(string  $latex) 

Extract all bibliographies from latex code.

Parameters

string $latex

Latex code to search for bibliographies.

extract_abstracts()

extract_abstracts(string  $latex) 

Extract all abstracts from latex code.

Parameters

string $latex

Latex code to search for abstracts.

un_escape_url()

un_escape_url(string  $latex_url) : string

Un-escape a LaTeX style escaped url.

Parameters

string $latex_url

LaTeX style escaped url.

Returns

string —

Url without LaTeX escape sequences.

match_single_non_character_makro_regexp_fragment()

match_single_non_character_makro_regexp_fragment(string  $char) 

Utility function to construct the $latex_special_chars_dictionary.

Parameters

string $char

The non-character symbol characteristic to the respective latex macro.

match_single_character_makro_regexp_fragment()

match_single_character_makro_regexp_fragment(string  $char) 

Utility function to construct the $latex_special_chars_dictionary.

Parameters

string $char

The character characteristic to the respective latex macro.