本博文源于Latex对段落样式和页面大小布局进行学习,包含居中对齐、单侧对齐、页面大小布局。
实验效果
实验内容
居中对齐
居中对齐只需要设置\begin{center}
即可。然后加上开门与关门。
%开始对段落居中对齐学习
This is the first normal paragraph.
\begin{center}
Hi,the center,Hi,the center,Hi,the center!\\
Hi,the center,Hi,the center,Hi,the center!\\
\end{center}
This is the first normal paragraph.
%结束对段落居中对齐学习
单侧对齐
单侧对齐就是把center改为left。
\begin{flushleft}
Hi,the left,Hi,the Left.\\
Hi,the left,Hi,the Left.
\end{flushleft}
\begin{flushright}
Hi,the right,Hi,the right.\\
Hi,the right,Hi,the right.
\end{flushright}
页面大小布局
页面大小布局就是设置页面多大的,这个要放在\begin{document}
之前
\usepackage[b5paper,text={125mm,195mm},centering]{geometry}
从中括号开始参数:
- 第一个参数,页面类型可以改动比如b5,a4
- 第二个参数:页面正文区域的宽度和高度大小
- 第三个参数:将正文区域自动居中
实验完整latex源码
\documentclass[UTF8]{article}
%开始对页面大小布局
\usepackage[b5paper,text={125mm,195mm},centering]{geometry}
%结束对页面大小布局
\usepackage{titletoc}
\usepackage{ctexcap}
\begin{document}
%开始对段落居中对齐学习
This is the first normal paragraph.
\begin{center}
Hi,the center,Hi,the center,Hi,the center!\\
Hi,the center,Hi,the center,Hi,the center!\\
\end{center}
This is the first normal paragraph.
%结束对段落居中对齐学习
% 开始单侧对齐学习
\begin{flushleft}
Hi,the left,Hi,the Left.\\
Hi,the left,Hi,the Left.
\end{flushleft}
\begin{flushright}
Hi,the right,Hi,the right.\\
Hi,the right,Hi,the right.
\end{flushright}
%结束单侧对齐学习
\end{document}
实验总结
在对页面大小进行设置的时候,开始排版感觉没啥效果,但是我对将b5改成a4等常见样式时发现还是有变化的,说明latex进行编译时通过对代码的编辑。