Texlive 如何安装自己的 cls 和 sty 文件

参考文献:https://tex.stackexchange.com/questions/1137/where-do-i-place-my-own-sty-or-cls-files-to-make-them-available-to-all-my-te

 

以下为安装 commonstuff.cls 和 commonstuff.sty 的方式,如commonstuff.* 变为 example.* 和 下文中commonstuff相关的内荣要相应改为example

 

You could create a folder below your TeX home directory and put your .sty file therein. Use this command at the command prompt to find out where:

kpsewhich -var-value=TEXMFHOME

On my computer it shows

C:/Users/stefan/texmf

but it might also be ~/texmf/ on a Linux or Unix computer.

Following the TeX directory structure, you should place your file in a subdirectory like ~/texmf/tex/latex/commonstuff/, according to Arthur's comment below. This has the advantage that it is not necessary to update the package database as TeX searches your personal texmf tree directly. If there is an ls-R file in your home texmf tree you can safely delete it as TeX will not use it anyway. (Note: this assumes your personal tree is on a local file system: users with remotely-mounted home folders may still need to hash.)

Regarding MiKTeX, have a look at the section "Installing sty or cls files" in the answer to the question How can I manually install a package on MikTex (Windows).

You can then verify what file will be used with:

kpsewhich filename.sty

This will show the path to the file picked up by the TeX implementation.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: 如何安装texlivetexstudio? 可以按照以下步骤在电脑上安装texlivetexstudio: 1. 下载texlive安装文件,可以在官网或镜像网站上找到,下载后进行安装。 2. 下载texstudio,同样可以在官网或镜像网站上找到并下载。 3. 安装texstudio,按照提示进行操作。 4. 打开texstudio,将texlive路径配置到软件中,即可开始使用。 ### 回答2: TeXLiveTeXstudio是目前较为常见的TeX编译工具,TeXLiveTeX系统的基础,它集成了所有的TeX程序包和字体,并能够进行跨平台的安装和升级;TeXstudio则是一款TeX编辑器,它提供了许多TeX编辑相关的功能,如语法高亮、智能补全、实时预览等。 安装TeXLiveTeXstudio步骤如下: 1. 下载TeXLiveTeXstudio TeXLive的下载地址为:https://www.tug.org/texlive/acquire.html,选择符合自己系统的版本进行下载;TeXstudio的下载地址为:https://www.texstudio.org/#download,同样选择符合自己系统的版本下载。 2. 安装TeXLive 安装TeXLive需要管理员权限,可以选择默认安装选项,也可以根据自己的需要进行定制安装安装完成后,需要添加环境变量,将TeXLive的bin目录添加到系统的PATH环境变量中,这样才可以在命令行中使用TeXLive的相关命令。 3. 安装TeXstudio 安装TeXstudio只需要按照安装向导逐步进行即可,可以选择默认安装选项。安装完成后,可以打开TeXstudio进行设置,如字体、编码、默认保存格式、插件等。 4. 使用TeXstudio 打开TeXstudio后,可以使用左侧的工具栏进行文件建、打开、保存等操作;中间的编辑区可以编辑TeX文件,右侧的预览区可以预览TeX文件的内容。可以使用菜单栏上的编译按钮进行编译,编译完成后预览区会显示PDF文件。 需要注意的是,TeXLiveTeXstudio是两个相互独立的软件,需要分别安装和设置。同时,如果需要使用中文编译,还需要安装相关中文字体和中文支持包。 ### 回答3: TeXLiveTeXStudio是TeX文档编译的两个常用工具,TeXLive提供了一系列TeX相关的工具和库,TeXStudio则是一款TeX文档编写和编辑的工具。在这里,将详细介绍TeXLiveTeXStudio的安装过程。 一、TeXLive安装 1. 下载TeXLive:首先需要下载TeXLive安装包,可在官网(https://tug.org/texlive/acquire-netinstall.html)下载,也可以使用国内的镜像网站下载(如:https://mirrors.tuna.tsinghua.edu.cn/)。 2. 安装TeXLive:解压下载下来的安装包,运行其中的“install-tl-windows.exe”安装程序,根据提示进行安装。一般选择默认设置即可。 3. 配置环境变量:在安装过程中会提示是否配置环境变量,如果没有配置,需手动配置。在系统环境变量中添加“PATH”变量,将TeXLive的bin目录添加到其中。 4. 检查安装安装完成后,可以在命令行中输入“tex -v”验证TeXLive是否安装成功。 二、TeXStudio安装 1. 下载TexStudio:TeXStudio官网(http://texstudio.sourceforge.net/)提供了Windows、Mac、Linux等多个操作系统平台的版本,选择相应的版本进行下载。 2. 安装TeXStudio:双击下载下来的安装包,按照提示进行安装,一般选择默认设置即可。 3. 配置编译器:打开TeXStudio,依次选择“选项”-“配置TeXStudio”,在左边的菜单中选择“构建”选项卡,在右边的下拉框中选择“默认编译器”为“txs:///pdflatex”(如果需要使用XeLaTeX或者LuaLaTeX编译,需要在论文开头添加对应的格式)。 4. 配置PDF查看器:在TeXStudio中预览PDF文档需要安装PDF查看器,Windows系统常用的有Adobe Acrobat Reader、Sumatra PDF等,Mac系统自带Preview,Linux系统可安装epdfview等多个查看器。在TeXStudio中选择“选项”-“配置TeXStudio”,在左边的菜单中选择“构建”选项卡,在右边的下拉框中选择“PDF查看器”为上述所用的PDF查看器。 5. 检查配置:完成以上配置后,可以建一个.tex文件,写入测试代码并编译,观察是否编译成功。 以上是TeXLiveTeXStudio的安装和配置过程,希望对大家有所帮助。需要指出的是,与网上下载已经打包好的TeX环境相比,自己安装TeXLive可以根据需求自由配置安装内容,可有效减少安装文件大小,提高使用体验。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值