Tengo el siguiente código:
\begin{gather}
u(x,t) = 0 \ \mathrm{ si\ } x = 0, x = 1\\
\label{ex1bc}
\\
u(x,0) = \left\{
\begin{array}{ll}
2x, & \mathrm{si\ } 0 \le x \le 1/2 \\
2(1-x) & \mathrm{si\ } 1/2 \le x \le 1 \\
\end{array}
\right.
\label{ex1inicial}
\end{gather}
Eso produce:
Me gustaría tener eso pero sin la ecuación en blanco 2.23. ¿Qué estoy haciendo mal?
Respuesta1
Tienes un extra espurio \\
después de la primera ecuación. Elimínelo y la línea adicional desaparecerá.
Para la segunda ecuación, considere usar un cases
entorno; Por un lado, la llave de la izquierda será un poco más grande.
\documentclass{article}
\usepackage{amsmath} % for 'cases' env. and `\text` macro
\numberwithin{equation}{section} % just for this example
\setcounter{section}{2} % just for this example
\setcounter{equation}{21}
\begin{document}
\begin{gather}
u(x,t) = 0 \text{ si } x = 0, x = 1 \label{ex1bc}\\
u(x,0) = \begin{cases}
2x & \text{si } 0 \le x \le 1/2 \\
2(1-x) & \text{si } 1/2 \le x \le 1 \\
\end{cases} \label{ex1inicial}
\end{gather}
\end{document}