0

A question why I get this error when I use align? My code is the following

\documentclass[12pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{xargs}
\usepackage[usenames]{xcolor}
\usepackage{xr-hyper}
\usepackage[left=3.00cm, right=2.50cm, top=2.50cm, bottom=3.00cm]{geometry}
\usepackage{emptypage}
\usepackage[hyphens]{url}
\usepackage{fncychap}
\usepackage{fancyhdr}
\usepackage{amsthm}

\theoremstyle{definition}
\newtheorem{teorema}{Teorema}[chapter]
\newtheorem{definicion}{Definición}[chapter]
\newtheorem{lema}{Lema}[chapter]
\newtheorem{corolario}{Corolario}[chapter]
\newtheorem{proposicion}{Proposición}[chapter]
\newtheorem{observacion}{Observación}[chapter]
\newtheorem{ejemplo}{Ejemplo}[chapter]
\newtheorem{afirmacion}{Afirmación}[chapter]
\usepackage[colorlinks=true, pdfpagemode=None, linkcolor=blue, citecolor=blue]{hyperref}
\usepackage[shortlabels]{enumitem}



\newcommand{\sub}[2]{(#1_{#2})_{#2\in \mathbb{N}}}
\newcommand{\D}{\displaystyle}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\omp}{{\omega(p)}}
\newcommand{\orb}{\mathcal{O}}



\def\span{\mathrm{Span}}
\def\defi{\it}

\def\para#1{\parax(#1)}
\def\parax(#1){\mathbf{#1}}

\def\dfun#1{\dfunx(#1)}
\def\dfunx(#1,#2,#3,#4,#5){\begin{array}{cccl}
#1:&#2&\longrightarrow &#3\\
& #4 &\mapsto&\D #1(#4):= #5
\end{array}}

\def\dfunv#1{\dfunvx(#1)}
\def\dfunvx(#1,#2,#3,#4,#5){\begin{array}{cccl}
#1:&#2&\longrightarrow &#3\\
& #4 &\mapsto&\D #1 #4:= #5
\end{array}}

%%%%%%%%%%%%%%%%%%%comandos acoplados%%%%%%%%%%%
% COLORES personales---------------------------------------------------
    \definecolor{colortitulo}{RGB}{11,17,79} %
    \definecolor{colordominante}{RGB}{11,17,79}
    \definecolor{colordominanteA}{RGB}{243,102,25}
    \definecolor{colordominanteF}{RGB}{219,68,14}
    \definecolor{colordominanteD}{RGB}{74,0,148}



%************************************************
\newcommand{\pr}{\hspace*{5.5mm}}



%************************************************
%\numberwithin{equation}{chapter}
%\renewcommand\thesection{\arabic{section}}
%\renewcommand\thesubsection{\thesection.\arabic{subsection}}
%\setcounter{secnumdepth}{3}
%\setcounter{tocdepth}{3}
%%%%%%%%%%%-----Diseño de capítulos estilo 1. 2. 3.,...%%%%%%%%%%%

%\def\LigneVerticale{\vrule height 1.2cm depth 0.5cm\hspace{0.1cm}\relax}
%\def\LignesVerticales{%
%   \let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
\def\GrosCarreAvecUnChiffre#1{%
    \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
    \rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%
    \vrule height 0pt width 1cm depth 0pt}
\def\@makechapterhead#1{\hbox{%
        \bfseries
        \Huge
    %   \LignesVerticales
        \hspace{-0.5cm}%
        \GrosCarreAvecUnChiffre{\thechapter}
        \hspace{0.3cm}\hbox{#1}%
    }\par\vskip 2cm}
    
\begin{document}
\begin{titlepage}

\renewcommand{\contentsname}{INDICE GENERAL}
\tableofcontents
\fancyhead[LE,LO]{Contenido}
\newpage
\renewcommand{\chaptername}{}

\chapter{Preliminares variedades}

\begin{definicion}
Una {\defi variedad diferenciable de clase $C^k$ de dimensión $m$}, con $1\leq k\leq +\infty$, es un espacio topológico Hausdorff $M^m$ la cual tiene una base numerable de abiertos y está dotado de un {\defi atlas diferenciable} $\mathcal{A}=\{(U_\alpha,\para{x}_\alpha):\alpha\in\Lambda\}$, es decir, una familia de homeomorfismos $\para{x}_\alpha:U_\alpha\to \para{x}_\alpha(U_\alpha)$, $\alpha\in\Lambda$ tales que:
\begin{enumerate}[{1)}]
\item cada $U_\alpha$ es un abierto de $M^m$ mientras que cada $\para{x}_\alpha(U_\alpha)$ es un abierto de $\R^m$ y además $M^m=\D\bigcup_{\alpha\in\Lambda}U_\alpha$,
\item la aplicación $\para{x}_\beta\circ\para{x}^{-1}_\alpha:\para{x}_\alpha(U_\alpha\cap U_\beta)\to\para{x}_\beta(U_\alpha\cap U_\beta)$ es un difeomorfismo de clase $C^k$ entre abiertos de $\R^m$, para cualesquiera $\alpha$ y $\beta$ en $\Lambda$ tales que $U_\alpha\cap U_\beta\neq\emptyset$.
\item la familia $\mathcal{A}=\{(U_\alpha,\para{x}_\alpha):\alpha\in\Lambda\}$ es maximal con respecto a la condición $(2)$, es decir, si $(U,\para{x})$ es una carta local tal que $\para{x}\circ\para{x}^{-1}_\alpha$ y $\para{x}_\alpha\circ\para{x}^{-1}$ son difeomorfismos de clase $C^k$ para todo $\alpha\in\Lambda$, entonces $(U,\para{x})\in\mathcal{A}.$
\end{enumerate}
\end{definicion}

A menos que se indique lo contrario, consideraremos variedades diferenciables conexas, es decir, tales que los únicos subconjuntos abiertos y cerrados simultáneamente son el propio $M^m$ y el conjunto vacío $\emptyset$. 

Los homeomorfismos $\para{x}_\alpha$ son llamados {\defi cartas locales} o {\defi coordenadas locales}, y las funciones $\para{x}_\beta\circ\para{x}^{-1}_{\alpha}$ son llamadas {\defi cambio de coordenadas}. 

Diremos que una aplicación $f:M^m\to N^n$ entre variedades diferenciblaes es {\defi diferenciable} si 
\begin{equation}\label{fdif}
\para{y}_\beta\circ f\circ\para{x}^{-1}_\alpha:\para{x}(U_\alpha\cap f^{-1}(V_\beta))\to \para{y}_\beta(V_\beta\cap f(U_\alpha))
\end{equation}
es una aplicación diferenciable para toda carta local $\para{x}_\alpha:U_\alpha\to\para{x}(U_\alpha)$ de $M^m$ y toda carta local $\para{y}_\beta:V_\beta\to\para{x}(V_\beta)$ de $N^n$ con $f(U_\alpha)\cap V_\beta\neq\emptyset$. Además, diremos que $f$ es de clase $C^k$ si $M^m$ y $N^n$ son variedades diferenciables de clase $C^k$ y toda aplicación $\para{y}_\beta\circ f\circ\para{x}^{-1}_\alpha$ en \eqref{fdif} es de clase $C^k$. Llamaremos {\defi difeomorfismo} a toda biyección $f:M^m\to N^n$ tal que tanto $f$ como $f^{-1}$ son diferenciables, si ambas aplicaciones fueran de clase $C^k$ diremos que el difeomorfismo es de clase $C^k$.

Sea $M^m$ una variedad diferenciable. Para cada $p\in M^m$, consideremos el conjunto $C_p(M^m)$ de todas las curvas $\gamma:I\to M$, donde $I$ es un intervalo abierto que contiene a $0$, tales que $\gamma(0)=p$ y $\gamma$ es diferenciable en el punto $0$, es decir la aplicación $\para{x}_\alpha\circ\gamma$ es diferenciable en el punto $0$, para toda carta local $\para{x}_\alpha:U_\alpha\to\para{x}_\alpha(U_\alpha)$ con $p\in U_\alpha$. Diremos que dos curvas $\gamma_1,\gamma_2$ en $C_p(M^m)$ son equivalentes si $\left.\D\dfrac{d}{dt}(\para{x}_\alpha\circ\gamma_1)(t)\right\vert_{t=0}=\left.\D\dfrac{d}{dt}(\para{x}_\alpha\circ\gamma_2)(t)\right\vert_{t=0}$ para toda carta local $\para{x}_\alpha:U_\alpha\to\para{x}_\alpha(U_\alpha)$. De hecho, si la igualdad vale para una carta local entonces ella vale para cualquier otra, en efecto notemos que dada cualquier otra carta local $\para{x}_\beta:U_\beta\to\para{x}(U_\beta)$ con $p\in U_\beta$, tenemos que

\begin{align}
\left.\D\dfrac{d}{dt}(\para{x}_\beta\circ\gamma_1)(t)\right\vert_{t=0}&=\left.\D\dfrac{d}{dt}((\para{x}_\beta\circ\para{x}^{-1}_\alpha)\circ(\para{x}_\alpha\circ\gamma_1))(t)\right\vert_{t=0}\\
&=\left.\D d(\para{x}_\beta\circ\para{x}^{-1}_\alpha)(\para{x}_\alpha\circ\gamma_1(0))\dfrac{d}{dt}(\para{x}_\alpha\circ\gamma_1)(t)\right\vert_{t=0}\smallskip\\
&=\left.\D d(\para{x}_\beta\circ\para{x}^{-1}_\alpha)(\para{x}_\alpha\circ\gamma_2(0))\dfrac{d}{dt}(\para{x}_\alpha\circ\gamma_2)(t)\right\vert_{t=0}\\
&=\left.\D\dfrac{d}{dt}(\para{x}_\beta\circ\gamma_2)(t)\right\vert_{t=0}.
\end{align}

Representamos por $[\gamma]$ a la clase de equivalencia de cualquier curva $\gamma\in C_p(M^m)$. El espacio tangente a la variedad $M^m$ en el punto $p$ es el conjunto de tales clases de equivalencia, el cual será denotado por $T_pM$. Dada cualquier carta local $\para{x}_\alpha:U_\alpha\to\para{x}_\alpha(U_\alpha)$


\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{chapter}{5.\;\;Bibliografía }
\fancyhead[LE,LO]{Bibliografía}
%\chapter{Bibliografía}
%\renewcommand{\bibname}{Bibliografía}
\begin{thebibliography}{20}
    %\addcontentsline{toc}{chapter}{7. Bibliografía}
    \fancyhead[LE,LO]{Bibliografía}
        
\bibitem{benazic}  Benazic, R. (2007). Tópicos de ecuaciones diferenciales ordinarias. Uni, Perú.
\bibitem{ciesielski} Ciesielski, K. (2012). The Poincaré-Bendixson theorem: from Poincaré to the XXIst century. Central European Journal of Mathematics, 10(6), 2110-2128.
\bibitem{hirsch} Hirsch, M. W., Smale, S., \& Devaney, R. L. (2012). Differential equations, dynamical systems, and an introduction to chaos. Academic press.
\bibitem{palis} Palis, J. J., \& De Melo, W. (1982). Geometric theory of dynamical systems: an introduction. Springer-Verlag.
\bibitem{perko} Perko, L. (2001). Differential equations and Dynamical systems.     
\bibitem{schwartz} Schwartz, A. J. (1963). A generalization of a Poincaré-Bendixson theorem to closed two-dimensional manifolds. American Journal of Mathematics, 453-458.      
\bibitem{sotomayor1979li} Sotomayor, J. (1979). Lic{\~o}es de equac{\~o}es diferenciais ordin{\'a}rias. Instituto de Matem{\'a}tica Pura e Aplicada, CNPq.
\end{thebibliography}
\end{document}

Any idea what to do to get rid of this error?

9
  • 3
    why are you using \def and \bf in a latex document? However the posted code runs without error in texlive 2022. Please show as text the log from the code you post, the screenshot of the error message is clearly from a different document that has \end{align} on line 31 May 4 at 6:42
  • \bf is not defined by default in latex but when it is defined (for compatibility with pre-1993 documents) it does not take an argument, so \bf #1 not \bf{#1} May 4 at 6:47
  • @DavidCarlisle I've already updated the photos to show the actual build, I just extracted the error part in the code. If I remove the align everything works fine, I don't know where the mistake I'm making is. I am compiling in TexMaker.
    – Zaragosa
    May 4 at 6:58
  • 1
    No sorry that is not useful. Do what you are asking others to do, run the code you have posted here, not your original document. There is no error. Do not post screenshots of error messages or code, please always post them as text and post the log of the code you post here. Otherwise it is impossible to guess what your error is. May 4 at 7:02
  • 1
    \def\span{\mathrm{Span}} is the problem.
    – egreg
    May 4 at 7:21

3 Answers 3

3

Now you know why LaTeX has \newcommand and everybody recommends using it instead of \def.

Inside amsmath.sty we find

\def\measure@#1{%
    \begingroup
        [...code that's not of a concern]
            \halign{\span\align@preamble\crcr
        [...code that's not of a concern]
    \endgroup
}

and \measure@ is a very basic function for alignment displays such as align.

You'd incur in the same problem without align, but with the kernel defined \multicolumn command.

You're redefining a primitive command of TeX, something that can be done (and LaTeX does it in some places), but you must know what you're doing. And sorry, but replacing this primitive with “print something in upright type” doesn't fall in this category.

Never use \def, unless you exactly know for sure that this will have no consequences (and such knowledge is quite rare for command names that aren't tailored in a very specific way).

If you want to use “Span” in math mode, do

\DeclareMathOperator{\Span}{Span}

and use \Span. This is safe and correctly uses LaTeX, whereas \mathrm{Span} doesn't.

If you really need \def for macros with delimited arguments, do

\newcommand{\dfunx}{}
\def\dfunx(#1,#2,#3,#4,#5){...}

so you will know whether \dfunx is used by some third party package.

Just in passing: why

\def\para#1{\parax(#1)}
\def\parax(#1){\mathbf{#1}}

instead of the much simpler

\newcommand{\para}[1]{\mathbf{#1}}

which does exactly the same?

You are also defining \D for \displaystyle and use it abundantly where it does nothing at all.

1
  • Thanks for the clear explanation from now on I'll use it so I don't make the same mistake.
    – Zaragosa
    May 4 at 7:51
3

As commented in the first comment under the question (before you posted the code that generated the error) you should use LaTeX constructs not \def so that you are warned if you are redefining TeX constructs.

\span is a TeX primitive that underlies \multicolumn so if you redefine \span you need to redefine every construct using it to use a saved version of the original primitive. That would be, at least

\sp@n from the LaTeX format

\gather@, \align@, \measure@ from amsmath

But even then your document would be likely incompatible with any package making any kind of alignment or array construct.

In practice the solution is to replace

\def\span{\mathrm{Span}}

by

\DeclareMathOperator{\Span}{Span}

then use \Span in your document,

1

I test (using recent MiKTeX) your MWE and it works fine. However, I would not use your \def but rather \mathbf as defined in LaTeX:

\documentclass[12pt,a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage{amsmath}

\begin{document}
\begin{align*}
\left.\dfrac{d}{dt}\bigl(\mathbf{x}_\beta\circ\gamma_1\bigr)(t)\right\vert_{t=0}
    & = \left.\dfrac{d}{dt}\bigl((\mathbf{x}_\beta\circ\mathbf{x}^{-1}_\alpha)
            \circ\mathbf{x}_\alpha\circ\gamma_1\bigr)(t)\right\vert_{t=0}\\
&=\left. d(\mathbf{x}_\beta\circ\mathbf{x}^{-1}_\alpha)(\mathbf{x}_\alpha\circ\gamma_1(0))\dfrac{d}{dt}(\mathbf{x}_\alpha\circ\gamma_1)(t)
\right\vert_{t=0}\\
    & = \left. d(\mathbf{x}_\beta\circ\mathbf{x}^{-1}_\alpha)
            (\mathbf{x}_\alpha\circ\gamma_2(0))
            \dfrac{d}{dt}(\mathbf{x}_\alpha\circ\gamma_2)(t)\right\vert_{t=0}\\
    & = \left.\dfrac{d}{dt}(\mathbf{x}_\beta\circ\gamma_2)(t)\right\vert_{t=0}.
\end{align*}
\end{document}

enter image description here

2
  • Exactly, everyone is right, I compile it separately and there is no error, but when I compile my entire document, I get this strange error. I will put my original code, but I think that the definitions are not the problem since removing that I still get the error.
    – Zaragosa
    May 4 at 7:16
  • @Zaragosa, source of your trouble is preamble. Definition s \def\span{\mathrm{Span}} \def\defi{\it} is cause of problem. Remove them and use LaTeX commands directly in your document. Beside this you hawe othe strang definition in preamble which are out of scope of the your question.
    – Zarko
    May 4 at 7:53

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