1

I would like to align the text in the left so all of the four texts start in the same position, just like seen in the picture below. I've used the enumerate environment. Thank you in advance!

1
  • 5
    Welcome! Please post the code that you have tried. Otherwise others need to punch in the text for you,
    – user194703
    May 26, 2020 at 19:46

3 Answers 3

0

You can use the tabto package (see How do I use tab stops in enumerate or itemize?)


\documentclass{article}
\usepackage{amssymb}
\usepackage{enumerate}
\usepackage{tabto}

\begin{document}
  \TabPositions{4cm}
  \begin{enumerate}
  \item $(\lambda+\mu)v=\lambda v+\mu v$ \tab Per la proprietat distributiva de $V$
  \item $\lambda(v+w)=\lambda v+\lambda w$ \tab Per la proprietat distributiva de $\mathbb{K}$
  \item $\lambda(\mu v)=(\lambda\mu)v$ \tab Per la proprietat associativa de $\mathbb{K}$ i $V$
  \item $1v=v$ \tab $1\in\mathbb{K}$ és neutre per al producte
  \end{enumerate}
\end{document}

enter image description here

1

Unfortunately, your question isn't too well-defined, and does not even provide some starting point for the answerer. Assuming (since you are not very specific) that the texts on the right fit in one line, there is an almost trivial possibility with eqparbox.

\documentclass{article}
\usepackage{eqparbox}
\newcounter{LMathindex}
\newcommand{\LMath}[2][LM-\number\value{LMathindex}]{\eqmakebox[#1][l]{$#2$}\qquad}
\newcommand{\diff}{\mathop{}\!\mathrm{d}}
\begin{document}
\stepcounter{LMathindex}
\begin{enumerate}
 \item \LMath{\lambda=1} Some text
 \item \LMath{\lambda=1\wedge\mu>0\wedge\chi\ne\xi} Some other text
 \item \LMath{\displaystyle\int_a^b f(x)\,\diff x} Some comments
\end{enumerate}

Some more stuff\dots\stepcounter{LMathindex}
\begin{enumerate}
 \item \LMath{\lambda=1} Some text
 \item \LMath{\lambda=2} Some other text
\end{enumerate}
\end{document}

enter image description here

  • You need to compile twice to get all the widths in.
  • If you do not want to reset the widths between two lists, drop \stepcounter{LMathindex} before that list.

As usual, there are many ways to generalize this. But this requires a well-defined question with clear specifications.

1

If we want to horizontal align then we can use \halign primitive:

\newcount\enumc
\def\enum#1\eenum{{\global\enumc=0 \par \advance\baselineskip by5pt \lineskip=5pt
   \halign{\global\advance\enumc by1 
           \the\enumc. $\displaystyle##$\hfil\qquad &##\hfil\cr#1\crcr}}\medskip}  

% document:

\enum \lambda=1                             & Some text \cr
      \lambda=1\wedge\mu>0\wedge\chi\ne\xi  & Some other text \cr
      \int_a^b f(x)\,{\rm d}x               & Some comments \eenum

Some more stuff...

\enum \lambda=1 & Some text \cr
      \lambda=2 & Some other text \eenum 

\bye

halign

I have tried two advantages of this approach:

  • It is good idea to know TeX primitives. Then you need not to find out the appropriate package to solve your problem but only use primitives. There are about 2770 LaTeX packages but only 270 TeX primitives.
  • If you use TeX primitives well then our source document (the part after the %document in my example) can look very friendly. There is minimum tags for setting desired structure. No unnecessary {}, $, \begin{something}, \end{something} etc.

You must log in to answer this question.

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