排版環境搭建(Arch Linux)

黃志斌發表於2015-02-11

我使用的作業系統為 Arch Linux 64-bit,桌面環境為 xfce4 。

堅果雲客戶端安裝和設定

~$ sudo pacman -S --needed gvfs libappindicator-gtk3 python-gobject
...
~$ wget https://jianguoyun.com/static/exe/installer/nutstore_linux_dist_x64.tar.gz -O /tmp/nutstore_bin.tar.gz
...
~$ mkdir -p ~/.nutstore/dist && tar zxf /tmp/nutstore_bin.tar.gz -C ~/.nutstore/dist
~$ ~/.nutstore/dist/bin/install_core.sh
Install Nutstore done.
Now you can start Nutstore from menu: Applications > Internet > Nutstore

點選螢幕左上角的應用程式選單 -> 網際網路 -> 堅果雲,啟動堅果雲客戶端,登入堅果雲,將同步資料夾修改為“/home/ben/NutData”。等待一會兒,堅果雲上的東東就會全部同步到本機了。

將方正和漢儀字型安裝到作業系統中

~$ su -
密碼:
# cd /usr/share
# mkdir -p fonts.avail/ttf-01 && cd fonts.avail/ttf-01
# cp /home/ben/NutData/Nutstore-share/相關中文字型/*.ttf .
# cd /usr/share/fonts
# ln -s /usr/share/fonts.avail/ttf-01 .
# fc-cache && mkfontscale && mkfontdir
# exit
登出
~$ fc-list | grep -i -e fz -e hy
/usr/share/fonts/wps-office/FZWBK.TTF: 方正魏碑_GBK,FZWeiBei-S03:style=Regular
/usr/share/fonts/wps-office/FZFSK.TTF: 方正仿宋_GBK,FZFangSong-Z02:style=Regular
/usr/share/fonts/wps-office/FZSongS(SIP)_2010603.TTF: 方正宋體S-超大字符集(SIP),FZSongS-Extended(SIP):style=Regular
/usr/share/fonts/wps-office/FZCCHK.TTF: 方正超粗黑_GBK,FZChaoCuHei-M10:style=Regular
/usr/share/fonts/ttf-01/fzxssk.ttf: 方正新書宋_GBK,FZNewShuSong-Z10:style=Regular
/usr/share/fonts/wps-office/FZXH1K.TTF: 方正細黑一_GBK,FZXiHeiI-Z08:style=Regular
/usr/share/fonts/ttf-01/fzbysk.ttf: 方正博雅宋_GBK,FZBoYaSong:style=Regular
/usr/share/fonts/wps-office/FZLSK.TTF: 方正隸書_GBK,FZLiShu-S01:style=Regular
/usr/share/fonts/wps-office/FZKTK.TTF: 方正楷體_GBK,FZKai-Z03:style=Regular
/usr/share/fonts/wps-office/FZHTK.TTF: 方正黑體_GBK,FZHei-B01:style=Regular
/usr/share/fonts/ttf-01/hyd4gjm.ttf: 漢儀粗仿宋簡,HYCuFangSongJ:style=Regular
/usr/share/fonts/wps-office/FZXBSK.TTF: 方正小標宋_GBK,FZXiaoBiaoSong-B05:style=Regular
/usr/share/fonts/wps-office/FZSongS_20100603.TTF: 方正宋體S-超大字符集,FZSongS-Extended:style=Regular
/usr/share/fonts/ttf-01/fzy3k.ttf: 方正準圓_GBK,FZZhunYuan-M02:style=Regular
/usr/share/fonts/wps-office/FZXKK.TTF: 方正行楷_GBK,FZXingKai-S04:style=Regular
/usr/share/fonts/ttf-01/fzy4k.ttf: 方正粗圓_GBK,FZCuYuan-M03:style=Regular
/usr/share/fonts/ttf-02/fzstk.ttf: 方正舒體,FZShuTi:style=Regular
/usr/share/fonts/wps-office/FZYTK.TTF: 方正姚體_GBK,FZYaoTi-M06:style=Regular
/usr/share/fonts/wps-office/FZSSK.TTF: 方正書宋_GBK,FZShuSong-Z01:style=Regular

安裝Tex Live

~$ sudo pacman -S texlive-most texlive-lang
...
~$ xetex --version
XeTeX 3.14159265-2.6-0.99991 (TeX Live 2014/Arch Linux)
kpathsea version 6.2.0
Copyright 2014 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty. Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 54.1; using 54.1
Compiled with zlib version 1.2.8; using 1.2.8
Compiled with FreeType2 version 2.5.5; using 2.5.5
Compiled with Graphite2 version 1.2.4; using 1.2.4
Compiled with HarfBuzz version 0.9.38; using 0.9.38
Compiled with libpng version 1.6.16; using 1.6.16
Compiled with poppler version 0.30.0
Compiled with fontconfig version 2.11.1; using 2.11.1

安裝TeX字型

~$ su -
密碼:
# cd /usr/local/share
# mkdir texmf && cd texmf
# wget https://files.cnblogs.com/files/skyivben/fonts.zip
# 7z x fonts.zip
...
# rm fonts.zip
# chmod 755 fonts fonts/* fonts/*/*
# texhash
texhash: Updating /etc/texmf/ls-R...
texhash: Updating /usr/local/share/texmf/ls-R...
texhash: Updating /usr/share/texmf/ls-R...
texhash: Updating /usr/share/texmf-dist/ls-R...
texhash: Updating /var/lib/texmf/ls-R...
texhash: Done.
# exit

安裝Git並配置

~$ sudo pacman -S git
...
~$ git --version
git version 2.3.0
~$ git config --global user.name "ben.skyiv"
~$ git config --global user.email "skyivben@126.com"
~$ git config --global push.default "simple"
~$ git config --global color.ui "true"
~$ git config --global alias.st "status"
~$ git config --global alias.co "checkout"
~$ git config --global alias.ci "commit"

常用的 git 命令:

$ git st
$ git log
$ git pull
$ git add .
$ git ci -m "說明文字"
$ git push

克隆版本庫並使用xetex編譯

~$ cd src
src$ git clone ~/NutData/Nutstore-share/taocp.git/
正克隆到 'taocp'...
完成。
src$ cd taocp
taocp$ git st
位於分支 master
您的分支與上游分支 'origin/master' 一致。
無檔案要提交,乾淨的工作區
taocp$ xetex 41.run
This is XeTeX, Version 3.14159265-2.6-0.99991 (TeX Live 2014/Arch Linux) (preloaded format=xetex)
restricted \write18 enabled.
entering extended mode
(./41.run (./taocpmac.tex (./figdir.local)
...
Output written on 41.pdf (18 pages).
Transcript written on 41.log.
taocp$

(以下內容已過時,新版本的堅裡雲無此問題)

以下指令碼用於修正堅果雲在 Linux 中不能同步某些 git 的 BUG:

$ cat ~/bin/nutmodify
cd ~/NutData/Nutstore-share/taocp.git && find . -perm 444 -exec chmod +w {} \;

參考資料

  1. 堅果雲:下載Linux客戶端
  2. ArchWiki: Fonts(簡體中文)
  3. ArchWiki: TexLive(簡體中文)
  4. Git教程 - 廖雪峰

相關文章