2

I'm writing equations that have different length in Latex , I would like to make the end of each equation ( for each t) to be in the same place in each equation. How can I do that?example

1
  • 3
    Does this form part of a bigger equation and you're only specifying the conditions of the variables? If so, can you provide that additional context? Also, you should consider providing the code for what you've shown.
    – Werner
    Mar 9, 2020 at 18:06

3 Answers 3

1

I think you may want to use array in this case, for example

\begin{document}

\[
\begin{array}{ll}
{q_\mathrm{t}^\mathrm{p}\geq0} & {\forall p\in\mathcal{P}\hspace{2mm}\forall t} \\
{R_\mathrm{t}^\mathrm{s}\geq0} & {\forall t}
\end{array}
\]

\end{document}

The {lr} behind the \begin{array} represent that the first column do left-justify and the second column do left-justify, if you want to have right-justify, use letter r.

Here's the result:

enter image description here

Also, you can add as many \qquad as you want if you create another column, like this:

\begin{document}

\[
\begin{array}{lcl}
{q_\mathrm{t}^\mathrm{p}\geq0} & {\qquad\qquad} & {\forall p\in\mathcal{P}\hspace{2mm}\forall t} \\
{R_\mathrm{t}^\mathrm{s}\geq0} & {\qquad\qquad} & {\forall t}
\end{array}
\]

\end{document}
2
  • 1
    This might look a little nicer with the first column being set right-aligned, since the zeros are the same width; that would line up the signs of relation. Mar 9, 2020 at 19:16
  • Yes, you are right, I didn't notice the lower case and upper case problem. Usually when I am doing such things myself, I would add the big { or } to make it looks nicer. Mar 9, 2020 at 19:55
4

This is very simply obtained with alignat:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat*}{3}
 q_\mathrm{t}^\mathrm{p} & \geq 0 & \qquad & \forall p\in\mathcal{P}\hspace{2mm} & \enspace & \forall t\\
 R_\mathrm{t}^\mathrm{s} & \geq 0 & & & & \forall t
\end{alignat*}

\end{document} 

enter image description here

0

Hope you like it!

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
 q_\mathrm{t}^\mathrm{p}\geq0 \qquad \forall p\in\mathcal{P}\hspace{2mm}\forall t&\\
 R_\mathrm{t}^\mathrm{s}\geq0 \qquad \forall t&
\end{align*}

\end{document}

Example

You must log in to answer this question.

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