[Vim-latex-devel] About Windows filenames...
Brought to you by:
srinathava,
tmaas
From: BodziO <si...@st...> - 2003-11-06 19:28:13
|
Hi! I've started recently my adventure with Latex-suite and I wanted to thank you for your work - it's a great package - exactly what I need to work on LaTeX files plus more. I'm using Windows version of gVim and I;ve got one little problem with compiling my .tex's with 'pdflatex'. If filename was simple - without any spaces - everything worked well, but I like to put some spaces in my filenames (for better esthetic impression & much easier identification of my files - long names help to maintain good order of work). That's the point where things went bad. Compiler refused to cooperate and stopped with a message "Can't find file" or something like that. I've started searching for reason of such behavior. Soon I've discovered what it was. Command formed for external process of compilation is good for Unix-like systems but not for Windows. Windows don't support escape characters (in this case '\' before ' ') before whitespaces - instead of this double quotes are used for marking filename phrase. So if I want to compile 'simple example.tex', I should use the following command: <code> pdflatex "simple example.tex" </code> Otherwise 'pdflatex' reports a nasty set of errors :(. Anyway I've told you a touchig story ;). I've tried to cope with this situation and this is what I've done: All changes was made in 'ftplugin/latex-suite/compiler.vim'. Originally there are two sections in 'function! Tex_CompileLatex()': <code> if exists('b:fragmentFile') || mainfname == '' let mainfname = escape(expand('%:t'), ' ') endif </code> and <code> exec 'make! '.mainfname </code> I've simply replaced these with code that modifies 'mainfname' depending on platform. <code> " begin of Win32 filenames with spaces modification if has('win32') let mainfname = expand('%:t') else let mainfname = escape(expand('%:t'), ' ') endif " end of modification </code> and <code> " another modification if has('win32') exec 'make! '.'"'.mainfname.'"' else exec 'make! '.mainfname endif " end of modification </code> That's it. I hope that this one will help. Please be patient if I made any mistakes in this mail (most probable I did :) ) - english is not my native language :). I'm also new in vim scripting, so I could miss some important reasons why mentioned code was written in such way, for what I'm sorry, but this modification works now smoothly on my system and I think that it could be helpful for other Windows users. Thanks again for a piece of good, hard work :) with best wishes and greetings Bogdan Szczurek -- /o/==============\o\ -=oO>=<OX< \The{BodziO} >XO>=================- \o\==============/o/ |