前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >LaTeX详细安装步骤和简明教程

LaTeX详细安装步骤和简明教程

作者头像
全栈程序员站长
发布2022-08-30 19:10:47
3.9K0
发布2022-08-30 19:10:47
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

第一步:环境配置

配置TeXLive和TeXstudio。TeXLive是编译器为Latex提供运行所需的环境;TeXstudio编辑器,提供操作界面,需要先安装好TeXLive之后,TeXstudio才能使用。

TeXLive

  1. 下载:

TeXLive下载地址:(清华镜像)https://mirrors.tuna.tsinghua.edu.cn/ctan/systems/texlive/Images/

下载“ .iso”文件 –> “texlive2020.iso 3.7 GiB”

  1. 安装:

下载好之后右键 install-tl-advanced.bat 文件,以管理员身份进行安装,左下角的advance按钮,点击可以更细致的设置安装(安装时间比较久,在我的电脑上大概要一个多小时

如果还不懂可以参考该视频:https://www.bilibili.com/video/BV1tg4y1B7f3?from=search&seid=13847273912978852220

  1. 测试是否安装成功
LaTeX详细安装步骤和简明教程
LaTeX详细安装步骤和简明教程

点击TeX Live command-line启动命令行窗口,输入latex -v, xelatex -v, pdflatex -v,如果能够出书版本信息,这说明安装成功。

TeXstuido

  1. 下载:

下载地址:

http://texstudio.sourceforge.net/,下载包“texstudio-3.0.4-win-qt5.exe”

  1. 安装:

直接点击texstudio-3.0.4-win-qt5.exe安装。

  1. 测试:

Help > Check LaTeX Installation,如果能正常输出配置信息则安装成功

  1. 设置:

设置中文语言:Options > Configure TeXstudio > General > Launguage > zh_CN

支持中文编辑:Options > Configure TeXstudio > Build > default compiler > XeLaTeX

  1. 模板使用

把模板下载到电脑中后,选择.tex类型的文件;

可以在左侧结构栏跳转到相应区域修改内容,也可以在右侧PDF阅览区右键 > 跳转到源直接跟踪到相应代码区,进行修改即可。

LaTeX的使用技巧

  1. 插入图片:

利用graphicx宏包提供的\includegraphics命令插入图片

\usepackage{graphicx} —–> \includegraphics[〈options〉]{〈filename〉}

图片需要和.TEX源文件同目录, 图片文件名里既不要有空格(类似 \include),也不要有多余的英文点号,否则宏包在解析文件名的过程中会出错。

代码如下:

\begin{figure*}

% Use the relevant command to insert your figure file.

% For example, with the graphicx package use

\includegraphics[width=0.75\textwidth]{example.eps}

% figure caption is below the figure

\caption{Randomly selected images from the VisDrone-2020 dataset, including different periods, different scenes and different shotting angles.}

\label{fig:2} % Give a unique label

\end{figure*}

图形文件一般和 .tex 源文件在同一目录下,因此可以直接写文件名插入。但有的时候图片会被合并到一个文件夹中进行管理,此时就可以使用 graphicx 宏包提供的 \graphicspath 命令来指定这个文件夹。指定后,所有图片的搜索都将在这个文件夹中进行。

\graphicspath{ {figures/}}

  1. 图片居中:

代码如下:

\centering\includegraphics[<options>]{<filename>}

  1. 多图排列(在图片下加 (a) ,(b), (c)标号):

%

\begin{figure}

\centering

\subfigure[]{

\begin{minipage}[c]{0.2\textwidth}

\centering

\includegraphics[width=\textwidth]{fig3.1}

\end{minipage}%

}%

\hspace{3ex} #设置两图之间的间隔,加空格或 \quad 换行

\subfigure[]{

\begin{minipage}[c]{0.193\textwidth}

%\centering

\includegraphics[width=\textwidth]{fig3.2}

\end{minipage}

}%

\caption{(a) The histogram shows the number of different classes; (b) The ratio of the length and width of the annotation targets to the original image}\label{}

\end{figure}

%

  1. 控制浮动插图

一个典型的插图语句

\begin{figure}[htbp]

\centering

\includegraphics[width=6.5cm]{graph.eps}

\caption{This is an inserted EPS graphic} \label{fig:graph}

\end{figure}

其中[htbp]就是浮动格式

“h 当前位置。将图形放置在正文文本中给出该图形环境的地方。如果本页所剩的页面不够,这一参数将不起作用。

t 顶部。将图形放置在页面的顶部。

b 底部。将图形放置在页面的底部。

p 浮动页。将图形放置在一只允许有浮动对象的页面上。”

  1. 插入表格

基本代码如下:

\begin{table}

% table caption is above the table

\caption{Taking COCO dataset as the standard, the proportion of large, medium and small targets in the visdrone-2020 dataset is calculated}

\label{tab:1} % Give a unique label

% For LaTeX tables use

\centering 表格居中

\begin{tabular}{lll}{c,c,c} l, c, r单元格内容左对齐/居中/右对齐

\hline\noalign{\smallskip} %画表格的一行,并且行距设置为smallskip

SIZE[\%] & COCO[\%] & VisDrone[\%] \\

\noalign{\smallskip}\hline\noalign{\smallskip}

Small (0, 0.3) & 41.43 & 87.77 \\

Medium (0.3, 3) & 34.32 & 11.97 \\

Large (3, 100) & 24.24 & 0.26 \\

\noalign{\smallskip}\hline

\end{tabular}

\end{table}

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/144957.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年5月1,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档