Use worksheet with LaTeX

939 views
Skip to first unread message

Marek Stepanek

unread,
Oct 7, 2011, 3:07:34 PM10/7/11
to bbe...@googlegroups.com


Hello all!


I am wondering, how to use a worksheet in BBEdit. I never used a
worksheet and probably I misunderstood it. Could somebody help me to use
it with LaTeX?

When using BBEdit for LaTeX, I am switching to the Terminal, to do the
following commands:

pdflatex file
open file.pdf

and some others.

This is pretty fast, using the history (arrow key up). I am wondering,
whether I could use a worksheet, which I save in the same folder, as my
file.tex with all the commands I need. Would convenient, if only the
switching to an other window would still exist in BBEdit: CMD+1, CMD+2
etc this was really handy in old BBEdit times.

Only problem: the commands I need, are apparently unknown to my worksheet.

pdflatex file.tex
This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)
restricted \write18 enabled.
entering extended mode
! I can't find file `file.tex'.
<*> file.tex

(Press Enter to retry, or Control-D to exit)
Please type another input file name:

Because the command pdflatex command is unknown to the worksheet, I
tried to export the PATH, with following commands, which are all not
working (is a worksheet using bash dialect or tcsh?):

export PATH="${PATH}:/usr/local/texlive/2011/bin/"
set PATH=($PATH /usr/local/texlive/2011/bin/)
setenv PATH "/usr/local/texlive/2011/bin/"


Any help? Thank you!


marek


Herbert Schulz

unread,
Oct 7, 2011, 3:13:51 PM10/7/11
to bbe...@googlegroups.com


Howdy,

It looks like pdflatex was found fine (that's were those starting lines come from). the problem seems to be that file.tex isn't being found. This is most likely happening because the worksheet isn't starting in the directory that contains the file.

Also, DON'T use /usr/local/texlive/2011/bin/ in the path (and it's another directory deep anyway), always use /usr/texbin which will point to the active TeX distribution.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)

Maarten Sneep

unread,
Oct 7, 2011, 3:14:59 PM10/7/11
to bbe...@googlegroups.com

On 7 okt. 2011, at 21:07, Marek Stepanek wrote:

> I am wondering, how to use a worksheet in BBEdit. I never used a worksheet and probably I misunderstood it. Could somebody help me to use it with LaTeX?

I guess you could, but I don't think you'd want to. The output of the pdflatex run will be stored in the worksheet. It is much easier to use a script to tell the terminal to process your document. You could use this set of scripts: http://msneep.home.xs4all.nl/latex/

> This is pretty fast, using the history (arrow key up). I am wondering, whether I could use a worksheet, which I save in the same folder, as my file.tex with all the commands I need. Would convenient, if only the switching to an other window would still exist in BBEdit: CMD+1, CMD+2 etc this was really handy in old BBEdit times.
>
> Only problem: the commands I need, are apparently unknown to my worksheet.
>
> pdflatex file.tex
> This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)
> restricted \write18 enabled.
> entering extended mode
> ! I can't find file `file.tex'.
> <*> file.tex
>
> (Press Enter to retry, or Control-D to exit)
> Please type another input file name:
>
> Because the command pdflatex command is unknown to the worksheet, I tried to export the PATH, with following commands, which are all not working (is a worksheet using bash dialect or tcsh?):
>
> export PATH="${PATH}:/usr/local/texlive/2011/bin/"
> set PATH=($PATH /usr/local/texlive/2011/bin/)
> setenv PATH "/usr/local/texlive/2011/bin/"
>
>
> Any help? Thank you!

tcsh is no longer used. Ar maybe that is my ideal world.

But that is not your problem. pdflatex starts all right, but then asks for your file. So apparently the worksheet does not start in the directory where you think it is running. Have you tried to run 'pwd' in the worksheet?

Maarten

Marek Stepanek

unread,
Oct 7, 2011, 3:52:58 PM10/7/11
to bbe...@googlegroups.com

Thank you for the quick answers. Herbert, Maarten you where right. It
was pretty clear, that my worksheet was starting in my ~/ home folder. I
changed the directory with cd to the folder, where my file.tex and
file.worksheet are saved. And now it is compiling as it is intended. But
you are right: the output is written to the worksheet and I have to make
a CMD + Z and CMD + S to get rid of it. Is it like that it is intended
to work?

Strange: the worksheet is staying now in the starting folder, also after
a restart of BBEdit. Will it stay here also after a new start of the
computer?

No I will stay with vim and my second terminal window to run my commands.

But I will look into the suggested ShellScripts which Maarten suggested.


Thank you once again

marek


Doug McNutt

unread,
Oct 7, 2011, 4:49:35 PM10/7/11
to bbe...@googlegroups.com

BBedit 8.5.2 on MacOS 10.3.9 is as far as I go.

But have a look at: <ftp://ftp.macnauchtan.com/Software/BBEdit/>. There are some files there that start with "Worksheet" which I use to execute a few lines of text from a worksheet each time it is opened. Typically I define $PATH and set the current working directory but I might also tell Finder to open a directory or two. I often ask Vectorworks to open a particular design file.

It's somewhat a labor of love and I use it with tcsh which is much closer to MPW than bash and is OK to use if you stay away from fancy scripting. I did some tests with bash but they were not complete. It will take a bit of loving application of geeky things including modifying your $HOME/tcshrc or profile startup scripts so they recognize the initial call that is made when bbedit opens a worksheet.

For me it answered a lot of your frustration. Coming from MPW where such things were simple I thought I really needed them on a worksheet that would run under OS neXt.. BBEdit remains the only real potion.

In that ftp directory there is also a copy of Services.dmg. It allows you to select lines in a bbedit text file and execute them in a shell. Things like

date | pbcopy
bbedit SomePath

Run nicely, populating your clipboard with the UNIX date and time or opening a common file you need.

As for unwanted writing to a worksheet you can redirect stdout and possibly stderr to an open bbedit text file if you want. Bbedit will happily reload the modified file the next time you bring its window to the front.
--

--> Halloween == Oct 31 == Dec 25 == Christmas <--

Maarten Sneep

unread,
Oct 7, 2011, 5:47:12 PM10/7/11
to bbe...@googlegroups.com

On 7 okt. 2011, at 22:49, Doug McNutt wrote:

[snip]

> As for unwanted writing to a worksheet you can redirect stdout and possibly stderr to an open bbedit text file if you want. Bbedit will happily reload the modified file the next time you bring its window to the front.

You don't want to do this with TeX and derived systems. TeX may request input during a run, and redirecting stdout and stderr will block this. This will leave you wondering what is happening.

Another advantage of using the terminal is that the path will be set correctly by the installer. This is tested by the good folks behind MacTeX. This is easier and simpler than anything you can come up with for a worksheet.

Best,

Maarten

Tim Gray

unread,
Oct 10, 2011, 9:18:04 AM10/10/11
to bbe...@googlegroups.com
On Oct 07, 2011 at 09:52 PM +0200, Marek Stepanek wrote:
>But I will look into the suggested ShellScripts which Maarten suggested.

I used Maarten's scripts (modified a bit by myself) for many years. I
highly recommend them if you are using BBEdit instead of TeXShop for
latex. I really can't imagine using latex with BBEdit any other way.

Reply all
Reply to author
Forward
0 new messages