17.4.15

Using TeXstudio with SumatraPDF

Tomado de http://robjhyndman.com/hyndsight/texstudio-sumatrapdf/

Suma­traPDF is my favourite pdf reader and TeX­studio is my favourite LaTeX edi­tor. Here’s how to get them to work nicely together.
Go to Options/​Configure TeX­studio and click on “Com­mands”. Beside Pdf Viewer, untick “Inter­nal viewer” and add the fol­low­ing command:
"c:/Program Files/SumatraPDF/SumatraPDF.exe" -reuse-instance %.pdf
(If you have Suma­traPDF stored some­where other than the spec­i­fied paths, you will need to edit this accordingly.)
Then you need to tell Suma­traPDF how to jump to the cor­rect line in TeX­studio. From within Suma­traPDF, go to Settings/​Options and set the inverse search com­mand to
"C:\Program Files\TeXstudio\texstudio.exe" "%f" -line %l
Change the path to TeX­studio if necessary.
In order to go from the tex file to the cor­re­spond­ing loca­tion in the pdf, you can add a For­ward­Search com­mand within TeX­studio. Select “User” from the main menu, then “User com­mands” and “Edit User com­mands”. Then add a com­mand with the fol­low­ing definition:
dde://"C:/Program Files/SumatraPDF/SumatraPDF.exe":SUMATRA/control/
  [ForwardSearch("?am.pdf","?c:am.tex",@,0,0,1)]
(That should all be on one line with no space before [ForwardSearch. Again, edit the path for Suma­traPDF as nec­es­sary. Give the com­mand a name such as “For­ward­Search” and click “OK”. Now you should be able to jump to the cor­re­spond­ing part of the pdf file using “Alt-​​Shift-​​F1” (or what­ever key-​​combination is asso­ci­ated with your new command).
Being lazy, I pre­fer a sim­ple func­tion key. To map F2 to your new com­mand, select “Options/​Configure TeX­studio” and choose “Short­cuts”. Find your new com­mand under the User menu, dou­ble click to the right of it and select “F2” from the drop-​​down box. Pre­vi­ously F2 was mapped to LaTeX, but I never use LaTeX directly, so los­ing this func­tion is no problem.
Now you can dou­ble click on any part of the pdf from within Suma­traPDF and it should take you to the cor­re­spond­ing place in your tex file in TeX­studio. And thenF2 will take you back again.

No hay comentarios:

Publicar un comentario