I'm having problems with latex-suite (some research indicates that many people are). The issue at hand is that they have a nifty python script that gives you a nice outline of your document and reference labels present therein.

I am running VimTouch for Android, which runs vim 7.3. It is compiled without python support. However, I have python on my system, so it uses a few lines of code like this

function TexStartOutline()
. . . 
let retval = system(latex_path."/outline.py". ' ' .shellescape(fname) . ' ' .shellescape (leader))

"not an exact replica, but it's the same idea. It gets called from another 
"function which is called from a mapping

In any case, when I run the same script myself (say with :! ~/vim/ftplugin/latex-suite/outline.py myfile.tex I do get the correct output.

It seems that for some reason, python won't return anything when it's called from a function. Is there any way around this? It would be helpful.


2 Answers 2


I am not quite sure, however there is something strange with your system() call. You do: let retval = system(latex_path."/outline.py". shellescape(fname) . shellescape (leader) Note, that you do concat the filename to the python script without spaces, so you call ~/vim/ftplugin/latex-suite/outline.pymyfile.texleader which most likely does not make sense. Also I don't know, what leader is, so not sure, if it should be added as argument to your python script. Also note, that you function most likely won't handle path with spaces appropriately.

  • Sorry, that's a typo here, the real script has spaces. Will update to reflect that. Shellescape takes care of spaces in filenames, for the record.
    – A Gold Man
    Dec 21, 2016 at 21:00
  • 1
    It does yes, but you are not using shellescape for latex_path. Dec 21, 2016 at 21:09
  • The path to the script has no spaces.
    – A Gold Man
    Dec 22, 2016 at 9:05

I figured out the problem. Turns out, it WAS because of spaces in filenames. My python setup is that I have a shell script in /system/bin which calls python from where it is in my system. This resulted in escape characters being stripped twice. I changed the python code to run python from its actual location on my box. Thanks for the direction, at least.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.