美文网首页
软件安装7:ubuntu18.04+sublime+texliv

软件安装7:ubuntu18.04+sublime+texliv

作者: 闪电侠悟空 | 来源:发表于2019-12-15 14:52 被阅读0次

    目的是更好的写latex文章

    1. TexLive安装

    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安装

    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
    
    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 插件

    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+texliv

          本文链接:https://www.haomeiwen.com/subject/qbrdyctx.html