Advertisement
Guest User

Bad horizontal alignment

a guest
May 10th, 2022
20
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.06 KB | None
  1. \documentclass{article}
  2. \usepackage{amsmath}
  3. \usepackage{mathtools}
  4. \usepackage{lipsum}
  5.  
  6. \begin{document}\pagestyle{empty}
  7.  
  8. \lipsum[1]
  9.  
  10. \noindent Vertical numbering:
  11.  
  12. \noindent\begin{minipage}{.4\textwidth}
  13.  \begin{align}
  14.    x&=1 \\
  15.    y&=1
  16.  \end{align}
  17. \end{minipage}% <-- % symbol necessary
  18. \begin{minipage}{.6\textwidth}
  19.  \begin{align}
  20.    z&=1\\
  21.    w&=1
  22.  \end{align}
  23. \end{minipage}
  24.  
  25. \bigskip
  26.  
  27. \noindent Horizontal numbering:
  28.  
  29. \noindent\begin{minipage}{0.4\textwidth}
  30. \begin{equation}
  31. x^2 + y = \mathrlap{z + 4}\phantom{z + 4 + y^2 - p} \\
  32. \end{equation}
  33. \end{minipage}
  34. \begin{minipage}{0.6\textwidth}
  35. \begin{equation}
  36. \phantom{x^2 + y^3 - 17}\mathllap{x^2} = z + 4 + q \\
  37. \end{equation}
  38. \end{minipage}\\[-2ex]
  39. \begin{minipage}{0.4\textwidth}
  40. \begin{equation}
  41. \phantom{x^2 + y}\mathllap{x^2} = z + 4 + y^2 - p \\
  42. \end{equation}
  43. \end{minipage}
  44. \begin{minipage}{0.6\textwidth}
  45. \begin{equation}
  46. x^2 + y^3 - 17 = \mathrlap{z}\phantom{z + 4 + q} \\
  47. \end{equation}
  48. \end{minipage}
  49.  
  50. \vspace{\baselineskip}
  51.  
  52. \lipsum[2]
  53.  
  54. \end{document}
  55.  
Advertisement
RAW Paste Data Copied
Advertisement