1

Suppose I have something like,

$\therefore$ we have the following:

\begin{align}
2x + 7 &= 5x + 8 \\[0.1in]
&= 2x - 7 \\[0.1in]
&= 4 \\[0.1in]
\end{align}

I randomly made equations up but the point is I want to line up all the equal signs. However when I do something like this it always tabs everything in between the align command all the way to the center of the page when I just when to align the equal signs while not shifting the whole equation over. Also, when I do this it numbers each line which I do not want it to do. Is there a way to align the equal signs without numbering each line and without moving everything over so much?

Template:

\documentclass[12pt]{article}

\newcommand{\myname}{Name: -------}  
\newcommand{\course}{-------}                
\newcommand{\assignment}{-------}                  
\newcommand{\probs}{}                     

\usepackage{amsmath}            
\usepackage{amsthm}             
\usepackage{amssymb,latexsym}   
\usepackage{graphicx}         
\usepackage{verbatim}        
\usepackage{enumerate}        
\usepackage[left=1in,right=1in,top=0.75in,bottom=0.5in]{geometry}
\usepackage[dvipsnames,usenames]{color}    
\usepackage{ifthen} 
\usepackage{enumitem}

\newcommand{\mytitle}{
\begin{flushleft}
\bfseries
\assignment       \hspace*{\fill} \course \hspace*{\fill} \myname\\
\probs    \hspace*{\fill}              
\rule[10pt]{\linewidth}{1pt}
\end{flushleft}
}

\pagestyle{myheadings}
\markright{\course{} \assignment: \myname}
\newenvironment{exercise}[2][Exercise]
 {\begin{trivlist}\item[\hspace{0pt} \textbf{#1}~\textbf{#2.}]}
 {\end{trivlist}}

\newcommand{\checkname}
{
\ifthenelse{\equal{\myname}{}}
{
  \vspace*{\fill}
  \begin{center}
    {\LARGE \bf Your name is {\color{BrickRed} \myname}?\\[3pt]
    Please change \texttt{\color{BrickRed} \textbackslash myname} and re-process.}
  \end{center}
  \vspace*{\fill}
  \end{document}
  \newpage
}
{}
}

\begin{document}
\thispagestyle{empty}   
\mytitle                

\renewcommand{\qedsymbol}{}  

\end{document}
  • 1
    Without numbering, you just have to use the align* environment. For the other question: do you want to have the alignment within the text flow or on a separate, left aligned display? – Bernard Sep 15 '14 at 22:05
  • I would just like to have it pretty much how I have it as above except all the equal signs are aligned. In other words the first equation is touching the left margin just like the $\therefore$ part. – user62563 Sep 15 '14 at 22:35
  • Or use \notag if you want some numbered and some not. – JPi Sep 15 '14 at 23:29
1
\documentclass{article}
\usepackage{amsmath,amssymb,showframe}     %% show frame just for demo
\begin{document}
  \noindent
  $\therefore$ we have the following:
  \begin{flalign*}
   & \begin{aligned}
       2x + 7 &= 5x + 8 \\[0.1in]
              &= 2x - 7 \\[0.1in]
              &= 4 %\\[0.1in]
     \end{aligned}
   &
\end{flalign*}
\end{document}

enter image description here

With your template:

\documentclass[12pt]{article}

\newcommand{\myname}{Name: -------}
\newcommand{\course}{-------}
\newcommand{\assignment}{-------}
\newcommand{\probs}{}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb,latexsym}
\usepackage{graphicx}
\usepackage{verbatim}
\usepackage{enumerate}
\usepackage[left=1in,right=1in,top=0.75in,bottom=0.5in]{geometry}
\usepackage[dvipsnames,usenames]{color}
\usepackage{ifthen}
\usepackage{enumitem}

\newcommand{\mytitle}{
\begin{flushleft}
\bfseries
\assignment       \hspace*{\fill} \course \hspace*{\fill} \myname\\
\probs    \hspace*{\fill}
\rule[10pt]{\linewidth}{1pt}
\end{flushleft}
}

\pagestyle{myheadings}
\markright{\course{} \assignment: \myname}
\newenvironment{exercise}[2][Exercise]
 {\begin{trivlist}\item[\hspace{0pt} \textbf{#1}~\textbf{#2.}]}
 {\end{trivlist}}

\newcommand{\checkname}
{
\ifthenelse{\equal{\myname}{}}
{
  \vspace*{\fill}
  \begin{center}
    {\LARGE \bf Your name is {\color{BrickRed} \myname}?\\[3pt]
    Please change \texttt{\color{BrickRed} \textbackslash myname} and re-process.}
  \end{center}
  \vspace*{\fill}
  \end{document}
  \newpage
}
{}
}

\begin{document}
\thispagestyle{empty}
\mytitle

\renewcommand{\qedsymbol}{}

  \noindent
  $\therefore$ we have the following:
  \begin{flalign*}
   & \begin{aligned}
       2x + 7 &= 5x + 8 \\[0.1in]
              &= 2x - 7 \\[0.1in]
              &= 4 %\\[0.1in]
     \end{aligned}
   &
\end{flalign*}

\end{document}

enter image description here

  • Hmm I did that and did not get an error but it didn't move it to the left at all. Maybe something in my template is making it do that. I will post my template with my question and maybe you can see if there is something there causing it to do that. Otherwise I have no idea. – user62563 Sep 15 '14 at 23:01
  • @user62563 With your template, it works too. – user11232 Sep 15 '14 at 23:08
  • I'm asking why: (1) people want to be cryptic by using strange symbols instead of plain words; (2) those formulas should be left aligned. – egreg Sep 15 '14 at 23:11
  • Thats so strange that it works for you. Wander why its not putting mine to the left. – user62563 Sep 15 '14 at 23:15
  • @egreg It wasn't my choice, :-) – user11232 Sep 15 '14 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.