.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "GLADTEX 1" .TH GLADTEX 1 "2014-06-24" "gladtex 1.3" "User Commands" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" gladtex \- generate html with LaTeX equations embedded as images .SH "SYNOPSIS" .IX Header "SYNOPSIS" gladtex [options] <\s-1FILE1\s0> [<\s-1FILE2\s0> ...] .SH "DESCRIPTION" .IX Header "DESCRIPTION" Reads a 'htex' file (html with LaTeX maths embedded in <\s-1EQ\s0>) and produces html with equations substituted by images. .SH "QUICK START" .IX Header "QUICK START" Write \s-1HTML\s0 code as usual, but use LaTeX equations within the tags <\s-1EQ\s0>... Don't use .html extension, .htex is recommended. Now, run: .PP .Vb 1 \& gladtex \-v myfile.htex .Ve .PP Or, to process multiple files: .PP .Vb 1 \& gladtex \-v *htex .Ve .PP The \-v option is not mandatory, but gives you more feedback. If there are no LaTeX errors, this will generate the file myfile.html (or similar) and numerous eqn???.png files, which contain images of your equations. The \s-1HTML\s0 file generated is a copy of yours, but the equations are substituted by links to the image files. .PP If you prefer gif files, add the option \*(L"\-f gif\*(R". .PP gladTeX tries to avoid regenerating identical image files. To achieve this, a cache file (gladtex.cache) is used, containing the equations used for generating each image. If you delete the image files before rerunning gladTeX, you should also delete the cache file (gladTeX never deletes an image file). .PP If your \s-1HTML\s0 contains more than a couple of equations, it is a good idea to place equation images in a separate directory with the \-d option. With this option turned on, the cache file is also moved to that directory. .SH "OPTIONS" .IX Header "OPTIONS" You can optain the command-line help using gladTeX without options. .IP "\fB\-a\fR" 4 .IX Item "-a" Save text alternatives for images which are too long for the alt attribute into a single separate file and link images to it. In \-attributes, you can only have up to 255 characters. Since equations with line breaks / long equations don't fit in there, this switch allows outsourcing in a file called desc.html in the directory specified with \-d or the current directory by default. .IP "\fB\-b\fR \fIcolour\fR" 4 .IX Item "-b colour" Set background colour in \s-1RGB\s0 manner. This option can also be set indivdually for each equation by writing <\s-1EQ\s0 BGCOLOR=\*(L"...\*(R"> in the htex file. For \&\s-1PNG\s0 format with transparency on, this option has no effect. For \s-1GIF\s0 format (which does not support alpha channel, as far as I know), antialiasing is done from the foreground color (\-c option) to the background colour, so the background colour should be set even with transparency on. .IP "\fB\-c\fR \fIcolour\fR" 4 .IX Item "-c colour" Set foreground colour in \s-1RGB\s0 manner. For instance \*(L"\-c 00FFFF\*(R" gives yellow text. This option can also be set indivdually for each equation by writing <\s-1EQ\s0 COLOR=\*(L"...\*(R"> in the htex file. See also \-b option. .IP "\fB\-d\fR \fIpath\fR" 4 .IX Item "-d path" Store image files in the path given. The image links in the generated html file(s) will be made relative. If you need absolute links, use the \-u option in addition. .IP "\fB\-e\fR \fIenv\fR" 4 .IX Item "-e env" Use the specified LaTeX environment instead of \*(L"displaymath\*(R" when generating the image. This option can also be set individually for each equation by writing <\s-1EQ\s0 ENV=\*(L"env\*(R">. .IP "\fB\-f\fR \fIformat\fR" 4 .IX Item "-f format" Use the specified image format in output files. Formats supported may depend on compile-time decisions. At the time of writing, png and gif are the ones supported. .IP "\fB\-i\fR \fIclass\fR" 4 .IX Item "-i class" Assign the specified \s-1CSS\s0 class name to images whose environment is \&\*(L"math\*(R". Defaults to \*(L"inlinemath\*(R". .IP "\fB\-l\fR \fIclass\fR" 4 .IX Item "-l class" Assign the specified \s-1CSS\s0 class name to images whose environment is \&\*(L"displaymath\*(R". Defaults to \*(L"displaymath\*(R". .IP "\fB\-p\fR \fIstring\fR" 4 .IX Item "-p string" Add this string to the LaTeX preamble when generating the equations. For example, \*(L"string\*(R" may be a \eusepackage{} command. Note that if you need this for only a few equations, you can also write <\s-1EQ\s0 PREAMBLE=\*(L"...\*(R"> in the htex file. .IP "\fB\-r\fR \fIdpi\fR" 4 .IX Item "-r dpi" Set resolution of output images, larger numbers produce larger images. 100 dpi is default. This is most often a bit larger than surrounding text, but as LaTeX output is really intended for hires output, details will often disappear at lower resolutions. Do some experimenting. This option can also be set indivdually for each equation by writing <\s-1EQ\s0 DPI=\*(L"...\*(R"> in the htex file. .IP "\fB\-s\fR \fIn\fR" 4 .IX Item "-s n" Set oversampling factor. Larger values will increase antialiasing verbosity, but is slower. The default is 4. A value of 1 turns off antialiasing, which I don't recommend. .IP "\fB\-t\fR" 4 .IX Item "-t" Disable transparent background. With this option, the background colour (\-b option) is solid. .IP "\fB\-u\fR \fIurl\fR" 4 .IX Item "-u url" Set absolute url to the image files folder. Use this together with \-d option if you can't use relative links for some reason. .IP "\fB\-v\fR" 4 .IX Item "-v" Verbose mode, give extra feedback. Gladtex is pretty silent without. .SH "eqn2img UTILITY" .IX Header "eqn2img UTILITY" The gladTeX script just parses your html-code and feeds the equations to the C program eqn2img. This takes care of running LaTeX, dvi2ps and ghostscript. Furthermore, it finds the baseline of the equation (guided by a dot that is inserted into the equation), antialiases and writes the image in the final format. All this is independent from the gladTeX script, for instance you may write .PP .Vb 1 \& echo \*(Aq\esqrt{2}\*(Aq | eqn2img > sqrt.png .Ve .PP to produce an image of the squareroot of two. For normal operation of gladTeX, you never use this utility directly, but in any case, here are (some of) the options. .IP "\fB\-f\fR \fIformat\fR" 4 .IX Item "-f format" Use the specified image format in output files. If \*(L"format\*(R" is just a question sign \*(L"?\*(R", eqn2img will print a list of supported formats and quit. .IP "\fB\-s\fR \fIn\fR" 4 .IX Item "-s n" Set oversampling factor (see description of same option for gladTeX). .IP "\fB\-o\fR \fIname\fR" 4 .IX Item "-o name" Set output filename. Without this option, the image is written to stdout. .IP "\fB\-c\fR \fIcolour\fR" 4 .IX Item "-c colour" Set foreground colour in \s-1RGB\s0 manner. .IP "\fB\-b\fR \fIcolour\fR" 4 .IX Item "-b colour" Set background colour in \s-1RGB\s0 manner. .IP "\fB\-t\fR" 4 .IX Item "-t" Turn transparency off. .IP "\fB\-v\fR" 4 .IX Item "-v" Verbose mode, give some feedback. .PP All messages are written to stderr. Furthermore, a text string specifying the dimensions is written to stdout, unless the image is being written to stdout. In this case, the dimension string is written to stderr. .PP Note that eqn2img will only process one file at a time. .SH "PARSING DETAILS" .IX Header "PARSING DETAILS" Gladtex is not case sensitive, so is allright. Any tag must be closed by a . Whitespace between \*(L"\*(R" is allowed. Certain options (such as \*(L"COLOR=...\*(R") may be present in the tag, see the Options section above. Whitespace is not allowed anywhere else, so \&\*(L"< eq>\*(R", \*(L"< /eq>\*(R" and \*(L"\*(R" are all illegal. I'm not quite sure how this agrees with html standards/conventions. .SH "THANKS" .IX Header "THANKS" I am grateful to all users who have provided feedback. The current version of gladTeX incorporates suggestions from a number of helpful users. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Project homepage at http://gladtex.sourceforge.net .PP Copyright (C) 1999\-2010 Martin G. Gulbrandsen .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, \s-1MA 02111\-1307 USA\s0