Post

写论文vscode+overleaf

写论文环境配置vscode联动overleaf,相关技巧记录

写论文vscode+overleaf

vscode 安装插件

vscode工作区:latex https://blog.csdn.net/Ray_yep/article/details/140066059 使用cookie 登陆: overleaf_session2= 操作文档:document

翻译插件

关键是让这个插件走 代理端口: 教程 vscode设置中搜索 proxy ,用户的http:proxy 中添加http://127.0.0.1:7890。 不开Strict SSL,不在远程主机使用该配置,注意对整个用户有效

常用操作记录(mac键)

1
2
3
command+option+b  # 编译主文档
# 编译后PDF文件在 .output/output.pdf,打开放右边栏
command+option+j

源文件 与pdf 定位与反定位

SyncTeX:将光标放在文档编辑器中的预期位置,然后按 command + option + J 跳转到 PDF 中的相应位置(需要关闭 Latex workshop 估计是按键冲突) 反向 SyncTeX:双击 PDF 上的文本,跳转到编辑器中的相应位置

Latex 如何写作

参考教程

\label{…} 交叉引用

\label{…} 是 LaTeX 中用于交叉引用的命令,常用于章节、公式、图表、定理、命题等环境。它的作用是给某个对象(如定理、图、表、公式等)打上一个“锚点”,方便后续在文中引用。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
定义方式
\begin{figure}
  \includegraphics{fig1.pdf}
  \caption{An example figure.}
  \label{fig:example}
\end{figure}

\begin{equation}
  E = mc^2
  \label{eq:einstein}
\end{equation}
使用方式: 
As shown in Figure~\ref{fig:example}, ...
See Section~\ref{sec:method} for details.
By Theorem~\ref{thm:main}, we know that ...
Equation~\eqref{eq:einstein} shows the relationship ...

编译后,\ref{fig:example} 会自动替换为该图的编号,\ref{sec:method} 替换为该节的编号,\eqref{eq:einstein} 会带上圆括号自动引用公式编号

\label{fig:framework} 要放在\caption 之后

参考文献

.bib 文件添加引用,文章中使用 ~\cite{XXX},XXX 为引用的第一个字段。 文章末 有\bibliographystyle{plain},按bib中作者名自动生成序号顺序,\bibliography{main} 根据bib 文件 自动生成目录

图片定位

[!htbp] 表示:

  • 优先级顺序:首先尝试 h(当前位置),然后是 t(页面顶部),接着是 b(页面底部),最后是 p(单独页面)
  • 强制执行:! 让 LaTeX 忽略一些严格的格式限制,更积极地尝试放置浮动体

移动到不同文本的位置后面,来决定列位置

This post is licensed under CC BY 4.0 by the author.