Monday, May 24, 2010

Latex Question - Displaying Math and Text?

I'm in a proofs course and use Latex to type up all the homework. I've come across a situation where my teacher wants us to show a certain kind of proof one way, but I cannot figure it out in Latex.





Basically I want to display some stuff like I normally display Math (using eqnarray or align, etc). However, I need to add a quick description at the end of each line. I cannot figure out how to do this while still aligning = signs.





Here is my goal...





\begin{display}


$(A \cup B) - C %26amp;=%26amp; (A \cup B) \cap C\, '$ (by the basic property of set difference) \\


$%26amp;=%26amp; C\, ' \cap (A \cup B)$ (by the communitive property of set intersection) \\


$%26amp;=%26amp; (C \, ' \cap A) \cup (C\, ' \cap B)$ (by the distributive property of intersection over union) \\


$%26amp;=%26amp; (A \cap C\, ') \cup (B \cap C\, ')$ (by the communitive property of set intersection) \\


$%26amp;=%26amp; (A - C) \cup (B - C)$ (by the basic property of set difference).


\end{display

Latex Question - Displaying Math and Text?
Basically, you will be in the math environment so in order to write like normal while you are in the math environment, you use the commend \textrm{something} which is for text roman.





So if I want y=x² for all x


the code would be $y=x^2 \textrm{ for all }x.





Also remember that the math environment ignores all space so the textrm must include space if you want it.





In addition, I am assuming that you want more space than just one space bar and the commands for that are in the order from smalles to largest





\,


\:


\;


\quad


\qquad





These above five space commands only work in the math mode.





So what you are looking for is probably like





$=(A-C) \subset (B-C)\qquad \qquad \qquad \qquad \textrm{by the basic property of set difference}$





Just copy paste it, compile it and then see how it looks.


No comments:

Post a Comment