1
$\begingroup$

I am trying to export notebook in PDF but these formulas below always automatically converts to raw input form such as $a/b$ instead of $\frac{a}{b}$. So it doesn't look nice.
There are many other fractions but all are OK except these long fractions. I have tried a lot of methods from old posts but haven't found anything similar and works for me.

I set these formulas with Bold and font 20. So how to export theses as $\frac{a}{b}$ instead of $a/b$?

iL -> ((-1 + D1 + D2) Vin)/(2 ((-1 + D1 + D2)^2 R2 + 
       2 (-1 + D1 + D2) D3 R2 + D3^2 (R1 + R2))) ;
V1 -> -(((-1 + D1 + D2) D3 R1 Vin)/((-1 + D1 + D2)^2 R2 + 
       2 (-1 + D1 + D2) D3 R2 + D3^2 (R1 + R2)));
V2 -> ((-1 + D1 + D2) (-1 + D1 + D2 + 
       D3) R2 Vin)/((-1 + D1 + D2)^2 R2 + 2 (-1 + D1 + D2) D3 R2 + 
     D3^2 (R1 + R2));
VCF1 -> -(((-1 + D1 + D2 + D3) ((-1 + D1 + D2) R2 + 
         D3 (R1 + R2)) Vin)/((-1 + D1 + D2)^2 R2 + 
       2 (-1 + D1 + D2) D3 R2 + D3^2 (R1 + R2)));
VCF2 -> -((D3 ((-1 + D1 + D2) R2 + 
         D3 (R1 + R2)) Vin)/((-1 + D1 + D2)^2 R2 + 
       2 (-1 + D1 + D2) D3 R2 + D3^2 (R1 + R2)));
$\endgroup$
  • $\begingroup$ If you are writing using LaTeX, you can use TeXForm[put expression here], copy, paste in the TeX-document and when you convert it to pdf it has the form that you want. $\endgroup$ – Konstantinos Mar 25 '18 at 23:59
  • $\begingroup$ I don't use LaTex in this notebook, just press Ctrl + / and fill out the formula. $\endgroup$ – anhnha Mar 26 '18 at 0:02
  • $\begingroup$ Not in this formula. I meant if you want to use LaTeX to produce the pdf-file you want. $\endgroup$ – Konstantinos Mar 26 '18 at 0:03
  • $\begingroup$ Yes, do you have any idea how to make those formulas above display $\frac{a}{b}$ in PDF? $\endgroup$ – anhnha Mar 26 '18 at 0:05
  • $\begingroup$ Give me a second. I will post an answer. $\endgroup$ – Konstantinos Mar 26 '18 at 0:05
2
$\begingroup$

If you take for example the first expression and put in Mathematica

TeXForm[((-1 + D1 + D2) Vin)/(2 ((-1 + D1 + D2)^2 R2 + 
      2 (-1 + D1 + D2) D3 R2 + D3^2 (R1 + R2)))]

The output is

\frac{\text{Vin} (\text{D1}+\text{D2}-1)}{2 \left(2 \text{D3} \text{R2} (\text{D1}+\text{D2}-1)+\text{R2} (\text{D1}+\text{D2}-1)^2+\text{D3}^2 (\text{R1}+\text{R2})\right)}

And the pdf-file looks like Result

I hope that it is what you wanted.

Cheers!!!

$\endgroup$
  • $\begingroup$ Thanks. But I only want to export the formula not including input like TeXForm[]. How to make the formula display as input? $\endgroup$ – anhnha Mar 26 '18 at 0:15
  • $\begingroup$ Sorry, I just saw that. If you copy the output of the TeXForm command, you will only export the formula, unless I don't understand what you want to do. $\endgroup$ – Konstantinos Mar 26 '18 at 0:58
  • $\begingroup$ Well, I tried but PDF file the formula is clutter like output above and this link: imgur.com/KpmRHwC $\endgroup$ – anhnha Mar 26 '18 at 2:45
  • $\begingroup$ And if you take that expression and compile it into a LaTeX file it should give you a nice looking fraction. I mean all the thing with the frac, etc etc $\endgroup$ – Konstantinos Mar 26 '18 at 2:48
  • $\begingroup$ But I need to export PDF file because these formulas is in a big file. $\endgroup$ – anhnha Mar 26 '18 at 2:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.