通过 ACM 论文模版学习 LaTeX 语法 【三、格式】

embedded/2024/10/18 9:25:16/

文章目录

  • 一、LaTeX 简介
  • 二、ACM 论文模版
  • 三、格式
    • 3.1 文章格式
      • 3.1.1 注释
      • 3.1.2 空格
      • 3.1.3 换行
      • 3.1.4 列表
    • 3.2 字体
      • 3.2.1 字体样式
      • 3.2.2 字体大小
      • 2.2.3 字体颜色

LaTeX__2">一、LaTeX 简介

通过 ACM 论文模版学习 LaTeX 语法 【一、LaTeX简介和安装】

二、ACM 论文模版

通过 ACM 论文模版学习 LaTeX 语法 【二、ACM 论文模版】

三、格式

3.1 文章格式

3.1.1 注释

LaTeX中,注释用于在源代码中添加说明或标记,这些注释不会显示在最终的文档中。注释的方式是使用 % 符号,后面跟随的所有内容在该行都被视为注释。

示例代码

% This is a comment
\documentclass{article}\begin{document}% This is a comment before the title
\title{Sample Article} % Title of the article
\author{Author Name}
\date{\today}\maketitle% Introduction section
\section{Introduction}
This is the introduction section.\end{document}

3.1.2 空格

LaTeX中,空格的处理方式与普通文本编辑器有所不同:

  • 普通空格LaTeX会自动处理空格,多个空格会被合并成一个空格。
  • 非断行空格:使用 ~ 插入不间断空格。这个空格不会被拆分到下一行。例如:Hello~World
  • 强制空格:使用 \ 插入普通空格,例如:Hello\ world

示例代码

\documentclass{article}\begin{document}\Huge This is a sentence with normal spaces.\Huge This~is~a~sentence~with~non-breaking~spaces.\Huge This is a sentence with non-breaking spaces.\Huge Hello\ world, this is a sentence with a forced space.\end{document}

在这里插入图片描述

3.1.3 换行

LaTeX中的换行有多种方式:

  • 简单换行:使用 \\ 进行换行。例如:

    This is the first line.\\
    This is the second line.
    

    在这里插入图片描述

  • 段落换行:一个或多个空行表示新的段落。例如:

    This is the first paragraph.This is the second paragraph.
    

    在这里插入图片描述

  • 强制换行:使用 \newline 强制换行。例如:

    This is the first line.\newline
    This is the second line.
    

    在这里插入图片描述

  • 换行和段落分隔:在某些情况下,可以使用 \vspace 命令添加额外的空间。例如:

    This is the first line.\\[10pt]
    This is the second line with extra space.
    \vspace{2em}This is the third line.
    

    在这里插入图片描述

这些方法帮助你在LaTeX中有效地处理文章格式中的注释、空格和换行,以便进行精确的排版和文档设计。

3.1.4 列表

有序列表:

  1. \begin{enumerate}\end{enumerate}

    • enumerate 环境用于创建一个编号列表。在该环境内,每个项目将自动编号,编号的格式可以根据需要进行自定义。
  2. \item

    • \item 命令用于列表中的每一项。这将生成一个新的编号项。每个 \item 后面的内容是该项的具体内容。
Our work makes the following technical contributions:
\begin{enumerate}\item We propose and develop the concept of on-device post-deployment neural architecture adaptation, and implement it with an end-to-end system.\item We introduce a pretraining-assisted model elastification method that can effectively and flexibly generate a model search space, as well as edge-tailored strategies to search the optimal model from the space and maintain it at runtime.\item Our method achieves significantly better accuracy-latency tradeoffs than SOTA baselines according to experiments on various edge devices and common tasks.The tool and models are open-sourced at https://github.com/wenh18/AdaptiveNet.
\end{enumerate}

在这里插入图片描述


无序列表:

  1. \begin{itemize}\end{itemize}

    • itemize 环境用于创建无序列表。该环境内的每个项目符号项由 \item 命令定义。
  2. \item

    • \item 命令用于列表中的每一项。这将生成一个新的编号项。每个 \item 后面的内容是该项的具体内容。
\begin{itemize}
\item \textbf{Image classification} aims to recognize the category of an image. We select three 
popular classification models, MobileNetV2 \cite{mbv2}, ResNet50 \cite{resnet}, and ResNet101 
\cite{resnet} to represent small, middle, and large models. The dataset used in this task is 
ImageNet2012 \cite{imagenet}.
\item \textbf{Object detection} aims to detect objects in an image, predicting the object bounding 
boxes and categories. We choose EfficientDet \cite{efficientdet} with ResNet50 \cite{resnet} 
backbone as the detection model, which is one of the top-performing detection models, and 
COCO2017 \cite{coco} as the dataset.The performance of detection models is measured by 
mean average precision over Intersection over Union threshold 0.5 (mAP@0.5).
\item \textbf{Semantic segmentation} aims to predict the class label of each pixel in an 
image.We choose FPN \cite{fpn} model with ResNet50 \cite{resnet} encoder pretrained on 
ImageNet2012 \cite{imagenet}. The dataset is CamVid \cite{camvid}, a road scene 
understanding dataset. The performance is measured by Mean Intersection over Union (mIoU).
\end{itemize}

在这里插入图片描述

3.2 字体

LaTeX中调整文本的字体格式,可以通过一些基本的命令和包来实现。以下是一些常用的调整方法,包括字体样式、字体大小和字体颜色:

3.2.1 字体样式

\underline{underline} \textbf{Bold text}\textit{Italic text}\textsc{Small caps text}\texttt{Typewriter font text}\textrm{Roman font text}\textsf{Sans-serif font text}

当然,以下是每行代码的解释:

  1. \underline{underline}:这行代码将“underline”这个单词加下划线

  2. \textbf{Bold text}:这行代码将“Bold text”这段文字加粗

  3. \textit{Italic text}:这行代码将“Italic text”这段文字斜体化

  4. \textsc{Small caps text}:这行代码将“Small caps text”这段文字转换为小型大写字母(小型大写字母是指字母的高度介于大写字母和小写字母之间的一种字体)。

  5. \texttt{Typewriter font text}:这行代码将“Typewriter font text”这段文字设置为打字机字体(等宽字体)。

  6. \textrm{Roman font text}:这行代码将“Roman font text”这段文字设置为罗马字体(衬线字体)。

  7. \textsf{Sans-serif font text}:这行代码将“Sans-serif font text”这段文字设置为无衬线字体。

在这里插入图片描述

LaTeX 中,\emph 命令用于强调文本。默认情况下,它会将文本设置为斜体(italic),但实际效果可能因文档的字体设置而有所不同。在某些情况下,\emph 也可以用于其他强调样式。

基本语法

\emph{text}

示例

\documentclass{article}\begin{document}This is normal text.\emph{This text is emphasized.}\end{document}

在这里插入图片描述

作用

  • 默认效果:在大多数文档类和字体设置中,\emph 会使文本变为斜体。例如,“This text is emphasized.” 将以斜体显示。
  • 嵌套效果:如果 \emph 被嵌套使用(即在已经斜体的文本中使用 \emph),LaTeX 会恢复到正常字体(即非斜体),使得强调效果在嵌套中相反。

示例(嵌套使用):

\documentclass{article}\begin{document}This is \emph{emphasized text with \emph{nested emphasis}}.\end{document}

在这里插入图片描述

在这个例子中,“nested emphasis” 会以正常的字体显示,因为内层的 \emph 会取消外层的强调效果。

\emph 通常用于强调文档中的某些文本部分,尤其是在学术或技术文档中,用于突出重要概念或术语。它是一个语义上的强调工具,而不仅仅是视觉上的变换。

3.2.2 字体大小

可以使用以下命令来设置不同的字体大小:

\tiny      % 极小号字体
\scriptsize  % 脚本字体
\footnotesize  % 注脚字体
\small     % 小号字体
\normalsize % 正常大小字体(默认)
\large     % 大号字体
\Large     % 更大号字体
\LARGE     % 很大号字体
\huge      % 特大号字体
\Huge      % 最大号字体

示例:

\tiny This is tiny text. % 极小号字体
\scriptsize This is scriptsize text. % 脚本字体
\footnotesize This is footnotesize text. % 注脚字体
\small This is small text. % 小号字体
\normalsize This is normalsize text. % 正常大小字体(默认)
\large This is large text. % 大号字体
\Large This is Large text. % 更大号字体
\LARGE This is LARGE text. % 很大号字体
\huge This is huge text. % 特大号字体
\Huge This is Huge text. % 最大号字体

在这里插入图片描述

2.2.3 字体颜色

使用 xcolor 包可以改变文本的颜色:

  1. 在导言区引入 xcolor 包:

    \usepackage{xcolor}
    
  2. 使用 \textcolor 命令来设置字体颜色:

    \textcolor{red}{Red text}
    

    在这里插入图片描述

    可以使用预定义的颜色名(如 red, blue, green)或自定义颜色:

    \definecolor{mycolor}{RGB}{255,100,100}
    \textcolor{mycolor}{Customised red text}
    

在这里插入图片描述

组合使用

可以组合使用上述命令,例如:

\textbf{\textit{\textcolor{blue}{Bold and italicised text in blue}}}

在这里插入图片描述

这是LaTeX中调整字体格式的基本方法,根据需要可以灵活组合使用。


http://www.ppmy.cn/embedded/90430.html

相关文章

一文掌握Python全部条件执行语句(基础篇)

前言 本文,小编将总结一个非常实用而且非常基础的Python知识点“条件语句”。熟练掌握python条件语句,让你的程序代码做出精准判断,实现智能决策。废话不多说,接下来在正文中,将结合实际代码案例进行详细说明。 正文…

el-ui 导航菜单重复点击报错问题解决

重复点击菜单报错 NavigationDuplicated: Avoided redundant navigation to current location: xxxxx 解决办法: 路由文件.js最下边加入这段代码 //NavigationDuplicated: Avoided redundant navigation to current location 解决重复点击路由报错 // 重写路由push方法 const…

模板方法模式

1.什么是模板方法模式? 模板方法模式是一种设计模式,用于定义算法的框架结构,将算法中不变的部分封装在父类中, 而将可变的部分延迟到子类中实现。 2.使用场景: 框架设计:在框架设计中,模板方法…

使用Chainlit接入通义千问快速实现一个自然语言转sql语言的智能体

文本到 SQL 让我们构建一个简单的应用程序,帮助用户使用自然语言创建 SQL 查询。 最终结果预览 ​ 先决条件 此示例有额外的依赖项。你可以使用以下命令安装它们: pip install chainlit openai​ 导入 应用程序 from openai import AsyncOpenAI…

HarmonyOS多目标产物构建最佳实践

背景 在Android或iOS开发时经常会有打“马甲”包的场景,就是一套代码打出不同主题的包,一个公司的产品可能针对不同用户提供不同的应用,比如抖音有国内版也有国外版,滴滴有个人版还有企业版,同样的在鸿蒙平台也有类似…

ComfyUI: 报EP Error错误(onnxruntime)

🤶背景描述 在使用反推提示词的时候,按照上一篇介绍的方法是可以正常使用的。 但是看后台的时候,发现有一个错误: *************** EP Error *************** EP Error D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_s…

”关于“八股文”对程序员开发作用

在程序员开发的语境中,“八股文”通常指的是那些被广泛讨论、反复练习的技术面试问题和答案,这些问题往往围绕经典的技术知识点,如算法、数据结构、设计模式等。对于“八股文”对程序员开发的作用,可以从以下几个方面进行分析&…

Vulnhub入门篇-Kioptrix2014

1.环境配置 下载地址:https://download.vulnhub.com/kioptrix/kiop2014.tar.bz2 攻击机kali:192.168.26.128(Nat模式) 靶机配置:Nat模式 这里注意,根据官网地址说明,需要我们先将网络适配器…