wildgoat的个人空间 https://blog.eetop.cn/wildgoat [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

[ZZ]PDF syncing in Sublime Text for LaTeX on Windows

已有 2445 次阅读| 2012-12-25 22:52 |个人分类:Latex相关

I have moved all of my work back onto a Windows box recently, which means completing overhauling my LaTeX setup. I know there are a lot of integrated environments for LaTeX on Windows, but I prefer a straight text editor. Coming from Textmate, I landed on Sublime Text 2.

Sublime comes with a LaTeX bundle already installed (which has syntax highlighting and a number of other bells and whistles), but it takes a bit more elbow grease to achieve two-way syncing with a PDF viewer and use XeTeX. I couldn’t find anywhere else on the web that exactly details this process and confirms that it works, so for anyone searching for the solution (and for myself next time), here is how I got it working:

  • Install Sublime Text 2 and Sumatra PDF Viewer.
  • Install the Sublime Package Control package using these instructions.
  • Install the LatexTools package from these instructions.
  • Make sure SumatraPDF.exe is in your path.
  • Find the file LaTeX.sublime-build in the LatexTools directory and replace the following (in the Windows portion):
"cmd": ["texify", 
"-b", "-p",
"--tex-option="--synctex=1""
],

with

"cmd": ["latexmk", 
"-e", "$pdflatex = 'xelatex %O -interaction=nonstopmode -synctex=1 %S'",
//"-silent",
"-f", "-pdf"],
  • Set Sumatra to perform. inverse search in Sublime. Open a LaTeX-generated pdf that was compiled with synctex enabled, and you will see a relevant option in the Sumatra preferences. Replace that line with:
"C:Program FilesSublime Text 2sublime_text.exe" "%f:%l"`

And you’re done. Now, you can compile any LaTeX file in Sublime Text via latexmk by ctrl+b, and it will launch the pdf in Sumatra, opened exactly at the location of your last edit. When you want to go back to the LaTeX source in Sublime Text, double-click in the pdf wherever you want the source to open.

Big improvement over opening on the title page of your dissertation every compile.


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 128

    粉丝
  • 43

    好友
  • 339

    获赞
  • 119

    评论
  • 22191

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-7-6 16:16 , Processed in 0.011812 second(s), 8 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部