Teach you to install latex environment under Linux __linux

Source: Internet
Author: User
Tags chmod install perl aliyun
introduction of Latex

LaTeX (LaTeX, transliteration "Lateh") is a typesetting system based on Tex, developed by the American computer scientists Leslie Lambert (Leslie Lamport) in the early 1980s, using this format, Even if the user does not have the knowledge of typesetting and program design, it can also give full play to the powerful functions provided by Tex, and can produce many books of print quality in a few days or even hours.

Latex has distributions on windows, Linux, and Mac OS:

Operating system Release version Editor
Windows MiKTeX TeXnicCenter, WinEdt
Unix/linux TeX Live Emacs, Vim, Kile
Mac OS MacTeX TeXShop


Second, LaTeX download installationFirst we download texlive image, this is recommended Xiamen University open source software image, with the latest texlive 2012, download speed is also very impressive. http://mirrors.xmu.edu.cn/CTAN/systems/texlive/Images/Install texlive below:
#cd Downloads
#su
passwd:
# mount-t  iso9660-o loop texlive2012-20120701.iso/mnt/
mount:warning :/mnt/seems to be mounted read-only.
#./install-tl 

Third, LaTeX configuration first we copy the required fonts from elsewhere, such as the most commonly used fonts from Windows c:/windows/fonts: Msyh.ttf (Microsoft Ya-hei) Simfang.ttf (imitation) Simhei.ttf (bold) Simkai.ttf (italics) SIMSUN.TTC (XXFarEastFont-Arial)
For example, we copy to the Linux/home/username/fonts directory: Next open the terminal to configure:

# mkdir/usr/share/fonts/winfonts/#
CP ~/fonts/msyh.ttf/usr/share/fonts/winfonts/  
# CP ~/fonts/simfang.ttf/ usr/share/fonts/winfonts/ 
# CP ~/fonts/simhei.ttf/usr/share/fonts/winfonts/ 
# CP ~/fonts/simkai.ttf/usr/ share/fonts/winfonts/ 



If you need more fonts, use the same method to copy. After the copy is complete, be sure to use chmod for font permissions:
# sudo chmod a+x  


The following actions are followed
# cd/usr/share/fonts/winfonts/#
Mkfontscale #  
Mkfontdir #  
Fc-cache

The above command works by creating a scalable index for the X font, creating an index of the X font file in one directory, and creating a font information cache file.
Next, use the Fc-list command to view:
# sudo fc-list:lang=zh-cn

nsimsun, neo-Arial: Style=regular
Kaiti, italics: Style=regular,normal,obyčejné,standard, Κανονικά,normaali,normál,normale,standaard,normalny,обычный,normálne,navadno,arrunta
SimSun, XXFarEastFont-style= Regularunibit:style=regular
Wenquanyi Zen Hei, Wen Quan Shu City Taipei Black, Wen Black: Style=regular simhei
, blackbody: Style=regular,normal, Obyčejné,standard,κανονικά,normaali,normál,normale,standaard,normalny,обычный,normálne,navadno,arrunta
Wenquanyi Zen Hei Mono, Wen Quan Shu City Taipei, etc. wide positive black: Wen style=regular Wenquanyi Zen Hei, Sharp Wen Quan shu dot
matrix is black, City Taipei Dot matrix is black: Wen Quan Shu



Finally, we modify the file according to the information displayed by the fc-list command/usr/local/texlive/2012/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def
# cat/usr/local/texlive/2012/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def

  % Ctex-xecjk-winfonts.def:windows xecjk font settings, default to six easy fonts  
  % Vim:ft=tex  
    
  \setcjkmainfont[boldfont={simhei}, Italicfont={[simkai. TTF]}]
    {SimSun}
    \setcjksansfont{simhei}
    \setcjkmonofont{[simfang. TTF]}
      
    \setcjkfamilyfont{zhsong}{simsun}
    \setcjkfamilyfont{zhhei}{simhei}
    \setcjkfamilyfont{zhkai}{ [Simkai. TTF]}
    \setcjkfamilyfont{zhfs}{[simfang. TTF]}
    % \setcjkfamilyfont{zhli}{lisu}
    % \setcjkfamilyfont{zhyou}{youyuan}
      
    \newcommand*{\songti}{\ Cjkfamily{zhsong}}% arial
    \newcommand*{\heiti}{\cjkfamily{zhhei}}   % bold
    \newcommand*{\kaishu}{\ Cjkfamily{zhkai}%  regular script
    \newcommand*{\fangsong}{\cjkfamily{zhfs}}% imitation
    % \newcommand*{\lishu}{\ Cjkfamily{zhli}}%
    \newcommand*{\youyuan}{\cjkfamily{zhyou}% XXFarEastFont-Arial
      
    




I need to make changes to the red mark, modified into fc-list on the italics (or other) related to, I this for kaiti, some environment for kaiti_gb2312, the modification needs to be based on the environment Fc-list printed information. After the modification, let's take a look at the following:
# cat/usr/local/texlive/2012/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def

% Ctex-xecjk-winfonts.def:windows xecjk font settings, default to six easy fonts  
% Vim:ft=tex  
  
\setcjkmainfont[boldfont={simhei}, Italicfont={kaiti}]
  {SimSun}
  \setcjksansfont{simhei}
  \setcjkmonofont{[simfang. TTF]}
    
  \setcjkfamilyfont{zhsong}{simsun}
  \setcjkfamilyfont{zhhei}{simhei}
  \setcjkfamilyfont{zhkai}{ Kaiti}
  \setcjkfamilyfont{zhfs}{[simfang. TTF]}
  % \setcjkfamilyfont{zhli}{lisu}
  % \setcjkfamilyfont{zhyou}{youyuan}
    
  \newcommand*{\songti}{\ Cjkfamily{zhsong}}% arial
  \newcommand*{\heiti}{\cjkfamily{zhhei}}   % bold
  \newcommand*{\kaishu}{\ Cjkfamily{zhkai}%  regular script
  \newcommand*{\fangsong}{\cjkfamily{zhfs}}% imitation
  % \newcommand*{\lishu}{\ Cjkfamily{zhli}}%    \newcommand*{\youyuan}{\cjkfamily{zhyou}% XXFarEastFont-
    
  \endinput  


At this point, the configuration is complete.
I will be prompted to use Xelatex, xelatex:command information such as not found, and then use the following manual configuration to work properly: #vim/ETC/BASH.BASHRC
Add one line at the end: path= $PATH:/usr/local/texlive/2012/bin/i386-linux/(this path is best step by step, using automatic completion to find, but the general difference for the final, 64-bit machine for x86_64-linux)
#source/ETC/BASH.BASHRC
Then close all terminals, then. four, latex learning helpLaTeX Learning document Download: http://download.csdn.net/detail/longerzone/4703133
http://download.csdn.net/detail/longerzone/4703238

reference Documentation

"1" http://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf

"2" http://www.aboutlinux.info/2005/12/adding-windows-fonts-in-linux.html

"3" http://hi.baidu.com/defeattroy/blog/item/5df1ffcac3348415be09e6de.html

"4" http://learningloong.blog.163.com/blog/static/1623081242011731102219361/

"5" http://forum.ubuntu.com.cn/viewtopic.php?f=35&t=350882

"6" http://blog.csdn.net/defeattroy/article/details/7581846---------------------------2018.3.6 update-------- -------------------Good many years passed, this article in Baidu can search a lot, but incredibly can't find my original. Want to build latex environment, found that texlive 2013 download not, even the mirror of Xiamen University is not through, toss the next, add as follows:

Mirrored downloads: https://mirrors.aliyun.com/CTAN/systems/texlive/Images/(using Aliyun mirroring Station, download texlive 2017)

Simple installation, mount directly after the/INSTALL-TL, if you encounter the "can" T locate digest/md5.pm in @INC (@ ...) Alarm, use Package management tool to install PERL-DIGEST-MD5, such as "Yum-y install PERL-DIGEST-MD5".

After texlive 2017 is installed, Mkfontscale and Mkfontdir are not found in the prepared Windows Fonts directory, but the software upgrades will only make the software more effective, where we only need to run "Fc-cache", You can then use "fc-list" to view the Windows fonts that we have prepared.

# Fc-list/usr/share/fonts/winfonts/simsun.ttc:nsimsun, Xin-song body: style=regular/usr/share/fonts/ Winfonts/msyh.ttf:microsoft Yahei, Microsoft James Black: Style=regular,normal,obyčejné,standard,κανονικά,normaali,normál,normale, Standaard,normalny,обычный,normálne,navadno,arrunta/usr/share/fonts/winfonts/simkai.ttf:kaiti, italics: style=Regular
, Normal,obyčejné,standard,κανονικά,normaali,normál,normale,standaard,normalny,обычный,normálne,navadno,arrunta /usr/share/fonts/winfonts/simfang.ttf:fangsong, Imitation: Style=regular,normal,obyčejné,standard,κανονικά,normaali, Normál,normale,standaard,normalny,обычный,normálne,navadno,arrunta/usr/share/fonts/winfonts/simsun.ttc:simsun, XXFarEastFont-Arial: Style=regular/usr/share/fonts/winfonts/simhei.ttf:simhei, Blackbody: style=regular,normal,obyčejné,standard,κανονικά , Normaali,normál,normale,standaard,normalny,обычный,normálne,navadno,arrunta 

Then we need to modify the Windows fonts Font profile as "/usr/local/texlive/2017/texmf-dist/tex/latex/ctex/fontset/ Ctex-fontset-windowsnew.def ", make a backup first, and then modify the following (currently I use normal):

\setcjkmainfont [Boldfont =Simhei, Italicfont =Kaiti] {SimSun\setcjksansfont [Boldfont = Msyhbd\l__ctex_msyh_suffix_tl] {MSYH\L__CTEX_MSYH_SUFFIX_TL} 48 \setcjkfamilyfont {Zhyahei} [Boldfont = Msyhbd\l__ctex_msyh_suffix_tl] {Msyh\l__ctex_msyh_suff IX_TL} \ctex_punct_map_family:nn {\cjksfdefault} {Zhyahei} Wuyi \ctex_punct_map_bfseries:n n {\cjksfdefault, Zhyahei} {Zhyaheib} \setcjkmonofont {Simfang.ttf} \setcjkfamilyfo NT {Zhkai} {Kaiti\setcjkfamilyfont {ZHFS} {Fangsong\setcjkfamilyfont {Zhsong} {SimSun\setcjkfamilyfont {Zhhei} {Simhei\setcjkfamilyfont {Zhli} {Simli.ttf} \setcjkfamilyfont {zhyou} {Simyou.ttf}
Current normal use, if subsequent changes continue to keep the update

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.