Linux安装texlive&texstudio

linux下写paper神器,简单好用,装就完了,不要多问

一、安装Texlive

  1. texlive镜像下载,传送门。这里我们选择texlive2023-20230313.iso下载。
  2. cd到下载目录,挂载镜像
    sudo mount -o loop texlive2023-20230313.iso /mnt #挂载文件目录
    cd /mnt 
    sudo ./install-tl   #安装
    
    安装过程中,会提示做选择,输入I继续安装,等安装结束后卸载镜像sudo umount /mnt
  3. 配置环境变量。texlive 的默认安装目录在/usr/local/texlive/2023,(2023是版本号,记好此目录,后面会用到),
    vim ~/.bashrc
    # 在文件末尾增加以下内容
    export MANPATH=${MANPATH}:/usr/local/texlive/2023/texmf-dist/doc/man
    export INFOPATH=${INFOPATH}:/usr/local/texlive/2023/texmf-dist/doc/info
    export PATH=${PATH}:/usr/local/texlive/2023/bin/x86_64-linux
    # 在文件末尾增加以上内容
    :wq  # 保存退出
    source ~/.bashrc
    tex -v  # 检测安装是否成功
    

二、安装TexStudio

  1. 直接sudo apt-get install texstudio即可。
  2. 终端输入texstudio,弹出使用界面,然后依次点击options-->Configure TexStudio-->Commands。找到这四个LaTex,PdfLaTex,XeLaTex,LuaLaTex,点击他们后边的选择文件按钮,将他们后边的路径都修改为对应的安装目录,如Latex对应目录修改为/usr/local/texlive/2023/bin/x86_64-linux/latexPdfLaTex修改为/usr/local/texlive/2023/bin/x86_64-linux/PdfLatex,以此类推,这四个都修改完,保存。

三、测试

本地新建一个test.tex,将下面一大段copy到test.tex中,然后按F5,即可运行。

\documentclass[lettersize,journal]{IEEEtran}
\usepackage{amsmath,amsfonts}
\usepackage{algorithmic}
\usepackage{array}
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\usepackage{textcomp}
\usepackage{stfloats}
\usepackage{url}
\usepackage{verbatim}
\usepackage{graphicx}
\hyphenation{op-tical net-works semi-conduc-tor IEEE-Xplore}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\usepackage{balance}
\begin{document}
\title{How to Use the IEEEtran \LaTeX \ Templates}
\author{IEEE Publication Technology Department
\thanks{Manuscript created October, 2020; This work was developed by the IEEE Publication Technology Department. This work is distributed under the \LaTeX \ Project Public License (LPPL) ( http://www.latex-project.org/ ) version 1.3. A copy of the LPPL, version 1.3, is included in the base \LaTeX \ documentation of all distributions of \LaTeX \ released 2003/12/01 or later. The opinions expressed here are entirely that of the author. No warranty is expressed or implied. User assumes all risk.}}

\markboth{Journal of \LaTeX\ Class Files,~Vol.~18, No.~9, September~2020}%
{How to Use the IEEEtran \LaTeX \ Templates}

\maketitle

\begin{abstract}
This document describes the most common article elements and how to use the IEEEtran class with \LaTeX \ to produce files that are suitable for submission to the Institute of Electrical and Electronics Engineers (IEEE).  IEEEtran can produce conference, journal and technical note (correspondence) papers with a suitable choice of class options.
\end{abstract}

\begin{IEEEkeywords}
Class, IEEEtran, \LaTeX, paper, style, template, typesetting.
\end{IEEEkeywords}


\section{Introduction}


\begin{thebibliography}{1}

\bibitem{ams}
{\it{Mathematics into Type}}, American Mathematical Society. Online available: 

\bibitem{oxford}
T.W. Chaundy, P.R. Barrett and C. Batey, {\it{The Printing of Mathematics}}, Oxford University Press. London, 1954.

\bibitem{lacomp}{\it{The \LaTeX Companion}}, by F. Mittelbach and M. Goossens

\bibitem{mmt}{\it{More Math into LaTeX}}, by G. Gr\"atzer

\bibitem{amstyle}{\it{AMS-StyleGuide-online.pdf,}} published by the American Mathematical Society

\bibitem{Sira3}
H. Sira-Ramirez. ``On the sliding mode control of nonlinear systems,'' \textit{Systems \& Control Letters}, vol. 19, pp. 303--312, 1992.

\bibitem{Levant}
A. Levant. ``Exact differentiation of signals with unbounded higher derivatives,''  in \textit{Proceedings of the 45th IEEE Conference on Decision and Control}, San Diego, California, USA, pp. 5585--5590, 2006.

\bibitem{Cedric}
M. Fliess, C. Join, and H. Sira-Ramirez. ``Non-linear estimation is easy,'' \textit{International Journal of Modelling, Identification and Control}, vol. 4, no. 1, pp. 12--27, 2008.

\bibitem{Ortega}
R. Ortega, A. Astolfi, G. Bastin, and H. Rodriguez. ``Stabilization of food-chain systems using a port-controlled Hamiltonian description,'' in \textit{Proceedings of the American Control Conference}, Chicago, Illinois, USA, pp. 2245--2249, 2000.

\end{thebibliography}

\end{document}

你可能感兴趣的:(linux)