DEV Community

latexteada
latexteada

Posted on

1

LaTeX & Maths: Conditional Expressions and Multiple Equations

Hello, how are you? :)

In this post I tell you how to create conditional expressions and what you can do if you have multiple equations and align them at the center. Let's start!!!

Conditional Expressions

You need to use the cases instruction to define the expression

\begin{cases}
   equation
\end{cases}
Enter fullscreen mode Exit fullscreen mode

code

Produces

Screenshot from 2021-08-23 10-16-57

You can add a new file with \\ at the end of the line

  • This must be inside a math environment like $ $, \[ \] or equation

Aligning Multiple Equations

We have seen many ways to write equations, but Just one equation what if you want to write 5 equations, or more than 5 equations? Do we need to put each equation in \[\] it is going to be a nightmare!!

There exist an environment, the gather environment this centers a group of formulas on a separate line

code

Produces

Screenshot from 2021-08-23 10-30-29

  • You can create a new line with \\
  • No blank lines are permitted within the environment

This is all for today.

Do not forget to follow me on twitter @latexteada

Greetings :)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay