Although there are many materials online relating to Sweave and its workflow, I could not find any source on how to make SyncTeX work properly with my favorite TeXmaker editor. I hope that you know the Sweave (http://www.stat.uni-muenchen.de/~leisch/Sweave/) is a tool that allows to embed the R code for complete data analyses in LaTeX documents.
- Ubuntu 12.10 32bit
- TeXmaker v.4.0.4 (compiled with Qt 4.8.3 and Poppler 0.20.4)
- pdfLaTeX / pdfTeX, Version 3.1415926-2.5-1.40.14 from TeX Live 2013 distribution (format=pdflatex 2013.7.15)
- R (R version 3.0.2 (2013-09-25) — "Frisbee Sailing")
- patchDVI R package version 1.9 (works with Sweave and document previewers to facilitate editing: it modifies the links that LaTeX puts into the output so that they refer to the original source)
- I assume that you have R, LaTeX and TeXmaker installed.
- Install the patchDVI package ( the package is available online at http://r-forge.r-project.org/projects/sweavesearch ) Start R, and run the command:
- Open TeXmaker and go to Options menu -> Configure Texmaker -> Quick Build. Select Quick Build command ‘User’ and copy the following:
- In all Sweave (.Rnw) documents, the following lines must be included:
- Open your .Rnw file in TeXmaker and compile it to PDF using F1 user command
- When PDF is successfully compiled, check whether sync works or not by: In TeXmaker, set cursor to the word and open right-click mouse menu, select "Jump to pdf", if everything is Okay, the viewer shows a line with the word. Holding
key, double-click any word n PDF viewer, the cursor moves to right place of the .Rnw source file.
Wow! It works!