五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

VS Code+Sumatra PDF正反向搜索

2023-06-29 00:36 作者:青爺威武  | 我要投稿

簡介

重新裝機后,在配置VS Code和LaTeX的環(huán)境后,問題卡在了正反向搜索這邊,簡單記錄下。


綜合參考以下鏈接:

  • [VS Code + Tex Live + SumatraPDF配置LaTeX反向搜索(持續(xù)更新)](https://blog.csdn.net/yihuajack/article/details/123877375)

  • [解決SumatraPDF 在VS Code上反向搜索失效](https://www.jianshu.com/p/2b21384e0638)

  • [Sumatra PDF反向搜索的問題記錄 (texlive+vscode)](https://zhuanlan.zhihu.com/p/447892378)

正向

在安裝LaTeX Workshop后,打開VS Code的settings.json


首先是配置基本的命令參數(shù),常用的就是這三種

? ?"latex-workshop.latex.tools": [
? ? ? ?{
? ? ? ? ? ?"name": "xelatex",
? ? ? ? ? ?"command": "xelatex",
? ? ? ? ? ?"args": [
? ? ? ? ? ? ? ?"-synctex=1",
? ? ? ? ? ? ? ?"-interaction=nonstopmode",
? ? ? ? ? ? ? ?"-file-line-error",
? ? ? ? ? ? ? ?"-pdf",
? ? ? ? ? ? ? ?"%DOCFILE%"
? ? ? ? ? ?]
? ? ? ?},
? ? ? ?{
? ? ? ? ? ?"name": "pdflatex",
? ? ? ? ? ?"command": "pdflatex",
? ? ? ? ? ?"args": [
? ? ? ? ? ? ? ?"-synctex=1",
? ? ? ? ? ? ? ?"-interaction=nonstopmode",
? ? ? ? ? ? ? ?"-file-line-error",
? ? ? ? ? ? ? ?"%DOCFILE%"
? ? ? ? ? ?]
? ? ? ?},
? ? ? ?{
? ? ? ? ? ?"name": "bibtex",
? ? ? ? ? ?"command": "bibtex",
? ? ? ? ? ?"args": [
? ? ? ? ? ? ? ?"%DOCFILE%"
? ? ? ? ? ?]
? ? ? ?}
? ?],


然后是由上述基本命令引出的編譯鏈

? ?"latex-workshop.latex.recipes": [
? ? ? ?{
? ? ? ? ? ?"name": "xelatex",
? ? ? ? ? ?"tools": [
? ? ? ? ? ? ? ?"xelatex"
? ? ? ? ? ?]
? ? ? ?},
? ? ? ?{
? ? ? ? ? ?"name": "pdflatex",
? ? ? ? ? ?"tools": [
? ? ? ? ? ? ? ?"pdflatex"
? ? ? ? ? ?]
? ? ? ?},
? ? ? ?{
? ? ? ? ? ?"name": "xe->bib->xe->xe",
? ? ? ? ? ?"tools": [
? ? ? ? ? ? ? ?"xelatex",
? ? ? ? ? ? ? ?"bibtex",
? ? ? ? ? ? ? ?"xelatex",
? ? ? ? ? ? ? ?"xelatex"
? ? ? ? ? ?]
? ? ? ?},
? ? ? ?{
? ? ? ? ? ?"name": "pdf->bib->pdf->pdf",
? ? ? ? ? ?"tools": [
? ? ? ? ? ? ? ?"pdflatex",
? ? ? ? ? ? ? ?"bibtex",
? ? ? ? ? ? ? ?"pdflatex",
? ? ? ? ? ? ? ?"pdflatex"
? ? ? ? ? ?]
? ? ? ?}
? ?],


接著配置外部PDF閱讀器

? ?"latex-workshop.view.pdf.viewer": "external",
? ?"latex-workshop.view.pdf.ref.viewer": "external",
? ?"latex-workshop.view.pdf.external.viewer.command": "C:/Users/AppData/Local/SumatraPDF/SumatraPDF.exe",


接下來才是正向搜索:

  1. 首先保證.gz不會被刪除

  2. 同樣地,在settings.json寫入配置

"latex-workshop.view.pdf.external.synctex.command": "C:/Users/AppData/Local/SumatraPDF/SumatraPDF.exe",
? ?"latex-workshop.view.pdf.external.synctex.args": [
? ? ? ?"-forward-search",
? ? ? ?"%TEX%",
? ? ? ?"%LINE%",
? ? ? ?"-reuse-instance",
? ? ? ?"-inverse-search",
? ? ? ?"%PDF%"
? ?],

有人在latex-workshop.view.pdf.external.synctex.args加入反向搜索的命令,但其實不會起作用,反向搜索只要在Sumatra PDF中設(shè)置就可以了

  1. 設(shè)置正向搜索等快捷鍵,打開keybindings.json

{
? ? ? ?"key": "alt+s",
? ? ? ?"command": "latex-workshop.synctex",
? ? ? ?"when": "editorTextFocus && !isMac"
? ?},
? ?{
? ? ? ?"key": "alt+b",
? ? ? ?"command": "latex-workshop.build",
? ? ? ?"when": "editorTextFocus && !isMac"
? ?},
? ?{
? ? ? ?"key": "alt+t",
? ? ? ?"command": "latex-workshop.kill",
? ? ? ?"when": "editorTextFocus && !isMac"
? ?},
? ?{
? ? ? ?"key": "alt+e",
? ? ? ?"command": "latex-workshop.recipes"
? ?},

這樣就可以通過alt+s來正向搜索

反向

在Sumatra PDF的設(shè)置->選項中,設(shè)置反向搜索命令:

"C:\Users\AppData\Local\Programs\Microsoft VS Code\Code.exe" "C:\Users\AppData\Local\Programs\Microsoft VS Code\resources\app\out\cli.js" --ms-enable-electron-run-as-node -r -g "%f":"%l"

  • 第一個參數(shù)是VS Code的所在位置

  • 第二個參數(shù)的cli.js和第三個參數(shù)的--ms-enable-electron-run-as-node是避免VS Code使用子進(jìn)程打開Sumatra PDF后,Sumatra PDF無法反向搜索的情況


VS Code+Sumatra PDF正反向搜索的評論 (共 條)

分享到微博請遵守國家法律
新晃| 五大连池市| 日喀则市| 中宁县| 南平市| 湟中县| 凌海市| 利津县| 宁国市| 嘉黎县| 扎赉特旗| 桦南县| 濮阳市| 丰镇市| 炎陵县| 东城区| 浠水县| 远安县| 棋牌| 锡林浩特市| 唐山市| 容城县| 繁峙县| 文山县| 葵青区| 宁乡县| 嘉峪关市| 澜沧| 蒙自县| 磐石市| 揭东县| 盖州市| 德令哈市| 杨浦区| 和田市| 鹿邑县| 都兰县| 阳谷县| 疏附县| 永和县| 石景山区|