[OS X TeX] Flashmode

Claus Gerhardt gerhardt at math.uni-heidelberg.de
Mon Dec 6 13:47:02 EST 2004


Flashmode is avalaible for download from
http://www.math.uni-heidelberg.de/studinfo/gerhardt/tex/

The download envelope contains Flashmode-Scripts.zip and my PGP 
signature for this archive.

Below is a copy of the ReadMe file.

Enjoy.

Claus

											Flashmode 1.0

Installation:
The application(s) have to be placed in the Applications Folder, such 
the path to Flashmode has the form /Applications/Flashmode.app, 
otherwise it will not work. The Flashmode-Scripts folder can be placed 
anywhere.

Requirements:
Flashmode requires only a fairly complete tetex installation, 
preferably Gerben Wierda's distribution, BBEdit v.7, or better, as 
editor and TeXniscope v. 0.3.3, or better, by Massimiliano Gubinelli as 
  pdf viewer. No further tex scripts are necessary, though they might be 
helpful, e.g., TeX-Scripts-BBEdit, see below for some important 
information in this regard.

Hardware: On a G5 at 2.5GHz it is a really joy running Flashmode, while it 
is a bit slow on a old G4 at 500MHz.

Usage:
Flashmode enables simultaneous typesetting as Textures did and still 
does in classic mode. When Flashmode is started, it looks for the front 
most document in BBEdit, gets its path and after that it is hooked for 
ever to this document as long as it stays open, i.e., a few split 
seconds after Flashmode has started the front most document in BBedit 
could be anything without doing any harm.

Then Flashmode checks in regular intervals (default is 0.5 sec), the 
length of which is user definable, if its tex document has been 
modified, and if so, it initiates a save, a pdflatex run, and asks 
TeXniscope to refresh the front most pdf. The pdf has to be opened once 
by other means, which is completely unproblematic.

An important feature is that tex syntax errors don't cause any error 
messages or disruptions of any kind, i.e., the pdf gets never 
corrupted, at least the pdf viewer is never aware of it,  and the last 
refreshment is always visible; the pdf viewer will never complain.

Thus, the user never gets any error messages; the presence of errors 
can only be deduced from the pdf window which then doesn't change any 
more; of course the errors will be reported in the log file and can be 
looked up.

When the tex document is unmodified, Flashmode stays put in the 
background with very little CPU load: on my machine the total load 
would be 200% and the idle Flashmode has about 2.7%, i.e., Flashmode 
can stay open as long as one wishes without any bad side effects. Only 
when one wants to run a different tex document in Flashmode, then it 
has to quit first, or one of the copies has to be started.

While Flashmode is active, the source document can be typeset 
independently by other scripts or commands, especially other tex tools 
like bibtex can be run without any interference by Flashmode.

Important:
Flashmode will detect only unsaved modifications of the tex file, i.e., 
don't save your document manually, if Flashmode is supposed to act.

Changing the settings:
Flashmode is an application bundle, i.e., you can open its contents by 
control clicking on its icon. Inside the Contents Folder is a folder 
Preferences containing a file "Settings". There you can change the 
length of the checking interval by entering a numeric value at the 
appropriate place. If you are entering a decimal number use the format 
of your system, i.e., write 0.4 or 0,4 whatever is your system's 
format.

Changing the typesetting engines:
Flashmode's typesetting is done by a shell script 'flashmode' in the 
Contents of Flashmode, /Applications/Flashmode.app/Contents/bin. 
'flashmode' simply runs 'pdflatex' with some additional options. If you 
want to run another typesetting engine, you could replace 'pdflatex', 
if you wanted, though, I would recommend to use one of three copies of  
Flashmode, e.g., Flashmode_one, for this kind of endeavour.

Flashmode_alt uses the typesetting command 'altpdflatex' with some 
options. This command is supposed to be changed to 'simpdftex latex 
--maxpfb' in later versions of tex. If this will be the case, then you 
can simply change the command. Beware not to replace the file, but only 
the command, because, as a shell script, it has to be executable.

Interaction with TeXniscope:
Fix TeXniscope's window in the left half of your screen and BBEdit's 
window in the right, then you can see both, if other applications are 
hidden.

In TeXniscope's preferences set

Edit command: /Applications/Flashmode.app/Contents/bin/bbeditc
Editor arguments :  +%line  '%file'

Then synchronization TeXniscope --> BBEdit is be possible, if the 
package pdfsync is loaded.

The reverse synchronization BBEdit --> TeXniscope is done by an 
Applescript 'sync', which is included. It works without using the 
package pdfsync - only the package color has to be loaded: place the 
cursor in the line of your source document, you are interested in, and 
run 'sync' (preferable via a shortcut key), then the pdf window will 
display the exact page, and in the line corresponding to your line in 
the source file, you will see the word 'sync' printed in red.

Root files:
If you have a master file and several slave files which are read by an 
'\include' or '\input' statement, then you can work with these slave 
files and Flashmode will typeset the corresponding master file, if its 
relative path is given within the first three lines of the slave 
document in the form

%SourceDoc 'relative path'

e.g., like

%SourceDoc ./master.tex

The 'sync' script will also work when applied to the slave files with 
the only catch that the '\includeonly' command must not be used, i.e., 
the master file must read all slave files.
If this is the case, then the 'sync' script will also take care of 
possible differences between the page numbering of the pdf file and the 
page numbering of the document, and it will open the exact page one has 
chosen.

When the '\includeonly' is active, one should use the script 
'sync_include_only' in conjunction with the package pdfsync. The pdf 
file is then displayed at a page very close to the exact page and one 
should look for the the word 'sync' written in red.

Working with several documents:
If several documents should be controlled by Flashmode, then each 
document has to be controlled by a different copy of Flashmode - there 
are five included. All copies, except Flashmode_alt, use pdlatex for 
typesetting, though of course the engines can be changed by the user, 
as described above.
If, accidentally, one document is controlled by two copies of 
Flashmode, then this will probably cause erratic behaviour from 
TeXniscope.

Debugging:
Flashmode is silent, i.e., it doesn't complain when errors occur. 
Therefore each Flashmode copy is accompanied by a corresponding debug 
version,  that has the same functionality as the silent copy except 
that errors are reported. The debug versions are no application 
bundles, instead they use the shell scripts and preferences of the 
silent applications.

TeX-Scripts-BBEdit:
TeX-Scripts-BBEdit 2.0 do not know about TeXniscope. If TeXniscope 
should be the previewer, then add its name to the corresponding scripts

--set previewer to "TeXShop"
set previewer to "TeXniscope"
--set previewer to "Acrobat  6.0.1 Professional"
--set previewer to "Preview"

and replace the subroutine 'preview_bbedit' in 
~/Library/TeXShop/Scripts by the new subroutine, included with this 
distribution.

Six Applescripts 'activate-flashmode-T.scpt', 
'deactivate-flashmode-T.scpt', 'sync', sync_include_only', 'startup', 
and 'pdflatexc' are also included, which do not rely on an installation 
of TeX-Scripts-BBEdit. They all work both with single tex files as well 
as with combinations master/slaves.
When a Flashmode applications starts, it tries to open the 
corresponding pdf file and to tell TeXnsiscope to stop its default 
behaviour for that pdf file. When Flashmode quits, it tells TeXmsicope 
to resume its default behaviour. The Applescripts 
'activate-flashmode-T.scpt' and  'deactivate-flashmode-T.scpt' change 
TeXniscope's default behaviour for the front most pdf window as well.
Please, notice that all Applescripts are tailored for BBEdit v.8; 
'startup' will also run in v.7, the others might not, but they could be 
modified, if they don't run.

Acknowledgement:
Many thanks to Matthew Hills for his generous and valuable help in 
writing Applescript applications.

Licence:
Flashmode is free for personal, non-commercial use. It may not be 
bundled with other software, distributed or offered for download 
without my prior consent.

© Claus Gerhardt 2004
All rights reserved
gerhardt at math.uni-heidelberg.de


--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list