latex模板
作者:互联网
@
目录latex中“盒子”的概念(box)?
parbox
makebox
常用操作
给内容加颜色
{\color{red} text }
给部分文本内容加底色
\colorbox[RGB]{255, 255, 204}{ text }
给多行内容加底色高亮
\newcommand\hl[1]{\bgroup\markoverwith{\textcolor{#1}{\rule[-.5ex]{2pt}{2.5ex}}}\ULon}
使用
\hl{yellow}{多行文本}
给多行内容加底色(RGB颜色)
%% 使用rgb颜色 RGB(0~255) rgb(0~1)
\noindent
\colorbox[RGB]{255, 255, 204}{%
\parbox{\linewidth-0\fboxsep}{%
\setlength{\parindent}{2em}
%
%
需要加底色的内容
}}
公式中部分高亮
\newcommand{\mathcolorbox}[2]{\colorbox{#1}{$\displaystyle #2$}}
\begin{equation}
\mathcolorbox{yellow}{y=x}+c
\end{equation}
latex英文模板
\documentclass[a4paper,11pt]{article}
%%
\usepackage[top=1in, bottom=1in, left=0.8in, right=0.8in]{geometry}
%\usepackage[UTF8]{ctex}
\usepackage{setspace,indentfirst}
%% usepackage{float}
%%
\usepackage{amssymb,amsfonts,amsmath,bm,showlabels}
\usepackage{showlabels}
\allowdisplaybreaks
%%
\usepackage{graphicx,subfigure,caption,epstopdf,epsfig,enumitem}
\graphicspath{{figure/}}
%%
\usepackage{stmaryrd}
%%
%% \usepackage[normalem]{ulem}
%%
%% \usepackage{citesort}
\usepackage{cite}
\usepackage{color}
%%
\usepackage{changes}
\definechangesauthor{red}
\colorlet{Changes@Color}{red}
%%
\usepackage{hyperref}
\hypersetup{colorlinks=true,citecolor={red},linkcolor={green}}
%% Color Information from - http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/latex_advanced/node13.html
%% NEW COMMAND
%% marginsize{left}{right}{top}{bottom}:
%% \marginsize{3cm}{2cm}{1cm}{1cm}
%% \marginsize{0.85in}{0.85in}{0.625in}{0.625in}
\def\baselinestretch{1}
%% \pagestyle{empty}
%% \newcommand{\hsp}{\hspace*{\parindent}}
%% \definecolor{gray}{rgb}{0.4,0.4,0.4}
\newcommand\bi[1]{\textbf{\textit{#1}}}
\begin{document}
%\songti
%\youyuan
\maketitle
\clearpage
\tableofcontents
body text
\end{document}
latex中文模板
\documentclass[12pt,a4paper]{article}
\usepackage[left=3.18cm, right=3.18cm, top=3.18cm, bottom=3.18cm]{geometry}
\usepackage[UTF8]{ctex}
%%
\usepackage{indentfirst,setspace,microtype}
\linespread{1.2}
%%
\usepackage{amssymb,amsfonts,amsmath,bm,showlabels}
\allowdisplaybreaks
%%
\usepackage{graphicx,subfigure,caption,enumitem,epstopdf,epsfig,wrapfig,tikz}
\graphicspath{{figure/}}
%%
\usepackage{hyperref,cite,color}
\hypersetup{colorlinks=true,citecolor={red},linkcolor={blue}}
%%
\usepackage{changes}
\definechangesauthor{red}
\colorlet{Changes@Color}{red}
%%
\usepackage{titlesec}
\titleformat{\paragraph}[hang]{}{\theparagraph \quad}{0pt}{}
\titleformat{\subparagraph}[hang]{}{\thesubparagraph \quad}{0pt}{}
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{5}
%%
%\usepackage{draftwatermark}
%\SetWatermarkText{内部使用} % the Text
%\SetWatermarkLightness{0.9} % the lightness from 0 to 1, default 0.8
%\SetWatermarkScale{0.5} % the scale, default 1.2
%% others
\usepackage{pifont,listings,framed}
%% newcommand
%\newcommand{\ti}[1]{\tilde{#1}}
% title, author, date
\title{\LARGE\bfseries\songti -------}
%\author{ \kaishu ---
% \thanks{Thanks for every people.} \\[0.5ex] % 在第一页左下角加感谢
% }
\date{\small\itshape Last update: \today}
\begin{document}
\songti
\maketitle
\clearpage
\tableofcontents
\clearpage
正文区
\end{document}
常用操作
%% 插入图片
\begin{figure}[!ht]
\centering
\includegraphics[width=0.45\textwidth]{20210118-3.pdf}
%%\caption{}
\end{figure}
%% 插入多个子图
\begin{figure*}[!ht]
\centering
\subfigure[]{
\centering
\includegraphics[width=0.45\textwidth]{20210120-1.png}
}
\subfigure[]{
\centering
\includegraphics[width=0.45\textwidth]{20210120-2.png}
}
%%\caption{}%%\label{}
\end{figure*}
多行公式居中对齐,*号表示不显示编号。
\begin{equation*}
\begin{aligned}
&tr (\bm{A} \cdot \bm{B}) \\
&= tr (A_{ij} \bm{e}_i \otimes \bm{e}_j \cdot B_{mn} \bm{e}_m \otimes \bm{e}_n)
= tr (A_{ij} B_{mn} \delta_{jm} \bm{e}_i \otimes \bm{e}_n)
= A_{ij} B_{mn} \delta_{jm} \delta_{in}
= A_{ij} B_{ji} \\
\end{aligned}
\end{equation*}
\begin{align*}
f(x) &= (x+a)(x+b) \\
&= x^2 + (a+b)x + ab \\
\end{align*}
多行公式左对齐,*号表示不显示编号。
\begin{flalign*}
\begin{aligned}
&tr (\bm{A} \cdot \bm{B}) \\
&= tr (A_{ij} \bm{e}_i \otimes \bm{e}_j \cdot B_{mn} \bm{e}_m \otimes \bm{e}_n)
= tr (A_{ij} B_{mn} \delta_{jm} \bm{e}_i \otimes \bm{e}_n)
= A_{ij} B_{mn} \delta_{jm} \delta_{in}
= A_{ij} B_{ji} \\
\end{aligned}
\end{flalign*}
%%标题添加脚注
\subsubsection{为什么不可压缩材料的泊松比为0.5\protect\footnotemark[1]}
\footnotetext[1]{ 参考\href{https://www.douban.com/note/256704531/}{豆瓣} }
%% split与aligned效果相同
\begin{equation}
\begin{aligned}
c
&=a+b \\
&=e+f \\
\end{aligned}
\end{equation}
\begin{equation}
\left\lbrace
\begin{aligned}
&c=a+b \\
&d=e+f \\
\end{aligned} \right.
\end{equation}
标签:latex,begin,end,usepackage,%%,bm,aligned,模板 来源: https://www.cnblogs.com/Nazorine/p/16480369.html