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.

3
  • Welcome to TeX.SE.
    – Mico
    Commented Oct 24, 2022 at 12:42
  • Don't use \\ for new lines in normal text. The amsmath package provides a lot of environments to align equations properly and which usually look good. Or are you not using LaTeX? Commented Oct 24, 2022 at 13:06
  • Off-topic: Both ^{'} and ^' are wrong. It should just be '.
    – Mico
    Commented Oct 24, 2022 at 13:13

2 Answers 2

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?

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .