Latex various treatment paper operation-illustration, insert form

Source: Internet
Author: User
Tags bmp image
Latex Insert Picture

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
How do you control the position of the picture in latex?
Add parameter [h!] after \begin{figure}
\begin{figure}[h!]% Requires
\includegraphics[width=]{}\\
\caption{}
\label{}
\end{figure} \begin{figure} followed by parameters [h!] that is \begin{figure}[h!]% Requires \includegraphics[width=]{}\\ \caption{} \label {} \end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1, inserting JPG images
In the command-line environment, use the command:
Ebb Figure.jpg
Generate a bounding box file FIGURE.BB.

Use the following command:
\includegraphics[width=0.8\textwidth]{figure.jpg}

You can use PDF texify to compile directly into PDF files.

2. Insert BMP image
There is no way to insert a BMP image directly. The current approach is to use the
GIMP converts the BMP into JPG and then inserts it as described above. Do not convert
With Windows Painter, the picture quality is lost too much. With GIMP or
Fastone image Viewer, the JPG quality is selected as the highest, the conversion is obtained after the
Picture quality is good.

3. Insert jpg and EPS pictures simultaneously
The inserted command does not change. Compile-time using Latex, dvi2pdf, two-format
Pictures can be displayed.

Insert EPS picture
Use the \includegraphics[option]{file} command to insert an EPS picture. Here is one of the simplest examples:

\documentclass{article}
\USEPACKAGE{GRAPHICX}% using Graphicx package
\begin{document}
\includegraphics{file.eps}% Insert Picture, insert according to the original size of the picture
\end{document} \begin{document} \includegraphics{file.eps}% Insert Picture, insert \end{document by original size of picture

Attention:
(1) EPS files and Tex files are placed in the same folder, can be called only with the file name, without writing the path.

(2) Pdflatex cannot be used at compile time, error occurs. Even if there is no error, you cannot see the diagram. You should use Latex compilation to generate DVI, and then dvi2ps,ps2pdf can see the diagram.

Use [options] to specify the size of the picture:

\includegraphics[width=3in]{file.eps}
Set the image width to 3 inches, and the image height will be automatically scaled.

\includegraphics[width=\textwidth]{file.eps}
Sets the width of the image to the width of the text.

\includegraphics[width=0.8\textwidth]{file.eps}
Set the width of the image to 0.8 times times the width of the text

\includegraphics[width=\testwidth-2.0in]{file.eps}
Set the width of the picture to 2 inches less than the text width.

Use [options] to specify the picture rotation angle:
\includegraphics[angle=270]{file.eps}
Rotates the picture 270 degrees.

Two options are used at the same time, separated by commas:
\includegraphics[width=\testwidth, Angle=270]{file.eps}
For a variety of graphic graphics, you can use MATLAB to draw, Word also line, also useful Viso, save as EPS graphics, vectors, otherwise the graphics will be distorted, and then can also be edited with Adobe Acrobat Pro. Insert Table

Tabular environment
\begin{tabular}{|c|l|r|} % Alignment "|" Vertical line of the table
\hline% horizontal line of table
11&11&11\\
\hline
11&11&11\\
\hline
\end{tabular} \begin{tabular}{|c|l|r|} % Alignment "|" Vertical line of table \hline% table horizontal 11&11&11\\ \hline 11&11&11\\ \hline \end{tabular}
Standard LaTeX provides an array and tabular two watchmaking environments with the complete format as follows:
\begin{array}[table position]{column style} \end{array}
\begin{tabular}[table position]{column style} \end{tabular} \begin{tabular}[table position]{column style} \end{tabular}
\begin{tabular*}{Table total width}[table position]{column style} \end{tabular*} \begin{tabular*}{table total width}[table position]{column style} \end{tabular*}

The options and parameter definitions for both environments are the same, but arrays are primarily used for the layout of array matrices and can only be used in mathematical environments, such as equation.
The array macro package expands the array and tabular environment features, primarily adds and enhances column style options, and even programmatically defines new column styles, as well as a number of fine-tuning features such as changing the thickness of vertical table lines and automatically adjusting table gaps. You can use this macro package to produce beautiful, feature-rich tables.

The macro package does not have any option to extend the two environment's Column style options:

Options
Description

L
The column is aligned to the left
C
The column is arranged in the center
R
The column is aligned to the right
p{Column Width}
Set the column width to align the top of the text
@{Declaration}
Each row of the column inserts the text in the Declaration
m{Column Width}
Set the width of the column, align the text center
b{Column Width}
Set the width of the column, align the text bottom

Statement
Declaration can be a command or text before inserting a column element
<{Declaration}
Declaration can be a command or text after inserting a column element
|
Add a vertical line between column edges or columns
! Statement
Replace the vertical line between columns with the style of the declaration requirement
For more details, refer to "1"

2 Making a complex table
Usually draw forms need to use to \multicolumn, \multirow, \hline, \cline four kinds of

directive to use \multirow, must precede first to join
\usepackage{multirow} See examples directly, latex code =
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{2}{*}{multi-row} &
\multicolumn{2}{c|} {multi-column} &
\multicolumn{2}{c|} {\multirow{2}{*}{multi-row and Col}} \ \
\cline{2-3}
& column-1 & column-2 & \multicolumn{2}{c|} {} \\
\hline
Label-1 & Label-2 & label-3 & label-4 & label-5 \
\hline
\end{tabular} \usepackage{multirow} See examples directly, latex code = \begin{tabular}{|c|c|c|c|c|} \hline \multirow{2}{*}{ Multi-row} & \multicolumn{2}{c|} {multi-column} & \multicolumn{2}{c|} {\multirow{2}{*}{multi-row and Col}} \ \cline{2-3} & column-1 & Column-2 & \multicolumn{2}{c|} {} \ \hline Label-1 & label-2 & label-3 & label-4 & label-5 \ \hline \end{tabular}

Effect Diagram =

Latex-table

\multirow and \multicolumn are used in the same way, and can be used across rows at the same time, see example \hline and \cline are used to draw a horizontal line

Four types of directives brief description =
1.\multirow{2}{*}{multi-row}
\multirow is a cross-column function, the first parameter 2, which indicates that the system automatically adjusts the text, the second parameter *, the text that is to be filled in, the last parameter is the type to fill in, and it is important to note that the column table that uses the \multirow directive is left blank when the next column of tables is to be written, Non-filled words (after filling out will know why)

2.\multicolumn{2}{c|} {multi-column}
\multicolumn is a cross-line feature, the first parameter 2, which represents two rows, the second parameter c|, the text placement, and a line box to the right of the field, and the last parameter is the text to fill in

3.\hline says to draw a whole line from left to right
4.\cline{2-3} indicates that a horizontal line is drawn in the 2nd column to the 3rd column, and the other fields will not have a cross-section

To carefully study latex illustrations, recommended latex illustrations guide article (General Ctex installation directory under the Help folder Graphics.pdf just), the bottom of the double quotation marks are quoted from the book. PS: This article in the code of the image file name in the compilation, please replace the actual pictures of your computer, this should all understand.

1, I used to use word the result is that latex pictures floating format is not used to, and then I heard such a passage, feel the feeling of Daigo: "

Do not use text that relies on placement of graphics. Use such as "This picture ..." Or "The following graphic ..." Such phrases require that the graphic be in a fixed position. And like "Figure 5 ..." Such a phrase allows the graphic to appear in any position.

Second, relax. Some users tend to be very anxious when they find that the graphics are not exactly where they want them to appear. This is not necessary, the placement of the graphics is latex work, it is best to relax some. ”

Why Latex does not recommend that we let graphics appear exactly where they are placed. "Because that leads to bad paging, leaving a large space below the page. To get expert typesetting, the author has to manually adjust the position of the graphic. This kind of work is very tedious, especially if you have to do it almost every time you modify a document. ”

When Knuth was doing Tex, the goal was to focus our attention on the content of the article, not on typography. Especially when doing long articles or books, it is inconvenient to re-adjust the pictures when you insert new text with Word every time you modify it. (actually fortunately, our article is short like the rabbit tail to think that word is also very good)

2. Floating format

A typical illustration statement

\BEGIN{FIGURE}[HTBP]

\centering

\includegraphics[width=6.5cm]{graph.eps}

\caption{this is an inserted EPS graphic} \label{fig:graph}

\end{figure}

where [HTBP] is the floating format

"H current position. Place the graphic in the body text where the graphic environment is given. If there are not enough pages left on this page, this parameter will not work.

Top of T. Place the graphic at the top of the page.

B Bottom. Place the graphic at the bottom of the page.

P Floating page. Place the graphic on a page that allows you to have a floating object. ”

I generally use [HTB] Such a combination, only with [H] is useless (reason to ask the reader to think). This combination means Latex will try to satisfy the floating format in front, that is, h-t-b this order, so that the layout of the effect as good as possible. Anyway, remember, relax.

3, if you want to plug in the position you want to do.

I will do this: if Tex does not let you in the position you want to plug in, it means that your picture is too big, you can try to adjust the size of [width=6.5cm], so that it can be inserted, in fact, we do this in Word. It is recommended to use the \textwidth unit. But that sentence, don't be too reluctant.

4, some pictures of side-by

If you want to do this, you need to have two graphs tied together, or a couple of graphs lined up. You can try the following template, please run the effect yourself

Template One

\BEGIN{FIGURE}[HTBP]

\centering

\SUBFIGURE[SIN1]{\LABEL{FIG:FFT:A}

\begin{minipage}[c]{0.5\textwidth}

\centering

\includegraphics[width=6.5cm]{sin1.eps}

\end{minipage}%

}% Note that this "%" absolutely cannot save, you can try not to hit the effect of%

\subfigure[sin2]{

\begin{minipage}[c]{0.5\textwidth}

\centering

\includegraphics[width=6.5cm]{sin2.eps}

\end{minipage}

}

\CAPTION{FFT}\LABEL{FIG:FFT}

\end{figure}

Template Two

\BEGIN{FIGURE}[HTBP]

\centering

\begin{minipage}[c]{0.5\textwidth}

\centering

\includegraphics[width=6.5cm]{sin1.eps}

\end{minipage}%

}% Note that this "%" absolutely cannot save, you can try not to hit the effect of%

\begin{minipage}[c]{0.5\textwidth}

\centering

\includegraphics[width=6.5cm]{sin2.eps}

\end{minipage}

}

\CAPTION{FFT}\LABEL{FIG:FFT}

\end{figure}

5, the other details can be described in the beginning of the book. There is also about the format of the picture, if the use of Latex compilation can only be used in EPS format of the picture, Matlab saved as EPS, the other with the software to turn it, but if the latex2pdf compiled with the words as if can be used jpg,eps instead. But the recommended use of EPS, I tried to figure out the MATLAB image EPS quality is good, but it seems to not support Chinese, in fact, there are ways to solve, I know the method is to use Psfrag macro package, the detailed method or see that book, but I think in English is OK.

6, in fact, the real master latex paint is such a painting, the following section of code from Arnold a paper, you can run a bit, see what effect.

\begin{picture} (6,6)

\thicklines

\put (0,0) {\line () {6}}

\put (0,6) {\line (1,-1) {3}}

\put (+) {\circle*{0.2}}

\put (1,5) {\circle*{0.2}}

\put (5,5) {\circle*{0.2}}

\thinlines

\multiput (0,0.2) {20}{\line (0,1) {0.1}}

\multiput (1,5) (0.2,0) {20}{\line (1,0) {0.1}}

\put (1,5.2) {\mbox{A A}}

\put (1,0.5) {\mbox{c C}}

\put (4.5,5.2) {\mbox{b b}}

\end{picture}

Latex Insert document reference Order automatic arranging
Automatically sort document numbers in cite order, with \BIBLIOGRAPHYSTYLE{UNSRT}
Latex echnical 斺 since Rick (iv) make citations in the order of reference automatic arranging
The other types are as follows [Goto]:

You can do this by setting BibliographyStyle, Bibtex have the ability to sort by themselves, and you can choose the sort method you want. Bibtex has 8 styles, as follows (excerpt from LaTeX newsroom):

Plain, in alphabetical order, comparing order to author, year and title

UNSRT, style with plain, just sort by reference

Alpha, alphabetical order with the first and second digits of the author's initials + years

ABBRV, similar to plain, changes the month's spelling to abbreviated, more compact:

IEEETR, International Association of Electrical and Electronics Engineers journal Style:

ACM, Journal of the American Computer Society style:

Siam, Journal of the American Institute of Industrial and Applied Mathematics:

Apalike, journal style of American Psychological Society:

"1" http://zzg34b.w3.c361.com/package/table.htm
"2" http://blog.sina.com.cn/s/blog_62ef85c201013uj9.html
"3" http://www.cnblogs.com/machine/archive/2013/01/18/2866654.html
[4]http://www.ctex.org/documents/latex/graphics/node67.html
"5" http://blog.renren.com/share/230039275/6286294913
"6" http://blog.sina.com.cn/s/blog_7e4ac8b50102uxlg.html

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.