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 =)

7
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Commented Feb 26, 2017 at 18:41
  • Related/duplicate: How to provide a definition for symbols in a LaTeX math equation?
    – Werner
    Commented Feb 26, 2017 at 18:46
  • Which \leq symbol? There's none in your code.
    – Bernard
    Commented Feb 26, 2017 at 18:52
  • Your first order of business should, no doubt, be to encase the strings of text (e.g., "Conjunto de estados") in \text{...} wrappers. And, for more-appropriate spacing, instead of :, consider writing \colon.
    – Mico
    Commented Feb 26, 2017 at 18:52
  • 1
    @Mico: What I mean is \colon will have too tight a spacing, whereas a real : in math mode will be better. That said, we should wait to know what are those mysterious \leq
    – Bernard
    Commented Feb 26, 2017 at 19:27

2 Answers 2

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

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}
1
  • 1
    To the downvoter: Please enlighten me as to what's objectionable about this answer.
    – Mico
    Commented Feb 27, 2017 at 18:11

You must log in to answer this question.

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