Latex Use Tips _latex

Source: Internet
Author: User

Start using latex in paper writing, and sort out some of the materials that are commonly used in the manual and collected online for later reference.

Text format appears in \TEXTRM formula

\label{} tagged

\ref{} Reference

\eqref{} formula Reference

\mathbf{} bold (mathematical notation)

\textbf{} bold (text)

\emph{} Italic Accent

Formulas can be edited using the online formula editor, WYSIWYG

http://zh.numberempire.com/texequationeditor/equationeditor.php

Insert algorithm

Referring to the algorithms section in Http://www.ctex.org/documents/packages/verbatim/index.htm, here are some examples of how to note

First, introduce several packages that need to be used

\usepackage{algorithm}%format of the algorithm
\usepackage{algorithmic}%format of the algorithm
\usepackage{multirow}%multirow for format of table
\usepackage{amsmath}
\usepackage{xcolor}

Redefine the keyword corresponding to the Require and ensure commands (here the default require/ensure is customized to input/output)

\renewcommand{\algorithmicrequire}{\textbf{input:}
\renewcommand{\algorithmicensure}{\textbf{output:}

Analyze the example:

\begin{algorithm}% algorithm start
Title of \caption{sample algorithm}% algorithm
\LABEL{ALG1}% Algorithm label
\BEGIN{ALGORITHMIC}[1]% here [1] control every sentence in the algorithm is preceded by a label
\require Text:today is a good day. Variables: $u, v,w$. $G = (v,e) $% Enter criteria (the Require default keyword here is require, which has been customized as input)
\ensure something.% output (the ensure default keyword here is ensure, which has been customized to output)
% If-then-else
\if{some condition is true}
\state do some processing
\elsif{some other condition is true}
\state do some different processing
\else
\state do the default actions
\endif
% for loop
\for{$i =0$ to $10$}
\state carry out some processing
\endfor
\forall{$i $ such that $0\leq I\leq 10$}
\state carry out some processing
\endfor
% While-loop
\while{some condition holds}
\state carry out some processing
\endwhile
% Repeat-until Loop
\repeat
\state carry out some processing
\until{some condition is met}
% Infinite loop
\loop
\state This processing would be repeated forever
\endloop

\end{algorithmic}
\end{algorithm}

The output results are as follows:

Here's a couple of helpful links.

Learn Latex http://latex.yo2.cn/articles/latex-learning12.html

Ctex-Online documentation-TEX/LATEX commonly used macro packs http://www.ctex.org/documents/packages/verbatim/index.htm

Latex Online Formula editor http://zh.numberempire.com/texequationeditor/equationeditor.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.