2

I have multiple equations that I want center-aligned, but starting at the same point, like I see in other people's texts:

enter image description here

If I use this code:

\begin{align*}
\Pr(\mathbb{X}_2 = 0) = 1-\Pr(\mathbb{X}_2 > 0) \\
\Pr(\mathbb{X}_2 = 4) = \Pr(\mathbb{X}_2 > 3.99) 
\end{align*}

I get the equations center-aligned with all lines stopping at the same point, which looks weird. If I use this code:

\begin{align*}
\Pr(\mathbb{X}_2 = 0) &= 1-\Pr(\mathbb{X}_2 > 0) \\
\Pr(\mathbb{X}_2 = 4) &= \Pr(\mathbb{X}_2 > 3.99) 
\end{align*}

I get it left aligned:

enter image description here What can I do to get it center-aligned but starting at the same point?

Ethan Bolker
  • 9,333
  • 3
  • 42
  • 69
noms
  • 21
  • 2
    Welcome to TeX.SX! The second code snippet provides the same shaping as in the picture. Use \Pr, not Pr. – egreg Apr 08 '16 at 11:27
  • 1
    Thank you! But it is not centered when I run it, I'll add a new photo to the question. – noms Apr 08 '16 at 11:42
  • Off-topic, but do not forget to define Pr as an operator (not italic). – Karlo Apr 08 '16 at 11:56
  • Thanks, fixed the last ones too now! But could it be something weird with my file? I tried to run my friends code that was centered in her document, but then it was left aligned in mine. – noms Apr 08 '16 at 12:06
  • Centered for me too. You should post a complete MWE - a minimal example that reproduces the problem. Start with a copy of your document and remove pieces until you find out what makes the problem go away. If it doesn't, then show the smallest example that shows it. – Ethan Bolker Apr 08 '16 at 12:09
  • 1
    Are you by any chance using the option [fleqn]? – campa Apr 08 '16 at 12:11
  • Yes! I removed it and now it works! Could there be any downsides of removing it? I just got the lines in the start of the document from my supervisor, don't really know what they're for. – noms Apr 08 '16 at 12:17
  • Sorry, read about [fleqn] now. But thank you so much everyone! – noms Apr 08 '16 at 12:22
  • @campa -- can you post an answer, please? (i looked for a duplicate, but couldn't find one.) – barbara beeton Apr 08 '16 at 13:11
  • @barbarabeeton done, even if I think it was a wild guess rather than a proper answer... – campa Apr 08 '16 at 13:46
  • 1
    @campa -- even wild guesses are often good. and having an answer keeps this off the "answer the unanswered" list. thanks. – barbara beeton Apr 08 '16 at 15:34

0 Answers0