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}