软件安装7:ubuntu18.04+sublime+texlive+zathura

目的是更好的写latex文章

1. TexLive安装

  • 一种方法是下载安装。Ali Mirror,以及ubuntu18.04安装TeX Live 2018,详情略

  • 另外一种方法是apt-get 安装

sudo apt-get install texlive-full
# 下面的是编辑器 texstudio的安装
sudo add-apt-repository ppa:sunderme/texstudio
sudo apt-get update
sudo apt-get install texstudio

2. zathura安装

sudo apt-get install zathura # 好像很简单的样子

3.sublime安装

  • sublime 官网给出了详细的安装步骤
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text
  • 类似参考网址Ubuntu18.04下安装Sublime Text3,并解决不能输入中文的问题!,中文输入问题解决
git clone https://github.com/lyfeyaj/sublime-text-imfix.git
cd sublime-text-imfix && ./sublime-imfix
  • 建立一个软链接,方便命令行打开,也方便zathura反向的时候找到sublime。
sudo ln -s /opt/sublime-text/sublime_text /usr/local/bin/sublime 

3.1 LaTeXTools 插件

  • 通过官方指南https://packagecontrol.io/installation安装package control;
  • Preferences--->Package Control--->安装LaTeXTools插件

4. 配置【重点】

4.1 sublime 配置

  • Preferences--->Package Settings--->LaTeXTools--->Settings-User
//227行左右,设置tex,python 路径
"linux" : {
        // Path used when invoking tex & friends; MUST include $PATH
        "texpath" : "$PATH:/usr/bin",
        // Command to invoke Python. Useful if you have Python installed in a
        // non-standard location or want to use a particular version of python.
        // Both Python2 and Python3 are supported, but must have the DBus bindings
        // installed.
        "python": "~/anaconda2/envs/torch/bin",
        // The name of the ST2 or ST3 executable. On Ubuntu, both subl and sublime-text are
        // available for ST2; adjust as needed for other platforms, and for ST3
        "sublime": "sublime-text",
        // How long to wait after evince or okular has launched before sending a sync message
        // in seconds, floating point; choose 2.0 or 3.0 on a slower machine, 0.5 on a fast one
        // Note: only tweak this if sync after launching the PDF viewer does not seem to work,
        // or if the PDF viewer opens instantly and you don't want to wait.
        // Default: 1.5 (works on my MBP4,1...)
        "sync_wait": 1.5,
        // Command to invoke Sublime Text. Used if the keep_focus toggle is true.
        // If blank, "subl" or "sublime_text" will be used.
        "sublime_executable": "",
        // how long (in ms) to wait after the jump_to_pdf command completes
        // before switching focus back to Sublime Text. This may need to be
        // adjusted depending on your machine and configuration.
        "keep_focus_delay": 0.5
    },
     //379行左右,指定tex builder为 simples
    "builder": "simples",
//487行左右,指定pdf viewer为 zathura
    "viewer": "zathura",

4.2 zathura 反向查找配置

  • 新建zathura的配置文件,路径为"~/.config/zathura/zathurarc"。(跟配置VIM是一回事情)
  • 配置文件中写入反向查找代码:依据你的sublime是什么名字。
set synctex true
set synctex-editor-command 'sublime %{input}:%{line}'

或者,

set synctex true
set synctex-editor-command 'subl %{input}:%{line}'
  • 反向查找时候,记得按ctrl+鼠标左键。这点困惑了我很久,一直没有用上这个技能点。

4.3 重启完事

  • 这一步不是必要的,如何使得zathura的配置生效呢?我采用的是重启大法。感觉很好用了。

你可能感兴趣的:(软件安装7:ubuntu18.04+sublime+texlive+zathura)