¬  loTEX ± Monotonic Previewing
ã1992 Derek Beatty.  All rights reserved.

Introduction	

This little program provides a partial ``continuous'' previewing capability, which may be useful for ``getting it right'' when trying to format something tricky in TeX or its relatives.  It's no substitute for a full-blown continuous previewing environment.  It's not a full- featured editor, and you can only work on one page at a time.   It does you type in one window and see the formatted results a few seconds later in TeXview.  It also includes an easy-to-use reference to the symbol commands of LaTeX.

Installation

First start the program.  (If you're reading this, you've probably gotten that far.)  Then adjust the Preferences to your liking.  The program comes set up for LaTeX, but you can easily select any other variant.  (If you don't have fullpage.sty installed at your site, you'll want to delete this document style option.)  You can set the TeX command to be run, the ``preamble'' that will precede your text, and the ``postamble'' that will follow it.  (You can't insert newline characters in these fields, but you can paste text containing newlines into them.)

You can also adjust three timers.  The first controls the delay between successive runs of TeX.  The second controls the delay between your last keystroke and the time TeX starts running, to keep TeX from running when you're in the middle of typing a keyword.  If you're a fast typist, you might want to lower this setting, and if you hunt-and-peck, you might want to raise it.  The final timer is a safety feature.  If TeX hasn't finished after it has been running for the time determined here, loTeX will kill the process.

You can click on the ``Revert'' button to restore the defaults saved from last time you ran loTeX, and you can click the ``Factory Defaults'' button to restore the initial values.

To test your settings, type in the ``Monotonic TeX Previewing'' window.  A few seconds later you should see the formatted version appear in TeXview.  If you don't, bring up the Messages window.  (You will find it under the Windows menu.)  There you will find the verbiage produced by TeX.

When loTeX runs TeX, it sends a `r' character to the tex process.  If TeX stops because of an error, this will make TeX continue in batch mode.  It still doesn't hurt to put TeX into nonstop mode via a command early in the Preamble.   (The Preamble is the large text field in the Preferences panel).

You can create an empty file r.tex for TeX to find in case it stops to ask for a file name, although this shouldn't happen.

You can use Interface Builder to customize the Symbols panel, and extend it arbitrarily.

LoTeX places its temporary files in the /tmp directory, and runs TeX there.
	
Use	

LoTeX is good for fine-tuning small pieces of long documents.  You can paste the preamble that establishes the ``look'' of your document (i.e., its document design) into the Preferences panel.  Then you can work on a small portion of your document at a time.

When you're trying to format tricky TeX construct that you're having trouble getting right, paste the troublesome code into the Monotonic TeX Previewing window, edit it there until things look right, then cut it and paste it back to your original document.     

For example, if you're formatting something with many equations, you're likely to find it contains underfull or overfull hboxes.  You can quickly fix these as follows.  First, run TeX on your entire document.  Then use Edit to find each paragraph you need to fix.  (You can specify a line range in the Line and Character Range panel of Edit by separating the beginning and ending lines with a colon.)  Copy the paragraph into loTeX, edit until it looks good, and check the Messages window to be sure you've eliminated the bad boxes.  Then cut the text from loTeX and paste it back in place of the orginal in your file in Edit.  Continue on to the next paragraph.  Even if a document with slightly underfull and overfull boxes doesn't look bad, eliminating spurious warnings helps you stay alert for warnings that indicate actual problems. 

You can insert various LaTeX symbol commands (including delimiter pairs) via the Symbols panel, which you can bring up from the Edit menu.

If you can't figure out what's going on, bring up the Messages window to see what TeX has been doing behind your back.

For safety, you cannot Quit the program while you have text in the main window.  To discard your text, you must take explicit action to delete it.  To save your text, Cut it from this window and Paste it into another application.

Notes

The name of the main window is a pun.  Monotonicity is to partial orders as continuity is to cpo's, and this program is not a complete system for using TeX.  For example, if you make a change in the Preferences panel without changing the text in the main window, loTeX will not update the preview window.  The ``poke yourself in the eye'' icon is intended as a recommendation for Harald Schlangmann's free TeXmenu application.  TeXmenu provides an excellent way to organize and process a large document, to typeset it, check its spelling, make an index and bibliography, and clean up the clutter of the numerous temporary files that TeX creates.

 If this is your own copy of loTeX.app (i.e., if it's in your ~/Apps directory), you should be able to edit this file and make your own notes in it directly.  I've avoided boldface (except in the headings) in this help file so that you can use that to mark your own notes.

The source code is in the app wrapper.  The Subprocess object is from the NeXT example, but it contains a bug fix.  Thanks to those who have placed example code on the archives, but particularly to those whose objects I used: Mike Dixon, David Holscher, and Greg Burd.  See their copyright notices in some of the source files.

You can customize the Symbol panel by editing the nib files with InterfaceBuilder.  You can also add additional symbol panels.  Use Interface Builder to resize one of the matrices to add a new button to the upper area in the SymbolPanel within loTeX.nib.  Give the button an icon whose name describes the new panel you wish to add.  Make a copy of blank.nib, making its name the same as that of the icon.  (E.g., for icon "custom" you'd copy blank.nib to custom.nib.)  Add button matrices to the lower area of the panel in your new nib file, give the buttons the proper icons and/or titles, name the icons, and connect the matrices to the appropriate methods.  (You can find brief descriptions of what the methods do in the source file Controller.h.)  That's it!  If you want to get really fancy, you can also place buttons in the lower portion of the panel to bring up still more additional panels.

The easiest way to create icons for new buttons is to use loTeX to typeset them.  Then use /NextDeveloper/Demos/Grab to create a bitmap from a selection in the TeXview window, copy the bitmap to the pasteboard, and paste it directly into the Nib file in Interface Builder.

If you find this program useful, I encourage you to decide what it's worth, and send a small donation to a deserving charity.  Such organizations often will find even a small amount helpful.  For those of us in the US, let me suggest the following, which was recently established to provide minority scholarships in response to the ``Rodney King'' riots:
	Interfaith Educational Fund
 	1004 Devonshire Rd
	Pittsburgh, PA   15213

Author Contact Information

Currently (Fall 1992) you can reach me as:  Derek Beatty, School of Computer Science, Carnegie Mellon University, 5000 Forbes Avenue, Pittsburgh, Pennsylvania 15213 USA.    E-mail: beatty+@cs.cmu.edu.  (No NeXTmail please; MIME Ok.)  Note that I wrote loTeX to help format my doctoral thesis, and after I complete the thesis I'll probably go somewhere else.  Hopefully at least e-mail will be forwarded.

Appendix

\section*{\LaTeX{} Commands on Symbols Panel}

Accents: \^{a} \`{a} \'{a} \.{a} \u{a} \={a} \~{a} \"{a} \v{a} \H{a} \t{a} \c{a} \d{a} \b{a}

Math accents: $$\hat{a} \grave{a} \acute{a} \dot{a} \breve{a} \bar{a} \tilde{a} \ddot{a} \check{a} \vec{a} \overline{abc} \underline{abc} \overbrace{abc} \underbrace{abc}$$

Arrows:
$$\leftarrow \leftrightarrow \rightarrow \mapsto \Leftarrow \Leftrightarrow \Rightarrow \longmapsto \hookleftarrow \Updownarrow \hookrightarrow \leadsto \leftharpoonup \rightleftharpoons \rightharpoonup \uparrow $$
$$\leftharpoondown \updownarrow \rightharpoondown \downarrow \longleftarrow \longleftrightarrow \longrightarrow \Uparrow \Longleftarrow \Longleftrightarrow \Longrightarrow \Downarrow \swarrow \nwarrow \nearrow \searrow $$

Operators:
$$\pm \cdot \bullet \circ \bigcirc \wr \mp \odot \cap \sqcap \wedge \bigtriangleup \times \uplus \cup \sqcup \vee \bigtriangledown $$
$$\div \dagger \setminus \amalg \triangleleft \triangleright \ast \ddagger \oplus \ominus \lhd \rhd \star \diamond \otimes \oslash \unlhd \unrhd $$

Greek letters:
$$\alpha \beta \gamma \delta \epsilon \varepsilon \zeta \eta \theta \vartheta \iota \kappa \lambda \mu \nu \xi o \pi \varpi \rho \varrho \sigma \varsigma \tau \upsilon \phi \varphi \chi \psi \omega $$
$$ \Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega $$

Miscellaneous mathematical symbols:
$$\aleph \prime \forall \exists \neg \sharp \natural \flat \emptyset \hbar \imath \nabla \partial \backslash \infty \jmath $$
$$ \surd \Box  \Diamond \triangle \clubsuit \diamondsuit \angle \top \ell \wp \bot \| \spadesuit \heartsuit \Re \Im  \mho $$

Relational symbols:
$$< > \dashv \vdash \leq \geq = \models \prec \succ \equiv \perp \preceq \succeq \sim \mid \ll \gg \simeq \parallel $$
$$ \subset \supset \asymp \bowtie \subseteq \supseteq \approx \Join  \sqsubset \sqsupset \cong \smile \sqsubseteq \sqsupseteq \neq \frown \in \ni \doteq \propto $$

Miscellaneous symbols:\& \% \dag \ddag \S \P \copyright \_ \ldots \{ \} \ss ?` !` \pounds \$ \oe \OE \ae \AE \aa \AA \o \O \l \L 

Mathematical constructions:
$$ \frac{}{} \cdots \vdots \ldots \ddots  \sqrt{2} \sqrt[n]{2}  1 ^{2} _{3}$$

Variable-sized mathematical operators:
$$ \sum ^{1}_{2}\int \oint \bigoplus \prod \coprod \bigodot \bigotimes \bigcap \bigcup \biguplus \bigwedge \bigvee $$

Delimiters, singly or in matched pairs:
$$ | \uparrow \updownarrow \downarrow / \langle \lfloor [ \lceil \{ ( ) \} \rceil ] \rfloor \rangle \backslash \Downarrow \Updownarrow \Uparrow \|  \left[ \left( \left(  \right)\bigcap \left\{  \right\}\right) \right] $$

And various math spaces $ \, \! \: \; \quad \qquad $ (which don't show up well here), the type size and style declarations{\tiny }{\scriptsize }{\footnotesize }{\small }{\normalsize }{\large }{\Large }{\LARGE }{\huge }{\Huge }{\rm }{\bf }{\it }{\sl }{\tt }{\sc }{\sf }, and the log-like functions $$ \sin \cos \tan \cot \sec \csc \deg \lim \sinh \cosh \tanh \coth \dim \gcd$$ $$ \sup \limsup \arcsin \arccos \arctan \Pr \det \min \inf \liminf \exp \ln \lg \log \arg \max \ker \hom. $$