江湖中的剑(1)科研工具配置与使用


1.论文写作

1.1 LaTeX排版

1.1.1 VSCode+LaTeX环境配置

使用VSCode编写LaTeX
2020搭建Latex环境:Texlive+VScode
使用VSCode编写LaTeX

  1. 安装 texlive
    清华镜像源
    华为镜像源

  2. 安装 VSCode 上的LATEX插件

  3. 配置 VSCode 的LATEX插件

  4. 配置正向和反向搜索
    安装Sumatra PDF
    Viewing & SyncTeX
    GitHub Issue

    {
        "workbench.colorTheme": "Default Dark+",
        "security.workspace.trust.untrustedFiles": "open",
        "latex-workshop.latex.tools": [
            {
        // 编译工具和命令
        "name": "xelatex",
        "command": "xelatex",
        "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "%DOCFILE%"
                ]
            },
            {
                "name": "pdflatex",
                "command": "pdflatex",
                "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
                ]
            },
            {
                "name": "bibtex",
                "command": "bibtex",
                "args": [
                "%DOCFILE%"
                ]
            }
        ],
        "latex-workshop.latex.recipes": [
        {
        "name": "xelatex",
        "tools": [
        "xelatex"
            ],
        },
        {
        "name": "pdflatex",
        "tools": [
        "pdflatex"
            ]
        },
        {
        "name": "xe->bib->xe->xe",
        "tools": [
        "xelatex",
        "bibtex",
        "xelatex",
        "xelatex"
            ]
        },
        {
        "name": "pdf->bib->pdf->pdf",
        "tools": [
        "pdflatex",
        "bibtex",
        "pdflatex",
        "pdflatex"
            ]
        }
        ],
        "latex-workshop.view.pdf.viewer": "external",
    
        "latex-workshop.view.pdf.external.viewer.command": "D:/Program Files (x86)/SumatraPDF/SumatraPDF.exe",
        "latex-workshop.view.pdf.external.viewer.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "\"C:/Program Files/Microsoft VS Code/Code.exe\" \"C:/Program Files/Microsoft VS Code/resources/app/out/cli.js\" -r -g \"%f:%l\"",
        "%PDF%"
        ],
        "latex-workshop.view.pdf.external.synctex.command": "D:/Program Files (x86)/SumatraPDF/SumatraPDF.exe",
        "latex-workshop.view.pdf.external.synctex.args": [
        "-forward-search",
        "%TEX%",
        "%LINE%",
        "-reuse-instance",
        "-inverse-search",
        "\"C:/Program Files/Microsoft VS Code/Code.exe\" \"C:/Program Files/Microsoft VS Code/resources/app/out/cli.js\" -r -g \"%f:%l\"",
        "%PDF%",
        ],
    }
    
    
  5. 快捷键设置

    // 将键绑定放在此文件中以覆盖默认值
    [
        {
            //正向搜索
            "key": "ctrl+d",
            "command": "latex-workshop.synctex",
            "when": "editorTextFocus && !isMac"
        },
        {
            //使用默认 recipe 编译
            "key": "ctrl+k",
            "command": "latex-workshop.build",
            "when": "editorTextFocus && !isMac"
        },
        {
            //终止编译
            "key": "alt+t",
            "command": "latex-workshop.kill",
            "when": "editorTextFocus && !isMac"
        },
        {
            "key": "alt+e",
            "command": "latex-workshop.recipes"
        },
    ]
    
  6. 其他设置

1.1.2 Latex使用

1.2.1.latex显示中文

latex显示中文

在源文件中导言部分加入代码:\usepackage[UTF8]{ctex}

1.3 GitHub代码管理

1.3.1 安装

  1. 安装Git
    git安装教程
    Download for Windows
    一句话总结,一直next到底,选择默认设置
    在这里插入图片描述

  2. 安装TortoiseGit
    TortoiseGit安装教程
    Download
    注意:下载安装包和语言包(简体中文)
    在这里插入图片描述

1.3.2 TortoiseGit使用

存在问题,TortoiseGit与Git的密码不兼容,从而导致其与Vscode为两个单独部分。目前,Vscode+Git代码管理中没有使用TortoiseGit,#TODO增加将Git与TortoiseGit进行统一。

TortoiseGit使用

1.创建本地密钥

在这里插入图片描述

  1. 运行Puttygen,把右下角的数值改成4096(这个是最长的)然后点击“Generate”就可以了。点击之后它会要求你随机移动鼠标,直到进度条满为止。
  2. 在passphrase和下面的确认框输入密码,这个密码你自己写咯,不过记着哦。写好之后,点“save private key”保存就行。
  3. Public key是填在服务器上的,打开你的Github账户,Edit YourProfile,然后SSH keys,然后add,然后把putty生成的public key贴进去就行了。
2.建立github仓库

在这里插入图片描述

3.克隆仓库到本地及推送服务器端
  1. url中填写之前github提供的ssh地址,putty key填写创建的private key,ok之后,输入passphrase。
    在这里插入图片描述
    在这里插入图片描述
  2. commit记录到本地版本库,注意,git要求每次commit必须输入描述信息。
    在这里插入图片描述
  3. 推送(push)到服务器端
    在这里插入图片描述
  4. GitHub服务器端查看
    在这里插入图片描述
4.使用用例

Git客户端(TortoiseGit)基本使用详解

Git Pull是从远端拉取最新的代码
Git Fetch是从远端拉取最新的分支
Git Push是将本地仓库的代码提交到远端
Git Commit ->”master”,将本地代码提交到本地版本库

1.3.3 Vscode配置Git

在VScode上配置Git

  1. 设置全局变量
    git config --global user.name "your name" 
    git config --global user.email "your@email.com"
    
  2. 登陆GitHub,创建SSHkey
    ssh -T git@github.com
    
  3. 克隆仓库
    git clone git@github.com:fenyukuang/TestCode.git
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

冰火舞动

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值