5 Drawing charts

Table in 5.1

  • The table is a special typesetting object with two-dimensional extension, which is different from the tabbing environment by simply presetting the alignment position
    • The width of the later content in the table will also affect the arrangement of the previous content.
    • In LIX, the table is input line by line, and the column alignment format and table line of the table can be set.
      • Some special effects can also be achieved through the expanded macro package

5.1, 1 tabular and array

  • The form is entered in two environments:
    • Tabular environment is available in text or math mode,
    • Array environment is also available in math mode
  • The tabular environment is used in the math mode, and the content of the table items is also typeset according to the text mode.
  • Except for different modes, tabular and aray are functionally the same
  • Tabular typesetting is generally used,
    • Array environment typesetting formulas containing mathematical symbols, such as complex matrices

Insert picture description here

  • Use \\ after each line to indicate a line break
  • Use & to separate between different columns in a row

Insert picture description here

Insert picture description here

  • In the column format description, use | to draw a vertical line,
    • Use the \ hline command before and after a line in the table to draw a horizontal line, such as

Insert picture description here

  • `` Vertical alignment '' parameter
  • t Align to the top of the table, the top is the first row or table line of the table
  • b Align at the bottom of the table, the bottom is the last row or line of the table
  • Vertical centering by default, non-t and b parameters are regarded as centering

Insert picture description here

  • The tables obtained in the tabular environment and the array environment are just an ordinary box,
    • Tables and other parts of text or mathematical formulas are usually directly connected

Insert picture description here

  • Most forms usually do not have text before and after, so they can be placed in a special environment.
  • Tables in documents are often placed in floating bodies with numbers and headings. This ensures that the table is not directly connected to the front and back text, and avoids unsightly paging, see 5.3.1.
  • The column format specifiers are as follows

Insert picture description here

Insert picture description here

Insert picture description here

here

5.3 Floating body and title control

  • Picture tables usually occupy a larger piece, and placing them directly in the document often results in the previous page not being able to be placed, and placing it on the next page causes a lot of blank space.
  • Some other large pieces of content have similar problems,
    • Such as program algorithms, large formulas and paragraphs with special shapes that should not be broken.
    • The solution to this problem is to use "foat".
  • A floating body is an active box that can place content not far from the front and back of the floating body code, usually the location of the floating body code, but it can also be placed at the beginning, end, or on a separate page of the page.
  • With the use of floating bodies, it is possible to adjust the content without too much effort, and to avoid messing up the neat page with large charts.

  • Another important use of floating bodies is to add a title to the chart.
  • The latex floating body environment provides special commands for chart titles to automatically number and automatically generate directories. The format of the title can also be designed overall through third-party macro packages.

  • This section will recognize the floating body mechanism of Ⅸ, and analyze the floating body and its title settings.

5.3.1 Floating body

  • The standard document class predefines two floating body environments: figure and table,
    • Layout for figures and tables
  • grammar:

Insert picture description here

  • The table environment is similar.

  • Allow position to set where the floating environment can appear on the page

  • h, the floating body is placed in the context of the code

  • t, the floating body is placed at the top of the page,

    • The page where the code is located or later,
    • Note that the floating body when the page layout may appear before the actual code.
  • b. The floating body is placed at the bottom of the page.

  • p, one or more floating bodies are placed on a separate page, this page is called a floating page

    • Text pages are called text pages
  • [hbp] allows floating objects to appear at the location of the environment, at the bottom of the page or on a single page, but not at the top of a page.

  • The order of the allowed position options of the floating body is not important. Always try to place the floating body in htbp order.

  • However, a single h option is usually not always satisfied,

    • Will relax it to ht (see section 7.1.2.4),
    • The following three floating body environments are equivalent at the beginning:

Insert picture description here

  • If not set, figure and table environments default to tbp.
  • If there are many charts, it is better to limit the position of the floating chart to a looser setting.
    • To prevent excessive floating volume pressure, and finally unified output.

  • The most common form of floating body is to place the table generated by tabular directly in the table environment, or
    to place the \ includegraphics command in the figure environment.
  • Often, the centering command is used to center the chart,

Insert picture description here

Insert picture description here

  • A floating body is just a box with the same width as the center of the plate, and the content can be placed anywhere.
  • The figure environment can also be graphics drawn with TX codes or ASC characters,
  • The table environment can also be a table obtained in the form of illustrations, and even the content can be irrelevant to the name.
  • It is also possible to put algorithms, codes or very long formulas in the figure environment.

  • Another important function of floating body is \ caption plus caption,
  • The syntax is as follows:

Insert picture description here

  • Parameter short titles are used in the chart catalog (see 3.1.1),
  • The cross-reference label \ 1abe1 needs to be placed after \ caption, or in (title), (long title).
  • In \ caption's (long title), multiple paragraphs of narration can be carried out, but paragraph division is not allowed in (short title) or individual (title).

Insert picture description here

  • In the double column, the figure and table environments become a floating box (width is the column width) that only occupies one column, and its usage is the same as in the single column environment.
  • The standard document class also provides figure environment and figure table of hurdle typesetting, which is used to generate floating body of hurdle typesetting.
  • Huddle floats are only allowed to be placed at the top of the page (t) or in a separate floating page§, other positional parameters will be ignored.
  • The default location options for figure and tab1e environments are both tp. In most cases, the effect of using a table or figure environment is to arrange the content at the top of the next page.

Published 589 original articles · 300 praises · 80,000 + views

Guess you like

Origin blog.csdn.net/zhoutianzi12/article/details/105554565