Math & ScienceTriangolar Diagram

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
arkanoid
Posts: 4
Joined: Fri Feb 13, 2015 12:27 pm

Triangolar Diagram

Post by arkanoid »

Hi everybody.
It's the first time that i write i this forum so i hope i've choose the right topic.
I'm writing my math-thesis using latex.
I've to create a triangolar diagram to show the composition law of three functions.
So i use this code:

Code: Select all

\begin{tikzcd}[column sep=small] & S^{'} \arrow[dl,dashrightarrow] \arrow[dr] & \\ S \arrow{rr} & & C \end{tikzcd}


but the program produces an error when i insert the code to label the arrow:

Code: Select all

\begin{tikzcd}[column sep=small] & S^{'} \arrow[dl,dashrightarrow,"\epsilon"] \arrow[dr] & \\ S \arrow{rr} & & C \end{tikzcd}
The error is the seguent:

Code: Select all

! Undefined control sequence.
\it@cwm  ->\let \it@@next 
                          \relax \ifcat \noexpand \it@temp a\def \it@@next {...
l.395 ...[dr] & \\ S \arrow{rr} & & C \end{tikzcd}
                                                  
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
here i have my preamble:

Code: Select all

\documentclass[oneside,italian]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{units}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{esint}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}
 \theoremstyle{definition}
 \newtheorem*{defn*}{\protect\definitionname}
  \theoremstyle{remark}
  \newtheorem*{rem*}{\protect\remarkname}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{tikz-cd}

\AtBeginDocument{
  \def\labelitemi{i}
  \def\labelitemii{\(\bigtriangledown\)}
  \def\labelitemiv{i)}
}

\makeatother

\usepackage{babel}
  \providecommand{\definitionname}{Definizione}
  \providecommand{\remarkname}{Osservazione}
Can someone tell help me to find the error?
STRANGE FACT:
I've copied only the diagram text with the label code \epsilon in a new file and it works???? Are there some packages that create the error?
I've found that setting the language to english instead of italian all works. When i change language, i use italian, there is the extra babel package. i think the problem is this but i cannot say why.
Any ideas?
Last edited by Stefan Kottwitz on Fri Feb 13, 2015 2:22 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Triangolar Diagram

Post by Johannes_B »

Hi and welcome, can you extend the code you have been posting to a fully compilabel example? It is easier this way to reproduce an error and give a perfect testing suite.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Triangolar Diagram

Post by Stefan Kottwitz »

Welcome to the forum!

I tested both tikz-cd drawings with your whole preamble. It worked fine. There was no error. And this preamble still is Italian.

Perhaps post a Infominimal working example which brings that error when compiled. The cause of the error is somewhere, but not in the code above.

Stefan
LaTeX.org admin
arkanoid
Posts: 4
Joined: Fri Feb 13, 2015 12:27 pm

Triangolar Diagram

Post by arkanoid »

Code: Select all

\documentclass[oneside,italian]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{tikz-cd}

\makeatother

\usepackage{babel}
\begin{document}
\begin{tikzcd} A \arrow[rd] \arrow[r, "\phi"] & B \\ & C \end{tikzcd} 
\end{document}
This code gives me the error. If i delete the part "\phi" it works. I don't know what is the problem.

here the error message:

... \arrow[r, "\phi"] & B \\ & C \end{tikzcd}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Triangolar Diagram

Post by Stefan Kottwitz »

This is a very good minimal example! I tested it. It works fine on my system with TikZ 3.0.

You are using a handy quoting syntax for the labels, which has been introduced in TikZ 3.0 and got support in tikz-cd as well. But I think you are using an older version. So an update of the pgf and tikz-cd packages should solve the problem.

Stefan
LaTeX.org admin
arkanoid
Posts: 4
Joined: Fri Feb 13, 2015 12:27 pm

Re: Triangolar Diagram

Post by arkanoid »

How can i upgrade that packages?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: Triangolar Diagram

Post by Stefan Kottwitz »

You got a package manager, both with MikTeX and TeX Live, which you can use.
Open it, search the package, click and choose update.

Stefan
LaTeX.org admin
Post Reply