[Share Experiences] 在deepin上使用LaTeX
Tofloor
poster avatar
zimo1
deepin
2021-12-29 05:20
Author

LaTeX简介

LaTeX是一种排版语言,是写论文,写书的好工具,具体的渊源这里不详述了。和Word这类编辑排版工具相比,LaTeX能通过记事本编写论文,通过LaTeX编译器和文档生成器,还可以生成pdf、word等等格式的文档。因为所有的格式都通过语法控制,所以对于文档格式的控制和调整更加自如。

另外LaTeX在数学公式排版方面非常好用。

image.png

LaTeX安装

LaTeX的安装分为两个模块,前端的文本编辑器和后端的编译工具包。我们选择的前端的文本编辑器为texstudio,后端编译工具包为texlive。

  • 安装LaTeX
    sudo apt-get install texlive-full
    此命令安装了XeLaTeX编译引擎texlive-xetex,中文支持包texlive-lang-chinese等等许多工具。也可以到官网https://tug.org/texlive/下载源码编译安装,这样的优点是可以获得最新的版本。
  • 安装图形化界面编辑器texstudio
    sudo apt-get install texstudio
    当然也可以选择其他编辑器,比如Visual Studio Code,一来比较的美观,二来Visual Studio Code自动语法补全比较好用。

配置

在texstudio菜单栏的Options,选择Configure TeXstudio-->Build-->Default Compiler使用XeLaTeX。对于其他的编辑器,也需要配置和后端编译器的连接,请根据具体工具搜索网络教程。

image.png

测试

在texstudio中新建文件,输入如下文本。

\documentclass[UTF8]{ctexart}

\title{deepin安装LaTeX}

\author{sinan}

\date{\today}

\CTEXsetup[format={\zihao{-3}\raggedright\bfseries}]{section}

\begin{document}

\maketitle

\noindent

\section{LaTeX简介}

LaTeX是一种排版语言,是写论文,写书的好工具。

\end{document}

然后按F5编译并查看结果,可以在右边看到生成的文档效果:

image.png

LaTeX表格

在texstudio中新建文件,输入如下文本。

\documentclass[UTF8]{ctexart}

\begin{document}

\begin{tabular}{ccc}

\hline

姓名& 学号& 性别\

\hline

Steve Jobs& 001& Male\

Bill Gates& 002& Female\

\hline

\end{tabular}

\end{document}

效果如下:

image.png

LaTeX公式

在texstudio中新建文件,输入如下文本。

\documentclass{article}

\usepackage{ctex}

\begin{document}

公式实例
\begin{equation}

f(x) = \sum_{i=1}^{n} {x_i}

\end{equation}

\end{document}

效果如下:

image.png

导出为PDF

在texstudio菜单栏的Files,选择Save As,可以导出为PDF文档。

提示

无需安装CTEX(LaTeX工具集成包),该包已过维护期

Reply Favorite View the author
All Replies
实数集
deepin
2021-12-29 05:45
#1

感谢分享

Reply View the author
sudo_free
deepin
2021-12-29 16:25
#2

texlive-full占的空间太大了,特别是一堆没必要的语言支持,以下提供个日常用的最小配置:

sudo apt install latexmk texlive-science texlive-games texlive-publishers tex-common texlive-base texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra latex-cjk-all

顺便不推荐用瞎眼的texstudio,建议使用 vscode+Latex Workshop

Reply View the author
鲁鹏
Junior Packager
2021-12-29 16:56
#3

我觉得还是下载最新版镜像在安装比较好,直接使用命令行安装有时候会有问题。

Reply View the author
babyfengfjx
Super Moderator
CQA
2021-12-29 22:06
#4

这个太专业了😂

Reply View the author
神末shenmo
Moderator
Spark-App
2021-12-30 03:00
#5

对于普通人来说还是直接用wps更省事吧

我现在用markdown都不怎么熟练,还是wp的编辑器舒服

Reply View the author
doodo
deepin
2021-12-30 18:34
#6
It has been deleted!
jalawov
deepin
2021-12-30 18:49
#7

这个软件用deepin的qt库会旁边数学符号的菜单会乱码。用appimage自带依赖的版本正常

Reply View the author
BaByMeng
deepin
2021-12-31 04:04
#8

对,deepin上不要用texstudio,推荐自行配置vscode,说多了都是泪

Reply View the author
BaByMeng
deepin
2021-12-31 04:06
#9

还有就是最好完整安装,因为你不知道会不会引用个什么奇怪的东西

Reply View the author
zhangqf
deepin
2022-01-05 19:16
#10

不用这么麻烦,直接用在线的overleaf,也很方便:

https://www.overleaf.com/

Reply View the author
lsatenstein
deepin
2022-01-06 07:06
#11

Sorry, I am not able to respond in Chinese.

I installed and I am using the nightly (4 January 2022) Deepin ISO

First Issue.

/boot has chmod (rwx --- ---). It would be appreciated to be 744 (rwx r-- r--) I have system software that needs to extract information about /boot/efi. I manually changed /boot to (rwx r-- r--). As a non-system - regular user, I read /boot to extract information about /boot/efi and other.

The other issue I encountered is with the x11 terminal. During my installation I choose the Canadian French keyboard layout (cf ) . In graphical mode, the mapping is correct. But the ctl-alt-f2 terminal keboard mapping does not match the Canadian French Layout. I tried to set it to Canadian French, but was unsuccessful.

Your ISO and system are just fantastic. Thank you many times.

Leslie Satenstein
lsatenstein@yahoo.com

Reply View the author
字甲达宾
deepin
2022-01-07 05:05
#12

顺便再安装个 LYX。这个相当于 LaTeX 的图形化版本。如画表格、插入图片、标题层次、列表、正文,输入各种数学符号(如分数,根号,平方,下标,等等),不是一般的方便。

重点1:还可以输入/插入 TeX/LaTeX 代码,照样有效!

重点2:还可以选择 以代码形式(即 LaTeX 代码)查看,特别适合 LaTeX 初学者学习、快速了解 LaTeX!

Reply View the author
观天
deepin
2022-03-13 22:57
#13

一篇文章,以前只要关注自己想写的内容就行了,整这些有的没的,看看,几十个字,有多少次击键为是了所谓的“自由的排版符号”,有多少是真正的正文..............

不是很理解这种IT小资的心态.......😁

Reply View the author
流浪的加菲
deepin
2023-07-05 00:15
#14

理化生教学好帮手tail

Reply View the author