0

I have following equations groups that work in separate but not together. I do not want to use \begin{equation} because I do not want to number them. When I put them together, it just goes out of margins.

\begin{align*}
{
{\acrshort{elu}} & \equiv 
\begin{cases}
x, & \text{if $x > 0$}\\
\alpha * (e^{x} - 1), & \text{if $x \le 0$}
\end{cases}} &
{
{\acrshort{leaky}} & \equiv 
\begin{cases}
x, & \text{if $x > 0$}\\
\alpha * (\alpha*x), & \text{if $x < 0$}
\end{cases}
}\\ 
\end{align*}

second group:

\begin{align*}
{{\acrshort{relu}} & \equiv \max(0,x)} &
{maxout} & \equiv \max(w_1^Tx+b_1, w_2^Tx + b_2) 
\end{align*}

First two equations use curly braces and second do not. Expected: First two in first row and second two in second row. I tried using \\.

Edit: Regarding comment below, here is acrshort{} package info:

\usepackage[acronym]{glossaries}
\makeglossaries

and in page:

\printglossary[title=List of Acronyms,type=\acronymtype,nonumberlist,nogroupskip=true]

But I don't think that it is the conflict with glossary, is it?

Edit2 If I reverse the order, all four appear, though not aligned properly. Moreover, Issue is with first group.

Both equations in first group have curly braces in equation. So they do not align properly until I put another bracket around, which I did above then This group shows up but nothing else till next chapter.

  • welcome to tex.se! please make from your code sniperts one, small complete document with \documentclass ... on the start and with \end{document} on the end. – Zarko Oct 1 '18 at 14:19
  • not only I am new to latex, I am writing inside a university template. But equations work good otherwise, except in this example, can you please try it out somehow? – abdul qayyum Oct 1 '18 at 14:24
  • we should know, what is in the preamble of document and where are defined \acrshort. without see complete document, we can't help you. – Zarko Oct 1 '18 at 14:25
  • updated \acrshort{} – abdul qayyum Oct 1 '18 at 14:31
  • it is impossible to run the code you post, please always post complete small documents that show the problem otherwise it is very hard for anyone to help. – David Carlisle Oct 1 '18 at 17:35
2

to long for the comment ...

your expectation, that we have crystal ball in which we see your document and see, what is your problem, is wrong. most of us haven't it or it is broken and out of order :-).

so, i test your code (after cleaning all of unnecessary curly braces) with standard article document class and it work fine:

enter image description here

\begin{align*}
\text{elu}  & \equiv
\begin{cases}
x,                      & \text{if $x > 0$} \\
\alpha * (e^{x} - 1),   & \text{if $x \le 0$}
\end{cases} &   \text{leaky} & \equiv
                \begin{cases}
                x,                      & \text{if $x > 0$}\\
                \alpha * (\alpha*x),    & \text{if $x < 0$}
                \end{cases}
\end{align*}

\begin{align*}
\text{relu} & \equiv \max(0,x)  & maxout & \equiv \max(w_1^Tx+b_1, w_2^Tx + b_2)
\end{align*}

instead of \acrshort{} i use \text command from the amsmath package.

so, for any further help you need to provide mwe (minimal working example), a small but complete document by which we can reproduce your problem.

edit: i suspect that probably you like to obtain the following:

enter image description here

a complete mwe for above result is:

\documentclass{article}
\usepackage{mathtools}     % needed for "dcases*"
\DeclareMathOperator{\maxout}{maxout}

\begin{document}
\begin{align*}
\text{elu}  & \equiv
    \begin{dcases*}
    x,                      & if $x > 0$    \\
    \alpha * (e^{x} - 1),   & if $x \le 0$
    \end{dcases*}
        &   \text{leaky} & \equiv
                \begin{dcases*}
                x,                      & if $x > 0$    \\
                \alpha * (\alpha*x),    & if $x < 0$
                \end{dcases*}       \\
\text{relu} & \equiv \max(0,x)
    &  \maxout & \equiv \max(w_1^Tx+b_1, w_2^Tx + b_2)
\end{align*}
\end{document}

note: use * as sign for multiplication is in text very rare in use. you should consider to remove them.

  • Oh thank you, your second approach helped me, real problem was alot of {} and $ signs, removed them all and it is working now. – abdul qayyum Oct 2 '18 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.