Latex floating image adjustment

Source: Internet
Author: User

As we all know, it has always been one of the most troublesome problems to process the floating bodies of graphs and tables in latex, because even if the [H] option is used, the floating bodies will still run in disorder, however, if you remove/begin {figure}/end {figure} to a bare/shortdegraphics file, you cannot add the title with the/caption command. This issue is actually introduced in section 8.7 of the famous "latex2e and frequently used macro package User Guide", but I accidentally saw this section today, I think there are still many colleagues who are still struggling to deal with floating bodies, so I will share them with you:

The reason why figure and table can use the/caption command is that the/@ captype command is defined. That is to say, if we define the command ourselves, the same effect can be achieved. To do this, first Add the following command in the introduction:

/Makeatletter
/Newcommand {/figcaption} {/DEF/@ captype {figure}/caption}
/Newcommand {/tabcaption} {/DEF/@ captype {table}/caption}
/Makeatother

The reason for adding/makeatletter;/makeatother is that the command has the @ symbol.

After adding these four lines, you can

/Begin {Center}
/Includegraphics {XXX. EPS}
/Figcaption {XXXX}/label {FIG: XXX}
/End {Center}

While the table is

/Begin {Center}
/Begin {tabular}
Xxx
/End {tabular}
/Tabcaption {XXX}/label {tab: XXXX}
/End {Center}

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.