Skip to content

Commit

Permalink
update texstudio setting
Browse files Browse the repository at this point in the history
  • Loading branch information
OsbertWang committed Apr 26, 2021
1 parent f3bad64 commit ced07aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ \chapter{\TeX Studio}
最重要的效果就是正反向搜索.
在这里给出我所使用的命令行代码.
\begin{lstlisting}
<SumatraPDFROOT>\SumatraPDF.exe -reuse-instance -forward-search main.tex 4 -inverse-search "\"<TeXStudioROOT>\texstudio.exe\" \"%f\" -line %l" main.pdf
<SumatraPDFROOT>\SumatraPDF.exe -reuse-instance -forward-search subfile.tex 2 -inverse-search "\"<TeXStudioROOT>\texstudio.exe\" \"%f\" -line %l" main.pdf
\end{lstlisting}
其中,
\begin{lstlisting}
-reuse-instance
\end{lstlisting}
表示只打开一个 SumatraPDF 窗口;
\begin{lstlisting}
-forward-search main.tex 4
-forward-search subfile.tex 2
\end{lstlisting}
表示对 \texttt{main.tex} 的第 4 行进行正向搜索
表示对 \texttt{subfile.tex} 的第 2 行进行正向搜索
(在 SumatraPDF 中表现为 \texttt{main.pdf} 对应位置变蓝);
\begin{lstlisting}
-inverse-search "\"<TeXStudioROOT>\texstudio.exe\" \"%f\" -line %l" main.pdf
Expand All @@ -120,10 +120,10 @@ \chapter{\TeX Studio}
首先在 \menu{Options > Configure TeXstudio} 中选择 \menu{Show Advanced Options},
而后在 \menu{Build > User commands} 中添加
\begin{lstlisting}
"<SumatraPDFDIR>\SumatraPDF.exe" -reuse-instance -forward-search ?c:rme" @ -inverse-search "<TeXstudioDIR>\texstudio.exe %%f -line %%l" "?m.pdf"
"<SumatraPDFDIR>\SumatraPDF.exe" -reuse-instance -forward-search ?c:rme" @ -inverse-search "<TeXstudioDIR>\texstudio.exe %%f -line %%l" ?p{pdf}:ame"
\end{lstlisting}
将其命名为 \texttt{user0:sumatrapdf}.
这里的 \texttt{?c:rme}、\texttt{@}、\texttt{\%\%}、\texttt{?m.} 均是 \TeX Studio 自己定义的有特殊含义的字符.
这里的 \texttt{?c:rme}、\texttt{@}、\texttt{\%\%}、\texttt{?p\{pdf\}:ame} 均是 \TeX Studio 自己定义的有特殊含义的字符.
接下来,
\menu{Build > Build \& View} 中将
\texttt{txs:///compile | txs:///view}
Expand All @@ -140,7 +140,7 @@ \chapter{\TeX Studio}
如果以上设置没能正确实现正反向搜索,
那么可以将 \texttt{user0:sumatrapdf} 改为
\begin{lstlisting}
dde:///"<SumatraPDFROOT>\SumatraPDF.exe":SUMATRA/control/[ForwardSearch("?m.pdf",?c:rme",@,0,0,1)]
dde:///"<SumatraPDFDIR>\SumatraPDF.exe":SUMATRA/control/[ForwardSearch(?p{pdf}:ame",?c:rme",@,0,0,1)]
\end{lstlisting}
其他不变.
而后用 SumatraPDF 打开编译完的 pdf 文件,
Expand Down

0 comments on commit ced07aa

Please sign in to comment.