Latex段落与页面大小设置(居中对齐/单侧对齐/页面大小布局)

本文详细介绍了使用LaTeX进行文档排版的技巧,包括如何实现段落的居中对齐、单侧对齐,以及如何设置页面大小布局。通过实际案例展示了不同对齐方式的效果,并提供了完整的LaTeX源代码供读者参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本博文源于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进行编译时通过对代码的编辑。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值