LaTex设置标题页、修改文字颜色和文字高亮

目录

一、标题页

1)常用的代码

2)添加脚注

二、修改文字颜色和文字高亮

1)设置文本的颜色

2)添加文本高亮

3)给文本添加有颜色的方框


一、标题页

主要的代码:

\begin{titlepage}  
	\noindent\fontsize{12}{15}\selectfont\textbf{Convolutional transformer attention network}
	
	\vspace{5mm} % 垂直间距
	\noindent\small{Liu xx\textsuperscript{a}, 	Yang xx\textsuperscript{a,$\ast$} and Huang xx\textsuperscript{a}}
	
	\vspace{2mm}
	\noindent\small{\textsuperscript{a}University, city, China}
	
	\vspace{5mm}\noindent
	Email addresses:\\
	Liu xx: xxx@163.com; ORCID: xxx\\
	Yang xx: xxx@163.com\\
	Huang xx: xxx@163.com
	
	\vspace{2mm}\noindent
	$\ast$ Corresponding author. \\
	$\dag$ Co-first author. 
	
\end{titlepage}
  • \noindent:取消首行缩进
  • \textbf{}:加粗
  • \fontsize{12}{15}:字体12,行间距15,但是需要配合使用\selectfont,否则行间距无效。即\fontsize{12}{15}\selectfont

1)常用的代码

\documentclass[]{interact} % 导入自己的样式,如果没有可以使用\documentclass[]{article}

\begin{document}
	
\begin{titlepage}  
	\noindent\fontsize{12}{15}\selectfont\textbf{Convolutional transformer attention network}
	
	\vspace{5mm} % 垂直间距
	\noindent\small{Liu xx\textsuperscript{a}, 	Yang xx\textsuperscript{a,$\ast$} and Huang xx\textsuperscript{a}}
	
	\vspace{2mm}
	\noindent\small{\textsuperscript{a}University, city, China}
	
	\vspace{5mm}\noindent
	Email addresses:\\
	Liu xx: xxx@163.com; ORCID: xxx\\
	Yang xx: xxx@163.com\\
	Huang xx: xxx@163.com
	
	\vspace{2mm}\noindent
	$\ast$ Corresponding author. \\
	$\dag$ Co-first author. 
	
\end{titlepage}

\end{document}

添加居中:

\documentclass[]{interact} % 导入自己的样式,如果没有可以使用\documentclass[]{article}

\begin{document}
	
\begin{titlepage}  
	\begin{center}
		\noindent\fontsize{12}{15}\selectfont\textbf{Convolutional transformer attention network}
		
		\vspace{5mm} % 垂直间距
		\noindent\small{Liu xx\textsuperscript{a}, 	Yang xx\textsuperscript{a,$\ast$} and Huang xx\textsuperscript{a}}
		
		\vspace{2mm}
		\noindent\small{\textsuperscript{a}University, city, China}
		
		\vspace{5mm}\noindent
		Email addresses:\\
		Liu xx: xxx@163.com; ORCID: xxx\\
		Yang xx: xxx@163.com\\
		Huang xx: xxx@163.com
		
		\vspace{2mm}\noindent
		$\ast$ Corresponding author. \\
		$\dag$ Co-first author. 
	\end{center}
\end{titlepage}

\end{document}

设置标题与上部页边距增大:

\documentclass[]{interact} % 导入自己的样式,如果没有可以使用\documentclass[]{article}

\begin{document}
	
\begin{titlepage}  
	\vspace*{\fill} % \vspace上下段落之间空的距离,{}可填写pt,cm,mm,in等单位
				    % \vsapce*{}中*表示在一页开始就空距离
	\begin{center}
		\noindent\fontsize{12}{15}\selectfont\textbf{Convolutional transformer attention network}
		
		\vspace{5mm} % 垂直间距
		\noindent\small{Liu xx\textsuperscript{a}, 	Yang xx\textsuperscript{a,$\ast$} and Huang xx\textsuperscript{a}}
		
		\vspace{2mm}
		\noindent\small{\textsuperscript{a}University, city, China}
		
		\vspace{5mm}\noindent
		Email addresses:\\
		Liu xx: xxx@163.com; ORCID: xxx\\
		Yang xx: xxx@163.com\\
		Huang xx: xxx@163.com
		
		\vspace{2mm}\noindent
		$\ast$ Corresponding author. \\
		$\dag$ Co-first author. 
	\end{center}
\end{titlepage}

\end{document}

2)添加脚注

使用该命令:\footnote[1]{This is the explanation.} ,其中[]中可以自定义标注数(只能是数字),不自定义则默认逐个加1显示。

下面示例是自定义其他字符的:

\documentclass[]{interact} % 导入自己的样式,如果没有可以使用\documentclass[]{article}

\begin{document}
	
	\begin{titlepage}  
		\begin{center}
			\noindent\fontsize{12}{15}\selectfont\textbf{Convolutional transformer attention network}
			
			\vspace{5mm} % 垂直间距
			\noindent\small{Liu xx\textsuperscript{a}, 	Yang xx\textsuperscript{a,$\ast$} and Huang xx\textsuperscript{a,}\renewcommand*{\thefootnote}{\dag}\footnote{This is the explanation.}}
			
			\vspace{2mm}
			\noindent\small{\textsuperscript{a}University, city, China}
			
			\vspace{5mm}\noindent
			Email addresses:\\
			Liu xx: xxx@163.com; ORCID: xxx\\
			Yang xx: xxx@163.com\\
			Huang xx: xxx@163.com
		\end{center}
	\end{titlepage}
	
\end{document}

二、修改文字颜色和文字高亮

首先导入必要的宏包:

\usepackage{xcolor}  %也可以使用{color}宏包,但是颜色库里面颜色较少,使用xcolor会更好

1)设置文本的颜色

一般文本颜色选用黑色和红色,标红采用red

\textcolor{red}{abcd}     %1.{}里面的文字颜色
{\color{blue} abcd}       %2.整体需要打括号,若不打大括号的话,{blue}后面均为蓝色

2)添加文本高亮

\colorbox{-blue}{abcd}

\colorbox{yellow}{abcd}

\colorbox{green}{\color{red} abcd} % 底色+字体颜色

\colorbox{green}{\color{black} abcd} % 底色+字体颜色

3)给文本添加有颜色的方框

\fcolorbox{red}{yellow}{\color{red}abcd} %框色+底色+红色文本

\fcolorbox{red}{white}{abcd} %框色+底色+默认文本颜色为黑色

整体效果

\documentclass[]{article}
\usepackage{xcolor}

\begin{document}

\textcolor{red}{abcd}     %1.{}里面的文字颜色 (方法一)
{\color{blue} abcd}       %2.整体需要打括号,若不打大括号的话,{blue}后面均为蓝色 (方法二)

\colorbox{-blue}{abcd}

\colorbox{yellow}{abcd}

\colorbox{green}{\color{red} abcd} % 底色+字体颜色

\colorbox{green}{\color{black} abcd} % 底色+字体颜色

\fcolorbox{red}{yellow}{\color{red}abcd} %框色+底色+红色文本

\fcolorbox{red}{white}{abcd} %框色+底色+默认文本颜色为黑色

\end{document}

  • 8
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

清纯世纪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值