MacOS X 安装免费的 LaTex 环境

最近把工作终端一步步迁移到Mac上来了,搭了个 Latex的环境,跟windows上一样好用。

首先,如果是 intel 芯片的 macOS,那么可以使用组合1,

如果是 M1、M2 或 M3 芯片或者 intel 芯片的 Mac book,则应该使用组合2,

texMaker目前在Mx芯片上工作不行;

1,Mactex + Texmaker

2,Mactex + (VScode + Latex workshop[James Yu])

效果分别如下图,点击

选择了 Mactex 做编译,用 Texmaker 做编辑;

1. 下载与安装

1.1 Mactex 下载安装

MacOS 安装和示例 LaTex 的编译器 与 编辑器

编译器使用免费的 Mactex:

https://tug.org/mactex/mactex-download.html

单击页面中的粗体 MacTeX.pkg. 即可开始下载;

下载 完毕后双击,进入安装页面,全部采用默认配置,一路点击,最后安装几分钟后结束。

如果是M1 M2 等M系列的Mac 电脑,那么不需要安装Texmaker,可以直接使用 已经安装进来的 Texshop,稍显简陋,但也能用:

分三步:

1, 打开软件

2, 输入latex代码

复制代码
\documentclass[12pt]{article}
\title{Dawn}
\begin{document}
\maketitle
\[
    Hello\,\, L^{A}T_{E}X\,2_{\epsilon} 
\]
\begin{equation}
    f\, =\,a^{x}\,+\,b
\end{equation}
$\backslash$
I read that Knuth divides the\newline
people working with \TeX{} into\newline
\TeX{}nicians and \TeX perts.\\
Today is \today.\\
{{\LaTeX}\,${2_{\epsilon}}$}\newline
\textsl{{\LaTeX}\,${2_{\epsilon}}$}\newline
\[
L^{A}T_{E}X\,2_{\epsilon}
\]
\end{document}

3, 编译显示

1.2 Texmaker 下载安装

在intel的mac电脑中安装 LaTeX 编辑器Texmaker:

https://www.xm1math.net/texmaker/download.html

单击 MacOS X Package 下载即可,

单击 安装包 texmaker-5.1.4.dmg 后,拖拽至application中,

在启动器中直接启动无法打开,需要到application中 ctrl+click,单击open,在弹出的对话框中再单击open 方可启动。

2. 示例测试

2.1 可用性测试示例

新建文件保存为 hello_world.tex

复制代码
\documentclass[12pt]{article}
\title{Hello  World!}
\author{Jimmy.Runn}
\date{}
\begin{document}
\maketitle

Hello LaTex World!

\end{document}

构建编辑效果:

生成pdf文件的效果:

3. VS code 结合 latex workshop

3.1 安装

关键信息都在图中可见

3.2 示例

复制代码
\documentclass[12pt]{article}
\title{Hello  World!}
\author{Jimmy.Runn}
\date{}
\begin{document}
\maketitle

Hello the Most Beautiful LaTex World!\\

Convolution formula: 

\begin{equation}
(f\ast g) = \int_{-\infty}^{\infty} f(\tau) g(t-\tau)\, d\tau
\end{equation}

\[
    y = \int_{-\pi}^{\pi}cos(\theta)\, d\theta
\]

\begin{equation}
    e^{ix} = cos\,x + i*sin\,x
\end{equation}

\begin{equation}
e^{i\pi} + 1 = 0
\end{equation}

\end{document}

4. 直接编译 tex文件

复制代码
xelatex --interaction=batchmode hello_latex.tex 2>&1 > /dev/null;open hello_latex.pdf

每次带着open 命令,就可以及时查看结果了:

相关推荐
tkevinjd41 分钟前
文件操作、流对象示例
macos·objective-c·cocoa
Dachui_11221 天前
MacOS上如何运行内网穿透详细教程
macos
Bruce_Liuxiaowei1 天前
使用Python脚本在Mac上彻底清除Chrome浏览历史:开发实战与隐私保护指南
chrome·python·macos
iFlyCai1 天前
对Mac文字双击或三击鼠标左键没有任何反应
macos·计算机外设
請你喝杯Java2 天前
Mac上Cursor无法安装插件解决方法
macos·cursor·vsode
网络之路Blog2 天前
【实战中提升自己】内网安全部署之端口隔离与MAC地址认证
安全·macos·网络之路一天·华为华三数通基础·华为华三企业实战架构·华为中小型企业实战·华为华三计算机网络基础
心随_风动2 天前
主流操作系统对比分析(macOS、Linux、Windows、Unix)
linux·windows·macos
lxw18449125142 天前
macOS 系统设置息屏情况下,PHP等后台脚本继续执行
macos
Brian_Lucky2 天前
在 macOS 上合并 IntelliJ IDEA 的项目窗口
java·macos·intellij-idea
未来之窗软件服务2 天前
声音分离人声和配乐-从头设计数字生命第5课, demucs——仙盟创梦IDE
ide·macos·xcode·仙盟创梦ide·数字生命