\ Centerline Syntax: \ centerline {text} This is the original Tex command, applicable to text with shorter center. Center Environment Syntax: \ begin {Center} First line \ second line \ end {Center}
The center environment enables multi-row center alignment. In the center environment, if the "first line" is too long, it will automatically wrap the line, and the text to wrap is still centered and aligned, so this is a common method. The following is a very practical example. When writing a thesis, you need to write a title, which is generally set to a Chinese title. The following is an English title:
123456789101112131415161718 |
\ Documentclass [11pt, a4paper] {Article} \ usepackage {CJK} \ usepackage {type 1cm} \ usepackage {times} \ newcommand {\ SONG} {\ cjkfamily {SONG} \ newcommand {\ Xiaoer} {\ fontsize {18pt} {18pt} \ selectfont} \ newcommand {\ xiaosan} {\ fontsize {15pt} {22pt} \ selectfont} \ renewcommand {\ baselinestretch} {1.8} % double Line spacing \ begin {document} \ begin {CJK *} {GBK} {SONG} \ begin {Center} {\ song \ Xiaoer \ textbf {shortest path algorithm: ~ Classification System and research progress }\\%,, bold {\ Xiaoer Shortest Path Algorithms :~ Taxonomy and advance in research} % Times New Roman, Xiao 'er \ end {Center} \ vspace {20pt} \ centerline {\ xiaosan for \ quad: Lu feng} % for short texts, use \ centerline \ end {CJK *} \ end {document} |
The effect is as follows: