TeX Live for windows 安装及更新

下载install-tl-windows.exe 或者install-tl.zip压缩包,解压之后右键以管理员身份运行install-tl-advanced.bat。可以从官网下载。国内有镜像安装源,例如 https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet/install-tl-windows.exe

目前下载到的是 Tex live 2015版。

第一步选择国内的CTAN(Comprehensive TeX Archive Network)站点。

如果全部安装,需要4322MB空间。由于从网上下载大批安装包,预计安装过程比较漫长。

这里选择 basic scheme(plain and latex) ,只需要磁盘空间244MB。

推荐选择 custom selection of collections。然后选择四个组件: Essential programs and files;LaTex fundamental packages;chinese;windows-only support programs。需要456MB空间。

Portable Setup选择了“是”。安装目录可以修改到其他驱动器,这里选择安装到D盘。其他选项基本不用修改,例如缺省纸张是A4,等等。

安装完成之后,到系统设置-高级选项-环境变量里面,把Path环境变量加上tex live的二进制程序目录。这里是 D:\texlive\bin\win32;

安装之后进行简单测试。

由于本机安装了python环境,直接 pip install pylatex。然后找了一个源码进行测试。

#!/usr/bin/python 
""" 
This example shows basic document generation functionality. 
 
..  :copyright: (c) 2014 by Jelte Fennema. 
    :license: MIT, see License for more details. 
""" 
# begin-doc-include 
from pylatex import Document, Section, Subsection, Command 
from pylatex.utils import italic, NoEscape 

def fill_document(doc): 
    """Add a section, a subsection and some text to the document. 
 
    :param doc: the document 
    :type doc: :class:`pylatex.document.Document` instance 
    """ 
    with doc.create(Section('A section')): 
        doc.append('Some regular text and some ') 
        doc.append(italic('italic text. ')) 


        with doc.create(Subsection('A subsection')): 
            doc.append('Also some crazy characters: $&#{}') 

if __name__ == '__main__': 
    # Basic document 
    doc = Document('basic') 
    fill_document(doc) 

    doc.generate_pdf() 
    doc.generate_tex() 

    # Document with `\maketitle` command activated 
    doc = Document() 

    doc.preamble.append(Command('title', 'Awesome Title')) 
    doc.preamble.append(Command('author', 'Anonymous author')) 
    doc.preamble.append(Command('date', NoEscape(r'\today'))) 
    doc.append(NoEscape(r'\maketitle')) 

    fill_document(doc) 

    doc.generate_pdf('basic_maketitle', clean=False) 

    # Add stuff to the document 
    with doc.create(Section('A second section')): 
        doc.append('Some text.') 

    doc.generate_pdf('basic_maketitle2') 
    tex = doc.dumps()  # The document as string in LaTeX syntax

保存为testlatex.py

> python testlatex.py

如果没问题,将生成basic.pdf。如果出错,需要根据出错信息进行处理。可能遇到下面的两个错误。


! Font T1/cmr/m/n/10=ecrm1000 at 10.0pt not loadable: Metric (TFM) file not found.

! LaTeX Error: File `lmodern.sty' not found.

错误是缺少相应的包导致。


更新包的过程很简单,TeX Live提供了图形化程序 TeX Live manager。

打开管理器,刷新软件源,分别搜索ec和lm,安装下面的两个包。

ec    computer modern fonts in T1 and TS1 encodings

lm    latin modern fonts in outline formats

完毕之后重新运行测试代码,如果无误将不会报错。检查输出文件basic.pdf是否已在当前目录创建,打开basic.pdf看内容是否符合预期。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值