![有没有办法可以在没有 root 权限的 Mac 上使用 LaTeX 编译器?](https://linux22.com/image/265555/%E6%9C%89%E6%B2%A1%E6%9C%89%E5%8A%9E%E6%B3%95%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%B2%A1%E6%9C%89%20root%20%E6%9D%83%E9%99%90%E7%9A%84%20Mac%20%E4%B8%8A%E4%BD%BF%E7%94%A8%20LaTeX%20%E7%BC%96%E8%AF%91%E5%99%A8%EF%BC%9F.png)
长话短说,我在 Mac 上的安装权限有限。我相信唯一的限制是我只能在用户目录中写入文件。我对用户目录之外的文件的读取权限也有限。那么,有没有办法在 Mac 上安装 LaTeX 而无需 root 访问权限?我确实知道 ShareLaTeX 等在线替代方案,但我的互联网覆盖有时不稳定,而且我经常编译以查看最终结果,因为我不太擅长使用 LaTeX。
答案1
根据这教程应该是可行的,您只需要在主目录中手动安装文件:
无需 root 权限即可安装 TeXLive
由于在没有 root 权限的情况下安装 MacTeX 需要进行一些复杂的自定义,我建议您使用这种简单的方法安装 TeXLive(我有更多时间时会添加 MacTex 的教程):
1)下载 TeXLive安装脚本
2)使用您喜欢的软件提取 tar 存档
3)运行安装脚本./install-tl
4)您将看到此屏幕提示
======================> TeX Live installation procedure <=====================
=======> Note: Letters/digits in <angle brackets> indicate menu items <=======
=======> for commands or configurable options <=======
Detected platform: <your platform>
<B> platforms: 1 out of 18
<S> installation scheme (scheme-full)
84 collections out of 85, disk space required: 3739 MB
Customizing installation scheme:
<C> standard collections
<L> language collections
<D> directories:
TEXDIR (the main TeX directory):
!! default location: /usr/local/texlive/2012
!! is not writable, please select a different one!
TEXMFLOCAL (directory for site-wide local files):
/usr/local/texlive/texmf-local
TEXMFSYSVAR (directory for variable and automatically generated data):
/usr/local/texlive/2012/texmf-var
TEXMFSYSCONFIG (directory for local config):
/usr/local/texlive/2012/texmf-config
TEXMFVAR (personal directory for variable and automatically generated data):
~/.texlive2012/texmf-var
TEXMFCONFIG (personal directory for local config):
~/.texlive2012/texmf-config
TEXMFHOME (directory for user-specific files):
~/texmf
<O> options:
[ ] use letter size instead of A4 by default
[X] allow execution of restricted list of programs via \write18
[X] create all format files
[X] install macro/font doc tree
[X] install macro/font source tree
<V> set up for portable installation
Actions:
<I> start installation to hard disk
<H> help
<Q> quit
最有趣的部分是<D>
,您需要将所有以 开头的目录移动到/usr
主文件夹中方便的位置。为此,只需输入d
并按回车键,系统将提示您显示以下第二个屏幕:
===============================================================================
Directories setup:
!! The default location as given below is forbidden or
!! can't be written to.
!! Either change the destination directory using <1> or create it
!! outside this script.
<1> TEXDIR: /usr/local/texlive/2012
support tree: /usr/local/texlive/2012/texmf
<2> TEXMFLOCAL: /usr/local/texlive/texmf-local
<3> TEXMFSYSVAR: /usr/local/texlive/2012/texmf-var
<4> TEXMFSYSCONFIG: /usr/local/texlive/2012/texmf-config
<5> TEXMFVAR: ~/.texlive2012/texmf-var
<6> TEXMFCONFIG: ~/.texlive2012/texmf-config
<7> TEXMFHOME: ~/texmf
Note: ~ will expand to $HOME (or to %USERPROFILE% on Windows)
Actions:
<R> return to main menu
<Q> quit
只需输入1
要安装 texlive 的目录,例如<your home>/Library/texlive/2012
。更改第一个目录后,所有其他目录将相应移动。设置目录后返回主安装屏幕R
并使用开始安装I
。完成。