\centerline
Syntax: centerline {text}
This is the original command of Tex for centering short text.
Center environment
Grammar:
\begin{center}
First line\\
The second line\\
\end{center}
Center environment can realize the alignment of multiple lines.
In the center environment, if the “first line” is too long, it will wrap automatically, and the text of the wrap is still center aligned, so this is a very common way.
example
Here is a very practical example. When writing a paper, you need to write a title, and it is usually stipulated that the title above is in Chinese and the title below is in English
one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen |
\documentclass[11pt,a4paper]{article} \usepackage{CJK} \usepackage{type1cm} \usepackage{times} \newcommand{\song}{\CJKfamily{song}} \newcommand{\xiaoer}{\fontsize{18pt}{18pt}\selectfont} \newcommand{\xiaosan}{\fontsize{15pt}{22pt}\selectfont} \Renewcommand {baselinestretch} {1.8}% double spacing \begin{document} \begin{CJK*}{GBK}{song} \begin{center} The shortest path algorithm: ~ classification system and research progress}} \ {Xiaoer shortest path algorithms: ~ taxonomy and advance in research}% Times New Roman, sophomore \end{center} \vspace{20pt} \Centerline {Xiaosan for Quad: Lu Feng}% can be used for shorter text \end{CJK*} \end{document} |
The results are as follows
Read More:
- Latex: How to Set text Center
- How to center your HTML button itself? ——Use the align attribute of center or Div
- Several ways to center elements horizontally and vertically
- CSS: several ways to center the box vertically and horizontally
- How to center the box horizontally and vertically in HTML
- Introduction to total phase data center
- Debian install sublime text 3
- HTML using title attribute to display text with mouse hover
- Jsoneexception: a jsonobject text must begin with ‘{at character 0
- [HTML] Python extracts HTML text to TXT
- How to align MathType formula with text in word
- Sublime text add to right mouse button function
- java.text.ParseException: Unparseable date: “2021-06-24“
- unrecognized relocation (0x2a) in section `.text`
- Win10, add sublime text in the right mouse button menu to open
- Markdown real time preview of sublime Text3
- Sublime text’s open in browser does not respond
- Parsing the difference between “R” and “RB” patterns of text files (Python)
- When websocket transmits JSON text, the parse method reports an error
- 209151; org.json.JSONException A JSONObject text must begin with'{‘at character 1 of {