1
$ABC+A^{'}B+ABC^'$ \\
$= AB(C+C^{'})+A^{'}B$
\hspace*{1in} (Common Parantheses)\\
$= AB + A^{'}B$
\hspace*{1in} (Complement Law)\\
$= B(A+A^{'})$
\hspace*{1in} (Common Parantheses)\\
$= B$
\hspace*{1in} (Complement Law)

I want to align "Common Parantheses" and "Complement Law" according to the right of page. Actually, I want to do something like hspace but from right, or hspace but relative to page not to text.

Qrrbrbirlbel
  • 119,821

2 Answers2

0

Something like this? (The framelines at the edges of the text block are drawn by the showframe package.) The solution employs an align* environment and four \tag directives.

enter image description here

\documentclass{article} % or some other suitable document
\usepackage{amsmath}    % for 'align*' env. and '\tag' macro
\usepackage{showframe}  % optional: draw frame around text block
\begin{document}
\begin{align*}
ABC+A'B+ABC'
 &= AB(C+C')+A'B \tag{Common Parentheses} \\
 &= AB + A'B     \tag{Complement Law}     \\
 &= (A+A')B      \tag{Common Parentheses} \\
 &= B            \tag{Complement Law}
\end{align*}
\end{document}
Mico
  • 506,678
0

Note that ^{'} and ^' are wrong and should simply be '.

I guess you want something like

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align} &ABC+A'B+ABC' \ &\quad= AB(C+C')+A'B && \text{(Common Parentheses)} \ &\quad= AB + A'B && \text{(Complement Law)} \ &\quad= B(A+A') && \text{(Common Parentheses)} \ &\quad= B && \text{(Complement Law)} \end{align}

\end{document}

I see no reason for pushing the justifications to the right margin, nor the formulas to the left margin; actually, I see several reasons not to.

enter image description here

Is it possible to have the justifications at the right margin? Yes, certainly so. Compare

\documentclass{article}
\usepackage{amsmath}

\usepackage{lipsum} % for mock text \usepackage{showframe} % to see the margins

\begin{document}

\lipsum[1][1-4] \begin{align} &ABC+A'B+ABC' \ &\quad= AB(C+C')+A'B && \text{(Common Parentheses)} \ &\quad= AB + A'B && \text{(Complement Law)} \ &\quad= B(A+A') && \text{(Common Parentheses)} \ &\quad= B && \text{(Complement Law)} \end{align} \lipsum[2][1-4] \begin{flalign} &ABC+A'B+ABC' \ &\quad= AB(C+C')+A'B && \text{(Common Parentheses)} \ &\quad= AB + A'B && \text{(Complement Law)} \ &\quad= B(A+A') && \text{(Common Parentheses)} \ &\quad= B && \text{(Complement Law)} \end{flalign} \lipsum[3][1-4]

\end{document}

enter image description here

Do you want your readers to have a hard time following lines with so large blank space between the two parts?

egreg
  • 1,121,712