TransWikia.com

Massive error in tikz-cd in 3 lines of code. Help!

TeX - LaTeX Asked by Norman on May 6, 2021

I have 3 lines of code that is supposed to say "This is a very important equation" downarrow $x = 123$

documentclass{article} 
usepackage{tikz-cd} 
begin{document}

begin{tikzcd}
                 This is a very important equation
                 arrow[blue]{d}
                 $x = 123$ 
end{tikzcd} 
end{document}

But I have received a tons of error just trying to get this simple line to work. The text is not printed correctly and the equation throws me an error.

How do I solve this problem?

One Answer

Everything inside a tikzcd environment is already in math mode, so you don't need (and can't have) $...$ inside it. Cascading errors are common in TeX. Usually only the first error encountered is really relevant.

Since math mode isn't designed for writing text, I've added amsmath and used its text macro for the first line.

documentclass{article} 
usepackage{tikz-cd}
usepackage{amsmath}
begin{document}

begin{tikzcd}
    text{This is a very important equation}
    arrow[blue]{d}
     x = 123
end{tikzcd} 
end{document}

output of code

Correct answer by Alan Munn on May 6, 2021

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