Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Problems with input and paths in tex documents #25

Open
wikimatze opened this issue Feb 6, 2011 · 9 comments
Open

Problems with input and paths in tex documents #25

wikimatze opened this issue Feb 6, 2011 · 9 comments

Comments

@wikimatze
Copy link

I'm using the following in my latex documents:

\newcommand{\home}{../../../styles}

%% style
\input{\home/style_bill.tex}

and syntastic is complaining that it Could not open "\home/style_bill.tex". I set the path correctly and my documents are compiling. Is this a bug or to I have to configure my .vimrc to get rid of this message.

Matthias Guenther

@scrooloose
Copy link
Collaborator

Hey Matthias, syntastic delegates the syntax checking off to external programs. In this case it is shelling out to lacheck. I dont have much experience with lacheck (and havent used latex in a long time) so I cant really give much advice. The man page for lacheck states that the tool is rather imprecise... it could be a good idea to email this bug to the maintainers. Their email is at the bottom of man lacheck.

Meanwhiel, you can disable the tex syntax checker by putting let loaded_tex_syntax_checker in your vimrc.

Hope this is somewhat helpful :)

@wikimatze
Copy link
Author

let loaded_tex_syntax_checker = 0 was the solution, thanks for your very fast response. This is a little work arround, but I can live quite good with it. I know how much work is in this great vim plugin. Hope in a several years I can understand the vim syntax.

Matthias

@kongo2002
Copy link
Collaborator

Hi Matthias,
I would suspect that vim's current working directory is not correctly set for your path command. lacheck is executed from vim's current working dir, so it probably does not find your files for that reason.
You can check the current directory with :pwd and try to set the directory with :cd to where you would compile your tex file.

Just a guess :-)

@wikimatze
Copy link
Author

Hey Kongo, this was a good test. But it is only working with relativ path of the current directory and all files which are below in the directory - you can not just define a path to some style information which are above the directory where the tex-files are. See the example, what I mean:

%% config
\def\home{../../styles} % go above don't work

%% documentclass
\input{\home/documentclass_normal_oneside}

%% generell-styling
\input{\home/style_proggen}

%% meta-tags for pdf
\input{tex/metatags.tex} % go down, works

Thanks for your guess :).

@kongo2002
Copy link
Collaborator

Hi again,
it's probably a dumb question but did you try to run lacheck <filename> from the command line to check if lacheck is capable of resolving your path logic at all?

Cheers
Gregor

@wikimatze
Copy link
Author

Hio Gregor,

this works :), how silly I am sometimes. Still don't know now to go on.

Cheers
Matthias

@kongo2002
Copy link
Collaborator

Hi,
it appears to me that lacheck is indeed not able to expand your \def command. I am by far no expert in tex or lacheck but I tried to following:
\def\foo{/tmp}
\input{\foo/bar.tex}
Running that with lacheck on the command line throws an error but the following does work:
\input{/tmp/bar.tex}

That means that lacheck simply does not interpret those \def commands properly.

Gregor

@wikimatze
Copy link
Author

Hey Gregor,

\def\home{../../styles}

doesn't work and

\renewcommand{\home}{../../styles}

isn't working either. Thanks for your help, Gregor.

Matthias

@wikimatze
Copy link
Author

I've contacted the author of the package (https://github.com/scrooloose/syntastic/wiki/TeX:---lacheck> and see what will be the outcome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants