wildgoat的个人空间 https://blog.eetop.cn/wildgoat [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

[ZZ] [LaTeX] Big inline fractions

已有 1142 次阅读| 2013-1-6 14:30 |个人分类:Latex相关

An example of the differences between \frac and \dfrac

In most cases, you would probably want to put equations and complex  formulae on their own separate, centered, equation lines. But sometimes  there are reasons to write them 'inline', for example if you just  mention something that you have already proven. LaTeX assumes by default  that fractions are meant to have the same height as the surrounding  text, if they are written inline. This is nice when you write 'a third'  or 'a fourth' with numbers instead of words, but more complex fractions  can become very difficult to read.

To solve this problem, just include the amsmathpackage and use \dfracinstead of the usual \frac. The same command can be used inside other dfrac's, to make the formula really high. In the same way, there is a \tfracto give the fraction text height. (t=text-style, d=display-style) Of  course, this is not as interesting, since you can produce the same thing  by writing $$\textrm{$\frac{1}{3}$}$$(although it is a rather disgusting way to do it).

\documentclass{article}
\usepackage{amsmath}
\begin{document}
One third is the same as $\frac{1}{3}$.

Introduce the variance estimator
$s_p^2=\frac{(n_x-1)s_x^2+(n_y-1)s_y^2}{(n_x+n_y-2)}$.
\vspace{10pt}

One third is the same as $\dfrac{1}{3}$.

Introduce the variance estimator
$s_p^2=\dfrac{(n_x-1)s_x^2+(n_y-1)s_y^2}{(n_x+n_y-2)}$.
\end{document}



点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 122

    粉丝
  • 42

    好友
  • 272

    获赞
  • 118

    评论
  • 22104

    访问数
关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-24 17:47 , Processed in 0.013090 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部