I updated to the latest bundle, and I noticed that the texMate.py
script has problems if included files aren't in the same directory as
the main file. Here is my quick and dirty patch, which should be
factored out into a separate function before it gets committed.
I can do this in a few weeks if there's interest.
^L
Index: texMate.py
===================================================================
--- texMate.py (revision 8473)
+++ texMate.py (working copy)
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# encoding: utf-8
+# Fixes by Louis Theran to respect TEXINPUTS
+
# This is a rewrite of latexErrWarn.py
# Goals:
# 1. Modularize the processing of a latex run to better capture
and parse errors
@@ -191,11 +193,14 @@
"""Find all packages included by the master file.
or any file included from the master. We should not have to go
more than one level deep for preamble stuff.
+
+ FIXUP --- Use kpsewhich to find files
"""
try:
- texString = open(fileName).read()
+ realfn = os.popen('kpsewhich -progname=%s %s' % ('pdflatex',
fileName)).read().strip()
+ texString = open(realfn).read()
except:
- print '<p class="error">Error: Could not open %s to check for
packages</p>' % fileName
+ print '<p class="error">Error: Could not open %s to check for
packages</p>' % realfn
print '<p class="error">This is most likely a problem with
TM_LATEX_MASTER</p>'
sys.exit(1)
incFiles = [x[3] for x in re.findall(r'((^|\n)[^%]*?)(\\input|\
\include)\{([\w /\.\-]+)\}',texString)]
@@ -204,7 +209,8 @@
if ifile.find('.tex') < 0:
ifile += '.tex'
try:
- myList += [x[3] for x in re.findall(r'((^|\n)[^%]*?)\
\usepackage(\[[\w, \-]+\])?\{([\w,\-]+)\}',open(ifile).read()) ]
+ realif = os.popen('kpsewhich -progname=%s %s' %
('pdflatex', fileName)).read().strip()
+ myList += [x[3] for x in re.findall(r'((^|\n)[^%]*?)\
\usepackage(\[[\w, \-]+\])?\{([\w,\-]+)\}',open(realif).read()) ]
except:
print '<p class="warning">Warning: Could not open %s to
check for packages</p>' % ifile
newList = []
Hello all,
I use TextMate to create PDFs with LaTeX. I've configured TextMate to
use pdflatex as the compile engine (TM_LATEX_COMPILER=pdflatex and the
default engine in the LaTeX preferences is pdflatex too). That works
fine.
Today I had to use for some reason the package epsfig and TextMate ran
everytime latex instead of pdflatex. Finally I forced the use of
pdflatex with the "%!TEX TS-program = pdflatex" directive in the tex
file.
Is there an explanation for that behaviour and maybe a solution for
that? (I found 3 postings here which are somehow related to that
problem, but because I'm not an expert, I didn't get the clue, which
might be in there.)
Thanks for your attention
Juergen
--
Juergen Arndt
So I'm working on writing up my (mathematical logic) thesis and I've
been using textmate to do it. Unfortunately I've ran into some
serious usability issues with the latex bundle in textmate and
unsurprisingly have been wasting time trying to fix them. I figured
I would post the issues to this list along with some of the hacks
that seem to help for me and see if people who know more about the
textmate stuff can help make this bundle more useable for intense
mathematics.
First of all I'm attaching a simple patch for PyTeXdoc.py so it
queries kpsewhich to look for included/inputed files if it fails to
find them. Since I keep some general purpose includes in my tex
directory this makes a difference.
Note that this is patched from the tree updated earlier today.
Now for some harder issues that I can only gesture at solving.
Useability Issues:
1) Typing commands inside $$ causes wacky highlighting flip-flops.
Often I will be editing an existing tex file and need to add
something like $\Gamma_{\alpha+1}(\sigma)\concat\tau$. This causes
issues since you have to pass through $$ $\$, $\Gamma_{\}$ and $
\Gamma_{\alpha+1}(\sigma)\concat\$ on the way each of which flips the
syntax highlighting for the ENTIRE rest of the document. Not only is
this annoying it causes unacceptable slowdowns as the rest of the doc
is rehighlighted.
My personal collection of hacks to deal with this problem is as
follows (some of these are old so i apologize if it was fixed in the
bundle and I missed it):
a) Elimate the $$ $$ notation for display math. It is considered
bad form to use the old $$ $$ approach rather than the new \[ \]
notation. I realize doing something like this would be controversial
in the default language grammar but I'd rather have the right way of
doing things be useable rather than correctly hightlighting the wrong
way. But maybe there is another way to deal with the issue.
b) Require $ to be escaped as {\$}. Once again not a good general
solution but for me this works since I rarely use a real dolsign.
Perhaps a better trick would be to require this weird special
escaping only when in math mode. Once again I'm puzzled about how to
do this correctly but as it stands it causes serious problems.
c) I used to have problems with $\Gamma_{\}$ letting the braces spill
over but it is either fixed now I or I changed something locally I
don't remember.
2) Typing { when the caret is before a slash causes smart typing
pairs to insert {\} instead of {} because it thinks we are trying to
escape the {. This can be fixed by changing the match for
constant.character.escape.tex to start with a positive backref of (?<=
\\) instead of just (\\). It seems weird to me that having a caret
in front of the string causes it to be grabbed but go figure.
3) Often I need to insert math inside an already written paragraph.
So I start with a line like
If $x$ is a blah then blah2
and need to fix it to
If $x$ is a blah and $math stuff$ then blah2
which one naturally does by simply putting the caret in front of the
t in then and starting to type. Unfortunately the smart typing pairs
for $ fail to activate when you are in front of a character. I have
no idea why this is (seems to work for {) but the best fix I could
come up with was a hack to define meta.in-front-of-char.latex and
create a snippet for this situation assigning it to $. If I knew how
to insert true smart typing pairs from a snippet (or command) a
general purpose solution that works could be found.
On the other hand probably anyone who knows textmate well enough will
see how to do this in an elegant fashion.
4) SPEED
This is a big one. Frequently I will type a long paragraph filled
with many many math commands and my powerbook G4 1Ghz will slow
enough to make typing difficult if I am inserting anything inside the
paragraph. If I actually hard wrap the lines this stops happening
but since textmate doesn't support hard wrapping well this isn't
really an option.
I noticed in the language definition there are many syntax elements
(like meta.function.embedded.java.latex) whose matches begin with
something like: (?:\s*)((\\)begin) ..... I can't figure out what
sense this makes at all. Why match the spaces if they can just
happen anywhere in the line? Maybe I am just missing something
obvious and I'm deluding myself but when I changed these all to (?:^
\s*)((\\)begin) .... everything seemed to keep working and things
seemed to speed up considerably. Then again maybe it was an
unrelated bundle update.
Still before I keep screwing with this I figured I would toss this
out there and see if it was a well known problem.
------------------
Sorry to describe the changes I made rather than giving a bunch of
patches but the normal bundle development model just won't work for
me. I change a bunch of stuff for my personal use (like some of the
hacks above) so I need to keep the ~/Library/Application Support/
Textmate directory for my own personal modifications. If someone
could tell me an easy way to produce a diff of the changes I've made
here with the actual bundle maybe I could be more helpful.
Anyway thanks to the author(s) of the latex bundle for all the work
they've put in so far. Hopefully this was helpful an not just
useless bitching.
Peter
When was creating a new file from template I got a dialog where I
could set the filename.
Then strange things happened ... and now I just get automatically
created a new file called untitled each time I want to create a new
file.
How can I enforce the dialog ?
(changing [Preferences >> General >> Untitled Documents] doesn't seem
to affect this.)
regards
--
Roberto Saccon
http://rsaccon.com
I just wrote my first TextMate custom command, for compiling erlang
source code and showing hyperlinked errors (if there are any) in a
HTML popup.
More information, download and screencast at:
http://www.rsaccon.com/2007/11/easy-erlang-compiling-with-textmate.html
As scripting language for the command I am using Erlang escript.
regards
--
Roberto Saccon
http://rsaccon.com
I am having trouble using the subversion bundle in textmate after my
upgrade to leopard. I did a clean install of leopard and TM, and
haven't added any bundles, just using the default configuration.
Here are the troubles I am seeing, is anyone else having this issue /
know how to fix it?
when I try to commit a file i get this error:
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
Permission denied (publickey,password,keyboard-interactive).
svn: Commit failed (details follow):
svn: Connection closed unexpectedly
I have seen some stuff on ssh-askpass, but it looked like this was
supposed to pop up a window for me to type my password in? that didn't
happen...
when i try to "blame":
NoMethodError
reason: undefined method `+' for nil:NilClass
trace:
/Applications/TextMate.app/Contents/SharedSupport/Bundles/
Subversion.tmbundle/Support/format_blame.rb:49
/Applications/TextMate.app/Contents/SharedSupport/Bundles/
Subversion.tmbundle/Support/format_blame.rb:43:in `each_line'
/Applications/TextMate.app/Contents/SharedSupport/Bundles/
Subversion.tmbundle/Support/format_blame.rb:43
when i try to "log":
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/rexml/source.rb:226:in `pos': Illegal seek (Errno::ESPIPE) from /
System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/
rexml/source.rb:226:in `current_line' from /System/Library/Frameworks/
Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parseexception.rb:
44:in `line' from /System/Library/Frameworks/Ruby.framework/Versions/
1.8/usr/lib/ruby/1.8/rexml/parseexception.rb:28:in `to_s' from /
Applications/TextMate.app/Contents/SharedSupport/Support/lib/escape.rb:
30:in `htmlize' from /Applications/TextMate.app/Contents/SharedSupport/
Bundles/Subversion.tmbundle/Support/svn_helper.rb:90:in
`handle_default_exceptions' from /Applications/TextMate.app/Contents/
SharedSupport/Bundles/Subversion.tmbundle/Support/format_log_xml.rb:171
REXML::ParseException
There are some things that work, like "status", "info", but it's
pretty much unusable if I can't get it to commit... Anyone have any
ideas?
-Josh
I have a very simple command
names=( $TM_SELECTED_TEXT )
for name in ${names[@]}
do
touch $TM_DIRECTORY/$name.php
done
basically you select a list of text
about
policies
hours
contact_us
and it generates a php page for each item in the current directory -
it does that well enough, what would be truly excellent (and I think
this is easy) is to gather all those pages into a scratch project - I
actually have a laundry list of things I'd like it to do (all likely
pretty easy IMHO) but I really don't want to seem greedy - I
appreciate the effort everyone on this list puts out on a daily basis..
saul - visualchutzpah.com
hi there
I am a TextMate user in a primarily Vim development shop writing php
and html. Vim does this thing where it adds a new line to the end of
any files it saves. Here is an example, foo.txt was made with Vim,
foo2.txt was made the TextMate.
Desktop jachin$ vi foo.txt
Desktop jachin$ mate foo2.txt
Desktop jachin$ hexdump foo.txt
0000000 66 6f 6f 0a
0000004
Desktop jachin$ hexdump foo2.txt
0000000 66 6f 6f
0000003
Where this cases a problem is with subversion. We are starting to see
a lot of svn diffs with:
No newline at end of file
Files are showing up as modified that, for all practical purposes, are not.
One solution would be to just have all the Vim developers to :set
noeol, but Vim is the standard text editor here and all other text
editors must conform.
I was hoping TextMate would have a preference setting under "Text
Editing" or "Advanced"->"Saving".
Also one more wrinkle, sometimes, even the "Vimers", do not want that
final line break (in the case of some html files), so a perfect
solution would allow us to set this behavior on a file type basis.
Is there a way to hook into the save command through a bundle?
Are there any other ideas any one has for a solution?
Thanks
-jachin