4

While using \frac gives me smaller characters, \cfrac almost get what I want, except there is quite large space above the denumerator.

I follow this but right now without the $\displaystyle$ because I do not where I should use that.

\begin{equation}
\frac{v_{out}}{i_{in}} = \cfrac{R_{D}} {\left(\cfrac{s}{\cfrac{1}{C_{o}R_{D}}} + 1 \right) 
\left( \cfrac{s}{\cfrac{g_{m}r_{o} + 1}{C_{PD}(R_{D} + r_{0})}} + 1 \right) }
\end{equation}

enter image description here

3
  • Possibly a duplicate: tex.stackexchange.com/q/399482/134574 Dec 25, 2020 at 3:18
  • @PhelypeOleinik, Hi, thanks for the link. I tried and it works. But somehow it produces error as well 'Missing delimiter (. inserted). [}]'. it is just weird that usually, if there is error, the pdf file is not generated. Dec 25, 2020 at 4:15
  • @PhelypeOleinik, the error messages disappear if I do simply use the bracket, without \left or \right. thanks. I upvoted your post in that link. if you want, you can answer again here so I can close this question. Dec 25, 2020 at 4:20

3 Answers 3

8

A possible solution:

\documentclass[varwidth, margin=3.141592]{standalone}
\usepackage{amsmath}

\begin{document}
    \begin{equation}
\frac{v_{out}}{i_{in}} 
    = \dfrac{R_{D}}{
        \begin{pmatrix}
            \cfrac{s}{\cfrac{1}{C_{o}R_{D}} + 1}\\ 
        \end{pmatrix}
        \begin{pmatrix}
            \cfrac{s}{\cfrac{g_{m}r_{o} + 1}{C_{PD}(R_{D} + r_{0})} + 1}\\ 
        \end{pmatrix}
                }
    \end{equation}
\end{document}

enter image description here

7

Using \dfrac instead of \cfrac would seem perfectly adequate.

Combining this idea with @Zarko's suggestion to encase the large fraction terms in pmatrix environments instead of in \left( and \right wrappers generates the following results:

enter image description here

The \cfrac macro inserts a \strut, which has a total height of \baselineskip, in both the numerator and denominator terms. In contrast, \dfrac does not insert (typographic) struts by default. In the present case, the influence of the presence of the struts in \cfrac is particularly noticeable in the amount of whitespace that's present above the s numerator terms.

\documentclass{article}
\usepackage{amsmath} % for '\dfrac', '\cfrac', and '\text' macros
\begin{document}
\[
\cfrac{\text{with \texttt{\string\cfrac}}}{%
    \begin{pmatrix}
        \cfrac{s}{\cfrac{1}{C_{o}R_{D}} + 1}
    \end{pmatrix}
    \begin{pmatrix}
        \cfrac{s}{\cfrac{g_{m}r_{o} + 1}{C_{PD}(R_{D} + r_{0})} + 1}
    \end{pmatrix}
}
\quad\text{vs.}\quad
\dfrac{\text{with \texttt{\string\dfrac}}}{%
    \begin{pmatrix}
        \dfrac{s}{\dfrac{1}{C_{o}R_{D}} + 1}
    \end{pmatrix}
    \begin{pmatrix}
        \dfrac{s}{\dfrac{g_{m}r_{o} + 1}{C_{PD}(R_{D} + r_{0})} + 1}
    \end{pmatrix}
}
\]
\end{document}
2

This type of question is one I see frequently showing up on the site: how do I write this "ugly" / complicated expression in LaTeX? Usually you can either do as the other answer do, or you can try to split up the expression using words.

I tend to prefer to split up complicated expressions as show below enter image description here However, you should probably change the function f, alpha and beta to something that is more common in your field. Alternatively you could pack it into a single expression enter image description here Which arguably might be the best from both worlds.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\noindent
The ratio is given as
%
\begin{equation}
    \frac{v_{\text{out}}}{i_{\text{in}}}
    = \frac{R_D}{f(\alpha) \cdot f(\beta)}
\end{equation}
%
where 
%
\begin{equation*}
  f(x) = \frac{s}{x + 1}, \quad 
  \alpha = \frac{1}{C_o R_D} \quad \text{and} \quad 
  \beta = \cfrac{g_{m}r_{o} + 1}{C_{PD}(R_{D} + r_{0})}.
\end{equation*}
%
Let $f(x)=s/(x+1)$, then the ratio
$v_{\text{out}}/i_{\text{in}}$ is defined as
%
\begin{equation*}
    \frac{v_{\text{out}}}{i_{\text{in}}}
    = R_D\biggl/\biggl[ f\biggl(\frac{1}{C_o R_D}\biggr)f\biggl(\frac{g_{m}r_{o} + 1}{C_{PD}(R_{D} + r_{0})}\biggr)\biggr].
\end{equation*}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .