Hello,
I'm new to TextMate so please forgive my ignorance. My question is: is it possible to, or would it be possible to make, TextMate work well with xdvi? Even though part of the world is trending toward using PDF to display on the Mac, e.g. with Skim, there are still some advantages to xdvi, in particular that the display and updating are very fast, and it is much faster to latex a long document than to pdflatex it.
There are two things that would be needed.
1. When using latex as the engine, it seems that TextMate also invokes dvips to create a PDF file. This should be turned off. (Perhaps there is already an option for this?) Also, one would need to invoke latex with src-specials turned on (latex -src-specials).
2. One would like to be able to synchronize from TextMate to xdvi. This can be done with a command like: xdvi -sourceposition lineno$texfile $dvifile for example xdvi -sourceposition 50myfile.tex mymasterfile.dvi
Syncing from xdvi to TextMate is already relatively easy.
I'm guessing all this may be easy for those who are familiar with bundle editing (not me!), or even perhaps has been done already?
Thanks Geoff Vallis
Geoff,
Using the following directive at the top of your latex file %!TEX TS- program = mytex.sh
Then, write your own shell script to typeset the document in latex with your own options and own viewer. Here's what I wrote up as a quick test:
---------- snip and save to mytex.sh -------------
#!/bin/bash
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}"
latex -src-specials -interaction=nonstopmode -file-line-error $@ # "$FILE" #&& dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "${FILE.tex}.ps"
xdvi -sourceposition $TM_LINE_NUMBER$$FILE "${FILE%.tex}.dvi"
-----------------------------------------
Save the above to /usr/local/bin or some other directory on your path and you are good to go.
Make sure to uncheck automatically open pdf in the latex preferences window.
On Feb 6, 2008, at 7:56 AM, Geoff Vallis wrote:
Hello,
I'm new to TextMate so please forgive my ignorance. My question is: is it possible to, or would it be possible to make, TextMate work well with xdvi? Even though part of the world is trending toward using PDF to display on the Mac, e.g. with Skim, there are still some advantages to xdvi, in particular that the display and updating are very fast, and it is much faster to latex a long document than to pdflatex it.
There are two things that would be needed.
- When using latex as the engine, it seems that TextMate also
invokes dvips to create a PDF file. This should be turned off. (Perhaps there is already an option for this?) Also, one would need to invoke latex with src-specials turned on (latex -src-specials).
- One would like to be able to synchronize from TextMate to xdvi.
This can be done with a command like: xdvi -sourceposition lineno$texfile $dvifile for example xdvi -sourceposition 50myfile.tex mymasterfile.dvi
Syncing from xdvi to TextMate is already relatively easy.
I'm guessing all this may be easy for those who are familiar with bundle editing (not me!), or even perhaps has been done already?
Thanks Geoff Vallis
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Brad,
Thanks very much. Your script works as advertised.
I'd like now to be able to sync from the source document in TextMate to the xdvi window. I presume that I need to add some command in the Latex bundle that is analogous to the existing command 'show in PDF viewer (pdfsync)'. When I look at that command in the bundle editor it is not very informative as to how to do this. Any suggestions?
Geoff
On Feb 6, 2008, at 10:39 AM, Brad Miller wrote:
Geoff,
Using the following directive at the top of your latex file %!TEX TS-program = mytex.sh
Then, write your own shell script to typeset the document in latex with your own options and own viewer. Here's what I wrote up as a quick test:
---------- snip and save to mytex.sh -------------
#!/bin/bash
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}"
latex -src-specials -interaction=nonstopmode -file-line-error $@ # "$FILE" #&& dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "${FILE.tex}.ps"
xdvi -sourceposition $TM_LINE_NUMBER$$FILE "${FILE%.tex}.dvi"
Save the above to /usr/local/bin or some other directory on your path and you are good to go.
Make sure to uncheck automatically open pdf in the latex preferences window.
On Feb 6, 2008, at 7:56 AM, Geoff Vallis wrote:
Hello,
I'm new to TextMate so please forgive my ignorance. My question is: is it possible to, or would it be possible to make, TextMate work well with xdvi? Even though part of the world is trending toward using PDF to display on the Mac, e.g. with Skim, there are still some advantages to xdvi, in particular that the display and updating are very fast, and it is much faster to latex a long document than to pdflatex it.
There are two things that would be needed.
- When using latex as the engine, it seems that TextMate also
invokes dvips to create a PDF file. This should be turned off. (Perhaps there is already an option for this?) Also, one would need to invoke latex with src-specials turned on (latex -src-specials).
- One would like to be able to synchronize from TextMate to xdvi.
This can be done with a command like: xdvi -sourceposition lineno$texfile $dvifile for example xdvi -sourceposition 50myfile.tex mymasterfile.dvi
Syncing from xdvi to TextMate is already relatively easy.
I'm guessing all this may be easy for those who are familiar with bundle editing (not me!), or even perhaps has been done already?
Thanks Geoff Vallis
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Geoff,
The pdfsync commands rely on the applescript capability of the viewers like Skim. I don't think that is going to be possible with xdvi.
Brad
On Feb 6, 2008, at 11:00 AM, Geoff Vallis wrote:
Brad,
Thanks very much. Your script works as advertised.
I'd like now to be able to sync from the source document in TextMate to the xdvi window. I presume that I need to add some command in the Latex bundle that is analogous to the existing command 'show in PDF viewer (pdfsync)'. When I look at that command in the bundle editor it is not very informative as to how to do this. Any suggestions?
Geoff
On Feb 6, 2008, at 10:39 AM, Brad Miller wrote:
Geoff,
Using the following directive at the top of your latex file %!TEX TS-program = mytex.sh
Then, write your own shell script to typeset the document in latex with your own options and own viewer. Here's what I wrote up as a quick test:
---------- snip and save to mytex.sh -------------
#!/bin/bash
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}"
latex -src-specials -interaction=nonstopmode -file-line-error $@ # "$FILE" #&& dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "${FILE.tex}.ps"
xdvi -sourceposition $TM_LINE_NUMBER$$FILE "${FILE%.tex}.dvi"
Save the above to /usr/local/bin or some other directory on your path and you are good to go.
Make sure to uncheck automatically open pdf in the latex preferences window.
On Feb 6, 2008, at 7:56 AM, Geoff Vallis wrote:
Hello,
I'm new to TextMate so please forgive my ignorance. My question is: is it possible to, or would it be possible to make, TextMate work well with xdvi? Even though part of the world is trending toward using PDF to display on the Mac, e.g. with Skim, there are still some advantages to xdvi, in particular that the display and updating are very fast, and it is much faster to latex a long document than to pdflatex it.
There are two things that would be needed.
- When using latex as the engine, it seems that TextMate also
invokes dvips to create a PDF file. This should be turned off. (Perhaps there is already an option for this?) Also, one would need to invoke latex with src-specials turned on (latex -src- specials).
- One would like to be able to synchronize from TextMate to xdvi.
This can be done with a command like: xdvi -sourceposition lineno$texfile $dvifile for example xdvi -sourceposition 50myfile.tex mymasterfile.dvi
Syncing from xdvi to TextMate is already relatively easy.
I'm guessing all this may be easy for those who are familiar with bundle editing (not me!), or even perhaps has been done already?
Thanks Geoff Vallis
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Brad,
That's too bad if so, and seems a bit odd, to me at least. After all, an applescript can call a shell script, which could be used to call xdvi, presuming that the parameters like line number and file name could be passed on to the shell script. And I thought that Textmate could in any case invoke shell commands directly, which is all one would need along with the file name and line number.
I am presumably missing something!
Geoff
On Feb 6, 2008, at 1:43 PM, Brad Miller wrote:
Geoff,
The pdfsync commands rely on the applescript capability of the viewers like Skim. I don't think that is going to be possible with xdvi.
Brad
On Feb 6, 2008, at 11:00 AM, Geoff Vallis wrote:
Brad,
Thanks very much. Your script works as advertised.
I'd like now to be able to sync from the source document in TextMate to the xdvi window. I presume that I need to add some command in the Latex bundle that is analogous to the existing command 'show in PDF viewer (pdfsync)'. When I look at that command in the bundle editor it is not very informative as to how to do this. Any suggestions?
Geoff
On Feb 6, 2008, at 10:39 AM, Brad Miller wrote:
Geoff,
Using the following directive at the top of your latex file %!TEX TS-program = mytex.sh
Then, write your own shell script to typeset the document in latex with your own options and own viewer. Here's what I wrote up as a quick test:
---------- snip and save to mytex.sh -------------
#!/bin/bash
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}"
latex -src-specials -interaction=nonstopmode -file-line-error $@ # "$FILE" #&& dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "$ {FILE.tex}.ps"
xdvi -sourceposition $TM_LINE_NUMBER$$FILE "${FILE%.tex}.dvi"
Save the above to /usr/local/bin or some other directory on your path and you are good to go.
Make sure to uncheck automatically open pdf in the latex preferences window.
On Feb 6, 2008, at 7:56 AM, Geoff Vallis wrote:
Hello,
I'm new to TextMate so please forgive my ignorance. My question is: is it possible to, or would it be possible to make, TextMate work well with xdvi? Even though part of the world is trending toward using PDF to display on the Mac, e.g. with Skim, there are still some advantages to xdvi, in particular that the display and updating are very fast, and it is much faster to latex a long document than to pdflatex it.
There are two things that would be needed.
- When using latex as the engine, it seems that TextMate also
invokes dvips to create a PDF file. This should be turned off. (Perhaps there is already an option for this?) Also, one would need to invoke latex with src-specials turned on (latex -src- specials).
- One would like to be able to synchronize from TextMate to
xdvi. This can be done with a command like: xdvi -sourceposition lineno$texfile $dvifile for example xdvi -sourceposition 50myfile.tex mymasterfile.dvi
Syncing from xdvi to TextMate is already relatively easy.
I'm guessing all this may be easy for those who are familiar with bundle editing (not me!), or even perhaps has been done already?
Thanks Geoff Vallis
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Feb 6, 2008, at 1:13 PM, Geoff Vallis wrote:
Brad,
That's too bad if so, and seems a bit odd, to me at least. After all, an applescript can call a shell script, which could be used to call xdvi, presuming that the parameters like line number and file name could be passed on to the shell script. And I thought that Textmate could in any case invoke shell commands directly, which is all one would need along with the file name and line number.
I am presumably missing something!
You are probably right. I didn't think about it very carefully, and I don't really know anything about xdvi anymore as I've been very happily using pdf for several years now.
I would presume that if it can all be done in a shell script then using the TM_ variables would give you enough info to put together a script. In fact this script could simply be the body of a TextMate bundle command.
Brad
Geoff
On Feb 6, 2008, at 1:43 PM, Brad Miller wrote:
Geoff,
The pdfsync commands rely on the applescript capability of the viewers like Skim. I don't think that is going to be possible with xdvi.
Brad
On Feb 6, 2008, at 11:00 AM, Geoff Vallis wrote:
Brad,
Thanks very much. Your script works as advertised.
I'd like now to be able to sync from the source document in TextMate to the xdvi window. I presume that I need to add some command in the Latex bundle that is analogous to the existing command 'show in PDF viewer (pdfsync)'. When I look at that command in the bundle editor it is not very informative as to how to do this. Any suggestions?
Geoff
On Feb 6, 2008, at 10:39 AM, Brad Miller wrote:
Geoff,
Using the following directive at the top of your latex file %! TEX TS-program = mytex.sh
Then, write your own shell script to typeset the document in latex with your own options and own viewer. Here's what I wrote up as a quick test:
---------- snip and save to mytex.sh -------------
#!/bin/bash
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}"
latex -src-specials -interaction=nonstopmode -file-line-error $@ # "$FILE" #&& dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "$ {FILE.tex}.ps"
xdvi -sourceposition $TM_LINE_NUMBER$$FILE "${FILE%.tex}.dvi"
Save the above to /usr/local/bin or some other directory on your path and you are good to go.
Make sure to uncheck automatically open pdf in the latex preferences window.
On Feb 6, 2008, at 7:56 AM, Geoff Vallis wrote:
Hello,
I'm new to TextMate so please forgive my ignorance. My question is: is it possible to, or would it be possible to make, TextMate work well with xdvi? Even though part of the world is trending toward using PDF to display on the Mac, e.g. with Skim, there are still some advantages to xdvi, in particular that the display and updating are very fast, and it is much faster to latex a long document than to pdflatex it.
There are two things that would be needed.
- When using latex as the engine, it seems that TextMate also
invokes dvips to create a PDF file. This should be turned off. (Perhaps there is already an option for this?) Also, one would need to invoke latex with src-specials turned on (latex -src- specials).
- One would like to be able to synchronize from TextMate to
xdvi. This can be done with a command like: xdvi -sourceposition lineno$texfile $dvifile for example xdvi -sourceposition 50myfile.tex mymasterfile.dvi
Syncing from xdvi to TextMate is already relatively easy.
I'm guessing all this may be easy for those who are familiar with bundle editing (not me!), or even perhaps has been done already?
Thanks Geoff Vallis
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Replying to Brad and Niels in one go:
On Feb 6, 2008, at 4:13 PM, Niels Kobschaetzki wrote:
The "Show in PDF Viewer"-command says "texMate.py sync 1" (you can see that in the Bundle Editor) and locate tells me that texMate.py is located in "/Applications/TextMate.app/Contents/SharedSupport/Bundles/ Latex.tmbundle/Support/bin/texMate.py"
and a search in TextMate in that file says that the stuff you are searching for starts propably at line 109…
On Feb 6, 2008, at 4:33 PM, Brad Miller wrote:
Brad,
That's too bad if so, and seems a bit odd, to me at least. After all, an applescript can call a shell script, which could be used to call xdvi, presuming that the parameters like line number and file name could be passed on to the shell script. And I thought that Textmate could in any case invoke shell commands directly, which is all one would need along with the file name and line number.
I am presumably missing something!
You are probably right. I didn't think about it very carefully, and I don't really know anything about xdvi anymore as I've been very happily using pdf for several years now.
I would presume that if it can all be done in a shell script then using the TM_ variables would give you enough info to put together a script. In fact this script could simply be the body of a TextMate bundle command.
Brad
Thanks to both of you. Looking at texMate.py, it seems that in order to forward sync, TextMate calls the scripts that are provided by the PDF viewers, such as forward-search.sh in TeXniscope. On the face of it, it seems that one might be able to substitute a call to xdvi for one of these scripts, as the functionality and calling parameters are very similar. I guess I'll give it a shot -- unless someone who actually knows what they are doing wants to do it? I suspect it is a piece of cake in that case, and I'd be happy to provide any knowledge of xdvi that might be needed. (Unfortunately, I barely know what a 'bundle' is...)
Geoff
Geoff,
The "Watch document" command should attempt to use gv as the previewer, in latex mode. (I haven't tried this for a while, but it used to work and could easily be fixed if it's accidentally been broken.)
That's much faster than generating a PDF. As you've probably noticed, converting PostScript to PDF is actually the slowest part of the process, for a long or complicated document.
"Watch document" also caches the processed version of the document preamble, so you should find it significantly faster to update when making incremental changes.
Robin
Robin
Yes - 'Watch' still seems to work okay. The problem with gv is that no synchronization is possible: for speed and synchronization I've found xdvi hard to beat -- at least when using an editor that supports it :-)
Texniscope used to have a very nice feature that one could typeset in latex mode, and then Texniscope would convert to PDF for displaying, using dvipdfmx, but it would only convert the page that one was viewing and the few pages on either side. This made it quite fast, almost as fast as xdvi and with nicer viewing quality, but alas the feature doesn't seem to have been inherited by Skim, and Texniscope, also alas, is no longer supported.
Geoff
On Feb 6, 2008, at 5:25 PM, Robin Houston wrote:
Geoff,
The "Watch document" command should attempt to use gv as the previewer, in latex mode. (I haven't tried this for a while, but it used to work and could easily be fixed if it's accidentally been broken.)
That's much faster than generating a PDF. As you've probably noticed, converting PostScript to PDF is actually the slowest part of the process, for a long or complicated document.
"Watch document" also caches the processed version of the document preamble, so you should find it significantly faster to update when making incremental changes.
Robin
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Geoff,
How do you tell a running version of xdvi to change its position/page from the shell? If it can be done from the shell I'll look at adding it. If xdvi is to be an officially supported viewer then its going to take me a bit of time to make it work with the rest of the bundle options in texMate.py. All of the viewing commands assumed that pdf was the format that was going to be viewed so its not a trivial change. You are the first person to request support for xdvi. I'm curious if others would want xdvi supported as well.
If it is a short shell script then it really would be very easy for you to add your own bundle command.
type ctrl-opt-cmd-b to bring up the bundle editor You should see a bundle with your own name, or you can add the command to the latex bundle. click add new command in the lower left corner. Give your new command a name: dvisync Save: Nothing Command(s) Whatever shell script tells xdvi to update itself. The two variables you may want are: TM_LINE_NUMBER and TM_FILEPATH or TM_FILENAME Input: None Output: discard key equivalent: your choice Scope Selector: text.tex.latex
Brad
Close the bundle editor, and you've made your first TextMate command. On Feb 6, 2008, at 3:53 PM, Geoff Vallis wrote:
Replying to Brad and Niels in one go:
On Feb 6, 2008, at 4:13 PM, Niels Kobschaetzki wrote:
The "Show in PDF Viewer"-command says "texMate.py sync 1" (you can see that in the Bundle Editor) and locate tells me that texMate.py is located in "/Applications/TextMate.app/Contents/SharedSupport/Bundles/ Latex.tmbundle/Support/bin/texMate.py"
and a search in TextMate in that file says that the stuff you are searching for starts propably at line 109…
On Feb 6, 2008, at 4:33 PM, Brad Miller wrote:
Brad,
That's too bad if so, and seems a bit odd, to me at least. After all, an applescript can call a shell script, which could be used to call xdvi, presuming that the parameters like line number and file name could be passed on to the shell script. And I thought that Textmate could in any case invoke shell commands directly, which is all one would need along with the file name and line number.
I am presumably missing something!
You are probably right. I didn't think about it very carefully, and I don't really know anything about xdvi anymore as I've been very happily using pdf for several years now.
I would presume that if it can all be done in a shell script then using the TM_ variables would give you enough info to put together a script. In fact this script could simply be the body of a TextMate bundle command.
Brad
Thanks to both of you. Looking at texMate.py, it seems that in order to forward sync, TextMate calls the scripts that are provided by the PDF viewers, such as forward-search.sh in TeXniscope. On the face of it, it seems that one might be able to substitute a call to xdvi for one of these scripts, as the functionality and calling parameters are very similar. I guess I'll give it a shot -- unless someone who actually knows what they are doing wants to do it? I suspect it is a piece of cake in that case, and I'd be happy to provide any knowledge of xdvi that might be needed. (Unfortunately, I barely know what a 'bundle' is...)
Geoff
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Le 7 févr. 08 à 03:47, Brad Miller a écrit :
Geoff,
How do you tell a running version of xdvi to change its position/ page from the shell? If it can be done from the shell I'll look at adding it. If xdvi is to be an officially supported viewer then its going to take me a bit of time to make it work with the rest of the bundle options in texMate.py. All of the viewing commands assumed that pdf was the format that was going to be viewed so its not a trivial change. You are the first person to request support for xdvi. I'm curious if others would want xdvi supported as well.
NO !
dvi is not necessary because I work only with pdflatex and pgf(instead pf pstricks) to get directly PDF files.
Currently DVI is not a very convenient format to exchange
Best Regards
Alain Matthes
On Feb 7, 2008 7:17 AM, Alain Matthes alain.matthes@mac.com wrote:
Le 7 févr. 08 à 03:47, Brad Miller a écrit :
Geoff,
How do you tell a running version of xdvi to change its position/ page from the shell? If it can be done from the shell I'll look at adding it. If xdvi is to be an officially supported viewer then its going to take me a bit of time to make it work with the rest of the bundle options in texMate.py. All of the viewing commands assumed that pdf was the format that was going to be viewed so its not a trivial change. You are the first person to request support for xdvi. I'm curious if others would want xdvi supported as well.
NO !
dvi is not necessary because I work only with pdflatex and pgf(instead pf pstricks) to get directly PDF files.
Currently DVI is not a very convenient format to exchange
I do not need it either. DVI was never (even in my *nix-starting times 10 years ago) a convenient or comfortable format for me.
Niels
On Feb 7, 2008, at 3:47 AM, Brad Miller wrote:
I'm curious if others would want xdvi supported as well.
me too, also for the sake of speed. i agree that it's not very convenient (rendering of colorboxes doesn't work properly, pstricks doesn't work, etc.) but there are a lot of situations where speed matters :-)
christoph
Brad,
On Feb 6, 2008, at 9:47 PM, Brad Miller wrote:
How do you tell a running version of xdvi to change its position/ page from the shell? If it can be done from the shell I'll look at adding it.
The command to update xdvi is the same whether or not xdvi is already running. It is just: xdvi -sourceposition Lineno[:Column]Filename Masterfile[.dvi] with, I hope, obvious notation, and of course this command can be embedded in a shell script. The Column parameter is optional. If xdvi is already running, showing masterfile, this call will just bring the xdvi window to the front and switch positions accordingly. If not, the command will open an xdvi window with Masterfile showing.
There are a million other options that you can see with a 'man xdvi' or 'xdvi --help'. Generally, you first open an xdvi window with the size and options you want, and then the syncing just uses that open window.
If it is a short shell script then it really would be very easy for you to add your own bundle command.
type ctrl-opt-cmd-b to bring up the bundle editor You should see a bundle with your own name, or you can add the command to the latex bundle. click add new command in the lower left corner. Give your new command a name: dvisync Save: Nothing Command(s) Whatever shell script tells xdvi to update itself. The two variables you may want are: TM_LINE_NUMBER and TM_FILEPATH or TM_FILENAME Input: None Output: discard key equivalent: your choice Scope Selector: text.tex.latex
Brad
Close the bundle editor, and you've made your first TextMate command.
Thanks, I'll give this a shot, whether or not you decide to support xdvi. To be absolutely clear, can you say what the Textmate variables are that correspond to:
linenumber of the file being edited where the cursor is at; column of the cursor of the file being edited (if available; filename of the file being edited; masterfilename (which will be the name of the dvi file).
Regards Geoff
On Feb 7, 2008, at 7:38 AM, Geoff Vallis wrote:
Brad,
On Feb 6, 2008, at 9:47 PM, Brad Miller wrote:
How do you tell a running version of xdvi to change its position/ page from the shell? If it can be done from the shell I'll look at adding it.
The command to update xdvi is the same whether or not xdvi is already running. It is just: xdvi -sourceposition Lineno[:Column]Filename Masterfile[.dvi] with, I hope, obvious notation, and of course this command can be embedded in a shell script. The Column parameter is optional. If xdvi is already running, showing masterfile, this call will just bring the xdvi window to the front and switch positions accordingly. If not, the command will open an xdvi window with Masterfile showing.
That is very easy. I've just never found X to be very pleasant on the mac so I've mostly forgotten everything I used to know.
There are a million other options that you can see with a 'man xdvi' or 'xdvi --help'. Generally, you first open an xdvi window with the size and options you want, and then the syncing just uses that open window.
If it is a short shell script then it really would be very easy for you to add your own bundle command.
type ctrl-opt-cmd-b to bring up the bundle editor You should see a bundle with your own name, or you can add the command to the latex bundle. click add new command in the lower left corner. Give your new command a name: dvisync Save: Nothing Command(s) Whatever shell script tells xdvi to update itself. The two variables you may want are: TM_LINE_NUMBER and TM_FILEPATH or TM_FILENAME Input: None Output: discard key equivalent: your choice Scope Selector: text.tex.latex
Brad
Close the bundle editor, and you've made your first TextMate command.
Thanks, I'll give this a shot, whether or not you decide to support xdvi. To be absolutely clear, can you say what the Textmate variables are that correspond to:
linenumber of the file being edited where the cursor is at; column of the cursor of the file being edited (if available; filename of the file being edited; masterfilename (which will be the name of the dvi file).
Geoff,
You can see all of the environment variables exported by TM by running the command Bundles --> Bundle Development --> Show TM_* variables.
linenumber is TM_LINE_NUMBER columnnumber is TM_COLUMN_NUMBER filename of the file being edited: TM_FILENAME -- is the filename without any path information TM_FILEPATH -- is the filename with full path ${TM_FILENAME%.tex}.dvi will give you the name of the dvi file without path ${TM_FILEPATH%.tex}.dvi will give you the name of the dvi file with the path
Brad
Regards Geoff
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Brad
This is working now for files for files that do not have a master or root file. But if there is a master file, the name of the dvi file is not the same as the name of the file being edited, but is the name of the master file, or the tex root. I don't see the name of this in the Show TM_* variables list. What is it, including the full path?
Geoff
On Feb 7, 2008, at 2:45 PM, Brad Miller wrote:
On Feb 7, 2008, at 7:38 AM, Geoff Vallis wrote:
Brad,
On Feb 6, 2008, at 9:47 PM, Brad Miller wrote:
How do you tell a running version of xdvi to change its position/ page from the shell? If it can be done from the shell I'll look at adding it.
The command to update xdvi is the same whether or not xdvi is already running. It is just: xdvi -sourceposition Lineno[:Column]Filename Masterfile[.dvi] with, I hope, obvious notation, and of course this command can be embedded in a shell script. The Column parameter is optional. If xdvi is already running, showing masterfile, this call will just bring the xdvi window to the front and switch positions accordingly. If not, the command will open an xdvi window with Masterfile showing.
That is very easy. I've just never found X to be very pleasant on the mac so I've mostly forgotten everything I used to know.
There are a million other options that you can see with a 'man xdvi' or 'xdvi --help'. Generally, you first open an xdvi window with the size and options you want, and then the syncing just uses that open window.
If it is a short shell script then it really would be very easy for you to add your own bundle command.
type ctrl-opt-cmd-b to bring up the bundle editor You should see a bundle with your own name, or you can add the command to the latex bundle. click add new command in the lower left corner. Give your new command a name: dvisync Save: Nothing Command(s) Whatever shell script tells xdvi to update itself. The two variables you may want are: TM_LINE_NUMBER and TM_FILEPATH or TM_FILENAME Input: None Output: discard key equivalent: your choice Scope Selector: text.tex.latex
Brad
Close the bundle editor, and you've made your first TextMate command.
Thanks, I'll give this a shot, whether or not you decide to support xdvi. To be absolutely clear, can you say what the Textmate variables are that correspond to:
linenumber of the file being edited where the cursor is at; column of the cursor of the file being edited (if available; filename of the file being edited; masterfilename (which will be the name of the dvi file).
Geoff,
You can see all of the environment variables exported by TM by running the command Bundles --> Bundle Development --> Show TM_* variables.
linenumber is TM_LINE_NUMBER columnnumber is TM_COLUMN_NUMBER filename of the file being edited: TM_FILENAME -- is the filename without any path information TM_FILEPATH -- is the filename with full path ${TM_FILENAME%.tex}.dvi will give you the name of the dvi file without path ${TM_FILEPATH%.tex}.dvi will give you the name of the dvi file with the path
Brad
Regards Geoff
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Brad
Following up with a slightly more explicit description. My bundle(s) works, but not elegantly or well. I have a short script call dvisync.sh that looks like the following:
#!/bin/tcsh /usr/texbin/xdvi -sourceposition $1$2 $3
and then I have two(!) bundles, called dvisync1 and dvisync2 that look like:
/pathto/dvisync.sh $TM_LINE_NUMBER $TM_FILEPATH ${TM_FILEPATH%.tex}.dvi
and
/pathto/dvisync.sh $TM_LINE_NUMBER $TM_FILEPATH ${TM_LATEX_MASTER%.tex}
The first works if and only if there is no master file, and the second works if and only if there is one. I can't seem to get a single bundle to work in both cases, and also TextMate doesn't seem to reset the master file correctly all the time when I change the files I am editing.
Any suggestions would be appreciated.
Geoff
On Feb 7, 2008, at 2:45 PM, Brad Miller wrote:
On Feb 7, 2008, at 7:38 AM, Geoff Vallis wrote:
Brad,
On Feb 6, 2008, at 9:47 PM, Brad Miller wrote:
How do you tell a running version of xdvi to change its position/ page from the shell? If it can be done from the shell I'll look at adding it.
The command to update xdvi is the same whether or not xdvi is already running. It is just: xdvi -sourceposition Lineno[:Column]Filename Masterfile[.dvi] with, I hope, obvious notation, and of course this command can be embedded in a shell script. The Column parameter is optional. If xdvi is already running, showing masterfile, this call will just bring the xdvi window to the front and switch positions accordingly. If not, the command will open an xdvi window with Masterfile showing.
That is very easy. I've just never found X to be very pleasant on the mac so I've mostly forgotten everything I used to know.
There are a million other options that you can see with a 'man xdvi' or 'xdvi --help'. Generally, you first open an xdvi window with the size and options you want, and then the syncing just uses that open window.
If it is a short shell script then it really would be very easy for you to add your own bundle command.
type ctrl-opt-cmd-b to bring up the bundle editor You should see a bundle with your own name, or you can add the command to the latex bundle. click add new command in the lower left corner. Give your new command a name: dvisync Save: Nothing Command(s) Whatever shell script tells xdvi to update itself. The two variables you may want are: TM_LINE_NUMBER and TM_FILEPATH or TM_FILENAME Input: None Output: discard key equivalent: your choice Scope Selector: text.tex.latex
Brad
Close the bundle editor, and you've made your first TextMate command.
Thanks, I'll give this a shot, whether or not you decide to support xdvi. To be absolutely clear, can you say what the Textmate variables are that correspond to:
linenumber of the file being edited where the cursor is at; column of the cursor of the file being edited (if available; filename of the file being edited; masterfilename (which will be the name of the dvi file).
Geoff,
You can see all of the environment variables exported by TM by running the command Bundles --> Bundle Development --> Show TM_* variables.
linenumber is TM_LINE_NUMBER columnnumber is TM_COLUMN_NUMBER filename of the file being edited: TM_FILENAME -- is the filename without any path information TM_FILEPATH -- is the filename with full path ${TM_FILENAME%.tex}.dvi will give you the name of the dvi file without path ${TM_FILEPATH%.tex}.dvi will give you the name of the dvi file with the path
Brad
Regards Geoff
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Feb 7, 2008, at 4:33 PM, Geoff Vallis wrote:
Brad
Following up with a slightly more explicit description. My bundle(s) works, but not elegantly or well. I have a short script call dvisync.sh that looks like the following:
#!/bin/tcsh /usr/texbin/xdvi -sourceposition $1$2 $3
and then I have two(!) bundles, called dvisync1 and dvisync2 that look like:
/pathto/dvisync.sh $TM_LINE_NUMBER $TM_FILEPATH ${TM_FILEPATH %.tex}.dvi
and
/pathto/dvisync.sh $TM_LINE_NUMBER $TM_FILEPATH ${TM_LATEX_MASTER %.tex}
You should add a line something like this:
DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH}
Then use ${DVIFILE%.tex}.dvi on the /path/dvisync...... command
The first works if and only if there is no master file, and the second works if and only if there is one. I can't seem to get a single bundle to work in both cases, and also TextMate doesn't seem to reset the master file correctly all the time when I change the files I am editing.
That will depend on how and where you are setting TM_LATEX_MASTER. This variable is around only for backward compatibility with previous versions of the latex bundle. The preferred method for setting the master file is to put
%!TEX root = /path/to/root in your tex file. BUT that will not help you in your situation. I thought you said you were working with one giant file.
Brad
Any suggestions would be appreciated.
Geoff
On Feb 7, 2008, at 2:45 PM, Brad Miller wrote:
On Feb 7, 2008, at 7:38 AM, Geoff Vallis wrote:
Brad,
On Feb 6, 2008, at 9:47 PM, Brad Miller wrote:
How do you tell a running version of xdvi to change its position/ page from the shell? If it can be done from the shell I'll look at adding it.
The command to update xdvi is the same whether or not xdvi is already running. It is just: xdvi -sourceposition Lineno[:Column]Filename Masterfile[.dvi] with, I hope, obvious notation, and of course this command can be embedded in a shell script. The Column parameter is optional. If xdvi is already running, showing masterfile, this call will just bring the xdvi window to the front and switch positions accordingly. If not, the command will open an xdvi window with Masterfile showing.
That is very easy. I've just never found X to be very pleasant on the mac so I've mostly forgotten everything I used to know.
There are a million other options that you can see with a 'man xdvi' or 'xdvi --help'. Generally, you first open an xdvi window with the size and options you want, and then the syncing just uses that open window.
If it is a short shell script then it really would be very easy for you to add your own bundle command.
type ctrl-opt-cmd-b to bring up the bundle editor You should see a bundle with your own name, or you can add the command to the latex bundle. click add new command in the lower left corner. Give your new command a name: dvisync Save: Nothing Command(s) Whatever shell script tells xdvi to update itself. The two variables you may want are: TM_LINE_NUMBER and TM_FILEPATH or TM_FILENAME Input: None Output: discard key equivalent: your choice Scope Selector: text.tex.latex
Brad
Close the bundle editor, and you've made your first TextMate command.
Thanks, I'll give this a shot, whether or not you decide to support xdvi. To be absolutely clear, can you say what the Textmate variables are that correspond to:
linenumber of the file being edited where the cursor is at; column of the cursor of the file being edited (if available; filename of the file being edited; masterfilename (which will be the name of the dvi file).
Geoff,
You can see all of the environment variables exported by TM by running the command Bundles --> Bundle Development --> Show TM_* variables.
linenumber is TM_LINE_NUMBER columnnumber is TM_COLUMN_NUMBER filename of the file being edited: TM_FILENAME -- is the filename without any path information TM_FILEPATH -- is the filename with full path ${TM_FILENAME%.tex}.dvi will give you the name of the dvi file without path ${TM_FILEPATH%.tex}.dvi will give you the name of the dvi file with the path
Brad
Regards Geoff
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
You should add a line something like this:
DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH}
Then use ${DVIFILE%.tex}.dvi on the /path/dvisync...... command
That will depend on how and where you are setting TM_LATEX_MASTER. This variable is around only for backward compatibility with previous versions of the latex bundle. The preferred method for setting the master file is to put
%!TEX root = /path/to/root in your tex file. BUT that will not help you in your situation. I thought you said you were working with one giant file.
In fact I have files that are stand-alone, and others that sit under a root file. And I do use the %!TEX root method of setting the master file, not any other - it seems similar to what texshop and bbedit use.
I've tried using DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH} in my bundle, and it kind of works. But if I go from editing and latexing a collection of files which has a master file, to editing a stand-alone file, then textmate still tries to use the previous master file when dvi-syncing the stand-alone file, which obviously doesn't work. I can work around it with two bundles, or restarting textmate, but that seems very clunky.
But thanks for your input. I realize that there's not a whole lot of folk using xdvi with textmate.
Geoff
It sounds to me like you must have TM_LATEX_MASTER set in a project file or in .textmate_init in a project or something. The latex bundle does not set TM_LATEX_MASTER, it only uses the variable if its set. Are you sure it is always the previous master file?
Try typing this into a latex file and then pressing ctrl-r This will tell you what the environment variable is set to without running any latex commands. If it does not return a blank line then you need to hunt through your environment and see where it is set.
echo $TM_LATEX_MASTER
Brad
On Feb 7, 2008, at 7:06 PM, Geoff Vallis wrote:
You should add a line something like this:
DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH}
Then use ${DVIFILE%.tex}.dvi on the /path/dvisync...... command
That will depend on how and where you are setting TM_LATEX_MASTER. This variable is around only for backward compatibility with previous versions of the latex bundle. The preferred method for setting the master file is to put
%!TEX root = /path/to/root in your tex file. BUT that will not help you in your situation. I thought you said you were working with one giant file.
In fact I have files that are stand-alone, and others that sit under a root file. And I do use the %!TEX root method of setting the master file, not any other - it seems similar to what texshop and bbedit use.
I've tried using DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH} in my bundle, and it kind of works. But if I go from editing and latexing a collection of files which has a master file, to editing a stand- alone file, then textmate still tries to use the previous master file when dvi-syncing the stand-alone file, which obviously doesn't work. I can work around it with two bundles, or restarting textmate, but that seems very clunky.
But thanks for your input. I realize that there's not a whole lot of folk using xdvi with textmate.
Geoff
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Geoff are you by any chance setting the TM_LATEX_MASTER variable under TextMate -> Preferences -> Advanced? Then TM will always use that. But perhaps I've missed some part of this conversation.
I don't use xdvi for the very simple reason that by this point in time I don't feel the need to look at the output, simply looking at the code tells me all I need to know about how the output is going to be like, for the most part. And usually I don't have X11 running.
I'm a bit confused though. Do you still go through texMate.py, calling the existing compile command, or do you use your own command (command \equiv bundle item)? If it's the latter, then I don't see how the %!TEX directive will work, unless you do something special in your command. TextMate by itself does not do anything with the file, it just calls your command directly. In texMate,py, we have a lot of code whose job is exactly to locate the root file, if any, and use that, and that's what the built in compilation command uses.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Feb 7, 2008, at 8:17 PM, Brad Miller wrote:
It sounds to me like you must have TM_LATEX_MASTER set in a project file or in .textmate_init in a project or something. The latex bundle does not set TM_LATEX_MASTER, it only uses the variable if its set. Are you sure it is always the previous master file?
Try typing this into a latex file and then pressing ctrl-r This will tell you what the environment variable is set to without running any latex commands. If it does not return a blank line then you need to hunt through your environment and see where it is set.
echo $TM_LATEX_MASTER
Brad
On Feb 7, 2008, at 7:06 PM, Geoff Vallis wrote:
You should add a line something like this:
DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH}
Then use ${DVIFILE%.tex}.dvi on the /path/dvisync...... command
That will depend on how and where you are setting TM_LATEX_MASTER. This variable is around only for backward compatibility with previous versions of the latex bundle. The preferred method for setting the master file is to put
%!TEX root = /path/to/root in your tex file. BUT that will not help you in your situation. I thought you said you were working with one giant file.
In fact I have files that are stand-alone, and others that sit under a root file. And I do use the %!TEX root method of setting the master file, not any other - it seems similar to what texshop and bbedit use.
I've tried using DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH} in my bundle, and it kind of works. But if I go from editing and latexing a collection of files which has a master file, to editing a stand-alone file, then textmate still tries to use the previous master file when dvi-syncing the stand-alone file, which obviously doesn't work. I can work around it with two bundles, or restarting textmate, but that seems very clunky.
But thanks for your input. I realize that there's not a whole lot of folk using xdvi with textmate.
Geoff
With help from Brad in setting the root file correctly, I finally got a working bundle for syncing with xdvi. It is very short, and I listed it below. It doesn't go through texMate.py. I do think that it would be nice eventually to incorporate xdvi syncing into texMate.py, but at least for now this does the trick. Note that syncing requires that latex be called with the option '-src' so that source specials are included.
Relatedly, would be be possible to create a command 'Typeset (DVI)' that is analogous to 'Typeset and View (PDF)', that calls the latex (dvi) engine (but not dvips), that goes through texMate.py, and that one can call with a keyboard shortcut without either changing one's latex preferences and without adding a special TS-program line at the top of the file?
Thanks to all for their comments.
Geoff
--------------------------
divsync bundle:
TM_LATEX_MASTER=`${TM_RUBY:-ruby} <<"RUBY" require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" require "#{ENV['TM_SUPPORT_PATH']}/lib/LaTeXUtils.rb"
master = LaTeX.master(ENV['TM_LATEX_MASTER'] || ENV['TM_FILEPATH']) puts master RUBY`
DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH}
/pathto/dvisync.sh $TM_LINE_NUMBER $TM_FILENAME ${DVIFILE%.tex}.dvi
---------------------------
dvisync.sh: (shell script)
#!/bin/tcsh /usr/texbin/xdvi -sourceposition $1$2 $3
---------------------------
On Feb 7, 2008, at 9:52 PM, Charilaos Skiadas wrote:
Geoff are you by any chance setting the TM_LATEX_MASTER variable under TextMate -> Preferences -> Advanced? Then TM will always use that. But perhaps I've missed some part of this conversation.
I don't use xdvi for the very simple reason that by this point in time I don't feel the need to look at the output, simply looking at the code tells me all I need to know about how the output is going to be like, for the most part. And usually I don't have X11 running.
I'm a bit confused though. Do you still go through texMate.py, calling the existing compile command, or do you use your own command (command \equiv bundle item)? If it's the latter, then I don't see how the %!TEX directive will work, unless you do something special in your command. TextMate by itself does not do anything with the file, it just calls your command directly. In texMate,py, we have a lot of code whose job is exactly to locate the root file, if any, and use that, and that's what the built in compilation command uses.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Feb 8, 2008, at 11:43 AM, Geoff Vallis wrote:
With help from Brad in setting the root file correctly, I finally got a working bundle for syncing with xdvi. It is very short, and I listed it below. It doesn't go through texMate.py. I do think that it would be nice eventually to incorporate xdvi syncing into texMate.py, but at least for now this does the trick. Note that syncing requires that latex be called with the option '-src' so that source specials are included.
Relatedly, would be be possible to create a command 'Typeset (DVI)' that is analogous to 'Typeset and View (PDF)', that calls the latex (dvi) engine (but not dvips), that goes through texMate.py, and that one can call with a keyboard shortcut without either changing one's latex preferences and without adding a special TS-program line at the top of the file?
I've put xdvi support on my todo list for a future texMate.py release. I think I would prefer to make texMate smart enough that if xdvi is the viewer the dvips step is skipped. That would keep all the other options and preferences intact without creating another shortcut.
My one concern about this path going forward is that latex itself seems more and more insistent on producing pdf output. I tried a couple of old documents yesterday and even using the -output- format=dvi option latex still created a pdf file for me.
Brad
Thanks to all for their comments.
Geoff
divsync bundle:
TM_LATEX_MASTER=`${TM_RUBY:-ruby} <<"RUBY" require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" require "#{ENV['TM_SUPPORT_PATH']}/lib/LaTeXUtils.rb"
master = LaTeX.master(ENV['TM_LATEX_MASTER'] || ENV['TM_FILEPATH']) puts master RUBY`
DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH}
/pathto/dvisync.sh $TM_LINE_NUMBER $TM_FILENAME ${DVIFILE%.tex}.dvi
dvisync.sh: (shell script)
#!/bin/tcsh /usr/texbin/xdvi -sourceposition $1$2 $3
On Feb 7, 2008, at 9:52 PM, Charilaos Skiadas wrote:
Geoff are you by any chance setting the TM_LATEX_MASTER variable under TextMate -> Preferences -> Advanced? Then TM will always use that. But perhaps I've missed some part of this conversation.
I don't use xdvi for the very simple reason that by this point in time I don't feel the need to look at the output, simply looking at the code tells me all I need to know about how the output is going to be like, for the most part. And usually I don't have X11 running.
I'm a bit confused though. Do you still go through texMate.py, calling the existing compile command, or do you use your own command (command \equiv bundle item)? If it's the latter, then I don't see how the %!TEX directive will work, unless you do something special in your command. TextMate by itself does not do anything with the file, it just calls your command directly. In texMate,py, we have a lot of code whose job is exactly to locate the root file, if any, and use that, and that's what the built in compilation command uses.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Feb 8, 2008, at 2:38 PM, Brad Miller wrote:
I've put xdvi support on my todo list for a future texMate.py release. I think I would prefer to make texMate smart enough that if xdvi is the viewer the dvips step is skipped. That would keep all the other options and preferences intact without creating another shortcut.
My one concern about this path going forward is that latex itself seems more and more insistent on producing pdf output. I tried a couple of old documents yesterday and even using the -output- format=dvi option latex still created a pdf file for me.
I agree that PDF is more common, and may be the way forward, at least on the Mac. However, xdvi is actually a nice piece of software.
But I'm surprised that you get pdf output when using 'latex'. Under texlive 2007, latex and pdflatex are both symbolic links to pdftex, and pdftex parses the calling command to decide whether a dvi or pdf file is produced, unless overruled by 'output-format'. In the past, a line at the top of the file like %pdflatex was sometimes used to indicate the format output, and it might be causing trouble if still there.
Geoff
On Feb 8, 2008, at 3:22 PM, Geoff Vallis wrote:
On Feb 8, 2008, at 2:38 PM, Brad Miller wrote:
I've put xdvi support on my todo list for a future texMate.py release. I think I would prefer to make texMate smart enough that if xdvi is the viewer the dvips step is skipped. That would keep all the other options and preferences intact without creating another shortcut.
My one concern about this path going forward is that latex itself seems more and more insistent on producing pdf output. I tried a couple of old documents yesterday and even using the -output- format=dvi option latex still created a pdf file for me.
I agree that PDF is more common, and may be the way forward, at least on the Mac. However, xdvi is actually a nice piece of software.
But I'm surprised that you get pdf output when using 'latex'. Under texlive 2007, latex and pdflatex are both symbolic links to pdftex, and pdftex parses the calling command to decide whether a dvi or pdf file is produced, unless overruled by 'output-format'. In the past, a line at the top of the file like %pdflatex was sometimes used to indicate the format output, and it might be causing trouble if still there.
Brad, to what extent would it be possible to have texMate.py be something that people can use as a library? I.e. you would, say, import it, and then you could do something like "get_master_filename ()" etc. So that custom commands could easily take advantage of what it can do. Or is this already possible?
Geoff
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Feb 8, 2008, at 8:58 PM, Charilaos Skiadas wrote:
On Feb 8, 2008, at 3:22 PM, Geoff Vallis wrote:
On Feb 8, 2008, at 2:38 PM, Brad Miller wrote:
I've put xdvi support on my todo list for a future texMate.py release. I think I would prefer to make texMate smart enough that if xdvi is the viewer the dvips step is skipped. That would keep all the other options and preferences intact without creating another shortcut.
My one concern about this path going forward is that latex itself seems more and more insistent on producing pdf output. I tried a couple of old documents yesterday and even using the -output- format=dvi option latex still created a pdf file for me.
I agree that PDF is more common, and may be the way forward, at least on the Mac. However, xdvi is actually a nice piece of software.
But I'm surprised that you get pdf output when using 'latex'. Under texlive 2007, latex and pdflatex are both symbolic links to pdftex, and pdftex parses the calling command to decide whether a dvi or pdf file is produced, unless overruled by 'output-format'. In the past, a line at the top of the file like %pdflatex was sometimes used to indicate the format output, and it might be causing trouble if still there.
Brad, to what extent would it be possible to have texMate.py be something that people can use as a library? I.e. you would, say, import it, and then you could do something like "get_master_filename()" etc. So that custom commands could easily take advantage of what it can do. Or is this already possible?
Haris,
My goal for texMate.py was to make a single python command that could be used in many different bundle commands. So we have:
texMate.py latex 1 texMate.py sync 1 texMate.py bibtex 1
etc. (yeah, the 1 is a hack to tell whether the script is run as a TM command or from one of the javascript buttons in the window)
At the time of the big rewrite I was more or less following the philosophy of the dialog and other TM utilities.
Of course it would certainly be possible to do some refactoring to achieve both. 1. A library of Python functions useful for working with LaTex 2. A simple texMate.py command that uses the library.
The benefit of moving this direction is that it would be simpler for others to add their own custom commands building on the library.
Brad
Geoff
Haris Skiadas Department of Mathematics and Computer Science Hanover College
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Brad Miller wrote:
The pdfsync commands rely on the applescript capability of the viewers like Skim. I don't think that is going to be possible with xdvi.
That, and the inclusion of the package pdfsync, so that the pdf contains pointers to the original lines. So I don't think you'll have much luck trying to get something like that to work with xdvi.
If the processing time of pdflatex is the issue for you, then I'd suggest you cut up your source file into pieces, and run it on the pieces.
In my experience Skim is pretty damn fast in updating pdfs.
Jeroen.
The pdfsync commands rely on the applescript capability of the viewers like Skim. I don't think that is going to be possible with xdvi.
That, and the inclusion of the package pdfsync, so that the pdf contains pointers to the original lines. So I don't think you'll have much luck trying to get something like that to work with xdvi.
No - two-way syncing does work properly with xdvi, and in fact did so for a long time before pdfsync. The required information is embedded in the dvi file, and, for example, both BBEdit and emacs are able to easily synchronize both ways with xdvi. You just need to call xdvi with the line number and file names as arguments (i.e., xdvi - sourceposition lineno$texfile $dvifile), and xdvi goes to the right page with a marker at the appropriate location. And if you set the 'XEDITOR' environment to 'mate -line %l %f' then clicking on xdvi takes you to the right line in TextMate.
If the processing time of pdflatex is the issue for you, then I'd suggest you cut up your source file into pieces, and run it on the pieces.
Thats a fair enough point. It is just that recently I've been working on a very long document that doesn't split conveniently into chunks less than 50 pages, more in places, and it needs to be repeatedly typeset because I make lots of errors when typing math equations (duh).
But perhaps more than that, it does seem that one _should_ be able to make syncing work between TextMate and xdvi, given TextMate's vaunted flexibility and power.... Perhaps someone can point me to the code that enables syncing from TextMate to Skim, and tell me what it means, and I can try to hack it to work with xdvi?
Geoff
On Feb 6, 2008 9:37 PM, Geoff Vallis gkv@princeton.edu wrote:
<snip>
But perhaps more than that, it does seem that one _should_ be able to make syncing work between TextMate and xdvi, given TextMate's vaunted flexibility and power.... Perhaps someone can point me to the code that enables syncing from TextMate to Skim, and tell me what it means, and I can try to hack it to work with xdvi?
The "Show in PDF Viewer"-command says "texMate.py sync 1" (you can see that in the Bundle Editor) and locate tells me that texMate.py is located in "/Applications/TextMate.app/Contents/SharedSupport/Bundles/Latex.tmbundle/Support/bin/texMate.py"
and a search in TextMate in that file says that the stuff you are searching for starts propably at line 109…
Niels
Geoff Vallis wrote:
Thats a fair enough point. It is just that recently I've been working on a very long document that doesn't split conveniently into chunks less than 50 pages, more in places, and it needs to be repeatedly typeset because I make lots of errors when typing math equations (duh).
In that case, why not try LaTeXiT ?
I ran across it last night, never really used it, but its description sounds like just the thing you need:
LaTeXiT is a little utility designed to quickly typeset LaTeX equations and drag'n drop them into other applications. Its included service also allows to type and transform equations directly in most text editors.
Jeroen.
Forgot to paste the URL: http://ktd.club.fr/programmation/latexit_en.php
Jeroen van der Ham wrote:
Geoff Vallis wrote:
Thats a fair enough point. It is just that recently I've been working on a very long document that doesn't split conveniently into chunks less than 50 pages, more in places, and it needs to be repeatedly typeset because I make lots of errors when typing math equations (duh).
In that case, why not try LaTeXiT ?
I ran across it last night, never really used it, but its description sounds like just the thing you need:
LaTeXiT is a little utility designed to quickly typeset LaTeX equations and drag'n drop them into other applications. Its included service also allows to type and transform equations directly in most text editors.
Jeroen.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Jeroen,
LaTeXiT is great, and I use it a lot, mainly in order to import LaTeX equations into keynote presentations, which I think is what it was originally designed for. I guess you could go back and forth between LaTeXit and TextMate to check formatting etc. I'll give it a try, although it seems a bit awkward. Also, unfortunately, LaTeXit does not currently work properly with Leopard (a known issue).
Geoff
On Feb 7, 2008, at 6:59 AM, Jeroen van der Ham wrote:
Geoff Vallis wrote:
Thats a fair enough point. It is just that recently I've been working on a very long document that doesn't split conveniently into chunks less than 50 pages, more in places, and it needs to be repeatedly typeset because I make lots of errors when typing math equations (duh).
In that case, why not try LaTeXiT ?
I ran across it last night, never really used it, but its description sounds like just the thing you need:
LaTeXiT is a little utility designed to quickly typeset LaTeX equations and drag'n drop them into other applications. Its included service also allows to type and transform equations directly in most text editors.
Jeroen.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate