Loading ...
Sorry, an error occurred while loading the content.

Re: Setting the TEXINPUTS and BIBINPUTS varibles for latex inside vim/gVim

Expand Messages
  • Christoph Wiesmeyr
    Thanks for the answer, but unfortunately this does not solve the problem for me. After adding these environment variables to my vimrc they are accessible
    Message 1 of 13 , Mar 30, 2013
    • 0 Attachment
      Thanks for the answer, but unfortunately this does not solve the problem for me. After adding these environment variables to my vimrc they are accessible within gvim but when I start compiling they don't seem to be in the scope anymore. In fact more than that, when the variables are set on vim startup compilation does not even work in the console based vim, which used to work.



      Best,
      Christoph

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Gary Johnson
      ... The setting of the $TEXINPUTS variable and the g:Tex_TEXINPUTS variable is covered in ... Something that doesn t seem to be covered very well by the LaTeX
      Message 2 of 13 , Mar 30, 2013
      • 0 Attachment
        On 2013-03-22, Christoph Wiesmeyr wrote:
        > Dear all,
        >
        > I have been trying to set the TEXINPUTS variable for my latex to
        > have it search for packages in paths, where I have some custom
        > built macros and styles. I have therefore added this line in my
        > vimrc:
        >
        > let g:Tex_TEXINPUTS = '/home/christoph/Dokumente/Dropbox/NuHAG/latex/**,./**'
        >
        > According to what I found in http://tinyurl.com/d66jz45 , this
        > should do the job.
        >
        > It works in console based vim, as it seems to inherit the
        > environment varibles from the bash, where I have them set in
        > bashrc. However, when I use gVim this is not the case. Therefore I
        > have two questions:
        >
        > - is there anything wrong with how I set the environment variable
        > above?
        > - can I somehow also set environment variables in the internal
        > gVim shell, that is invoked on compilation?

        The setting of the $TEXINPUTS variable and the g:Tex_TEXINPUTS
        variable is covered in

        :help custom-packages
        :help Tex_TEXINPUTS

        Something that doesn't seem to be covered very well by the LaTeX
        Suite documentation is where to set the g:Tex_TEXINPUTS variable.
        It is set by the package in the ftplugin/latex-suite/texrc file.
        The top of that file says:

        NOTE: Do NOT be edit this file directly:
        this file will be over-written each time you install a new
        copy of latex-suite.

        You can do one of the following:
        1. Copy this file into $VIMFILES/ftplugin/tex/texrc
        and edit the values in that file.
        $VIMFILES is ~/.vim for UNIX systems and ~/vimfiles for
        WINDOWS systems.

        2. Just set values of each setting individually in your
        $VIMFILES/ftplugin/tex.vim file. (See above for what
        $VIMFILES is). You will need to use :let instead of
        :TexLet in this case.

        So, the proper place to set g:Tex_TEXINPUTS is _not_ in your
        ~/.vimrc file but in either of the two files mentioned above.

        Regards,
        Gary

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Gary Johnson
        [This may appear twice. I sent the original almost 6 hours ago and it still hasn t appeared on the list while messages from other posters have, so I m
        Message 3 of 13 , Mar 30, 2013
        • 0 Attachment
          [This may appear twice. I sent the original almost 6 hours ago and
          it still hasn't appeared on the list while messages from other
          posters have, so I'm assuming it got lost somewhere.]

          On 2013-03-22, Christoph Wiesmeyr wrote:
          > Dear all,
          >
          > I have been trying to set the TEXINPUTS variable for my latex to
          > have it search for packages in paths, where I have some custom
          > built macros and styles. I have therefore added this line in my
          > vimrc:
          >
          > let g:Tex_TEXINPUTS = '/home/christoph/Dokumente/Dropbox/NuHAG/latex/**,./**'
          >
          > According to what I found in http://tinyurl.com/d66jz45 , this
          > should do the job.
          >
          > It works in console based vim, as it seems to inherit the
          > environment varibles from the bash, where I have them set in
          > bashrc. However, when I use gVim this is not the case. Therefore I
          > have two questions:
          >
          > - is there anything wrong with how I set the environment variable
          > above?
          > - can I somehow also set environment variables in the internal
          > gVim shell, that is invoked on compilation?

          The setting of the $TEXINPUTS variable and the g:Tex_TEXINPUTS
          variable is covered in

          :help custom-packages
          :help Tex_TEXINPUTS

          Something that doesn't seem to be covered very well by the LaTeX
          Suite documentation is where to set the g:Tex_TEXINPUTS variable.
          It is set by the package in the ftplugin/latex-suite/texrc file.
          The top of that file says:

          NOTE: Do NOT be edit this file directly:
          this file will be over-written each time you install a new
          copy of latex-suite.

          You can do one of the following:
          1. Copy this file into $VIMFILES/ftplugin/tex/texrc
          and edit the values in that file.
          $VIMFILES is ~/.vim for UNIX systems and ~/vimfiles for
          WINDOWS systems.

          2. Just set values of each setting individually in your
          $VIMFILES/ftplugin/tex.vim file. (See above for what
          $VIMFILES is). You will need to use :let instead of
          :TexLet in this case.

          So, the proper place to set g:Tex_TEXINPUTS is _not_ in your
          ~/.vimrc file but in either of the two files mentioned above.

          Regards,
          Gary

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Charles E Campbell
          ... Setting environment variables from within an app affects that app and its child apps. So, are you compiling from within vim? ie. do you leave vim and
          Message 4 of 13 , Mar 30, 2013
          • 0 Attachment
            Christoph Wiesmeyr wrote:
            > Thanks for the answer, but unfortunately this does not solve the problem for me. After adding these environment variables to my vimrc they are accessible within gvim but when I start compiling they don't seem to be in the scope anymore. In fact more than that, when the variables are set on vim startup compilation does not even work in the console based vim, which used to work.
            >
            Setting environment variables from within an app affects that app and
            its child apps. So, are you compiling from within vim? ie. do you
            leave vim and then try latex, bibtex, etc?

            Another way to say this: changing an environment variable from within
            vim will not affect vim's parent environment. That's not a vim thing,
            that's a generic feature.

            Regards,
            C Campbell

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Christoph Wiesmeyr
            ... I have made the directory tex in my ftplugin folder, then I copied the original texrc there and added the following line: TexLet g:Tex_TEXINPUTS =
            Message 5 of 13 , Apr 2, 2013
            • 0 Attachment
              >
              >
              > The setting of the $TEXINPUTS variable and the g:Tex_TEXINPUTS
              >
              > variable is covered in
              >
              >
              >
              > :help custom-packages
              >
              > :help Tex_TEXINPUTS
              >
              >
              >
              > Something that doesn't seem to be covered very well by the LaTeX
              >
              > Suite documentation is where to set the g:Tex_TEXINPUTS variable.
              >
              > It is set by the package in the ftplugin/latex-suite/texrc file.
              >
              > The top of that file says:
              >
              >
              >
              > NOTE: Do NOT be edit this file directly:
              >
              > this file will be over-written each time you install a new
              >
              > copy of latex-suite.
              >
              >
              >
              > You can do one of the following:
              >
              > 1. Copy this file into $VIMFILES/ftplugin/tex/texrc
              >
              > and edit the values in that file.
              >
              > $VIMFILES is ~/.vim for UNIX systems and ~/vimfiles for
              >
              > WINDOWS systems.
              >
              I have made the directory tex in my ftplugin folder, then I copied the original texrc there and added the following line:

              TexLet g:Tex_TEXINPUTS = "pathtolatex/latex/"

              but that does not work and gVim still does not search the specified folder.
              >
              >
              > 2. Just set values of each setting individually in your
              >
              > $VIMFILES/ftplugin/tex.vim file. (See above for what
              >
              > $VIMFILES is). You will need to use :let instead of
              >
              > :TexLet in this case.

              Neither does that (I did change TexLet to let).

              Thank you anyway for your help,
              Christoph

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Christoph Wiesmeyr
              ... I do not really know how this is implemented in the latex package, but I guess I do leave vim for compilation. When I am using vim as a child process of
              Message 6 of 13 , Apr 2, 2013
              • 0 Attachment
                >
                > Setting environment variables from within an app affects that app and
                >
                > its child apps. So, are you compiling from within vim? ie. do you
                >
                > leave vim and then try latex, bibtex, etc?
                >
                I do not really know how this is implemented in the latex package, but I guess I do leave vim for compilation. When I am using vim as a child process of the bash, then it works because it seems to use the parent for compilation. There the environment variables are set correctly in my bashrc.

                When I work with gVim (which I generally prefer), then I do not really know where it goes when I compile. It seems to leave vim and invoke some shell where it can use the pdflatex command. However, it apparently does not set the environment variables specified in my bashrc there. For me it would be of great interest to know how to set variables in this environment invoked by gVim.



                Thanks,
                Christoph

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Gary Johnson
                ... Here is an overview of what s going on. There may be exceptions to the rules below, but I m not going to worry about them for now. Bash runs in one of
                Message 7 of 13 , Apr 3, 2013
                • 0 Attachment
                  On 2013-04-02, Christoph Wiesmeyr wrote:
                  > >
                  > > Setting environment variables from within an app affects that app and
                  > >
                  > > its child apps. So, are you compiling from within vim? ie. do you
                  > >
                  > > leave vim and then try latex, bibtex, etc?
                  > >
                  > I do not really know how this is implemented in the latex package,
                  > but I guess I do leave vim for compilation. When I am using vim as
                  > a child process of the bash, then it works because it seems to use
                  > the parent for compilation. There the environment variables are
                  > set correctly in my bashrc.
                  >
                  > When I work with gVim (which I generally prefer), then I do not
                  > really know where it goes when I compile. It seems to leave vim
                  > and invoke some shell where it can use the pdflatex command.
                  > However, it apparently does not set the environment variables
                  > specified in my bashrc there. For me it would be of great interest
                  > to know how to set variables in this environment invoked by gVim.

                  Here is an overview of what's going on. There may be exceptions to
                  the "rules" below, but I'm not going to worry about them for now.

                  Bash runs in one of two modes: interactive and non-interactive.
                  The shell you type at at the command line is an interactive shell.
                  When it starts, it sources ~/.bashrc to obtain aliases, functions,
                  some enviroment variables, and other things to aid your command line
                  use.

                  When bash is invoked as a subshell of another process for the
                  purpose of running some command, as it is when you run some command
                  from Vim with ":!command", bash runs in non-interactive mode. To
                  save start-up time, it does not source your ~/.bashrc since it
                  usually does not need anything defined there.

                  Despite what you read on the web, ~/.bashrc is not the right place
                  to set environment variables. For one thing, they won't be
                  available to programs launched from Vim with ":!command". For
                  another, they won't be available to programs started from your
                  window manager, as gvim often is.

                  Where you _should_ put environment variables is changing. In the
                  beginning, personal environment variables were set in ~/.profile.
                  Period. Then bash came along and offered ~/.bash_profile as an
                  alternative. Now I understand that Ubuntu recommends putting them
                  in ~/.environment. I believe that other desktop environments have
                  their own pet places. For the time being, however, I think that
                  ~/.profile or ~/.bash_profile will still be sourced when you log in
                  and before your window manager is launched, which is when you want
                  them set so that they are available to programs such as gvim.

                  There are (at least) two ways to fix your problem. One, not
                  recommended, is to force bash to always source your ~/.bashrc even
                  when it is run non-interactively. The other is to put all your
                  environment variable settings in ~/.bash_profile.

                  Also make sure that you export any variable you expect to be used by
                  a child of the shell.

                  HTH,
                  Gary

                  --
                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Christoph Wiesmeyr
                  ... Setting the variables in ~/.profile solved the problem for me, now everything works like a charm. Thank you very much for your detailed explanation, I
                  Message 8 of 13 , Apr 3, 2013
                  • 0 Attachment
                    > Despite what you read on the web, ~/.bashrc is not the right place
                    >
                    > to set environment variables. For one thing, they won't be
                    >
                    > available to programs launched from Vim with ":!command". For
                    >
                    > another, they won't be available to programs started from your
                    >
                    > window manager, as gvim often is.
                    >
                    >
                    >
                    > Where you _should_ put environment variables is changing. In the
                    >
                    > beginning, personal environment variables were set in ~/.profile.
                    >
                    > Period. Then bash came along and offered ~/.bash_profile as an
                    >
                    > alternative. Now I understand that Ubuntu recommends putting them
                    >
                    > in ~/.environment. I believe that other desktop environments have
                    >
                    > their own pet places. For the time being, however, I think that
                    >
                    > ~/.profile or ~/.bash_profile will still be sourced when you log in
                    >
                    > and before your window manager is launched, which is when you want
                    >
                    > them set so that they are available to programs such as gvim.
                    >

                    Setting the variables in ~/.profile solved the problem for me, now everything works like a charm. Thank you very much for your detailed explanation, I really appreciate this.



                    Best regards,
                    Christoph

                    --
                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php

                    ---
                    You received this message because you are subscribed to the Google Groups "vim_use" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Jaime A Millan Quijano
                    I apologise if my question seems a bit naive, but what do you mean by setting the variables in ~/.profile . When I open my .profile I only see the following
                    Message 9 of 13 , Mar 25
                    • 0 Attachment
                      I apologise if my question seems a bit naive, but what do you mean by "setting the variables in ~/.profile".

                      When I open my .profile I only see the following line "export PATH="/opt/local/bin:/opt/local/sbin:$PATH""

                      Do I just add the line and save?
                      let g:Tex_TEXINPUTS = '/usr/local ..."

                      Thanks a lot
                      J

                      On Wednesday, April 3, 2013 at 9:39:09 PM UTC+2, Christoph Wiesmeyr wrote:
                      > > Despite what you read on the web, ~/.bashrc is not the right place
                      > >
                      > > to set environment variables. For one thing, they won't be
                      > >
                      > > available to programs launched from Vim with ":!command". For
                      > >
                      > > another, they won't be available to programs started from your
                      > >
                      > > window manager, as gvim often is.
                      > >
                      > >
                      > >
                      > > Where you _should_ put environment variables is changing. In the
                      > >
                      > > beginning, personal environment variables were set in ~/.profile.
                      > >
                      > > Period. Then bash came along and offered ~/.bash_profile as an
                      > >
                      > > alternative. Now I understand that Ubuntu recommends putting them
                      > >
                      > > in ~/.environment. I believe that other desktop environments have
                      > >
                      > > their own pet places. For the time being, however, I think that
                      > >
                      > > ~/.profile or ~/.bash_profile will still be sourced when you log in
                      > >
                      > > and before your window manager is launched, which is when you want
                      > >
                      > > them set so that they are available to programs such as gvim.
                      > >
                      >
                      > Setting the variables in ~/.profile solved the problem for me, now everything works like a charm. Thank you very much for your detailed explanation, I really appreciate this.
                      >
                      >
                      >
                      > Best regards,
                      > Christoph

                      --
                      --
                      You received this message from the "vim_use" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php

                      ---
                      You received this message because you are subscribed to the Google Groups "vim_use" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                      For more options, visit https://groups.google.com/d/optout.
                    • Christian Brabandt
                      Hi Jaime! ... .profile is for your shell environment. You need to put vim specific configuration into ~/.vimrc Best Christian -- Ironie ist der Weg und Übung
                      Message 10 of 13 , Mar 25
                      • 0 Attachment
                        Hi Jaime!

                        On Mi, 25 Mär 2015, Jaime A Millan Quijano wrote:

                        > I apologise if my question seems a bit naive, but what do you mean by "setting the variables in ~/.profile".
                        >
                        > When I open my .profile I only see the following line "export PATH="/opt/local/bin:/opt/local/sbin:$PATH""
                        >
                        > Do I just add the line and save?
                        > let g:Tex_TEXINPUTS = '/usr/local ..."
                        >
                        > Thanks a lot

                        .profile is for your shell environment. You need to put vim specific
                        configuration into ~/.vimrc

                        Best
                        Christian
                        --
                        Ironie ist der Weg und Übung zur Laune.
                        -- Jean Paul

                        --
                        --
                        You received this message from the "vim_use" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php

                        ---
                        You received this message because you are subscribed to the Google Groups "vim_use" group.
                        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                        For more options, visit https://groups.google.com/d/optout.
                      • Jaime A Millan Quijano
                        ... Hi Christian, thanks for your reply I wrote the following line on my .vimrc let g:Tex_TEXINPUTS = /usr/local/texlive/2014/texmf-dist/tex/**,./** But I
                        Message 11 of 13 , Mar 26
                        • 0 Attachment
                          On Wednesday, March 25, 2015 at 9:40:35 PM UTC+1, Christian Brabandt wrote:
                          > Hi Jaime!
                          >
                          > On Mi, 25 Mär 2015, Jaime A Millan Quijano wrote:
                          >
                          > > I apologise if my question seems a bit naive, but what do you mean by "setting the variables in ~/.profile".
                          > >
                          > > When I open my .profile I only see the following line "export PATH="/opt/local/bin:/opt/local/sbin:$PATH""
                          > >
                          > > Do I just add the line and save?
                          > > let g:Tex_TEXINPUTS = '/usr/local ..."
                          > >
                          > > Thanks a lot
                          >
                          > .profile is for your shell environment. You need to put vim specific
                          > configuration into ~/.vimrc
                          >
                          > Best
                          > Christian
                          > --
                          > Ironie ist der Weg und Übung zur Laune.
                          > -- Jean Paul

                          Hi Christian, thanks for your reply

                          I wrote the following line on my .vimrc
                          let g:Tex_TEXINPUTS = '/usr/local/texlive/2014/texmf-dist/tex/**,./**'

                          But I still get the same mistake:
                          ! LaTeX Error: File `url.sty' not found.

                          I know that the package url is in the folder above.
                          Any help would be very welcome.
                          Thanks a lot in advance,
                          J

                          --
                          --
                          You received this message from the "vim_use" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php

                          ---
                          You received this message because you are subscribed to the Google Groups "vim_use" group.
                          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                          For more options, visit https://groups.google.com/d/optout.
                        Your message has been successfully submitted and would be delivered to recipients shortly.