![幫助排版分子和分母為分數的方程](https://rvso.com/image/309852/%E5%B9%AB%E5%8A%A9%E6%8E%92%E7%89%88%E5%88%86%E5%AD%90%E5%92%8C%E5%88%86%E6%AF%8D%E7%82%BA%E5%88%86%E6%95%B8%E7%9A%84%E6%96%B9%E7%A8%8B.png)
我有以下等式:
\documentclass{report}
\begin{document}
\begin{equation}
T_e=\frac{T_{disch}\cdot e^{\frac{T_{ahe}-T_{disch}}{LMTD}}-T_{ahe}}{e^{\frac{T_{ahe}-T_{disch}}{LMTD}}-1}
\end{equation}
\end{document}
我認為它看起來真的很糟糕,主要是因為分子和分母的分數升高。像這樣的方程式應該如何編碼?
斜體/羅馬文本的規則如何? s不應該T
是羅馬的嗎?
答案1
當設定分數時,我會放棄電源並使用\exp
.
\documentclass{report}
\def\LMTD{\mathrm{LMTD}}
\def\disch{\mathrm{disch}}
\def\ahe{\mathrm{ahe}}
\begin{document}
\begin{equation}
T_e=\frac{T_{\disch}\cdot \exp\big(\frac{T_{\ahe}-T_{\disch}}{\LMTD}\big)-T_{\ahe}}%
{\exp\big(\frac{T_{\ahe}-T_{\disch}}{\LMTD}\big)-1}
\end{equation}
\end{document}
如果你想要它在\displaystyle
...
\documentclass{report}
\def\LMTD{\mathrm{LMTD}}
\def\disch{\mathrm{disch}}
\def\ahe{\mathrm{ahe}}
\def\mydfrac{\displaystyle\frac}
\begin{document}
\begin{equation}
T_e=\frac{T_{\disch}\cdot \exp\bigg(\mydfrac{T_{\ahe}-T_{\disch}}{\LMTD}\bigg)-T_{\ahe}}%
{\exp\bigg(\mydfrac{T_{\ahe}-T_{\disch}}{\LMTD}\bigg)-1}
\end{equation}
\end{document}
答案2
從您的帖子來看,並不清楚您想要什麼。為什麼T應該是直立的?它有什麼特殊的意義嗎?一般來說,您應該輸入這樣的文字 ( \text{}
)。
您應該將常用術語包含在新命令中。這樣,如果您不喜歡最初的決定,您可以稍後進行更改。例如,我認為 LMTD 是一些縮寫詞並將其設為文字。如果不是,或者如果您想更改一些字距調整或類似的內容,您可以在我的命令中進行調整\LMTD
。
如果您認為您的公式看起來很糟糕或難以閱讀,您應該重新編寫它。我在 MWE 的第二部分中為此提出了一些建議。
% arara: pdflatex
\documentclass{report}
\usepackage{mathtools}
\newcommand*{\e}{\mathrm{e}} % supposing, this is the number e
\newcommand*{\di}{\text{disch}} % if you use these often. supposing these three are words or acronyms
\newcommand*{\ah}{\text{ahe}}
\newcommand*{\LMTD}{\mathrm{LMTD}}
\begin{document}
\begin{equation}
T_\e=\frac{T_{\di}\cdot \e^{\frac{T_{\ah}-T_{\di}}{\LMTD}}-T_{\ah}}{\e^{\frac{T_{\ah}-T_{\di}}{\LMTD}}-1}
\end{equation}
\begin{align}
T_\e&=\frac{T_{\di}\cdot \e^{Z}-T_{\ah}}{\e^{Z}-1}
\shortintertext{where}
Z&=\frac{T_{\ah}-T_{\di}}{\LMTD}
\end{align}
\end{document}
答案3
你的問題很難回答,因為「看起來真的很糟糕」是一個非常個人的問題。
但是,如果您不知道或沒有嘗試過,我可以建議您使用該nicefrac
套餐。
\documentclass{report}
\usepackage{nicefrac}
\begin{document}
\begin{equation}
T_e=\frac{T_{disch}\cdot exp(\nicefrac{(T_{ahe}-T_{disch})}{LMTD})-T_{ahe}}{exp(\nicefrac{(T_{ahe}-T_{disch})}{LMTD})-1}
\end{equation}
\end{document}