2

I wanted to center align two logical equations that do not use "=" sign. I also want to separate the equations with a line. Currently I use aligned environment and midrule. Can the equations be center aligned instead of right aligned? The minimum working example is given below:

\documentclass[border=3mm,preview]{standalone}
\usepackage{amsmath}
\usepackage{booktabs}

\begin{document}

    \begin{equation*}
    \begin{aligned}
        \forall_{t \in firing} \quad \forall_{a \in t \bullet} \quad a \in AN\\
        \midrule
        \mu^\prime_{an} = (\mu_{an} - \bullet t) \cup a, \quad c(a) = 0 \\
    \end{aligned}
    \end{equation*}
\end{document}

enter image description here

2
  • What shall be aligned here actually? Wouldn't alignat* not better than a combination of equation* and aligned?
    – user31729
    Commented Jan 26, 2017 at 16:01
  • @ChristianHupfer - The OP may have used some unintentionally ambiguous terminology. Instead of "center aligned", it might be more felicitous to simply write "center".
    – Mico
    Commented Jan 26, 2017 at 16:09

2 Answers 2

5

You could replace the aligned environment with a gathered environment, which centers its contents line by line.

\documentclass[border=3mm,preview]{standalone}
\usepackage{amsmath}
\usepackage{booktabs}
\begin{document}
    \begin{equation*}
    \begin{gathered} % 'gathered' instead of 'aligned'
        \forall_{t \in \textit{firing}} \quad \forall_{a \in t \bullet} \quad a \in AN\\
        \midrule
        \mu^\prime_{an} = (\mu_{an} - \bullet t) \cup a, \quad c(a) = 0 
    \end{gathered}
    \end{equation*}
\end{document}
1
  • it works with gathered.
    – raman
    Commented Jan 27, 2017 at 4:58
5

I hope you understand your question. I add my MWE centering two logical equations without equal sign and separate the equations with a line.

enter image description here

\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb,booktabs}
\begin{document}

$\begin{array}{@{}c@{}}
\forall_{t\in\mathit{firing}} \quad \forall_{a\in t\bullet} \quad a\in AN \\
\specialrule{.05em}{1em}{0em}\\
\mu'_{an} = (\mu_{an} - \bullet t) \cup a, \quad c(a) = 0 \\[.5em]
\specialrule{.2em}{.1em}{.1em} % optional
\end{array}$

\end{document}

enter image description here

4
  • Instead of using \multicolumn{4}{c}{$...$} for both rows, would it maybe be easier not to employ \begin{tabular}{llll} ... \end{tabular} and, instead, to employ $\begin{array}{c} ... \end{array}$?
    – Mico
    Commented Jan 27, 2017 at 9:11
  • You're right. When I entered the code I have not thought about it much. Compared much who is better than me. You can, if you like, change my code.
    – Sebastiano
    Commented Jan 27, 2017 at 16:38
  • I've taken you up on the invitation to modify your code. Feel free to apply further changes.
    – Mico
    Commented Jan 27, 2017 at 21:06
  • @Mico Perfect. This way I learn new codes and shortcuts. Thanks a lot.
    – Sebastiano
    Commented Jan 28, 2017 at 8:29

You must log in to answer this question.

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