I'm trying to write some longer pdfs with LaTeX. Jumping to the terminal
every time is quite painful... so I thought to install Vim-LaTeX
(http://www.vim.org/scripts/script.php?script_id=475) for convenience
reasons. Just clicking in the Menubar... choosing "Compile", "View".
That's what I thought to have. If I have to do without auctex.
A click - nothing happens. Therefore I called pdflatex (for pdf)
manually: !pdflatex %.
I get: zsh - command not found pdflatex. Shell returned 127.
Nevertheless pdflatex is exported to the Path. While searching through
this list I didn't find an answer... Does anybody know what's going
wrong here?
Thanks,
Marius
p.s.: there really isn't anything like auctex, isn't it *g*?
On 31.07.2008, at 11:10, wishi wrote:
> A click - nothing happens. Therefore I called pdflatex (for pdf)
> manually: !pdflatex %.
>
> I get: zsh - command not found pdflatex. Shell returned 127.
try checking "Start vim processes in a shell" in the Preferences. Does
that help?
Nico
Are you using Vim in a terminal or MacVim? If MacVim, do you have the
"Launch Vim processes in a login shell" preference enabled? How do you
start Vim/MacVim?
What does :echo $PATH give you within Vim? What about :!echo $PATH?
Ben.
I enabled this option. Nevertheless it's not reflected by $PATH. I use
zsh - a custom shell ;).
Is there any option to add /Library/TeX/Root/bin/i386-darwin/pdflatex
(the common path for MacTex) in the .vimrc to get the TeX stuff working?
Or do I have to alias this in the vimrc completely?
Thanks for the help!
Marius
Hmmh, that doesn't help :(
I think the problem it, that MacVim as a Cocoa app forks vim in its
backend through /bin/sh - which is a shell without the customised
environment variables (here). Maybe wrong... just my idea of inheritance.
vim itself, called via Terminal, does everything. Only MacVim completely
fails. Could have been a handy GUI, but without functions it's not very
useful - I assume.
Something like
#export LaTeX
export PATH=/Library/TeX/Root/bin/i386-darwin:$PATH
could be helpful in the general ~/.vimrc.
Because if you don't click als call pdflatex with ! - it works fine.
Just an environment problem.
Any idea how to solve it that way? A script maybe to call MacVim
directly out of the bash/zsh/whatever - without "open", because open
generates a new father-process...
Thanks,
Marius
See
:help macvim-preferences
As documented, you can use:
defaults write org.vim.MacVim MMLoginShellCommand /bin/zsh
That should let you use zsh. I just tested it, and that causes MacVim to
use the path in my ~/.zlogin.
> Is there any option to add /Library/TeX/Root/bin/i386-darwin/pdflatex
> (the common path for MacTex) in the .vimrc to get the TeX stuff working?
> Or do I have to alias this in the vimrc completely?
What's wrong with /usr/texbin, the proper path?
(/usr/texbin should get linked to the proper distribution)
--Ted
--
Ted Pavlic <t...@tedpavlic.com>
http://phaseportrait.blogspot.com/search/label/VIM-LaTeX
--Ted
This problem is well known and a fair amount of effort has gone into
fixing it, so if your configuration files are set up and you enable
MacVim's 'Launch vim processes in a login shell' option, it should work.
Details:
If you don't have 'Launch vim processes in a login shell' turned on,
MacVim will launch Vim directly, and thus inherit the environment of
LoginWindow (~/.MacOSX/Environment.plist or something like that; you can
set things there if you like; Google it to check exactly how).
If you do have that option turned on (which is the best way to get the
behaviour you want), MacVim will launch Vim using your selected shell
($SHELL) as a login shell (prepending '-' to argv0). I tested this with
at least bash, zsh, tcsh to make sure it works, so I'm sure it does, at
least with those. You can also set MMLoginShellArgument if necessary for
your shell (automatically done for bash). See the end of :help
macvim-preferences for details.
In addition to this, though, you must set your environment in the proper
configuration file for your shell. For bash this tends to mean
~/.profile not ~/.bashrc. But it can get complicated. Check your shell
manual for details. The shell that is started is a login shell, but a
non-interactive one.
> export PATH=/Library/TeX/Root/bin/i386-darwin:$PATH
>
> could be helpful in the general ~/.vimrc.
It is not a good idea to put this in MacVim's vimrc. But you can put it
in your own as something like
let $PATH="/Library/TeX/Root/bin/i386-darwin:".$PATH
Ben.
Wow... you're my LaTeX-MacVim-saver :). I must have overlooked that one
especially. Thanks a lot.
Greetings,
wishi
>
>> I think the problem it, that MacVim as a Cocoa app forks vim in its
>> backend through /bin/sh - which is a shell without the customised
>> environment variables (here). Maybe wrong... just my idea of
>> inheritance.
>
> This problem is well known and a fair amount of effort has gone into
> fixing it, so if your configuration files are set up and you enable
> MacVim's 'Launch vim processes in a login shell' option, it should
> work.
You and me both suggested that at the start of this thread; it seems
to not have worked ( http://groups.google.com/group/vim_mac/browse_thread/thread/64ddfcafed3f9795
).
>
wishi needed to set MMLoginShellCommand explicitly (perhaps he didn't
set his default shell correctly? wishi, how did you change your shell?
`chsh`?)
Nico