TransWikia.com

If-condition cannot be used in multline environment?

TeX - LaTeX Asked by Tianren Liu on October 6, 2020

Incomplete ifx error raises when compiling the following tex code.

documentclass{article}
usepackage{amsmath}

begin{document}
begin{multline} % <- Replacing `multline` with `equation` can fix the problem.
  iftrue
    begin{aligned} h end{aligned} % <- Removing `aligned` can fix the problem.
  fi
end{multline}
end{document}

One Answer

It is presumably an issue with grouping. If you enclose the aligned environment in braces the code compiles:

documentclass{article}
usepackage{amsmath}

begin{document}
begin{multline} % <- Replacing `multline` with `equation` can fix the problem.
  iftrue {
    begin{aligned} h end{aligned} % <- Removing `aligned` can fix the problem.
      }
  fi
end{multline}
end{document}

Correct answer by user30471 on October 6, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP