LaTeX的知识

Bisheng Du 杜碧升 

Bisheng Du 杜碧升, PhD, Professor

Department of Management Science & Engineering
School of Business, Ningbo University, Zhejiang, China

Homepage www.dubisheng.com
Email \(\tt {dubisheng@nbu.edu.cn}\)

LaTeX的模板网站

LaTeX的个人网页

投稿系统或模板

字体下载

XeLaTeX的字体问题

XeLaTeX中的XeCJK的字体配置
\usepackage{xeCJK}
\setmainfont{Times New Roman}    % 缺省字体
\setCJKmainfont[BoldFont={Adobe Heiti Std},ItalicFont={Adobe Kaiti Std}]{Adobe Song Std}
\setCJKsansfont{Adobe Heiti Std}
\setCJKmonofont{Adobe Kaiti Std}
\setCJKfamilyfont{song}{Adobe Song Std}
\setCJKfamilyfont{hei}{Adobe Heiti Std}
\setCJKfamilyfont{kai}{Adobe Kaiti Std}
\setCJKfamilyfont{fs}{Adobe Fangsong Std}
%\setCJKfamilyfont{li}{LiSu}
%\setCJKfamilyfont{you}{YouYuan}
%\setCJKfamilyfont{yahei}{Microsoft YaHei}
%\setCJKfamilyfont{xingkai}{STXingkai}
%\setCJKfamilyfont{xinwei}{STXinwei}
%\setCJKfamilyfont{fzyao}{FZYaoTi}
%\setCJKfamilyfont{fzshu}{FZShuTi}
%-------------------------------------------------------------------
\newCJKfontfamily\song{Adobe Song Std}
\newCJKfontfamily\hei{Adobe Heiti Std}
\newCJKfontfamily\kai{Adobe Kaiti Std}
\newCJKfontfamily\fs{Adobe Fangsong Std}
%\newCJKfontfamily\li{LiSu}
%\newCJKfontfamily\you{YouYuan}
%\newCJKfontfamily\yahei{Microsoft YaHei}
%\newCJKfontfamily\xingkai{STXingkai}
%\newCJKfontfamily\xinwei{STXinwei}
%\newCJKfontfamily\fzyao{FZYaoTi}
%\newCJKfontfamily\fzshu{FZShuTi}

\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt

中文配置

简易中文文档配置

\documentclass[14pt,a4paper]{article}
\usepackage{fontspec}
\setmainfont[BoldFont=AdobeHeitiStd-Regular]{AdobeHeitiStd-Regular}
\setsansfont[BoldFont=AdobeHeitiStd-Regular]{AdobeHeitiStd-Regular}
\setmonofont{Times New Roman}
\begin{document}
\title{随手笔记}
\author{作者}
\date{\today}
\maketitle

\end{document}
日期的两种中文表示
%第一种格式\\
\renewcommand{\today}{\number\year 年 \number\month 月 \number\day 日}
%\today\\
%第二种格式\\
%\renewcommand{\today}{\CJKnumber\year 年 \CJKnumber\month 月 \CJKnumber\day 日}
%\today

Beamer

背景图设置
Global Setting of Background:

In the preamble of your TEX file write the command
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{<file_name>}


Individual Setting of Background:

For a individual setting, write the same line as above just before the \begin{frame} command

of the frame you want to edit, and then wrap it all with braces.
{
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{<file_name>
\begin{frame}
    \titlepage
\end{frame}
}
半透明的背景图
\usepackage{tikz}

\usebackgroundtemplate{%
\tikz\node[opacity=0.13,inner sep=0] {\includegraphics[height=\paperheight,width=\paperwidth,keepaspectratio]{image_name}};}
Beamer的大小比例
\documentclass[aspectratio=1610]{beamer}
%Sets aspect ratio to 16:10, and frame size to 160mm by 100mm.
\documentclass[aspectratio=169]{beamer}
%Sets aspect ratio to 16:9, and frame size to 160mm by 90mm.
\documentclass[aspectratio=149]{beamer}
%Sets aspect ratio to 14:9, and frame size to 140mm by 90mm.
\documentclass[aspectratio=141]{beamer}
%Sets aspect ratio to 1.41:1, and frame size to 148.5mm by 105mm.
\documentclass[aspectratio=54]{beamer}
%Sets aspect ratio to 5:4, and frame size to 125mm by 100mm.
\documentclass[aspectratio=43]{beamer}
%The default aspect ratio and frame size. You need not specify this option.
\documentclass[aspectratio=32]{beamer}
%Sets aspect ratio to 3:2, and frame size to 135mm by 90mm.
用Tikz在插入的图片上画图(出处)
\documentclass{beamer}
\usepackage{tikz}

\begin{document}

\begin{frame}

\begin{tikzpicture}[nodes={inner sep=0}]
% 插图
\node (a)
  {\includegraphics[width=3cm]{example-image-a}};
\node (b) at (5,0)
  {\includegraphics[width=3cm]{example-image-b}};
% 画图
\draw[->,red,line width=2mm] (a) -- (b);
\draw[<-,blue,line width=2mm] (a) -- ++ (-1,-3);
\draw[green,line width=1mm] (b.center) circle (1.5cm);
\end{tikzpicture}

\end{frame}

\end{document}

参考文献

文中author-year引用文后排序给出(出处)
\documentclass{article}
\usepackage[numbers]{natbib}
\bibliographystyle{plainnat}
\renewcommand\cite[1]{\citeauthor{#1} (\citeyear{#1})}
\begin{document}
\cite{Knuth:BAMSN-1-337}

\bibliography{texbook1}
\end{document}