1

I am trying to write the next thing in Texmaker

\documentclass[12pt,twoside]{report}
\usepackage{amsmath} 
\usepackage{amssymb} 
\usepackage{amsfonts}

\begin{document}  
\chapter{Intro}
Los equilibrios paralelos del $ATP$,$ADP$ y $P_i$ a un pH cercano a 7 permiten reescribir $K_1$ del siguiente modo:
    \[K_1=\frac{[ADP][P_i]}{[ADP]}

    \[K_1= \frac{([ADP^{3-}]+[HADP^{2-}]+[MgADP^-])\times([HPO_4^{2-}]+[H_2PO_4^-]+[MgHPO_4])}{([ATP]^{4-}+[HATP]^{3-}+[MgATP^{2-}])}

    \[K_1=K\times\lgroup\frac{(1+ \frac{10^{-pH}}{K_{HADP^{2-}}} + \frac{10^{-pMg}}{K_{MgADP^{-}}})\times(1+ \frac{10^{-pH}}{KH_2PO_4^{2-}} + \frac{10^{-pMg}}{K_{MgHPO_4}})}{(1+ \frac{10^{-pH}}{K_{ATP^{3-}}} + \frac{10^{-pMg}}{K_{MgATP^{-2}}})\times10^{-pH}}\rgroup

\end{document}

With that code, pdf looks more or less like this:

enter image description here

Questions:

  • I tried to modify the relative distance between those formulas with //~//, but I am not sure if it is the best way to do that.
  • Symbols like \lgroup, \rgroup (big parenthesis) aren't showed in the correct way (see photo).

Can you help me to fix those things?

Is there any simpler way to write those formulas? (they look pretty bad)

Tiuri
  • 7,749
  • 1
    please always post a complete small document that peopel can run, not disconnected fragments with preamble and equations that everyone then has to join together. You should be using display math \[ (or aligned dispolays such as \begin{align*} not inline math $ (and never use \\~\\) – David Carlisle Jun 02 '17 at 07:50
  • @DavidCarlisle i will edit –  Jun 02 '17 at 07:52
  • Tiuri just beat me to an align solution, which is the way to set this as mathematics, but I suspect this is really chemistry? There are several packages to help with typesetting chemical constructs – David Carlisle Jun 02 '17 at 08:05
  • @DavidCarlisle yes there are, but my head will explode. I am writing it in that "silly" way for the moment. Thank you.. –  Jun 02 '17 at 08:07
  • 4
    It seems odd to struggle to typeset chemistry as math and then need to ask how to make it look reasonable rather than use packages designed to make it easier to enter chemistry directly. (I'm not a chemist so haven't really used them myself but several users here are. Perhaps one of them will post an answer showing how to set your formula using one of the chemistry packages. – David Carlisle Jun 02 '17 at 08:09
  • The pH in your text is upright but italic in you reaction. The latter is wrong. Also, chemical elements are typeset upright, not italic, again, this is wrong in your example. Using a package like chemmacros (and chemformula), or mhchem would take care of that and give you a consistent and propely formatted document. – Johannes_B Jun 03 '17 at 12:26
  • @Johannes_B yes but i don't know where to learn the use of Chemmacros. –  Jun 03 '17 at 12:57
  • (Almost) every package has a documentation. Open a terminal and type texdoc chemacros. After hitting the Enter key, your pdf viewer will open the doc with all the relevant information. – Johannes_B Jun 03 '17 at 13:00
  • @Johannes_B it has no documentation.. –  Jun 03 '17 at 13:03
  • Yes it does. I mistyped above. it should be texdoc chemmacros. – Johannes_B Jun 03 '17 at 13:27

1 Answers1

3

Use an align* environment to typeset your equations:

\documentclass{article}

\usepackage{amsmath}
\usepackage{nccmath}

\begin{document}

Los equilibrios paralelos del $ATP$, $ADP$ y $P_i$ a un pH cercano a 7 permiten reescribir $K_1$ del siguiente modo:
\begin{align*}
    K_1&=\frac{[ADP][P_i]}{[ADP]} \\[1em]
    K_1&=\frac{\big([ADP^{3-}]+[HADP^{2-}]+[MgADP^-]\big)\times\big([HPO_4^{2-}]+[H_2PO_4^-]+[MgHPO_4]\big)}{[ATP]^{4-}+[HATP]^{3-}+[MgATP^{2-}]} \\[1em]
    K_1&=K\times\left\lgroup\frac{\left(1+\mfrac{10^{-pH}}{K_{HADP^{2-}}} + \mfrac{10^{-pMg}}{K_{MgADP^{-}}}\right)\times\left(1+\mfrac{10^{-pH}}{KH_2PO_4^{2-}}+\mfrac{10^{-pMg}}{K_{MgHPO_4}}\right)}{\left(1+\mfrac{10^{-pH}}{K_{ATP^{3-}}}+\mfrac{10^{-pMg}}{K_{MgATP^{-2}}}\right)\times10^{-pH}}\right\rgroup
\end{align*}

\end{document}

enter image description here

In detail:

  • Inside align*, start new lines with \\. You can modify the spacing by setting the optional argument, so \\[1em] will add an additional spacing of 1em.
  • Inside align*, put & directly before the symbol on which you want the equations to be aligned (= most of the times).
  • Inside align*, (first order) fractions are always set in full size. Nested fractions then have a reduced size. You can use \dfrac or \mfrac for the nested fractions to get them larger (full size for \dfrac, about 80% for \mfrac).
  • \lgroup and \rgroup only work if you use them together with \left and \right.
  • Think about whether you need all the brackets. Sometimes, you might want to change the size of a pair of brackets with respect to the automatically assigned size (with or without \left, \right): Use \big, \Big, \bigg, \Bigg (read more).
Tiuri
  • 7,749
  • Oh..you are god..and can the second formula be bigger? (for it to be clearer) –  Jun 02 '17 at 08:06
  • 1
    You can use \dfrac instead of \frac for the nested fractions to have them larger. I'll update the answer so that you can see how the result looks. – Tiuri Jun 02 '17 at 08:09
  • 2
    You also can use \mfrac, which is larger than \frac in this context, burt not as large as dfrac (it's about 80 % of \dfrac). Also I don't think you need all these parentheses. A fraction bar is a separator, so you don't need one more. – Bernard Jun 02 '17 at 08:18
  • @Bernard yes, you are right about parenthesis –  Jun 02 '17 at 08:20