This page was created by the IDL library routine
make_html_help. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? make_html_help
at the IDL command line prompt.
Last modified: Mon Apr 6 15:07:04 1998.
NAME:
MATCHDELIM
PURPOSE:
Match open/close delimiters in a string.
CATEGORY:
text/strings
CALLING SEQUENCE:
position = matchdelim( strn, [openpos])
INPUTS:
strn -- a string containing an open in
delimiter (e.g. '{') in which you
want to find the matching closing
delimiter (e.g. '}')
KEYWORD PARAMETERS:
OPEN_DELIM -- A single character containing the opening in
delimiter (e.g. '('). Default is '{'
CLOSE_DELIM -- A single character containing the closing in
delimiter (e.g. ')'). Default is '}'
OUTPUTS:
position -- returns the position in strn of the out
closing delimiter, -1 if no closing found.
openpos -- Set to a named variable to receive the out
position of the first opening delimiter.
Optional.
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
- Any pair of (nonidentical) characters can be used as
delimiters.
EXAMPLE:
matchdelim('{one{two}}three') returns 9, the character just
before 'three'.
MODIFICATION HISTORY:
$Id: matchdelim.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
$Log: matchdelim.pro,v $
Revision 1.3 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.2 1996/05/09 00:22:17 mcraig
Removed restriction that open delim must be first char. Added argument
to allow for return of position of open delim.
Revision 1.1 1996/01/31 18:41:06 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/matchdelim.pro)
NAME:
NEXTTOK
PURPOSE:
Find the next occurance of any of a set of characters in a
string and return the character which occurs next.
CATEGORY:
text/strings
CALLING SEQUENCE:
tok = nexttok( strn, tokens )
INPUTS:
strn -- string to be searched for sub/superscripts in
tokens -- string containing characters to be found. in
KEYWORD PARAMETERS:
POSITION -- Set to a named variable to get position out
of next token, or -1 if none found.
/HELP -- Print useful message and exit.
OUTPUTS:
tok -- Contains the character among tokens which out
occurs next in strn, or null '' if none found.
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
EXAMPLE:
nexttok( 'x^2 + N_j^3', '^_', position=pos ) returns '^' and sets
pos to 1.
MODIFICATION HISTORY:
$Id: nexttok.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
$Log: nexttok.pro,v $
Revision 1.3 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.2 1996/05/09 00:22:17 mcraig
Generalized so that the next occurence of any of a set of characters will
be returned.
Revision 1.1 1996/01/31 18:41:06 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/nexttok.pro)
NAME:
SHOWTEX
PURPOSE:
Display TeX sequence translation table on current graphics device.
CATEGORY:
text/strings
CALLING SEQUENCE:
showtex
INPUTS:
KEYWORD PARAMETERS:
/HELP -- print out info on use of the function
and exit.
FONT -- Set to 0 to use hardware font, -1 to use vector.
Note that the only hardware font supported is
Postscript
OUTPUTS:
COMMON BLOCKS:
SIDE EFFECTS:
Plot is created.
NOTES:
Hardware fonts are supported only for device PS (PostScript)
EXAMPLE:
MODIFICATION HISTORY:
$Id: showtex.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
$Log: showtex.pro,v $
Revision 1.3 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.2 1996/05/09 00:22:17 mcraig
Added error handling and updated built in help.
Revision 1.1 1996/02/08 18:55:12 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/showtex.pro)
NAME:
STRCNT
PURPOSE:
Count number of occurrences of a substring in a string.
CATEGORY:
text/strings
CALLING SEQUENCE:
num = strcnt(strn, substring, [pos])
INPUTS:
string -- The string in which to count occurences. in
substring -- The substring to count occurrences of. in
pos -- the position at which to begin the search. [in]
If not supplied, start at beginning of
string.
KEYWORD PARAMETERS:
/HELP -- Print useful message and return.
OUTPUTS:
num -- Number of occurances of substring in string. out
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
Overlapping occurances are not counted separately. For
example, counting occurances of 'bb' in 'blah bbb' returns one
occurance.
EXAMPLE:
MODIFICATION HISTORY:
$Id: strcnt.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
$Log: strcnt.pro,v $
Revision 1.3 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.2 1996/05/09 00:22:17 mcraig
Added fast processing using BYTE arrays if we are counting occurences of
a single character. Added error handling.
Revision 1.1 1996/01/31 18:47:37 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/strcnt.pro)
NAME:
STRTOK
PURPOSE:
Retrieve portion of string up to token.
CATEGORY:
text/strings
CALLING SEQUENCE:
new = strtok( old, token )
INPUTS:
old -- String to be split. Contains text after in, out
token on output.
token -- Token to use in splitting old. in
KEYWORD PARAMETERS:
/TRIM -- set to remove leading blanks from old
before returning.
/HELP -- print useful message and exit.
OUTPUTS:
new -- portion of string up to token. out
old -- portion of old after token. out, in
COMMON BLOCKS:
SIDE EFFECTS:
Input parameter old is modified.
NOTES:
Token may be one or more characters.
If token is not found, returns old and sets old to ''.
EXAMPLE:
If old is 'foo44 bar', then strtok( old, '44' ) would return
'foo', and upon return, old will be left with ' bar'. If /TRIM
were set, old would be 'bar' on return.
If old='xyz', then new=strtok(old,'a') would return with
new='xyz' and old=''.
THANKS:
To D. Linder who wrote GETTOK, part of the goddard library,
upon which this is based.
MODIFICATION HISTORY:
$Id: strtok.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
$Log: strtok.pro,v $
Revision 1.3 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.2 1996/05/09 00:22:17 mcraig
Added built in help.
Revision 1.1 1996/01/31 18:47:37 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/strtok.pro)
NAME:
STRTRANS
PURPOSE:
Translate all occurences of one substring to another.
CATEGORY:
text/strings
CALLING SEQUENCE:
new = strtrans(oldstr,from,to,ned)
INPUTS:
oldstr -- string on which to operate. in
May be an array.
from -- substrings to be translated. May be in
an array.
to -- what strings in from should be in
translated to. May be an array.
KEYWORD PARAMETERS:
/HELP -- Set this to print useful message and
exit.
OUTPUTS:
new -- Translated string. Array if oldstr is out
an array.
ned -- number of substitutions performed in out
oldstr. Array if oldstr is an array.
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
- Any of old, from, and to can be arrays.
- from and to must have the same number of elements.
EXAMPLE:
inp='Many*bad!chars+in_here'
from=['*','!','+','_']
to =[' ',' ',' ',' ']
out = strtrans(inp,from,to,ned)
Will produce out='Many bad chars in here', and set ned to 4.
MODIFICATION HISTORY:
$Id: strtrans.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $
$Log: strtrans.pro,v $
Revision 1.3 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.2 1996/05/09 00:22:17 mcraig
Sped up significantly by using str_sep to handle the translation. No longer
relies on routines fromother user libraries.
Revision 1.1 1996/01/31 18:47:37 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/strtrans.pro)
NAME:
SUB_SUP_IDL
PURPOSE:
Return the proper IDL font positioning command for TeX
sub/superscripts.
CATEGORY:
TeXtoIDL
CALLING SEQUENCE:
fnt = sub_sup_idl( strn )
INPUTS:
strn -- Either '^' or '_', the TeX super/subscript in
characters
KEYWORD PARAMETERS:
/FORCE_UD -- Set this to use !U/!D instead of !E/!I for
sub/superscripts .
/HELP -- Set to print useful message and exit.
OUTPUTS:
fnt -- Either '!U' or !E' for superscripts, out
or '!D' or '!I' for subscripts.
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
Used only by translate_sub_super. Should be kept in same
file.
EXAMPLE:
MODIFICATION HISTORY:
$Id: translate_sub_super.pro,v 1.4 1996/06/14 20:00:27 mcraig Exp $
$Log: translate_sub_super.pro,v $
Revision 1.4 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.3 1996/05/09 00:22:17 mcraig
Changed some function calls to reflect changes in those functions, moved
some code out of the main loop that didn't need to be there, added
documentation.
Revision 1.1 1996/01/31 18:47:37 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/translate_sub_super.pro)
NAME:
TEXTABLE
PURPOSE:
Returns a translation table from TeX to IDL.
CATEGORY:
text/strings
CALLING SEQUENCE:
table = textable()
INPUTS:
None
KEYWORD PARAMETERS:
/POSTSCRIPT -- If set, return postscript translation
table rather than vector fonts table.
Default is translations for vector
fonts.
/HELP -- Print help and exit.
OUTPUTS:
table -- a 2D text array. table(0,*) contains out
the words to be translated away, table(1,*)
contains the words to translate them to.
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
To find out what TeX sequences are available, look at
table(0,*).
EXAMPLE:
MODIFICATION HISTORY:
$Id: textable.pro,v 1.7 1996/07/22 23:56:08 mcraig Exp $
$Log: textable.pro,v $
Revision 1.7 1996/07/22 23:56:08 mcraig
Added \vartheta.
Revision 1.6 1996/07/12 21:31:42 mcraig
Fixed \varphi in vector font, added \circ.
Revision 1.5 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.4 1996/05/09 00:22:17 mcraig
Added command to return to previous font after switching to Greek or
symbol font.
Revision 1.3 1996/02/08 19:49:35 mcraig
Removed control sequence \perp because the postscript code for it is '^'.
Revision 1.2 1996/02/08 18:53:38 mcraig
Added translations for PostScript fonts, and added several new TeX
control sequences.
Revision 1.1 1996/01/31 18:47:37 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/textable.pro)
NAME:
TEXTOIDL
PURPOSE:
Convert a valid TeX string to a valid IDL string for plot labels.
CATEGORY:
text/strings
CALLING SEQUENCE:
new = textoidl(old)
INPUTS:
old -- TeX string to be converted. Will not be in
modified. old may be a string array.
KEYWORD PARAMETERS:
FONT -- Set to 0 to use hardware font, -1 to use
vector. Note that the only hardware font
supported is PostScript.
/TEX_SEQUENCES -- return the available TeX sequences
/HELP -- print out info on use of the function
and exit.
OUTPUTS:
new -- IDL string corresponding to old. out
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
- Use the procedure SHOWTEX to get a list of the available TeX
control sequences.
- The only hardware font for which translation is available is
PostScript.
- The only device for which hardware font'
translation is available is PostScript.'
- The FONT keyword overrides the font selected'
by !p.font'
EXAMPLE:
out = TeXtoIDL('\Gamma^2 + 5N_{ed}')
The string out may be used in XYOUTS or other IDL text
display routines. It will be an uppercase Gamma, with an
exponent of 2, then a plus sign, then an N with the subscript
ed.
MODIFICATION HISTORY:
$Id: textoidl.pro,v 1.4 1996/06/14 20:00:27 mcraig Exp $
$Log: textoidl.pro,v $
Revision 1.4 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.3 1996/05/09 00:22:17 mcraig
Added error handling, cleaned up documentation.
Revision 1.2 1996/02/08 18:52:50 mcraig
Added ability to use hardware fonts for PostScript device.
Revision 1.1 1996/01/31 18:47:37 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/textoidl.pro)
SPECIAL NOTE:
The file translate_sub_super.pro contains two functions,
translate_sub_super, and sub_sup_idl. The former is the
generic routine for processing TeX sub/superscripts, the
latter is used only by translate_sub_super and has no general
utility. Hence it lives here. You will see documentation for
translate_sub_super second if you use DOC_LIBRARY.
(See /deep0/marc/idlshare/general/TeXtoIDL/translate_sub_super.pro)
NAME:
TRANSLATE_SUB_SUPER
PURPOSE:
Translate TeX sub/superscripts to IDL sub/superscripts.
CATEGORY:
text/strings
CALLING SEQUENCE:
new = translate_sub_super( old )
INPUTS:
old -- string to be translated from TeX to IDL. in
KEYWORD PARAMETERS:
/RECURSED -- set if this function is being called
recursively.
/HELP -- Set to print useful message and exit.
OUTPUTS:
new -- string old converted from TeX to IDL out
COMMON BLOCKS:
SIDE EFFECTS:
NOTES:
- For best results, when both a sub and superscript are used,
place the shorter of the two first (e.g. 'N^{a}_{bbbb}' is
better than 'N_{bbbb}^{a}').
- Single character sub/super scripts do not need to be
protected by braces.
- Sub/superscripts may be nested (e.g. 'N^{N_1^N}').
EXAMPLE:
out = translate_sub_super( 'N^2_{big}' )
Then out='N!U2!N!Dbig!N' which looks like it should on the
display.
LIBRARY FUNCTIONS CALLED:
strtok -- Text/string (mcraig)
sub_sup_idl -- contained in this file
MODIFICATION HISTORY:
$Id: translate_sub_super.pro,v 1.4 1996/06/14 20:00:27 mcraig Exp $
$Log: translate_sub_super.pro,v $
Revision 1.4 1996/06/14 20:00:27 mcraig
Updated Copyright info.
Revision 1.3 1996/05/09 00:22:17 mcraig
Changed some function calls to reflect changes in those functions, moved
some code out of the main loop that didn't need to be there, added
documentation.
Revision 1.2 1996/02/08 18:54:20 mcraig
Changed default sub/superscript size to be !D/!U rather than !I/!E to
improve readability of plat annotations.
Revision 1.1 1996/01/31 18:47:37 mcraig
Initial revision
RELEASE:
$Name: Rel_1_2 $
COPYRIGHT:
Copyright (C) 1996 The Regents of the University of California, All
Rights Reserved. Written by Matthew W. Craig.
See the file COPYRIGHT for restrictions on distrubting this code.
This code comes with absolutely NO warranty; see DISCLAIMER for details.
(See /deep0/marc/idlshare/general/TeXtoIDL/translate_sub_super.pro)