1

I see there is a ton of questions concerning tikz-cd errors already, and I come to join the club because none of these solved my problem. Here is the code:

\documentclass[draft, 12pt, a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[icelandic,english]{babel}
\usepackage{amsmath, amssymb, amsfonts, geometry}
\usepackage{amsthm}
   \theoremstyle{definition}
      \newtheorem{definition}{Definition}
      \newtheorem*{remark}{Remark}
      \newtheorem*{review}{Review}
   \theoremstyle{plain}
      \newtheorem{proposition}{Proposition}
      \newtheorem{theorem}{Theorem}
   \theoremstyle{remark}
      \newtheorem{example}{Example}
\usepackage{mathrsfs}
\usepackage{txfonts}
\usepackage{braket}
\usepackage{hyperref}
   \hypersetup{colorlinks = true}
\usepackage{tikz-cd}
\usepackage{graphicx}

\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\ZC}{\mathbb{C}}
\newcommand{\ZR}{\mathbb{R}}
\newcommand{\CS}{\mathcal{S}}
\newcommand{\PC}{\mathbb{P}_\mathbb{C}}
\newcommand{\ph}{\,\cdot\,}
\newcommand{\op}[1]{\operatorname{#1}}
\newcommand{\covX}{\overline{X}}
\newcommand{\covx}{\overline{x}}
\newcommand{\covf}{\overline{f}}
\newcommand{\covg}{\overline{g}}

\begin{document}

\begin{center}
\begin{tikzcd}
   \covX\arrow[dr,"p"]\arrow[rr,"h"] & & \covX'\arrow[dl,"p'"] \\
   & X &
\end{tikzcd}
\end{center}

\end{document}

And here is the error

! Package pgfkeys Error: I do not know the key '/tikz/"p"'

Now I really can't imagine why this doesn't work, since I believe the standard way of labeling an arrow in tikz-cd is by simply adding the name between double quotes to the list of options of the arrow, as I did; actually, many examples I found around do like that. What is even more intriguing is that I used the same code in a beamer presentation (using a fragile frame) three days ago and it worked without problem! Hence I am quite lost. I suppose something is wrong with my preamble, but I cannot figure out what is wrong or missing.

1
  • 1
    Welcome to TeX.SE!
    – Mensch
    Mar 29 at 18:20

1 Answer 1

2

This fragment of your code inform me that your code tikz-cd work correctly. The problem was the babel icelandic!!! I hold icelandic babel and add \usetikzlibrary{babel}. Thus all the code work correctly.

\documentclass[draft, 12pt, a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,icelandic]{babel}

\usepackage{amsmath, amssymb, amsfonts, geometry}
\usepackage{tikz-cd}
\newcommand{\covX}{\overline{X}}
\usetikzlibrary{babel}

\begin{document}
\begin{center}
\begin{tikzcd}
   \covX\arrow[dr,"p"]\arrow[rr,"h"] & & \covX'\arrow[dl,"p'"] \\
   & X &
\end{tikzcd}
\end{center}

\end{document}

enter image description here

2
  • 1
    Indeed, I see that removing icelandic solves the problem. Unfortunately, I cannot take that out, since it is a shared project. For now I have dropped tikz-cd and started using xy, which doesn't seem to have this problem.
    – Albert
    Mar 29 at 19:09
  • 1
    @Albert Hi, have you seen last my edit of 55 secs ago? I have put \usetikzlibrary{babel} and you can use icelandic babel.
    – Sebastiano
    Mar 29 at 19:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .