mglib

Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes

vis/text/

mg_tex2idl.pro


Converts simple TeX notation to IDL format codes used in graphics output. Only handles subscripts, superscripts, and sequences listed below.

Other file information

Todo:

should be able to handle fractions too, use 190 (276 octal) to draw fraction bars, and !A/!B to go above/below the bar; decide whether to use \frac{1}{2}

Routines

Routines from mg_tex2idl.pro

result = mg_subsuper(token, level=long)

Translate TeX superscript (^) or subscript (_) to proper IDL format codes.

result = mg_matchdelim(input)

Returns the position in the input string of the closing curly brace that matches the first open curly brace, -1L if not found.

result = mg_strcnt(input, substr)

Count number of occurrences of a substring in a string.

result = mg_nexttoken(str, tokens [, position=long])

Find the next token in a given string.

result = mg_token(str, token)

Find a substring in an input string, return the portion of the input string before the substring, and modify the input string to contain only the portion of the string after the token.

result = mg_convert_subsuper(input [, level=long])

Convert TeX superscripts and subscripts in a given string to IDL format codes.

result = mg_convert_fraction(input [, /postscript])

Convert TeX fractions in a given string to IDL format codes.

result = mg_textable( [/postscript])

Returns table containing allowable TeX sequences and their translation to IDL.

result = mg_tex2idl(input [, font=long])

Convert a TeX string to a string with embedded IDL format codes.

Routine details

top mg_subsuper

result = mg_subsuper(token, level=long)

Translate TeX superscript (^) or subscript (_) to proper IDL format codes.

Return value

string

Parameters

token in required type=string

either ^ or _, others will return an empty string

Keywords

level in required type=long

set to subscript/superscript level to get appropriate format code

top mg_matchdelim

result = mg_matchdelim(input)

Returns the position in the input string of the closing curly brace that matches the first open curly brace, -1L if not found.

Return value

long

Parameters

input in required type=string

input string to search

top mg_strcnt

result = mg_strcnt(input, substr)

Count number of occurrences of a substring in a string.

Parameters

input in required type=string

string to search

substr in required type=string

substring to search for

top mg_nexttoken

result = mg_nexttoken(str, tokens [, position=long])

Find the next token in a given string.

Return value

string

Parameters

str in required type=string

string to search

tokens in required type=string

tokens

Keywords

position out optional type=long

position in str of next token

top mg_token

result = mg_token(str, token)

Find a substring in an input string, return the portion of the input string before the substring, and modify the input string to contain only the portion of the string after the token.

Return value

string

Parameters

str in out required type=string

input string; the output value of this string is the remaining portion of the string after the token

token in required type=string

substring to find in the input string

top mg_convert_subsuper

result = mg_convert_subsuper(input [, level=long])

Convert TeX superscripts and subscripts in a given string to IDL format codes.

Return value

string

Parameters

input in required type=string

input string to process

Keywords

level in optional type=long

set to subscript/superscipt level to indicate which format code is used to format it (and hence !E and !I are used instead of !U and !D)

top mg_convert_fraction

result = mg_convert_fraction(input [, /postscript])

Convert TeX fractions in a given string to IDL format codes.

Return value

string

Parameters

input in required type=string

input string to process

Keywords

postscript in optional type=boolean

set to use postscript fonts

top mg_textable

result = mg_textable( [/postscript])

Returns table containing allowable TeX sequences and their translation to IDL.

Return value

strarr(2, n)

Keywords

postscript in optional type=boolean

set to use postscript fonts

top mg_tex2idl

result = mg_tex2idl(input [, font=long])

Convert a TeX string to a string with embedded IDL format codes.

Return value

string or strarr

Parameters

input in required type=string/strarr

input TeX string or strarr

Keywords

font in optional type=long

set to -1 to translate for vector fonts, 0 for hardware fonts

File attributes

Modification date: Wed May 14 15:07:15 2014
Lines: 353
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.