这是一个基于python selenium+watchdog开发的Overleaf同步工具。Overleaf的编辑器已经无力再吐槽,然而它强大的实时编译和渲染又使得我们很难拒绝它。这个项目可以使你在本地编辑器写latex并实时将数据同步到Overleaf中,使得你既能在本地的编辑器写又能用上Overleaf的实时编译、渲染。
项目使用了Chromedriver作为Overleaf的浏览器,使用之前请先配置好Chromedriver,如果你是windows用户请参考配置方法,其他平台的用户大概都是Geeker直接默认会了。
###安装依赖包
该程序依赖于requests + watchdog + fire + selenium
,在使用前请先安装好这写依赖包,可以通过以下命令
pip install -r requirements.txt
或者自行安装。
- 在命令行中执行
python main.py \
--work_dir=/path/to/your/latex/project \
--url=<your overleaf website url> \
--email=<your overleaf email> \
--password=<your overleaf password>
其中work_dir为你的latex项目路径默认为当前路径,url
、email
、password
为你的overleaf地址、用户邮箱、密码,这三项仅为方便登陆使用,可以不设置。
- 如果你配置好了Chromedriver,程序运行后会弹出Chrome浏览器窗口。如果你设置了
url
、email
和password
,程序将会自动登录。 - 在Overleaf中进入任意的一个project页面,程序自动监测到该页面后便开始监听你所设置的工作路径,当工作路径内文件发生变化时,文件会自动同步到Overleaf网页端中。
- 创建一个.tex文件试试吧!
This is a synchonizing tools that can automatically synchonize your local latex code and your online Overleaf project. It's developed by python selenium + watchdog
If you haven't setup chromedriver, you can setup followd by this page.
Run the following command in your shell.
pip install -r requirements.txt
Or you can install the requirements listed in the requirements.txt
by yourself.
- Run
python main.py \
--work_dir=/path/to/your/latex/project \
--url=<your overleaf website url> \
--email=<your overleaf email> \
--password=<your overleaf password>
where work_dir
is the directory of you latex project. url
, email
, password
are your overleaf url, email, password separetely.
-
If you have correctly setuped chromedriver and have passed url, email and password, there will be a new Chrome window and it will directly login.
-
Enter a project and then the file watcher will start.
-
Create your first tex file and try it out.