01.24.06

TextMate LaTeX Screencast no 3

Posted in TextMate, LaTeX at 9:33 pm by Haris

No 3 is here! It’s short (3 minutes), small (10MB), sound is good (you can hear me), and it introduces the new commands for greek letters, other symbols and inline label and bibliography completion. Enjoy and, as always, leave me your comments.

Previous Screencasts: No 2 and No 1.

Update: This post clears the problems with syncing with TeXniscope in Intel macs that people have been having. Later

30 Comments »

  1. Abizer said,

    January 25, 2006 at 4:47 pm

    Short and sweet good sound through my earphones.

    Nice to see you correcting it as you went along.

    Have you thought about using a different TextMate theme when screencasting? I find the translucency distracting. Just a personal observation, not sure if anyone else is bothered about it.

  2. Haris said,

    January 25, 2006 at 5:09 pm

    Have you thought about using a different TextMate theme when screencasting? I find the translucency distracting. Just a personal observation, not sure if anyone else is bothered about it.

    Good point, never thought about it. I could just turn the translucency off for the screencasts. I find it very useful to be able to see what’s below, especially when typing code from some online tutorial or something. I particularly like the colors in this theme. Maybe I’ll experiment in future themes.

  3. Nathan Nutter said,

    April 6, 2006 at 9:00 am

    I was happy to see you did more than one. Just found them today.

  4. Nitin Madnani said,

    April 30, 2006 at 7:37 am

    Fantastic Screencast !!

    However, I can’t seem to do the -> to \rightarrow completion using Cmd+Opt+A. Is that the right shortcut ?

    Thanks !

  5. Haris said,

    April 30, 2006 at 7:46 am

    @Nitin,

    thanks! Actually, the shortcut is now Ctrl-Shift-S, and it requires a space before the ->, but otherwise it should work.

    Of course, you can change the shortcut, the command is a macro called: “Convert ASCII symbol to LaTeX Command”.

  6. Paul said,

    May 11, 2006 at 6:19 am

    Dear Haris,
    thanks very much for your very enlightning screencasts: being a long-time TeXShop-user, but a short-time TextMate-html-afficionado I may finally consider switching to TM for all things LaTeX as well. Although, I have to say, I think TeXShop is a very fine TeX-application, and that includes the TeX-editor (when you have made youself comfortable with macros and stuff). The support of pdfsync with TeXniscope let TM win some ground with regard to syncing source and pdf, but TeXShop meanwhile improved its syncing even further, so TM is still somewhat trailing.
    Still, the “Insert Based on …”-stuff could be something seductive. But what I like very much about TexShop is its being based on OS X’ standard text-editing environment, providing therefore rulers and stuff (I like to have white margins within the editing window, and I like non-fixed-width fonts …; TeXShop-drawn text is just a pleasure to look at: I know that’s not very geeky, but I love clear visuals).

    Sorry, I digress. The real point of this comment is that with LaTeX-screencast number three you changed the format to H.264. The problem is that older (I admit, quite old Macs like G3’s) just cant play H.264 smoothly, without frame-dropping. So I understand that the quality of H.264 is much higher and beautiful and whatnot. But you may want to consider the trade-off between providing most of the people with a higher viewing pleasure and leaving some (very few) in the dust. I mean, I couldnt complain about the quality of the first two screencasts anyway, so this point might be up to consideration.
    Thanks, and sorry for being that long.
    -Paul

  7. Danstan said,

    May 31, 2006 at 2:24 pm

    Hi Haris,
    Thanks for your screencasts that have led me to trying Textmate for latex. I am using iTexMac which is really quite good & powerful but is currently in a major transition to version 2.The appeal of textmate for me would be the ability to run several other applications (eg R from within one editor) - I currently use AlphaX (again quite customizable).

    I am having trouble getting the forward sync from TM to texniscope to work at all (the ^-ALT-CMD-O moves you to the pdf but that is it…). The otherway Texniscope to TM works with the suggestions that you gave in an earlier screencast. Any ideas? (I am running 10.4.6 on a 1st gen G4 PB) .. Thanks in advance Danstan

  8. Haris said,

    May 31, 2006 at 6:45 pm

    @Paul,

    I don’t really remember what was going on in my mind when I was making the screencasts, but I think a main motivation was the size of the files. I think H.264 tends to produce smaller files, so it is lighter on the Dreamhost server I am sharing with two other people. :)

    I’ll keep your comments in mind when I make more screencasts.

    I agree TeXShop is a pretty descent LaTeX editor, and I have used it myself a fair bit, though at some point I switched to iTeXMac. But I don’t find TeXShop nearly as easily and as much customizable as TextMate. Plus, it is just a LaTeX editor, while I use TextMate for a number of different things.

  9. Haris said,

    May 31, 2006 at 6:48 pm

    @Danstan,

    Hi, I don’t really have many suggestions, but one thing you can try for starters is open Console.app and see if there are any entries in the logs from either TeXniscope or TextMate that might be relevant. The other thing would be to try with larger files, and of course to also try with files without spaces anywhere in their filename/filepath.

    If you are still having trouble, send me your file and I will have a look.

  10. Danstan said,

    June 1, 2006 at 10:44 pm

    Thanks Haris,

    I found out what the problem was…. Apparrently the in the Bundles editor for “Find in Texniscope” I had to make the path explicit as below:

    # Note  I made the path explicit below
    # from "$Tspath"  to the  /Users/danstanbagenda/Applications/TeXniscope
    
    /Users/danstanbagenda/Applications/TeXniscope/TeXniscope.app/Contents/Resources/forward-search.sh "$TM_LINE_NUMBER" "$TM_FILEPATH" `echo $FILE | perl -e 'while(<>){s/.tex$/.pdf/;print;}' | xargs` ; open -a TeXniscope
    

    Note also that I had tried to change the export command & leave the above to the default as below & this did NOT work…

    export Tspath=${TM_TSCOPE:=/Users/danstanbagenda/Applications/TeXniscope}
    
    "$Tspath"/TeXniscope/TeXniscope.app/Contents/Resources/forward-search.sh "$TM_LINE_NUMBER" "$TM_FILEPATH" `echo $FILE | perl -e 'while(<>){s/.tex$/.pdf/;print;}' | xargs` ; open -a TeXniscope
    

    I hope this is helpful for anyone else that may have similar problems..

    Thanks again for your work on Textmate latex bundle

  11. Danstan said,

    June 1, 2006 at 11:15 pm

    Hello Haris again,

    I have another problem.

    When I do the \cite{{} and Option-esc I get the dialogue with the choices in my bibtex file as illustrated in your screencast. However, when I select the one I want & enter the my \cite{} is filled with the stuff below (the name of the reference is actually the last part “Covaad”):

    cite{/Users/danstanbagenda/Applications/Textmate/TextMate.app/Contents/SharedSupport/Support/bin/LatexCitekeys.rb:51: warning: Insecure world writable dir /Users/danstanbagenda/Applications/Textmate, mode 040777
    /Users/danstanbagenda/Applications/Textmate/TextMate.app/Contents/SharedSupport/Support/bin/LatexCitekeys.rb:51: warning: Insecure world writable dir /Users/danstanbagenda/Applications/Textmate, mode 040777
    Coovad}
    

    I should note that the bibdesk part works fine as adverstised.

    My “bibliography completion” looks as below (the default:)

    if [[ -z $TM_SELECTED_TEXT ]]
       then
    # If the cursor is inside empty braces {}, then offer
    # a list of all bibliography items. In that case,
    # the variable $phrase is not being set.
        prev_ch=${TM_CURRENT_LINE:$TM_LINE_INDEX-1:1}
        if [[ $prev_ch != '{' ]]
            then phrase=$TM_CURRENT_WORD
        fi
       else phrase=$TM_SELECTED_TEXT
    fi
    if [[ -z $phrase ]]
        then res=`"$TM_SUPPORT_PATH/bin"/LatexCitekeys.rb -full=true $TM_LATEX_BIB $TM_LATEX_MASTER $TM_FILEPATH`
        else res=`"$TM_SUPPORT_PATH/bin"/LatexCitekeys.rb -full=true -p=$phrase $TM_LATEX_BIB $TM_LATEX_MASTER $TM_FILEPATH`
    fi
    if [[ -z $res ]]
    then
        exit_discard
    else
    # NEED TO ADD HANDLING OF PRESSING "Cancel"
    res=`sed <<<$res -e $'s/,//g'`
    result=$(eval CocoaDialog dropdown 
      --title 'Bibliography completion' 
      --text 'Choose cite key for completion' 
      --button1 Ok --button2 Cancel 
      --string-output --no-newline 
      --items "$res")
    fi
    if [[ ${result:0:2} != Ok ]]
    then
        exit_discard
    else
        result=${result:3}
        echo -n ${result/ %*/}
    fi
    

    Thanks again for turning me to Textmate for my latex projects. As noted earlier I have been using itexmac for a couple of years I like the features you are bringing to this since my workflow seems quite similar to yours.

    danstan

  12. Haris said,

    June 2, 2006 at 8:03 am

    @danstan

    please drop an email to the textmate users mailing list about the bibliography completion problem you are having. I think it is related to the permissions of the directory …/Applications/Textmate
    It seems this directory is set to be “world writable” and ruby doesn’t like that. To be more precise, the completion script needs to execute another program, and ruby puts up this warning for call to a system command if the current search path includes a world writable directory. There are a lot of people in the list more knowledgeable about such issues than I, so it will be easier to solve with feedback from more people.

    I wonder if your Texniscope problems have similar origins as well. Try moving the applications TextMate and Texniscope out of the subdirectories with the same names, and make them live directly under Applications, and see if perhaps things work out then.

  13. Danstan said,

    June 2, 2006 at 1:48 pm

    Haris,

    Thanks again, I moved Textmate directly under Applications & viola! \cite{} bibtex completion now works as advertised so I guess you have the right diagnosis…

    Thanks again

    Being a grad student writing my PhD diss & knowing how time intense that is, I am really appreciative when another grad student takes the time to not only do a screencast but also responds to questions & share their knowledge, bundles etc…..

    We tend to aknowledge many loved ones before the prefaces of our dissertations & normally its “small” things like these that enable one to be highly productivie & to complete their work without losing sanity…

    cheers!

    danstan

  14. Haris said,

    June 2, 2006 at 10:06 pm

    Haris,

    Thanks again, I moved Textmate directly under Applications & viola! \cite{} bibtex completion now works as advertised so I guess you have the right diagnosis…

    Ah, excellent! If you don’t mind, could you check to see if doing the same thing with Texniscope would make the original version of the sync script work?

    I suspect it has to do with the permissions on those directories new directories you created. If you run ls -la from the command line in that directory, what are the permissions you see on those directories?

    Thanks again

    Being a grad student writing my PhD diss & knowing how time intense that is, I am really appreciative when another grad student takes the time to not only do a screencast but also responds to questions & share their knowledge, bundles etc…..

    You are most welcome. It actually offers me a great distraction from my work, and I just can’t stay away from the TextMate community. I have already minimized my activities. Only one-two more months of thesis work left….

    Best of luck to you too!

  15. Danstan said,

    June 2, 2006 at 11:34 pm

    Haris,

    As suggested by you I have also moved TeXniscope to /Applications & switched everything back to trhe default &, indeed, this time both the forward & background syncs worked without my tinkering with the defaults..

    The permissions in the directory I had TeXnisope in was :

    [Danstan-Bagendas-Computer:~/Applications/TeXniscope] danstanb% ls -la total 16
    drwxr-xr-x 4 danstanb staff 136 Jun 3 02:25 .
    drwxr-xr-x 114 danstanb staff 3876 May 31 03:50 ..
    -rw-r–r– 1 danstanb staff 6148 Jun 3 02:25 .DS_Store
    drwxr-xr-x 3 danstanb staff 102 Dec 17 2004 TeXniscope.app

    I hope this helps…

    best!

    danstan

  16. Haris said,

    June 3, 2006 at 2:47 am

    Thanks. It is a bit peculiar why the message was there then. Not important since it works fine now I guess, but I’d like to know why ruby was complaining about a “world-writable” directory. It seems to me that your directories were fine. Maybe I’ll do some local checks here and see if I can reproduce it.

    Best
    Haris

  17. Danstan said,

    June 8, 2006 at 12:36 pm

    Might be useful to you that when I try to run the ruby commands shown in the maths column screencasts I get the following error for example

    Ruby -rDate -e “puts Date::DAYNAMES”
    SyntaxError

    However, copying & pasting the same command to the terminal works well..

    On the other hand, in textmate the following works

    3.times {puts rand}
    0.975134850014001
    0.153431825572625
    0.712822897359729
    3

    As does the \cite{} bibliolgraphy & bibdesk illustration in your screencast…

    I am not sure what to make of this…

    danstan

  18. teka said,

    June 14, 2006 at 8:17 pm

    Haris,

    Thanks for the thoughtful and well articulated screencasts. Your future students will be very lucky to have you explain ideas to them.

    Given all the recent updates to TexShop–do you know if TexShop now enables synching with external editors (in particular textmate)?

    I’d prefer to use TexShop instead of Texniscope because it looks like it is being actively developed.

  19. Haris said,

    June 14, 2006 at 11:57 pm

    @teka

    I just tried the latest beta of TeXShop, and it doesn’t seem to do the desired syncing with external editors. But given that the source code has radically changed, it might now be easier to implement such a feature. But you’ll have to ask the TeXShop team.

  20. Danstan said,

    June 16, 2006 at 3:45 pm

    Hi Haris,

    I posted this in the textmate mail list but have not recieved any response. I wonder if you would have any ideas.. Since the last communication I have moved from a powerbook to a macbook & tried to get myself running again but I am having some problems… the major one is that TeXnisope is failing to auto open the pdf file my textmate response is as follows:

    Output written on ethics_new.pdf (11 pages, 150192 bytes).

    ethics_new.log

    Found 0 errors, and 16 warnings in 0 runs
    2006-06-16 04:26:54.611 open[4049] Couldn’t open file: /Users/Xolani/Documents/ethics_new.pdf

    The pdf file is created but cannot open. However, I can open the file at the terminal with

    open -a TeXniscope ethics_new.pdf

    Any help or thoughts would be greatly apprecciated..

    danstan

  21. Haris said,

    June 16, 2006 at 6:41 pm

    Hi Danstan,

    I saw your post on the mailing list, but unfortunately I don’t really have any ideas. The only thing I can think of is that Texniscope, being not universal, needs to run under Rosetta, and somewhere that affects things, but I’m afraid I don’t know much about such issues.

    I would suggest also trying with the other previewers, like Preview.app, TexShop etc.
    I would also contact the author of Texniscope, as he might have some more suggestions for you.

    Btw, are there any messages related to this in Console.app?

  22. Danstan said,

    June 17, 2006 at 9:40 pm

    Thanks Haris,

    One thing I had forgotten was the adjustments in the texniscope preferences that you note in your screencast. This has helped a bit. Now syncing from pdf to source seems to work (VERY INACCURATELY - quite haphazard - though). And syncing from triggering syncing from source to pdf leads to the Texniscope icon bouncing & a dialgoue box with the message that “the specfied pdf file could note be opened” clickiing the OK buttoen of this dialogue box leads though to an attempt to find the line in the pdf (again a seemingly Haphazard attempt even givens the
    green sync ball ).

    At this point the console.app gives a message similar to below:

    2006-06-18 00:36:01.014 TeXniscope[1570] forward search : /Users/Xolani/Documents/Ethics/ethics_nKass.tex line: 155
    2006-06-18 00:36:01.015 TeXniscope[1570] found candidate at page:3 point:{72.2711, 592.825}

    I also tried using a (unsupported beta) “intel” texniscope that I found at

    http://www.akropolix.net/rik0/blogs/2006/04/10/texniscope-intel/#comments

    What is frustrating is that the combination works almost perfectly on the powerbook (the syncs are even accurate within a line or two).

    The reason that this textmate combination would be great is that I also use the R & sweave bundles in my thesis work & it helps to have all the work being done in one editor.

    I will see if a note to the Texniscope author will help.

    Also, while I can get the built in viewer & texshop & preview to work, they do not seem to be able to sync at all.

    Thanks again for at least getting back to me. In case I get a solution, I will let you know.

    danstan

  23. mdadm said,

    June 22, 2006 at 11:23 am

    @danstan

    I am having the same problems you are (pdfsync’in inaccurately and the ‘can not open’ message for the .pdf file). A bit frustrated on this end too. Also on a macbook. Did you find a solution?

    mdadm

  24. mdadm said,

    June 22, 2006 at 1:43 pm

    Haris and danstan,

    This problem also surfaces if you just use an article template from textmate (name it help.tex) and:
    * populate it with a little information
    * add the pdfsync package and
    * compile.

    When you try to forward search (textmate->texniscope) the message given by texniscope is that it can not open the file.
    Note that texniscope is giving the msg.

    If you load the pdf file (help.pdf) manually and
    ’show sync marks’ you will also note that the sync marks are in very strange places..

    Lastly if you look under the textmate hood and see what command is being processed when you do a forward search you see it is along the lines:

    /Applications/TeXniscope.app/Contents/Resources/forward-search.sh 200 help.tex help.pdf

    (200 here is a random line number).

    This command also gives the same error message (can not open .pdf file). However, sometimes when the pdf file is open already it jumps to some spot in that file (although that spot is incorrect).

    few things i have noticed that may help figure things out..hopefully?:)

    could be that this setup just doesnt work for intel macs..the problem being with texniscope and the .pdfsync file being built incorrectly?

    if

  25. Haris said,

    June 22, 2006 at 3:01 pm

    @mdadm

    slightly off topic, but please provide an email address when you post a comment. Otherwise your post is held for moderation.

  26. Haris said,

    June 22, 2006 at 5:48 pm

    @Danstan,

    I just commited a patch by mdadm for the “Find in Texniscope” command, so it should now work slightly better. Don’t know about the syncing yet though.

  27. After thought » TeXniscope, TextMate and pdfsync in the Intel Macs said,

    June 22, 2006 at 10:58 pm

    […] This is just a quick entry to reference to clear the problems with the syncing between TextMate and Texniscope on the Intel Macs, that were discussed in the comments to this pos. You will need: […]

  28. Journal "Anwendungen & Windows" #2 - Apfeltalk said,

    March 27, 2007 at 2:49 am

    […] permalink Podcast skiadas der Dev des LaTeX Bundles hat übrigens schon seinen dritte Screencast erstellt. Der ist dort (also im Vlog) noch nicht erhältlich. Aber hier __________________ Zettt (Live, Reason, Logic, TextMate) zBlog, zettt.deLieber freiberuflich als gar kein Job! […]

  29. skislarry said,

    November 30, 2007 at 5:33 am

    Excellent forum with fantastic references and reading…. well done indeed…
    http://srubibablo.com
    I just wanted to pass on a note to let you know what a great job you have done with this forum.Thanks!

  30. a11en said,

    January 13, 2008 at 9:39 pm

    Hi Harris,

    I encountered something interesting- I’m a die-hard BibDesk user, and have to admit I loved it’s autocompletion ability. Anyhoo… I was extremely sad when Textmate didn’t play nice with Bibdesk for autocompletion. [Crestfallen]

    But, I played around with my bib files etc., and found out that for some reason TextMate’s latex bundle doesn’t like to play with softlink files. Which I found quite strange, because tetex and bibtex have no problem playing with softlink files. [ln -s]. I was only able to turn on TextMate’s autocompletion for bib items by copying my full .bib bibliography over to the folder for the project. [I originally had softlinks instead to safe space and effort in updating.]

    Do you know if there’s a way to make it play nice with softlinks? [Is it Ruby that’s causing the trouble, and if so, is there a way to make it less of a hypochondriac?]

    Cheers!
    -Allen

Leave a Comment