[OS X TeX] Flashmode for Emacs : Whizzytex + Enrico Franconi's Carbon Enhanced Emacs + TeXniscope

Philipp Mathey pmathey at uwo.ca
Sun Apr 10 07:41:17 CEST 2005


> I think I did understand that much.  What I don't understand is why two
> lines are needed to separate paragraphs.  For example in a typical tex
> document there might not be any double-blank lines at all

I don't know what other people do but I tend to have several empty 
lines at the end of one section, say,  and the beginning of another ( I 
mean, in the emacs buffer).

Any of the other slicing modes, e.g. 'section', do not require adding 
empty lines anywhere.

> there might not be any double-blank lines at all, so whizzytex
> would compile the whole document even in paragraph-slice mode.  Right?

Right.

>  But the *principle* should be
> that you should not have to change *anything* in your tex source in 
> order
> to use a flash mode.

whizzytex offers different slicing modes. All of them except for the 
paragraph mode don't require any changes to the tex source ( if we we 
forget about the %; whizzy ... line at the beginning)

Actually, even the first line "%; whizzy ..."-line may not be 
necessary. I just  commented out the line in one tex file and whizzytex 
(with TeXniscope) still worked.
So maybe you don't even have to add the %; whizzy line .... sorry about 
that

> At this point we are talking X11, not TeXniscope.  Reading your answer 
> I
> conclude that if you started emacs by double clicking on it (as I guess
> would be the standard way in OSX), and then decide to turn on whizzytex
> for a document, then you have to quit emacs and restart it from xterm.
>


- when using TeXniscope, start emacs by double-clicking on it as usual,

- when using advi,xdvi,gv, xpdf  : start emacs (once, at the beginning) 
from an xterm by typing
/Applications/Emacs.app/Contents/Resources/sitelisp/emacs   .
You may then work in emacs as usual. If you decide to activate 
whizzytex, you don't have to restart emacs . You may reactivate 
whizzytex as many times as you want. The xterm-thing is necessary only 
once, at the beginning. But maybe someone can figure out another 
solution.

> the open sockets.  Here is how it is done in Alpha:
>
> proc determineX11Display {} {
>     # The open displays are sockets listed in /tmp/.X11-unix/
>     # of names Xn for some nonegative integer n.  Pick the
>     # first one owned by the current user.
>     foreach socket [glob -nocomplain /tmp/.X11-unix/X*] {
> 	if { [file owned $socket] &&
> 	   [regsub {/tmp/\.X11-unix/X} $socket ":" display] } {
> 	    return $display
> 	}
>     }
> }
>
> You could have whizzytex perform such a check whenever it is activated.
> (I think you can easily read this little proc (Tcl is easy to read,
> isn't it?) and write the analogue in lisp.)

Maybe easy for you !
Actually, I don't even know what Tcl is...

> Yes, it works with pdftex and TeXniscope as viewer, but it's another
> script (mostly identical, but with a few internal differences due 
> exactly
> to the different nature of TeXniscope from xdvi.  The TeXniscope 
> variant
> was mentionned on the list on January 11th.  (Obviously, in the long 
> run,
> the two scripts should be merged into a single one, splitting cases 
> with
> the help of an internal variable when needed.)

Hmm, sounds good.
Maybe I am going to install AlphaX just to see what it looks like.
Perhaps you could enlighten me what the advantages of using AlphaX for 
someone like me are ( I am doing math).

Emacs has lots of nice features, including, as I mentioned in my 
original post, an emacs minor mode called UltraTeX. There is of cource 
also AucTeX.

The question is whether AlphaX supports/provides a similar kind of 
latex mode.


> My point was just not to let your detailed description stand as the 
> last
> word concerning flashing.  Other people should not think that those
> difficulties are inherent to getting a flash mechanism to work 
> (complicated
> installation involving makefiles, aliases, PATH setting; necessity of
> starting the editor in a particular way; necessity of adapting the tex
> source file...)
>

Right. I agree that it would be nice if the installation were simpler.  
I saw somewhere the announcement of whizzytex by Didier Remy , the 
author of whizzytex . He also asked whether someone was willing to port 
whizzytex to MacOsX. But apparently no one ever responded to this.

I am afraid the whizzytex installation instructions look more 
complicated than they are.  I tried to be as explicit as possible. If I 
had just said " go to ..., download the sources and compile them ", it 
might have been a little too vague.

All one has to do is to edit the Makefile.config configuration file and 
install whizzytex via make all. One also has to edit the .emacs file. 
That's it, as far as advi/xdvi/gv/xpdf are concerned. For TeXniscope, 
one has to add a few "cp $WHIZZY.$VIEW $WHIZZY.pdf" lines to the 
whizzytex shell script. So, all in all, it's not too bad. But, I agree, 
it would be nicer if one could install whizzytex with one click.

Perhaps someone could respond to Remy's offer and port whizzytex to 
MacOsX . Or the other 'flashmodes' ( yours, Claus Gerhard's,..) could 
be made to work with emacs...

Thanks,

Philipp Mathey




On 9-Apr-05, at 11:13 PM, Joachim Kock wrote:

>>> (Two empty lines?  Usually tex needs only one empty line to delimit a
>>> paragraph.)
>
>> You misunderstand.  The word "paragraph" here has a special meaning : 
>> it
>> does not refer to the layout of the compiled document, but instead it
>> refers to a 'slicing mode' - one of several ways in which whizzytex
>> 'slices' the source tex-file .
> ...
>> One other option is 'paragraph' : one 'paragraph' ( in the emacs 
>> buffer)
>> ends and a new 'paragraph' begins where there are two empty lines in 
>> the
>> emacs buffer.  I changed the default of 2 empty lines to 4 empty 
>> lines (
>> see instructions).  This makes it easier to separate 'paragraphs'.
>
> I think I did understand that much.  What I don't understand is why two
> lines are needed to separate paragraphs.  For example in a typical tex
> document there might not be any double-blank lines at all, so whizzytex
> would compile the whole document even in paragraph-slice mode.  Right?
>
>>> An important principle of the flash script in Alpha is that no 
>>> alterations
>>> are required in the tex documents, and that the script never writes 
>>> to your
>>> tex document or saves it for you or anything.  In this way the 
>>> document
>>> remains *yours* and you have complete control over it.
>>
>> Well, you only have to add one line at the beginning - not a big 
>> deal, is it ?
>> You can add it to your template.  And, of course, you still have 
>> "control"
>> over your tex-file !
>
> Not a big deal, neither to add extra tags at ths beginning, nor to 
> insert
> extra blank lines throughout the document.  But the *principle* should 
> be
> that you should not have to change *anything* in your tex source in 
> order
> to use a flash mode.
>
>
>>> This looks like a strange shortcoming.  Does it mean that if you 
>>> suddenly
>>> decide to use flash for some minutes you have to restart emacs from 
>>> the
>>> xterm?!
>>
>> No.
>>
>> When using whizzytex with TeXniscope, of course you don't need X11( 
>> for what ?!)
>
> At this point we are talking X11, not TeXniscope.  Reading your answer 
> I
> conclude that if you started emacs by double clicking on it (as I guess
> would be the standard way in OSX), and then decide to turn on whizzytex
> for a document, then you have to quit emacs and restart it from xterm.
>
>> frequently, when running applications that require X11, special
>> care has to be taken.  For example, an obvious problem might be that 
>> the
>> DISPLAY variable is not set correctly.
>
> When I say it's a strange shortcoming I mean that this DISPLAY problem
> should be something the programme could solve itself, instead of 
> requiring
> the user to change his habits.  Technically, one solution is to look 
> among
> the open sockets.  Here is how it is done in Alpha:
>
> proc determineX11Display {} {
>     # The open displays are sockets listed in /tmp/.X11-unix/
>     # of names Xn for some nonegative integer n.  Pick the
>     # first one owned by the current user.
>     foreach socket [glob -nocomplain /tmp/.X11-unix/X*] {
> 	if { [file owned $socket] &&
> 	   [regsub {/tmp/\.X11-unix/X} $socket ":" display] } {
> 	    return $display
> 	}
>     }
> }
>
> You could have whizzytex perform such a check whenever it is activated.
> (I think you can easily read this little proc (Tcl is easy to read,
> isn't it?) and write the analogue in lisp.)
>
>> But even with previewers requiring X11 you only have to open emacs 
>> once, at
>> the beginning of your emacs session.  Then you may activate, stop and
>> reactivate whizzytex as many times as you want.  You don't have to 
>> "restart
>> emacs" each time.
>
> Understood.  Once you have been through the xterm trick once, the 
> DISPLAY
> variable is correctly set.  So the remaining issue is whether 'once' is
> a reasonable value...
>
>
>> Still, if you could make your flashmode work together with Enrico 
>> Francon's
>> Carbon Enhanced Emacs , that would be fantastic.  I am not quite sure,
>> though - does it work with pdftex ?
>
> Yes, it works with pdftex and TeXniscope as viewer, but it's another
> script (mostly identical, but with a few internal differences due 
> exactly
> to the different nature of TeXniscope from xdvi.  The TeXniscope 
> variant
> was mentionned on the list on January 11th.  (Obviously, in the long 
> run,
> the two scripts should be merged into a single one, splitting cases 
> with
> the help of an internal variable when needed.)
>
> There is not much hope of getting this particular script to work in 
> emacs,
> unless emacs embeds a Tcl interpreter (which is not impossible, I 
> guess --
> nothing is impossible in emacs), or by rewriting the script in lisp.  
> But
> it is really crucial for both simplicity and speed that the script runs
> internally in the editor, in order to have direct access to the state 
> of
> the buffer.
>
>> If your flashmode could be made to work with Enrico Franconi's Carbon
>> Enhanced Emacs, and if it supported pdftex, and if it was faster than
>> whizzytex, I would be using it instead of whizzytex.
>
> You should definitely stay with whizzytex, if that works well for you.
>
> My point was just not to let your detailed description stand as the 
> last
> word concerning flashing.  Other people should not think that those
> difficulties are inherent to getting a flash mechanism to work 
> (complicated
> installation involving makefiles, aliases, PATH setting; necessity of
> starting the editor in a particular way; necessity of adapting the tex
> source file...)
>
> Cheers,
> Joachim.
> --------------------- 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>
>
>

--------------------- 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 macostex-archives mailing list