Ubuntu16.04中使用texlive+texstudio搭建Latex环境
来源:互联网 发布:淘宝详情页怎么做视频 编辑:程序博客网 时间:2024/05/17 09:18
The truth may hurt for a little while but a lie hurts forever.
真相可能会使我们痛一时,但谎言会令我们痛一生。
Ubuntu16.04中使用texlive+texstudio搭建Latex环境
- 1.安装texlive
sudo apt install texlive
- 2.安装中文字体包
sudo apt install latex-cjk-all
- 3.安装texstudio
sudo apt install texstudio
解决texstudio使用过程中遇到的问题:
1.GB.cpx乱码问题
在/usr/share/texmf/tex/latex/CJK/GB/下查找到GB.cpx文件并且使用一下代码替换:
% This is the file GB.cap of the CJK package% for using Asian logographs (Chinese/Japanese/Korean) with LaTeX2e%% created by aloft <aloft@ctex.org> for Standard LaTeX document class.%% Version 4.5.2 (18-May-2003)%% $Id: GB.cpx,v 1.7 2003/05/20 15:51:14 aloft Exp $%\def\fileversion{4.5.2}\def\filedate{2003/05/18}\ProvidesFile{GB.cap}[\filedate\space\fileversion for Standard LaTeX document class]% Chinese captions%% character set: GB 2312-80% encoding: EUC\renewcommand\contentsname{目录}\renewcommand\listfigurename{插图}\renewcommand\listtablename{表格}\@ifundefined{chapter} {\renewcommand\refname{参考文献}} {\renewcommand\bibname{参考文献}}\renewcommand\indexname{索引}\renewcommand\figurename{Fig}\newcommand\codename{代码}\renewcommand\tablename{表}\newcommand\CJKprepartname{第}\newcommand\CJKpartname{部分}\newcommand\CJKthepart{\CJKnumber{\@arabic\c@part}}\@ifundefined{chapter}{}{ \newcommand\CJKprechaptername{第} \newcommand\CJKchaptername{章} \newcommand\CJKthechapter{\CJKnumber{\@arabic\c@chapter}}}\renewcommand\appendixname{附录~\@Alph\c@chapter}\@ifundefined{mainmatter} {\renewcommand\abstractname{摘要}}{}% \renewcommand\ccname{} % ?% \renewcommand\enclname{附件}% \newcommand\prepagename{} % ?% \newcommand\postpagename{} % ?% \renewcommand\headtoname{} % ?% \renewcommand\seename{} % ?\let\CJK@todaysave=\today\def\CJK@todaysmall{~\the\year~年~\the\month~月~\the\day~日}\def\CJK@todaybig{\CJKdigits{\the\year}年\CJKnumber{\the\month}月\CJKnumber{\the\day}日}\def\CJK@today{\CJK@todaysmall}\renewcommand\today{\CJK@today}\newcommand\CJKtoday[1][1]{% \ifcase#1\def\CJK@today{\CJK@todaysave} \or\def\CJK@today{\CJK@todaysmall} \or\def\CJK@today{\CJK@todaybig} \fi}%% modify the definitions of Standard LaTeX document class%\@ifundefined{chapter}{ \def\@part[#1]#2{% \ifnum \c@secnumdepth >\m@ne \refstepcounter{part}%% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% \addcontentsline{toc}{part}{\CJKprepartname\expandafter\noexpand\CJKthepart\CJKpartname\hspace{1em}#1}% \else \addcontentsline{toc}{part}{#1}% \fi {\parindent \z@ \raggedright \interlinepenalty \@M \normalfont \ifnum \c@secnumdepth >\m@ne% \Large\bfseries \partname\nobreakspace\thepart \Large\bfseries \CJKprepartname\CJKthepart\CJKpartname \par\nobreak \fi \huge \bfseries #2% \markboth{}{}\par}% \nobreak \vskip 3ex \@afterheading}}{ \def\@part[#1]#2{% \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}%% \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% \addcontentsline{toc}{part}{\CJKprepartname\expandafter\noexpand\CJKthepart\CJKpartname\hspace{1em}#1}% \else \addcontentsline{toc}{part}{#1}% \fi \markboth{}{}% {\centering \interlinepenalty \@M \normalfont \ifnum \c@secnumdepth >-2\relax% \huge\bfseries \partname\nobreakspace\thepart \huge\bfseries \CJKprepartname\CJKthepart\CJKpartname \par \vskip 20\p@ \fi \Huge \bfseries #2\par}% \@endpart} \if@twoside \def\chaptermark#1{% \markboth {\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne \if@mainmatter% \@chapapp\ \thechapter. \ % \CJKprechaptername\CJKthechapter\CJKchaptername \ % \fi \fi #1}}{}}% \def\sectionmark#1{% \markright {\MakeUppercase{% \ifnum \c@secnumdepth >\z@% \thesection. \ % \thesection \ % \fi #1}}} \else \def\chaptermark#1{% \markright {\MakeUppercase{% \ifnum \c@secnumdepth >\m@ne \if@mainmatter% \@chapapp\ \thechapter. \ % \CJKprechaptername\CJKthechapter\CJKchaptername \ % \fi \fi #1}}} \fi \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne \if@mainmatter \refstepcounter{chapter}%% \typeout{\@chapapp\space\thechapter.}% \typeout{\CJKprechaptername\CJKthechapter\CJKchaptername}% \addcontentsline{toc}{chapter}%% {\protect\numberline{\thechapter}#1}% {\protect\numberline{}\CJKprechaptername% \expandafter\noexpand\CJKthechapter\CJKchaptername\hspace{0.8em}#1}% \else \addcontentsline{toc}{chapter}{#1}% \fi \else \addcontentsline{toc}{chapter}{#1}% \fi \chaptermark{#1}% \addtocontents{lof}{\protect\addvspace{10\p@}}% \addtocontents{lot}{\protect\addvspace{10\p@}}% \if@twocolumn \@topnewpage[\@makechapterhead{#2}]% \else \@makechapterhead{#2}% \@afterheading \fi} \def\@makechapterhead#1{% \vspace*{50\p@}% {\parindent \z@ \raggedright \normalfont \ifnum \c@secnumdepth >\m@ne \if@mainmatter% \huge\bfseries \@chapapp\space \thechapter \huge\bfseries \CJKprechaptername\CJKthechapter\CJKchaptername \par\nobreak \vskip 20\p@ \fi \fi \interlinepenalty\@M \Huge \bfseries #1\par\nobreak \vskip 40\p@ }} \renewcommand*\l@chapter[2]{% \ifnum \c@tocdepth >\m@ne \addpenalty{-\@highpenalty}% \vskip 1.0em \@plus\p@% \setlength\@tempdima{1.5em}% \setlength\@tempdima{0em}% \begingroup \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth \leavevmode \bfseries \advance\leftskip\@tempdima \hskip -\leftskip #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par \penalty\@highpenalty \endgroup \fi}\let\@appendix\appendix\renewcommand\appendix{\@appendix% \def\CJKprechaptername{\relax}% \def\CJKthechapter{\relax}% \def\CJKchaptername{\appendixname}}} %end of \@ifundefined{chapter}\def\numberline#1{\ifdim\@tempdima>0pt% \settowidth\@tempdimb{#1\space}% \ifdim\@tempdima<\@tempdimb% \@tempdima=\@tempdimb% \fi% \hb@xt@\@tempdima{#1\hfil}% \fi} \endinput
2.编译后Pdf中文不显示问题
当使用CJK中文包时,在Texstudio配置中使用pdflatex编译器而不是xelatex编译器。
如果使用ctex中文包时可以使用xelatex编译器。
阅读全文
0 0
- Ubuntu16.04中使用texlive+texstudio搭建Latex环境
- Texlive + TexStudio 写 latex 很是方便
- ubuntu14.04 install TexLive & TexStudio
- 搭建latex编辑环境(ubuntu14.04安装latex的支持包texlive和编辑器texworks)
- TeXstudio:LaTeX模板使用
- Latex:TexStudio的使用
- MiKTeX+TeXstudio 快速搭建latex环境(备忘)
- LaTex格式论文编写环境搭建(TexLive+WinEdt+SumatraPDF)
- [linux]ubuntu下进行texlive+texstudio+xeCJK中文环境安装
- ubuntu14.04配置中文latex完美环境(texlive+texmaker+lyx)
- Ubuntu16.04中Mysql&Hive环境搭建
- Ubuntu16.04环境搭建
- 如何配置TeXstudio+SumatraPDF+Texlive
- ubuntu16.04搭建java环境
- Ubuntu16.04 Redis 环境搭建
- Ubuntu16.04 搭建LAMP环境
- Eclipse中Python开发环境搭建(Ubuntu16.04)
- Eclipse中Python开发环境搭建(Ubuntu16.04)
- Hibernate 日志实现
- No.0 写博客那些事
- No.1 聊一聊数据获取和爬虫
- CCF——日期计算
- No.2 从0写一个爬虫,爬取500w好友关系数据
- Ubuntu16.04中使用texlive+texstudio搭建Latex环境
- No.3 漫谈数据开发工程师的技术广度
- linux 查看/修改jdk版本
- (CodeForces
- Hibernate 对象生命周期及crud操作
- No.4 聊一聊 PageRank 的原理和实现
- Cannot read property 'getElementsByTagName' of null解决办法
- 1026. 程序运行时间(15)
- 机器学习笔记-Adaptive Boosting