LaTex入门日记2

公式编辑

其实在latex里编辑公式挺容易的:

\begin{equation}\label{3-4-1}   %行间编号
		你的公式
\end{equation}

$a+b$        %行内公式

\[a+b=c\]   %行间不编号

但是复杂公式很麻烦,所见即所得可能会比较方便点,方便预览嘛,这里推荐一个网址:LaTex公式编辑器,可以在线生成代码,快速预览,同时注册后支持图片识别,比较方便。

算法表

\usepackage[linesnumbered, ruled]{algorithm2e}  
...
...
\begin{algorithm}[htb]
	% \SetAlgoNoLine  %去掉之前的竖线
	\SetAlgoCaptionSeparator{ }  % 变冒号为空格
	\caption{Prototypical Net}\label{alg-2}
	\KwIn{training set $ \mathcal{D}^{tr} $, learning rate $\beta$} 
	\KwOut{Model parameter $\theta$} 
	Randomly initiate $\theta$\;
	\While{not done}
	{
		Generate meta-tasks \{$\mathcal{T}_1, \mathcal{T}_2,...$\} from $ \mathcal{D}^{tr} $\;
		\For{each task $\mathcal{T}_i$} 
		{ 
			here\;
		}
	}
	return $ \theta $
\end{algorithm}

效果:(字体可以自己调整)
在这里插入图片描述

TeXstudio快捷键更改

注释快捷键

自定义超链接

\usepackage[colorlinks,linkcolor=blue,anchorcolor=blue,citecolor=blue]{hyperref}
\hypersetup{pdfauthor={Name}}
% 自定义超链接格式,~为空格
%\newcommand<命令>[<参数个数>][<首参数默认值>]{<具体的定义>}
\newcommand{\secref}[1]{Section~\ref{#1}}
\newcommand{\figref}[1]{Fig.~\ref{#1}}
\newcommand{\tabref}[1]{Table~\ref{#1}}
\newcommand{\equref}[1]{Eq.~(\ref{#1})}

正文使用

As illustrated in \figref{fig3-2_2},

行号

% line number
\usepackage{lineno}
\pagewiselinenumbers% 按页重新编号 

Definition

====宏包
\usepackage{amsmath}
\newtheorem{definition}{Definition}  
% definition 表示类型, 还有theorem, proof等; Definition是显示的内容

====正文
\begin{definition}[Domain]
		A domain consists of ......
\end{definition}

文字变色

这部分主要是针对论文返修时候用的(没错,最近俺有这个需求,哈哈)

\usepackage{color}

\textcolor{red/blue/green/black/white/cyan/magenta/yellow}{text}

PDF

pdflatex生成的文档在Adobe Acrobat中出现错误,但其他阅读器可以正常打开。
在\documentclass之前添加

\pdfminorversion=4

另外,指定用pdflatex编译——
在最开头添加:

%!TEX program = pdflatex

ORCID

这里介绍了网上搜到的两个方法,method 1中字母I和上面的圆点没有对齐,因此推荐使用method 2.

% ***** ORCID *****
\usepackage{tikz,xcolor,hyperref}% Make Orcid icon
\definecolor{lime}{HTML}{A6CE39}
\DeclareRobustCommand{\orcidicon}{%
	\begin{tikzpicture}
		\draw[lime, fill=lime] (0,0)
		circle [radius=0.16]
       % node[white]{{\fontfamily{qag}\selectfont \tiny ID}};  % method 1, letter I is unaligned
       % \draw[white, fill=white] (-0.0625,0.095)
		node[white]{{\fontfamily{qag}\selectfont \tiny $\dot{\mathsf I}$D}};  % method 2
		circle [radius=0.007];
	\end{tikzpicture}
	\hspace{-2mm}}
\foreach \x in {A, ..., Z}{%
	\expandafter\xdef\csname orcid\x\endcsname{\noexpand\href{https://orcid.org/\csname orcidauthor\x\endcsname}{\noexpand\orcidicon}}
}
% Define the ORCID iD command for each author separately. Here done for two authors.
\newcommand{\orcidauthorA}{XXXX-XXXX-XXXX-XXXX} % XX部分替换为作者ID
\newcommand{\orcidauthorB}{XXXX-XXXX-XXXX-XXXX}

% 在文中作者名字后面这样添加:
\author{Yancy Feng\orcidA{},~Yufeng Xu\orcidB{}, ...

效果呈现:
在这里插入图片描述

持续更新中……

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值