HI,
i'm running into a little problem with leopard.
The last update finds my "time machine" backups and tries to move /
update that one.
11/18/07 10:36:08 PM [0x0-0x2dd2dd].com.macromates.textmate[5399] mv:
rename /Volumes/TimeMachine/Backups.backupdb/username/
2007-08-30-201019/Macintosh HD/Applications/TextMate.app to /Volumes/
TimeMachine/Backups.backupdb/username/2007-08-30-201019/Macintosh HD/
Applications/TextMate.old.app: Operation not permitted
Luckily it fails .. but is it an apple issue or is it textmate ?
Regards J.
I'm trying to build a complicated macro to add a footnote to text selected in
a document. There are two values that I need to maintain while the macro
runs, so that those values can be inserted into the proper places within the
links that the macro creates. The values are CURRENT_FN_NUMBER, a unique id
I create with the shell date command; and CURRENT_FN_TITLE, which is the
value of $TM_SELECTED_TEXT when the macro launches.
I'd like to us those values to insert code into the document, e.g.
At the beginning of the current paragraph:
Replace selected text with: #fn{$CURRENT_FN_NUMBER} $CURRENT_FN_TITLE
At bottom of document, just before "<!--<next footnote -->":
#{CURRENT_FN_NUMBER} $CURRENT_FN_TITLE
There's more to it than that, but you get the idea. The macro does a lot of
jumping around within the document, setting and removing bookmarks as it
goes.
I've set CURRENT_FN_NUMBER and CURRENT_FN_TITLE as project environmental
variables, but I can't figure out how to set values for those variables when
the macro executes.
I'm (obviously) new at this game; I'd appreciate help.
Thanks.
Richard
--
View this message in context: http://www.nabble.com/Set-temporary-variables-within-macro-tf4837937.html#a…
Sent from the textmate users mailing list archive at Nabble.com.
I'm trying to build a complicated macro to add a footnote to text selected in
a document. There are two values that I need to maintain while the macro
runs, so that those values can be inserted into the proper places within the
links that the macro creates. The values are CURRENT_FN_NUMBER, a unique id
I create with the shell date command; and CURRENT_FN_TITLE, which is the
value of $TM_SELECTED_TEXT when the macro launches.
I'd like to us those values to insert code into the document, e.g.
* At the beginning of the current paragraph: <a
name="{$CURRENT_FN_NUMBER}"></a>
* Replace selected text with: <a
href="#fn{$CURRENT_FN_NUMBER}">$CURRENT_FN_TITLE</a>
* At bottom of document, just before "<!--<next footnote -->": <a
name="fn{$CURRENT_FN_NUMBER}"
href="#{$CURRENT_FN_NUMBER}">$CURRENT_FN_TITLE</a>
There's more to it than that (setting div and span tags, adding class
attributes, etc.), but you get the idea. The macro does a lot of jumping
around within the document, setting and removing bookmarks as it goes.
I've created CURRENT_FN_NUMBER and CURRENT_FN_TITLE as project environmental
variables, but I can't figure out how to set values for those variables when
the macro executes.
I'm (obviously) new at this game; I'd appreciate help.
Thanks.
Richard
--
View this message in context: http://www.nabble.com/Set-temporary-variables-within-macro-tf4838075.html#a…
Sent from the textmate users mailing list archive at Nabble.com.
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