How to configure vim-latex to use portable MiKTeX to compile












0















Recently I have installed vim-latex plugin in gVim. I use portable MiKTeX to compile tex document into pdf documents. Till now, I have used command prompt to compile the tex files. After installing vim-latex plugin I found that there's a compile option under Tex-Suite>Compile menu. But clicking it doesn't do anything. So how can I configure vim-latex to use the portable MiKTeX compiler?










share|improve this question





























    0















    Recently I have installed vim-latex plugin in gVim. I use portable MiKTeX to compile tex document into pdf documents. Till now, I have used command prompt to compile the tex files. After installing vim-latex plugin I found that there's a compile option under Tex-Suite>Compile menu. But clicking it doesn't do anything. So how can I configure vim-latex to use the portable MiKTeX compiler?










    share|improve this question



























      0












      0








      0








      Recently I have installed vim-latex plugin in gVim. I use portable MiKTeX to compile tex document into pdf documents. Till now, I have used command prompt to compile the tex files. After installing vim-latex plugin I found that there's a compile option under Tex-Suite>Compile menu. But clicking it doesn't do anything. So how can I configure vim-latex to use the portable MiKTeX compiler?










      share|improve this question
















      Recently I have installed vim-latex plugin in gVim. I use portable MiKTeX to compile tex document into pdf documents. Till now, I have used command prompt to compile the tex files. After installing vim-latex plugin I found that there's a compile option under Tex-Suite>Compile menu. But clicking it doesn't do anything. So how can I configure vim-latex to use the portable MiKTeX compiler?







      vim miktex






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 1 at 10:13









      albert

      2,96931123




      2,96931123










      asked Dec 15 '13 at 13:38









      th1rdey3th1rdey3

      2,68762052




      2,68762052
























          2 Answers
          2






          active

          oldest

          votes


















          1














          You need to set a few variables in vim to configure vim-latex.



          This one sets the order in which you want to export your tex file:



          let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'


          Notice that it converts the *.tex to *.dvi, then the *.dvi to *.ps, then *.ps to *.pdf.



          The next ones you need to set are the compile rules for vim-latex. Each of these rules define the program (and arguments) used to compile each output file:



          let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
          let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
          let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'


          When you convert from *.tex to *.dvi, vim-latex will use the 'latex' command. Then, when it converts from *.dvi to *.ps, it will use dvips. Finally it will use ps2pdf to convert from *.ps to *.pdf.



          It looks like MikTex's executable is named 'latex', so you should be OK to use the above settings. Just be sure that you have 'dvips' and 'ps2pdf' installed on your system.



          The output *.pdf file will be in the directory which contains your source *.tex file.






          share|improve this answer































            0














            Initial googling let me to this link: http://vim-latex.sourceforge.net/documentation/latex-suite/customizing-compiling.html#Tex_CompileRule_format. However, I couldn't find any clue to where actually configure this variables. But finally I found the location. For my case it was



            C:Program Files (x86)Vimvimfilesftpluginlatex-suitetexrc


            The texrc file has all the variables described in the link. As I said in my question, I use miktex portable so first I needed to change the compiler. So I searched for g:Tex_CompileRule_pdf in the file and found this line



            TexLet g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*'


            So, I just replaced pdflatex with the full path



            TexLet g:Tex_CompileRule_pdf = 'E:fullpathofmiktexpdflatex -interaction=nonstopmode $*'


            Next thing that needed to be changed is telling vim-latex to use pdflatex to compile by default. So, I searched for the g:Tex_DefaultTargetFormat variable in the file and found this line



            if has('macunix')
            TexLet g:Tex_DefaultTargetFormat = 'pdf'
            else
            TexLet g:Tex_DefaultTargetFormat = 'dvi'
            endif


            No need to keep all this checking. so I commented out most of the lines



            "if has('macunix')
            TexLet g:Tex_DefaultTargetFormat = 'pdf'
            "else
            " TexLet g:Tex_DefaultTargetFormat = 'dvi'
            "endif


            After this, vim-latex was able to compile my files. But the viewer wasn't working. So, needed to make a little more change. Searched for g:Tex_ViewRule_ps and changed the lines under if has('win32') to look like this.



            if has('win32')
            TexLet g:Tex_ViewRule_ps = 'gsview32'
            TexLet g:Tex_ViewRule_pdf = 'E:SharePortableAppsSumatraPDF-2.4SumatraPDF.exe'
            TexLet g:Tex_ViewRule_dvi = 'yap -1'


            I had to use SumatraPDF because for some reason Adobe Reader 11 was giving the error Unable to find the file. But Sumatra in not so bad. Now I can use vim-latex in peace :)






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20595158%2fhow-to-configure-vim-latex-to-use-portable-miktex-to-compile%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              You need to set a few variables in vim to configure vim-latex.



              This one sets the order in which you want to export your tex file:



              let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'


              Notice that it converts the *.tex to *.dvi, then the *.dvi to *.ps, then *.ps to *.pdf.



              The next ones you need to set are the compile rules for vim-latex. Each of these rules define the program (and arguments) used to compile each output file:



              let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
              let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
              let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'


              When you convert from *.tex to *.dvi, vim-latex will use the 'latex' command. Then, when it converts from *.dvi to *.ps, it will use dvips. Finally it will use ps2pdf to convert from *.ps to *.pdf.



              It looks like MikTex's executable is named 'latex', so you should be OK to use the above settings. Just be sure that you have 'dvips' and 'ps2pdf' installed on your system.



              The output *.pdf file will be in the directory which contains your source *.tex file.






              share|improve this answer




























                1














                You need to set a few variables in vim to configure vim-latex.



                This one sets the order in which you want to export your tex file:



                let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'


                Notice that it converts the *.tex to *.dvi, then the *.dvi to *.ps, then *.ps to *.pdf.



                The next ones you need to set are the compile rules for vim-latex. Each of these rules define the program (and arguments) used to compile each output file:



                let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
                let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
                let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'


                When you convert from *.tex to *.dvi, vim-latex will use the 'latex' command. Then, when it converts from *.dvi to *.ps, it will use dvips. Finally it will use ps2pdf to convert from *.ps to *.pdf.



                It looks like MikTex's executable is named 'latex', so you should be OK to use the above settings. Just be sure that you have 'dvips' and 'ps2pdf' installed on your system.



                The output *.pdf file will be in the directory which contains your source *.tex file.






                share|improve this answer


























                  1












                  1








                  1







                  You need to set a few variables in vim to configure vim-latex.



                  This one sets the order in which you want to export your tex file:



                  let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'


                  Notice that it converts the *.tex to *.dvi, then the *.dvi to *.ps, then *.ps to *.pdf.



                  The next ones you need to set are the compile rules for vim-latex. Each of these rules define the program (and arguments) used to compile each output file:



                  let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
                  let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
                  let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'


                  When you convert from *.tex to *.dvi, vim-latex will use the 'latex' command. Then, when it converts from *.dvi to *.ps, it will use dvips. Finally it will use ps2pdf to convert from *.ps to *.pdf.



                  It looks like MikTex's executable is named 'latex', so you should be OK to use the above settings. Just be sure that you have 'dvips' and 'ps2pdf' installed on your system.



                  The output *.pdf file will be in the directory which contains your source *.tex file.






                  share|improve this answer













                  You need to set a few variables in vim to configure vim-latex.



                  This one sets the order in which you want to export your tex file:



                  let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'


                  Notice that it converts the *.tex to *.dvi, then the *.dvi to *.ps, then *.ps to *.pdf.



                  The next ones you need to set are the compile rules for vim-latex. Each of these rules define the program (and arguments) used to compile each output file:



                  let g:Tex_CompileRule_dvi = 'latex --interaction=nonstopmode $*'
                  let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
                  let g:Tex_CompileRule_pdf = 'ps2pdf $*.ps'


                  When you convert from *.tex to *.dvi, vim-latex will use the 'latex' command. Then, when it converts from *.dvi to *.ps, it will use dvips. Finally it will use ps2pdf to convert from *.ps to *.pdf.



                  It looks like MikTex's executable is named 'latex', so you should be OK to use the above settings. Just be sure that you have 'dvips' and 'ps2pdf' installed on your system.



                  The output *.pdf file will be in the directory which contains your source *.tex file.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 15 '13 at 17:03









                  rustushkirustushki

                  8518




                  8518

























                      0














                      Initial googling let me to this link: http://vim-latex.sourceforge.net/documentation/latex-suite/customizing-compiling.html#Tex_CompileRule_format. However, I couldn't find any clue to where actually configure this variables. But finally I found the location. For my case it was



                      C:Program Files (x86)Vimvimfilesftpluginlatex-suitetexrc


                      The texrc file has all the variables described in the link. As I said in my question, I use miktex portable so first I needed to change the compiler. So I searched for g:Tex_CompileRule_pdf in the file and found this line



                      TexLet g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*'


                      So, I just replaced pdflatex with the full path



                      TexLet g:Tex_CompileRule_pdf = 'E:fullpathofmiktexpdflatex -interaction=nonstopmode $*'


                      Next thing that needed to be changed is telling vim-latex to use pdflatex to compile by default. So, I searched for the g:Tex_DefaultTargetFormat variable in the file and found this line



                      if has('macunix')
                      TexLet g:Tex_DefaultTargetFormat = 'pdf'
                      else
                      TexLet g:Tex_DefaultTargetFormat = 'dvi'
                      endif


                      No need to keep all this checking. so I commented out most of the lines



                      "if has('macunix')
                      TexLet g:Tex_DefaultTargetFormat = 'pdf'
                      "else
                      " TexLet g:Tex_DefaultTargetFormat = 'dvi'
                      "endif


                      After this, vim-latex was able to compile my files. But the viewer wasn't working. So, needed to make a little more change. Searched for g:Tex_ViewRule_ps and changed the lines under if has('win32') to look like this.



                      if has('win32')
                      TexLet g:Tex_ViewRule_ps = 'gsview32'
                      TexLet g:Tex_ViewRule_pdf = 'E:SharePortableAppsSumatraPDF-2.4SumatraPDF.exe'
                      TexLet g:Tex_ViewRule_dvi = 'yap -1'


                      I had to use SumatraPDF because for some reason Adobe Reader 11 was giving the error Unable to find the file. But Sumatra in not so bad. Now I can use vim-latex in peace :)






                      share|improve this answer




























                        0














                        Initial googling let me to this link: http://vim-latex.sourceforge.net/documentation/latex-suite/customizing-compiling.html#Tex_CompileRule_format. However, I couldn't find any clue to where actually configure this variables. But finally I found the location. For my case it was



                        C:Program Files (x86)Vimvimfilesftpluginlatex-suitetexrc


                        The texrc file has all the variables described in the link. As I said in my question, I use miktex portable so first I needed to change the compiler. So I searched for g:Tex_CompileRule_pdf in the file and found this line



                        TexLet g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*'


                        So, I just replaced pdflatex with the full path



                        TexLet g:Tex_CompileRule_pdf = 'E:fullpathofmiktexpdflatex -interaction=nonstopmode $*'


                        Next thing that needed to be changed is telling vim-latex to use pdflatex to compile by default. So, I searched for the g:Tex_DefaultTargetFormat variable in the file and found this line



                        if has('macunix')
                        TexLet g:Tex_DefaultTargetFormat = 'pdf'
                        else
                        TexLet g:Tex_DefaultTargetFormat = 'dvi'
                        endif


                        No need to keep all this checking. so I commented out most of the lines



                        "if has('macunix')
                        TexLet g:Tex_DefaultTargetFormat = 'pdf'
                        "else
                        " TexLet g:Tex_DefaultTargetFormat = 'dvi'
                        "endif


                        After this, vim-latex was able to compile my files. But the viewer wasn't working. So, needed to make a little more change. Searched for g:Tex_ViewRule_ps and changed the lines under if has('win32') to look like this.



                        if has('win32')
                        TexLet g:Tex_ViewRule_ps = 'gsview32'
                        TexLet g:Tex_ViewRule_pdf = 'E:SharePortableAppsSumatraPDF-2.4SumatraPDF.exe'
                        TexLet g:Tex_ViewRule_dvi = 'yap -1'


                        I had to use SumatraPDF because for some reason Adobe Reader 11 was giving the error Unable to find the file. But Sumatra in not so bad. Now I can use vim-latex in peace :)






                        share|improve this answer


























                          0












                          0








                          0







                          Initial googling let me to this link: http://vim-latex.sourceforge.net/documentation/latex-suite/customizing-compiling.html#Tex_CompileRule_format. However, I couldn't find any clue to where actually configure this variables. But finally I found the location. For my case it was



                          C:Program Files (x86)Vimvimfilesftpluginlatex-suitetexrc


                          The texrc file has all the variables described in the link. As I said in my question, I use miktex portable so first I needed to change the compiler. So I searched for g:Tex_CompileRule_pdf in the file and found this line



                          TexLet g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*'


                          So, I just replaced pdflatex with the full path



                          TexLet g:Tex_CompileRule_pdf = 'E:fullpathofmiktexpdflatex -interaction=nonstopmode $*'


                          Next thing that needed to be changed is telling vim-latex to use pdflatex to compile by default. So, I searched for the g:Tex_DefaultTargetFormat variable in the file and found this line



                          if has('macunix')
                          TexLet g:Tex_DefaultTargetFormat = 'pdf'
                          else
                          TexLet g:Tex_DefaultTargetFormat = 'dvi'
                          endif


                          No need to keep all this checking. so I commented out most of the lines



                          "if has('macunix')
                          TexLet g:Tex_DefaultTargetFormat = 'pdf'
                          "else
                          " TexLet g:Tex_DefaultTargetFormat = 'dvi'
                          "endif


                          After this, vim-latex was able to compile my files. But the viewer wasn't working. So, needed to make a little more change. Searched for g:Tex_ViewRule_ps and changed the lines under if has('win32') to look like this.



                          if has('win32')
                          TexLet g:Tex_ViewRule_ps = 'gsview32'
                          TexLet g:Tex_ViewRule_pdf = 'E:SharePortableAppsSumatraPDF-2.4SumatraPDF.exe'
                          TexLet g:Tex_ViewRule_dvi = 'yap -1'


                          I had to use SumatraPDF because for some reason Adobe Reader 11 was giving the error Unable to find the file. But Sumatra in not so bad. Now I can use vim-latex in peace :)






                          share|improve this answer













                          Initial googling let me to this link: http://vim-latex.sourceforge.net/documentation/latex-suite/customizing-compiling.html#Tex_CompileRule_format. However, I couldn't find any clue to where actually configure this variables. But finally I found the location. For my case it was



                          C:Program Files (x86)Vimvimfilesftpluginlatex-suitetexrc


                          The texrc file has all the variables described in the link. As I said in my question, I use miktex portable so first I needed to change the compiler. So I searched for g:Tex_CompileRule_pdf in the file and found this line



                          TexLet g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode $*'


                          So, I just replaced pdflatex with the full path



                          TexLet g:Tex_CompileRule_pdf = 'E:fullpathofmiktexpdflatex -interaction=nonstopmode $*'


                          Next thing that needed to be changed is telling vim-latex to use pdflatex to compile by default. So, I searched for the g:Tex_DefaultTargetFormat variable in the file and found this line



                          if has('macunix')
                          TexLet g:Tex_DefaultTargetFormat = 'pdf'
                          else
                          TexLet g:Tex_DefaultTargetFormat = 'dvi'
                          endif


                          No need to keep all this checking. so I commented out most of the lines



                          "if has('macunix')
                          TexLet g:Tex_DefaultTargetFormat = 'pdf'
                          "else
                          " TexLet g:Tex_DefaultTargetFormat = 'dvi'
                          "endif


                          After this, vim-latex was able to compile my files. But the viewer wasn't working. So, needed to make a little more change. Searched for g:Tex_ViewRule_ps and changed the lines under if has('win32') to look like this.



                          if has('win32')
                          TexLet g:Tex_ViewRule_ps = 'gsview32'
                          TexLet g:Tex_ViewRule_pdf = 'E:SharePortableAppsSumatraPDF-2.4SumatraPDF.exe'
                          TexLet g:Tex_ViewRule_dvi = 'yap -1'


                          I had to use SumatraPDF because for some reason Adobe Reader 11 was giving the error Unable to find the file. But Sumatra in not so bad. Now I can use vim-latex in peace :)







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 17 '13 at 5:57









                          th1rdey3th1rdey3

                          2,68762052




                          2,68762052






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20595158%2fhow-to-configure-vim-latex-to-use-portable-miktex-to-compile%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              'app-layout' is not a known element: how to share Component with different Modules

                              android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                              WPF add header to Image with URL pettitions [duplicate]