latex-盒子

盒子

属性

在这里插入图片描述

namedescription
基准点垂直方向上某一点
高度基准点到顶部距离
深度基准点到底部距离
宽度盒子宽度
总高高度+深度

命令

盒子都是单行模式

commandtypedescription
\mbox{object}属性跟随
\fbox{object}带框盒子框线:0.4pt
框到对象:3pt
\makebox[width][location]{object}指定宽度和位置l:左对齐
r: 右对齐
c:居中
s:均匀
省略宽度就必须省略位置
\framebox[offset][width][location]{object}同上
\raisebox[width][location]{object}上下盒子以基准点,offset偏移
正向上,负向下
\fboxrule=width框线粗细默认0.4pt
\fboxsep=width框线到对象距离默认3pt

类型

commandtypedescription
\ovalbox圆角边框\cornersize{ratio}
\cornersize*{diam}
\Ovalbox粗角边框同上
\shadowbox阴影边框线宽\fboxrule,默认0.4pt
阴影\shadowsize,默认4pt
\doublebox双边框内框线宽0.75\fboxrule
外框线宽0.15\fboxrule
内外框距1.5\fboxrule plus0.5pt

段落

% 单行盒子
\parbox[location][height][innerheight]{width}{object}
% 段落盒子
\begin{minipage}[location][height][innerheight]{width}{object}
\end{minipage}
attributedescriptionparam
location基准线位置c:水平中线
t:顶行对象
b:底行对象
height对象高度默认为对象高度
设定高度小于对象高度会凸出
innnerheight内部位置垂直对齐c:居中对齐
t:顶部对齐
b:底部对齐
s:均匀分布
width宽度
\noindent id: 10010
\newlength{\sublength}
\settowidth{\sublength}{gender: female}
\begin{minipage}[t]{\sublength}
name: jackson
gender: female
family: none
\end{minipage}

线段

\rule[offset]{width}{height}
fielddescription
offset基线偏移,正上负下
width
height

全黑的盒子,当宽度或者高度为0, 不可见,但是有支撑作用。

\newlength{\kidding}
\settowidth{\kidding}{Are you kidding me?}
\parbox{\kidding}{Are you kidding me? \par \rule[mm]{\kidding}{1pt}}

嵌套

\newlength{\msglength}
\settowidth{\msglength}{this is warning message!}
\fbox{\parbox{\msglength}{this is warning message!}} % 强调

测量

attrdescription
\width
\height
\depth
\totalheight\width + \depth
\framebox[2\width]{content} %边框为内容两倍
\framebox[2\width]{content} \showthe\width % 运行时控制台打印

对象存取

commanddescription
\newsavebox{boxname}\newlength{lengthname}
\sbox{boxname}{object}将对象放入盒中
\savebox{boxname}[width][height]{object}同上
\usebox{boxname}使用盒子
\newsavebox{\abox}     % 创建
\sbox{\abox}{\fbox{A}} % 填充
\usebox{\abox}         % 调用
\usebox{\abox}
\usebox{\abox}
\usebox{\abox}
\usebox{\abox}

环境存取

\newsavebox{\FrameBox}
\begin{lrbox}{\FrameBox} % 相当于是把lrbox内定义的复杂对象赋给指定的box
   \fbox{A}
\end{lrbox}
\usebox{\FrameBox}

跨页

\begin{bframe} % package: lineno
分页连续
\end{frame}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值