楼主: hylpy1
3884 26

[学习方法] [转载]Latex相关资源汇总 [推广有奖]

11
hylpy1 在职认证  发表于 2015-11-9 22:13:59
Latex 里面如何输入长等号?
\def\Eqlfill@{\arrowfill@\Relbar\Relbar\Relbar}
\newcommand{\extendEql}[1][]{\ext@arrow 0099\Eqlfill@{#1}}
\makeatother
a\extendEql\textrm{def}b

Latex 里面如何调整列表环境的间隔?
设置方法一:在列表环境里进行设置,这样每次使用列表时自己随时设置,比较随意些:
\documentclass{article}
\usepackage{times}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{159.0pt}
\usepackage{pifont}
\renewcommand\labelitemi{\ding{43}}
\begin{document}
  \begin{itemize}\setlength{\itemsep}{-\itemsep}
  \item Text of the first item in the list.
  \item Text of the first sentence in the second item of the list. And the second sentence.
  \end{itemize}
  \begin{enumerate} \setlength{\itemsep}{0pt}
        \item item of the list.
        \item item of the list.
        \item item of the list.
\end{enumerate}\end{document}

设置方法二:方法一有一个缺陷就是你要随时设置比较麻烦,下面的方法较为简单,可以进行统一的设置。简单方便:\documentclass{article}
\usepackage{times}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{159.0pt}
\usepackage{pifont}
\renewcommand\labelitemi{\ding{43}}
\usepackage{atbeginend} % 可选宏包, 能解决许多问题,
%比如itemize, enumerate环境\item之间的控制
%用法
\AfterBegin{itemize}{\addtolength{\itemsep}{-0.5\baselineskip}}
\AfterBegin{enumerate}{\addtolength{\itemsep}{-0.5\baselineskip}}
\begin{document}
  \begin{itemize}
        \item item of the list.
        \item item of the list.
        \item item of the list.
  \end{itemize}
  \begin{enumerate}
        \item item of the list.
        \item item of the list.
        \item item of the list.
\end{enumerate}
\end{document}

Latex 里面如何打印如下常用符号?


使用marvosym 宏包
演示:
marvosym-demo.jpg
代码:
\documentclass[a4paper,twoside]{book}
\usepackage{CJK}
\usepackage[body={398pt,550pt},footskip=30pt,%
            marginparwidth=60pt,marginparsep=10pt]{geometry}
%\setlength\textwidth{180.0pt}
\usepackage{marvosym}
\begin{CJK*}{GBK}{song}
\begin{document}
            \noindent\Emailct~XXXXXXX有限公司~~xxxx~xxxx~xxxxxx~xxx-xxx~室\\%
            \Telefon~\underline{0755-12345678}~~\\\Letter~\underline{xxx@xxxxxxxxx.com}~~\\%
            \Mobilefone~\underline{13812345678}~~\\\Pickup~\underline  {http://www.xxxxxxxxx.com/}\\%
打勾: ${\surd}$\\
打叉: ${\texttimes}$
\paragraph{}
\clearpage
\end{CJK*}
\end{document}

转自http://babe-hut.spaces.live.com/ ... AE39B56CC!200.entry



凡事,一笑而过..................

12
hylpy1 在职认证  发表于 2015-11-9 22:14:41
Latex常见问题集  
如何设置标题和副标题

\title{Introduction to \LaTeX{ } Symbols and Commands \\ [2ex] \begin{large} Common Expressions in \emph{AURORA} \end{large} }

通过换行符号\\,分开主标题和副标题,然后设置缩进位置2个X的位置,最后用一个局部环境设置副标题的字体大小。

There are two basic ways to change font sizes in Latex:

- To change the basic font size used all the way through your paper, put either
  "11pt" or "12pt" in your \documentclass line.  For example, if you had:

\documentclass{report}

  but you wanted to use 12pt type (10pt is the default), you would change it
  to:

\documentclass[12pt]{report}

NOTE:  12pt is an option to the "report" class, not a separate
package, so doing
\documentclass{report}
\usepackage{12pt}
will *not* work.   

- To change just a part of your paper into a different font size, you can use
  some of the sizing environments.  In increasing size, they are:

\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge

  The case is important in these commands.  Also, in some document styles,
  some of these commands may produce the same size font.  For example, if you
  wanted to just make a small part of your text in a different font, you would
  use something like:

This is in normal text, while these words are in {\large large text}.

  Or, if you wanted to put a larger region in a different size, you'd use
  something like:

\begin{small}
this will all be in small text
this too.
etc..
\end{small}
凡事,一笑而过..................

13
hylpy1 在职认证  发表于 2015-11-9 22:15:13
Latex中数学常用符号的输入 1、数学符号的重叠显示,用于变量上面斜杠$\rlap{$\backslash$} a  $$\rlap{$\setminus$} a  $$\diagdown \llap{a}   $ 2、在箭头上方/下方写字$ u(x) \overset{\text{UMP}}{\Longrightarrow} x(p,w) $ \\$ u(x) \underset{\text{UMP}}{\Longrightarrow} x(p,w) $ \\$Y  \xrightarrow[\text{ Cost Function }]{\text{Cost Minimization}}  c(w,q) $ 在括号上下方写字,用overbrace or underbrace。    f_{X_1,\cdots, X_k}(x_1, \cdots, x_k)=       \overbrace{\int_{-\infty}^{\infty} \cdots \int_{-\infty}^{\infty}}^{n-k}        f(x_1, \cdots, x_k, \xi_{k+1}, \cdots, \xi_{n})       d \xi_{k+1} \cdots d\xi_{n} 3、公式排列一个短公式写一行, 用equation,(有编号,加*无编号) 一个长公式分几行写,没有对齐功能,用multiline ,(有编号,加*无编号) 一个长公式分几行写,有对齐功能,用split。自身无编号。要编号,外套equation。 一组公式,无对齐功能,用gather。(有编号,加*无编号)  一组公式,有对齐功能,用align。(有编号,加*无编号)       \begin{align*}           a+b & = c+d \\           x+y & = c+d      \end{align*}上述两个公式按照&的位置对齐。如果不加*,则对每个公式进行编号,加了*就不编号。 将一组公式用类似矩阵形式进行排版对齐,用align或 flalign。(有编号,加*无编号)  4、矩阵的输入利用bmatrix环境,带方括号\begin{equation} X=\begin{bmatrix}  1 & \cdots & 2 \\  2 & \cdots & 3\end{bmatrix} \end{equation} 利用matrix环境,啥括号都不带\begin{equation} X=\begin{matrix}  1 & \cdots & 2 \\  2 & \cdots & 3\end{matrix} \end{equation} 利用array环境,自己在括号的地方写,可以用任意括号形式\begin{align}    E(X)=\left[           \begin{array}{ccc}             E(x_{11}) & \cdots & E(x_{1n}) \\             \cdots & \cdots & \cdots \\             E(x_{n1}) & \cdots & E(x_{nn}) \\           \end{array}         \right]   %如果用“\right.”,那么后面的括号就隐藏了,可以用来表示分段函数。  \end{align}
凡事,一笑而过..................

14
hylpy1 在职认证  发表于 2015-11-9 22:16:07
常见技巧1.多个blankspace等于一个blankspace,多个空行(line)等于一个空行,一个空行效果等于另起一段,并不会真正出现一个空行。2.九大保留字符的输入# $ % ^ & _ { }      前面加\就可以,如\$\                    
要用命令$\backslash$3.latex命令的书写要求$a\pm b___FCKpd___1nbsp; $a\pm3b___FCKpd___1nbsp; 命令\pm后面的空格、数字或者任何非字母的字符都标志着该命令的结束。如何在命令后产生一个空格:{}可以保护后面的空格。Get \LaTeX{} Started.一些命令(\footnote 或\phantom)内嵌于\caption 或\section时会失效,这时加上\protect可以保证不失效。\section{Higer Order Difference Equations \footnote{See
James(2000)}}  %\footnote失效\section{Higer Order Difference Equations
\protect\footnote{See James(2000)}}注意\protect只保护紧跟其后的命令本身,命令的参数并不受到保护,如果要保护参数,需要在参数前加\protect.其他一些脆弱命令还有:All commands that have an optional argument are fragile. Environments
delimited by \begin ... \end are fragile. Display math environment delimited
by \[ ... \] Math environment \( ... \) ,However, $ ... $ is robust Line
breaks, \\ .\item commands .\footnote commands .4.如何打印命令(将程序命令打印出来而不让命令执行)\begin{verbatim} Get \LaTeX{}       Started.
\end{verbatim}\verb*|like this :-) |5.添加程序注释的两种方法%Get \LaTeX{}              Started.\begin{comment} Get \LaTeX{}      
Started. \end{comment}第二个方法要在导言区添加\usepackage{verbatim}6.document class有哪些常见类型article, proc, minimal, report, book, slides7.页面式样\pagestyle{plain}\pagestyle{headings}\pagestyle{empty}\thispagestyle{empty}  
%将当前页面的式样改为empty.8.大型文档中插入一些子文档的方法\include{filename}  
%想让插入的子文档在新的一页开始显示;\input{filename} %插入的子文档直接显示,不用新开一页。\includeonly{file1,file2,file3}  %在导言区使用。只有在此列出的子文档才会在正文中被插入。
凡事,一笑而过..................

15
hylpy1 在职认证  发表于 2015-11-9 22:16:55
9.快速检查语法\usepackage{syntonly}\syntaxonly10.分行分页的方法\\  or  \newline  
:另起一行,但不另起一段。\\* :另起一行,但禁止分页。\newpage:另起一页。11.确定单词断点位置\hyphenation{FORTRAN Hy-phen-a-tion}   
%只有在-出现的地方才能断,没有-的单词不能断,必须整体出现。un\-derstood %在正文中输入understood的时候,插入\-告诉latex这里可以分开。12.几个单词整体出现\mbox{0116 291 2319}  
%让这几位数字作为一个整体出现在一行,不在不同的行显示。\fbox{0116 291 2319}  
%功能和\mbox一样,同时还在这个整体周围加框。13.特殊符号引号``well understood `physical' formula''   双引号要用两个重音号``和两单引号''前后表示。破折号daughter-in-law, X-rated\\pages 13--67\\yes---or no?
\\$0$, $1$ and $-1$波浪号~\~understood \~{}physical $\sim$formula   效果各不同温度度数$-30\,^{\circ}\mathrm{C}$$-30$\textcelsius  %这一种要加载\usepackage{textcomp}欧元符号\texteuro 100\euro
100 $需加载\usepackage[official]{eurosym}或者\usepackage[gen]{eurosym}\EURtm  $需加载\usepackage{marvosym}省略号直接用...不行,要用 \ldots, 文本中位于下部的省略号$\cdots___FCKpd___1nbsp;%math mode,
数学符号中的位于中部的省略号$\cdot___FCKpd___1nbsp; %math mode,数学符号中位于中部的一个点号。连字不管你信不信,在latex中,ff和f{}f显示的结果是不同的。ff是两个连在一起的整体符号。14.调整单词间隔\frenchspacing15.论文的标题、章节目等安排\title{My
Dissertation}  %在后面正文中用\maketitle生成标题\author{George Bush, Allen Greenspan}
\date{\today}\tableofcontents %在此位置插入章节目录\listoffigures  %在此位置插入图形目录\listoftables  %在此位置插入表格目录\part{XXX} %产生单独的一页,例如Part
I XXX\chapter{Introduction to SAS} %章 1 只有report和book才有章的划分。\section{My
God}  %节 1.1 \subsection{...}  %目
1.1.1\subsubsection{...}  %以下不再编号\paragraph{...}\subparagraph{...}\section*{My God}  %加了*后,该节就不出现在目录中,也不编号。\appendix  %该命令说明后面开始附录,下面的chapter命令采用字母编号\chapter{Mathematical analysis}
%Appendix A Mathematical analysis\section{Set Theory}   %A.1 Set Theory
凡事,一笑而过..................

16
hylpy1 在职认证  发表于 2015-11-9 22:17:33
16.book风格的文档\frontmatter %紧跟着\begin{document}命令出现,该命令启用罗马数字编页码。\mainmatter %出现在第一章前面,该命令启用阿拉伯数字编页码。\appendix
%标志书中附录材料的开始。该命令后的各章序号改用字母标记。\backmatter  %应该插入书中最后一部分内容的前面,如参考文献和索引17.交叉引用法\label{sec:my1} %放在在节、子节、图、表或定理后面,作为后面需要引用的标记\ref{sec:my1} %引用标志词sec:my1那里的节、子节、图、表或定理的序号\pageref{sec:my1} %引用标志词sec:my1所在的页码18.脚注、页边注和尾注\footnote{type the text here.}\marginpar{type the text
here.}尾注的方法\usepackage{endnotes}  %加载尾注宏包\endnote{type the text
here.} %在需要尾注的地方添加\theendnotes   %指明尾注内容在文中该地方出现。19.强调\underline{text} %下划线强调\emph{text}  %斜体强调20. 三种枚举方法Itemize、Enumerate
和Description\flushleft\begin{enumerate}  \item The strategy:   
\begin{itemize} \item First,look silly.\item[-] Second,be
smart.\end{itemize}  \item The result:    \begin{description}
\item[Stupid] You'll be smart.\item[Smart] You'll be
stupid.\end{description}\end{enumerate}21.文本的对齐和居中\begin{flushleft}。。。。。。\end{flushleft}\begin{flushright}。。。。。。\end{flushright}\begin{center}。。。。。。\end{center}22.引文、诗歌、摘要\begin{quote}。。。。。。\end{quote} %一次少量引用\begin{quotation}。。。。。。\end{quotation} %一次大量引用\begin{verse}。。。。。。\end{verse} %引用诗歌,排成韵律风格,每一行后用\\断行。\begin{abstract}。。。。。。\end{abstract} %学术论文的摘要。23.表格\begin{tabular}{|r||l @{ + } c@{ . }rrr@{ * }c|c|} \hline \hlinePosition
& Club & Games & W & T & L & Goals & Points\\[1.5ex]
\hline1 & Amesville Rockets & 33 & 19 & 13 & 1 &
66:31 & 51:15 \\2 & Borden Comets & 33 & 18 & 9 & 6
& 65:37 & 45:21 \\... & ..... & .. & .. & .. &
.. & ... & ... \\17 & Quincy Giants & 33 & 7 & 5
& 21 & 40:89 & 19:47 \\18 & Ralston Regulars & 33 &
3 & 11 & 19 & 37:74 & 17:49\\ \hline \hline\end{tabular}另一种更加复杂的表,可以随意画横线,几列共用一个标签\begin{tabular}{|r|l||rrr|r@{ : }l|r@{ : }l||c|}
\hline\multicolumn{10}{|c|}{\bfseries {\itshape Table 1}. 1st Regional
Soccer League --- Final Results 2002/03}\\ \hline\itshape Position &
\itshape Club & \itshape W & \itshape T & \itshape L &
\multicolumn{2}{|c|}{\itshape Goals} & \multicolumn{2}{|c||}{\itshape
Points} & \itshape Remarks\\[1ex] \hline \hline1 & Amesville Rockets
& 19 & 13 & 1 & 66&31 & 51&15 & League Champs\\
\hline2 & Borden Comets & 18 & 9 & 6 & 65&37 &
45&21 & Trophy Winners\\ \hline... & ..... & .. & ..
& .. & .. & ... & ... & ...& ...\\ \hline17 &
Quincy Giants & 7 & 5 & 21 & 40&89 & 19&47 &
Candidates \\ \cline{1-9}18 & Ralston Regulars & 3 & 11 & 19
& 37&74 & 17&49 & for Losers\\ \hline\end{tabular}24.
浮动体浮动体就是一个整体在正文中上下浮动,寻找合适的放置位置,通常为了避免一个“整体对象”遭遇分页等尴尬问题。例如不想让表格一半在上一页,一半在下一页。将上面表格作为浮动体处理,浮动体放置许可规则[!hbtp]表示忽略内部参数[!],首先优先放在这儿here[h],其次是bottom,再次放在top[t],然后考虑放在一个floating
page[p]。下面是表和图的浮动体例子。其中caption命令添加标题,[..]内的是简单标题,在\listoffigures 和 \listoftables
中出现,{...}内的是长标题,在正文中显示。\begin{table}[!hbtp]\caption[Finals]{1st Regional Soccer League --- Final
Results.}\begin{tabular}{|r|l||rrr|r@{ : }l|r@{ : }l||c|}
\hline\multicolumn{10}{|c|}{\bfseries {\itshape Table 1}. 1st Regional
Soccer League --- Final Results 2002/03}\\ \hline\itshape Position &
\itshape Club & \itshape W & \itshape T & \itshape L &
\multicolumn{2}{|c|}{\itshape Goals} & \multicolumn{2}{|c||}{\itshape
Points} & \itshape Remarks\\[1ex] \hline \hline1 & Amesville Rockets
& 19 & 13 & 1 & 66&31 & 51&15 & League Champs\\
\hline2 & Borden Comets & 18 & 9 & 6 & 65&37 &
45&21 & Trophy Winners\\ \hline... & ..... & .. & ..
& .. & .. & ... & ... & ...& ...\\ \hline17 &
Quincy Giants & 7 & 5 & 21 & 40&89 & 19&47 &
Candidates \\ \cline{1-9}18 & Ralston Regulars & 3 & 11 & 19
& 37&74 & 17&49 & for Losers\\ \hline\end{tabular}\end{table}Figure \ref{white} is an example of
Pop-Art.\begin{figure}[!hbp]\makebox[\textwidth]{\framebox[5cm]{\rule{0pt}{5cm}}}\caption[FiveFig]{Five
by Five in Centimetres.\label{white}}\end{figure} 浮动体的放置顺序遵循“先来先放”的原则。有时等待序列中浮动体太多,命令\clearpage可以让等待结束,立刻新开一页放置所有等待中的浮动体。在LaTeX文档中插入图片http://hepg.sdu.edu.cn/Service/tips/latex/latexfig.html25.如何使用中文字体先在导言区加载\usepackage{CJK}然后在正文使用中文的地方用\begin{CJK*}{GBK}{song}   中文或者英文  \end{CJK*}加*和不加*的区别在于对~的处理不同。加了*后,汉字之间的空格用~代替。不加*,汉字之间空格用英文正常空格。常用的其他字体还有:fs(仿宋)、kai(楷体)、hei(黑体)、li(隶书)、you(幼圆)。命令中的
GBK 是指中文内码,还可以用 GB 和 BIG5(繁体字),前提是相应的字库设置是正确的。如果在中间想要将宋体改变仿宋,就可以使用:\CJKfamily{GBK}{fs}
凡事,一笑而过..................

17
hylpy1 在职认证  发表于 2015-11-9 22:18:22
26.段首缩进latex默认每一段段首缩进,但是正文第一段不缩进。如果要缩进,采用下面两种方法:(1).加载\usepackage{indentfirst}的方法。(2).在该段首用\parindent来专门控制缩进,例如:\setlength{\parindent}{4em}
%放置在段首,它设置为当前字号的4个大写字母M的宽度,大约正好是4个汉字的宽度27.行距和段距的控制\setlength{\baselineskip}{1.8em} %行距控制为1.8个M,直到下次出现修改为止。1.8em是中文常见行距。\setlength{\parskip}{1ex}  %段距控制为1个x,直到下次出现修改为止。28.页眉页脚\usepackage{fancyhdr}\pagestyle{fancy}29.页面设置\usepackage[top=1in, bottom=1in, left=1in,
right=1in]{geometry}30.如何设置字体颜色\documentclass[letterpaper,11pt]{report}
\usepackage{color}
\definecolor{Blue}{rgb}{0.3,0.3,0.9}
\begin{document}
Hello! {\color{Blue}{World}}!
\end{document}


左对齐
\begin{flushleft}
\end{flushleft}


右对齐
\begin{flushright}
\end{flushright}

列举环境
\begin{itemize}
\end{itemize}

\begin{enumerate}
\end{enumerate}
凡事,一笑而过..................

18
hylpy1 在职认证  发表于 2015-11-9 22:19:32
保持环境
\verb|  |
\begin{verbatim}
\end{verbatim}

小页环境
\begin{minipage}{size}
\end{minipage}

诗歌环境
\begin{verse}
\end{verse}

浮动表格环境
\begin{table}
\end{table}

固定表格环境
\begin{tabular}
\end{tabular}

浮动图片环境
\begin{figure}
\end{figure}
10种字号命令
{\tiny  }   {\scriptsize  }  {\footnotesize  }  {\small  }  {\normalsize  }  {\large  }  {\Large  }
{\LARGE  }  {\huge  }  {\Huge  }
凡事,一笑而过..................

19
hylpy1 在职认证  发表于 2015-11-9 22:20:08
英文字体命令
{\rm  } 罗马字体    {\bf  } 黑体   {\it  } 意大利字体   {\sc  } 小号大写字体  {\sl  } 斜体
{\tt  } 打字机字体  {\cal } 花体  {\em  } 强调型字体

几种数字的格式
\arabic{}   \roman{}  \Roman{}  \alph{}  \Alph{}

章节命令
部分命令
\part{}

章命令
\chapter{}

节命令
\section{}
\subsection{}
\subsubsection{}
\subsubsubsection{}

附录命令
\appendix{}

使用上面所说的命令,处理一般的文字文档应该没多大问题了。但是一篇文章中还有三个很重要的部分:公式,图片,表格现在我们还没法处理。


下面就来讲一讲。
  要在Latex文档中加载图片,必须要包括graphicx宏包。
下面即是典型代码:
\begin{figure}
\begin{center}
\includegraphics[width=10cm,height=6cm]{1.eps}%就在前面括号中写图片名
\renewcommand{\figurename}{图}
\caption{}
\label{}
\end{center}
\end{figure}
这段代码功能是把名为1.eps的图片调进来,放在浮动图片环境中,并居中放置。
\includegraphics[width=10cm,height=6cm]{1.eps}中的\includegraphics 即为调用图片的命令。[]中的参数用于指定加载图片后图片显示的宽度和高度。
\renewcommand{\figurename}{图}用于将其默认的标号(为figure)改为“图”
\caption{}给这幅图片取一个名字或作一段说明用于显示出来。
\label{}中也写一个名字用来标明这幅图片,方便前面或后面的交叉引用。



插入表格
插入表格没有图片步骤多,但也要注意一些细节问题。
\begin{table}
\centering
\renewcommand{\tablename}{表}
\caption{}
\begin{tabular}{|l|l|l|}
\hline
  1 & 2 & 3\\
\hline
  8.2 & 7.8 & 12.7\\
  75.7 & 152.8 & 249.9\\
\hline
\end{tabular}
\end{table}
这段代码用来生成一个3行3列的浮动表格,并左右置中放置。
\begin{tabular}{|l|l|l|}中的|l|l|l|表示有三列,列与列之间用竖线隔开(共四根竖线)。
\hline表示画一根横线。






本文引用地址:http://blog.sciencenet.cn/blog-81613-322468.html  此文来自科学网王伟华博客,
凡事,一笑而过..................

20
smartlife 在职认证  发表于 2015-11-10 00:01:31
好帖。   

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-9 14:09