4

I'm new to latex and i'm writing my first document. I want to specify the conditions for a theorem to be true and i want to format it like this: Centered tuple at the top. List of items with roman numeration, each of them aligned on \leq simbol (but roman enumerate still at left)

I wrote this for a previous part

\begin{align*}
&AP=(Q,\Sigma,\Gamma,\delta,Q_0,Z_0,F) \\
Q&: Conjunto\ de\ estados \\
\Sigma&: Alfabeto\ de\ entrada \\
\Gamma&: Alfabeto\ de\ Pila \\
\delta&: Q\times(\Sigma\cup\{\lambda\})\times\Gamma \rightarrow  P(Q\times\Gamma^*)\\
Q&_0 \in Q \\
Z&_0 \in \Gamma \\
F&: Estados\ Finales,\ F \in Q
\end{align*}

which outputs

Centered tuple with aligned descriptions of each element on ":"

but instead of aligning to center as the above example i want to enumerate in roman numbers in such a way that numbers stay at left but the content of each conditions stays aligned by comparison symbol (be that <= or =)

2 Answers2

2

I can suggest two ways of solving your problem, none of which uses align.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,es-lcroman]{babel}
\usepackage{amsmath}
\usepackage{enumitem}

\usepackage{tabto} % for the first solution

\newcommand{\defitem}[1]{% for the second solution
  \item \makebox[2em][r]{#1: }\ignorespaces
}

\begin{document}
\begin{enumerate}
\item Defina formalmente $AP$, configuración istantanea
en un~$AP$, cambio de configuración en un~$AP$.

Definición de $AP$
\[
AP=(Q,\Sigma,\Gamma,\delta,Q_0,Z_0,F)
\]
\begin{enumerate}[label=(\roman*),leftmargin=4em,align=left]
\item $Q$\tabto{2em} Conjunto de estados
\item $\Sigma$\tabto{2em} Alfabeto de entrada
\item $\Gamma$\tabto{2em} Alfabeto de Pila
\item $\delta$\tabto{2em} $Q\times(\Sigma\cup\{\lambda\})\times\Gamma \rightarrow  P(Q\times\Gamma^*)$
\item $Q_0$\tabto{2em} $Q_0 \in Q$
\item $Z_0$\tabto{2em} $Z_0 \in \Gamma$
\item $F$\tabto{2em} Estados Finales, $F \in Q$
\end{enumerate}

\item Defina formalmente $AP$, configuración istantanea
en un~$AP$, cambio de configuración en un~$AP$.

Definición de $AP$
\[
AP=(Q,\Sigma,\Gamma,\delta,Q_0,Z_0,F)
\]
\begin{enumerate}[label=(\roman*),leftmargin=4em,align=left]
\defitem{$Q$} Conjunto de estados
\defitem{$\Sigma$} Alfabeto de entrada
\defitem{$\Gamma$} Alfabeto de Pila
\defitem{$\delta$} $Q\times(\Sigma\cup\{\lambda\})\times\Gamma \rightarrow  P(Q\times\Gamma^*)$
\defitem{$Q_0$} $Q_0 \in Q$
\defitem{$Z_0$} $Z_0 \in \Gamma$
\defitem{$F$} Estados Finales, $F \in Q$
\end{enumerate}
\end{enumerate}

\end{document}

enter image description here

egreg
  • 1,121,712
1

I think your formatting objective may be achieved by ditching the align* environment and, instead, using a good old tabular environment. Observe that I don't use any : symbols since they're not really needed.

enter image description here

\documentclass{article}
\usepackage{array}
\begin{document}
\[
\begin{tabular}{r >{$}l<{$} l }
& \multicolumn{2}{l}{$AP =(Q,\Sigma,\Gamma,\delta,Q_0,Z_0,F)$}\\[1ex]
i)   & Q     & Conjunto de estados \\
ii)  &\Sigma & Alfabeto de entrada \\
iii) &\Gamma & Alfabeto de Pila \\
iv)  &\delta & $Q\times(\Sigma\cup\{\lambda\})\times\Gamma \to  P(Q\times\Gamma^*)$\\
v)   & \multicolumn{2}{l}{$Q_0\in Q$} \\
vi)  & \multicolumn{2}{l}{$Z_0\in\Gamma$} \\
vii) &F      & Estados Finales, $F\in Q$
\end{tabular}
\]
\end{document}
Mico
  • 506,678
  • 1
    To the downvoter: Please enlighten me as to what's objectionable about this answer. – Mico Feb 27 '17 at 18:11