Skip to content
kjk edited this page Dec 8, 2014 · 1 revision

DDE message format:

The format of a single DDE command is: [Command(parameter1, parameter2, ..., )]

Multiple commands can be concatenated as follows: [Command1(parameter1, parameter2, ..., )][Command2(...)][...]

List of recognized commands

  • Open file command

    • Format: [Open("<pdffilepath>"[,<newwindow>,<setfocus>,<forcerefresh>])]
    • Arguments:
      • if newwindow = 1 then a new window is created even if the file is already open
      • if focus = 1 then the focus is set to the window
      • if forcerefresh = 1 the command forces the refresh of the file window if already open (useful for files opened over network that don't get file-change notifications)".
    • Eg: [Open("c:\file.pdf", 1, 1, 0)]
  • Forward-search command

    • Format: [ForwardSearch(["<pdffilepath>",]"<sourcefilepath>",<line>,<column>[,<newwindow>,<setfocus>])]
    • Arguments:
      • pdffilepath: path to the PDF document (if this path is omitted and the document isn't already open, SumatraPDF won't open it for you)
      • column: this parameter is for future use (just always pass 0)
      • newwindow: 1 to open the document in a new window (even if the file is already opened)
      • focus: 1 to set focus to SumatraPDF's window.
    • Eg:
    [ForwardSearch("c:\file.pdf","c:\folder\source.tex",298,0)]
    [ForwardSearch("c:\folder\source.tex",298,0,0,1)]
    
  • Jump to named destination command

    • Format: [GotoNamedDest("<pdffilepath>","<destination name>")]
    • Eg: [GotoNamedDest("c:\file.pdf", "chapter.1")]
    • Note: the pdf file must be already opened.
  • Go to page

    • Format: [GotoPage("<pdffilepath>",<page number>)]
    • Eg: [GotoPage("c:\file.pdf", 37)]
    • Note: the pdf file must be already opened.
  • Set view settings

    • Format: [SetView("<pdffilepath>","<view mode>",<zoom level>[,<scrollX>,<scrollY>])]
    • Arguments:
      • view mode: one of the strings "single page", "facing", "book view", "continuous", "continuous facing" and "continuous book view"
      • zoom level: either a zoom factor between 8 and 6400 (in percent) or one of -1 (Fit Page), -2 (Fit Width) or -3 (Fit Content)
      • scrollX, scrollY: PDF document (user) coordinates of the point to be visible in the top-left of the window
    • Eg: [SetView("c:\file.pdf","continuous",-3)]
    • Note: the pdf file must already be opened.

Configuring DDE-synchronization with TeX editors

TeXnicCenter

  • Path of executable: C:\Program Files\SumatraPDF\SumatraPDF.exe on 32-bit windows, C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe on 64-bit windows. (or wherever you've installed SumatraPDF)

  • View project's output: DDE command: [Open("%bm.pdf",0,1,1)] Server: SUMATRA Topic: control

  • Forward Search: DDE command: [ForwardSearch("%bm.pdf","%Wc",%l,0,0,1)] Server: SUMATRA Topic: control

(Some people reported better results when using %sbm instead of %bm in the above command.)

  • Close document before running (La)TeX: Do not close

  • To enable the inverse search, you also have to append to the (La)TeX compiler arguments: -synctex=1

See http://www.texniccenter.org/resources/tutorials/47 for more detailed instructions.

WinEdt, Emacs and Vim

See instructions at http://william.famille-blum.org/blog/static.php?page=static081010-000413

Clone this wiki locally