Lyx doesn't compile a kth root

A LyX document I wrote won't compile after I added in a mathematical formula the command root (in fact, \root[k]{\alpha}). I would have written you the code, but the document is long (over than 20 pages), so it would be too much. Any ideas on how to solve it?

Edit:

The specific line is:

Let $\alpha\in\mathbb{R}$. Then
$\sqrt[k]{\alpha}$

And the error message is:

"A number should have been here; I inserted 0'.
(If you can't figure out why I needed to see a number,
look up weird error' in the index to The TeXbook.)"

Edit 2:

Here is the problematic part, I created a new document and this one doesn't compile on LyX.]

%% Do not edit unless you really know what you are doing.
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2.54cm,bmargin=2.54cm,lmargin=3.18cm,rmargin=3.18cm}
\usepackage{mathrsfs}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}[section]
\theoremstyle{definition}
\newtheorem{defn}[thm]{\protect\definitionname}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{bbold}
\DeclareSymbolFont{bbold}{U}{bbold}{m}{n}
\DeclareSymbolFontAlphabet{\mathbbold}{bbold}
\setcounter{section}{-1}
\renewcommand{\raise}[2]{#1^#2}

\makeatother

\usepackage{babel}
\providecommand{\definitionname}{Definition}
\providecommand{\theoremname}{Theorem}

\begin{document}

\title{Try}

\maketitle
\global\long\def\layer#1#2{\overset{\left[#2\right]}{}#1}
\global\long\def\ELT#1#2{\mathscr{R}\left(#2,#1\right)}

\begin{defn}
Let $R=\ELT{\mathbb{R}}{\mathbb{C}}$, and take $\alpha=\layer a{\ell}\in R$
and $k\in\mathbb{N}$. Then $\sqrt[k]{\alpha}$.\end{defn}

\end{document}
• Welcome to TeX.SX! The command to create a square root sign is \sqrt, not \root. And a general comment: example code for questions should always be as short as possible. That means you should make a copy of your document, and remove everything that doesn't influence whether the error occurs or not. In some cases you may need to go through some trial and error, but in this case you could probably have removed everything but a single equation containing the command. It's also helpful to report the entire error message that you get. – Torbjørn T. Jan 19 '15 at 15:13
• Thanks @TorbjørnT. both for your help and your advice. I will write as you suggested (and will now edit to show the code), but I need the (k)-th root rather than a square root... – Guy Jan 19 '15 at 15:18
• We need an MWE! We can't guess what is happening. The MWE I prepared in order to help you works just fine: \documentclass{article}\usepackage{amsfonts} \begin{document}Let $\alpha\in\mathbb{R}$. Then $\sqrt[k]{\alpha}$\end{document} – LaRiFaRi Jan 19 '15 at 15:28
• @Guy the command is \sqrt even for the kth root. – David Carlisle Jan 19 '15 at 15:29
• @DavidCarlisle this command returns the same error... – Guy Jan 19 '15 at 15:39

You have redefined the the internal command \raise used for moving boxes up and down. Such boxes typically contain characters to typeset. This is used in the optional argument of the \sqrt command to get the symbol at an appropriate height, and in many other places in LaTeX. In fact, I am surprised that nothing else in your document triggered the error. Removing your redefition of \raise, gives a file that compiles without errors.


> \raise=\raise.

indicating that it is a primitive. In comparison \show\sqrt gives

> \sqrt=macro:
->\protect \sqrt  .

demonstrating that \sqrt is a macro, whereas \show\myundefinedcommand gives

> \myundefinedcommand=undefined.

Other methods for unravelling command definitions are discussed in the questions