LaTeX forum ⇒ Math & ScienceTriangolar Diagram

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

Triangolar Diagram

Postby arkanoid » Fri Feb 13, 2015 12:37 pm

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:

  1. \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:

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


The error is the seguent:

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


here i have my preamble:
  1. \documentclass[oneside,italian]{book}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[latin9]{inputenc}
  4. \setcounter{secnumdepth}{3}
  5. \setcounter{tocdepth}{3}
  6. \usepackage{units}
  7. \usepackage{amsthm}
  8. \usepackage{amsmath}
  9. \usepackage{amssymb}
  10. \usepackage{esint}
  11.  
  12. \makeatletter
  13. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
  14. \numberwithin{equation}{section}
  15. \numberwithin{figure}{section}
  16. \theoremstyle{definition}
  17. \newtheorem*{defn*}{\protect\definitionname}
  18. \theoremstyle{remark}
  19. \newtheorem*{rem*}{\protect\remarkname}
  20.  
  21. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
  22. \usepackage{tikz-cd}
  23.  
  24. \AtBeginDocument{
  25. \def\labelitemi{i}
  26. \def\labelitemii{\(\bigtriangledown\)}
  27. \def\labelitemiv{i)}
  28. }
  29.  
  30. \makeatother
  31.  
  32. \usepackage{babel}
  33. \providecommand{\definitionname}{Definizione}
  34. \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.
Reason: inline code changed to code blocks

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4078
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Feb 18, 2015 11:54 pm

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: 9504
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Feb 23, 2015 4:11 pm

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
Site admin

arkanoid
Posts: 4
Joined: Fri Feb 13, 2015 12:27 pm

Postby arkanoid » Wed Feb 25, 2015 12:07 pm

  1. \documentclass[oneside,italian]{book}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[latin9]{inputenc}
  4. \setcounter{secnumdepth}{3}
  5. \setcounter{tocdepth}{3}
  6.  
  7. \makeatletter
  8. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
  9. \usepackage{tikz-cd}
  10.  
  11. \makeatother
  12.  
  13. \usepackage{babel}
  14. \begin{document}
  15. \begin{tikzcd} A \arrow[rd] \arrow[r, "\phi"] & B \\ & C \end{tikzcd}
  16. \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: 9504
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Feb 25, 2015 3:00 pm

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
Site admin

arkanoid
Posts: 4
Joined: Fri Feb 13, 2015 12:27 pm

Postby arkanoid » Wed Feb 25, 2015 3:08 pm

How can i upgrade that packages?

User avatar
Stefan Kottwitz
Site Admin
Posts: 9504
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Feb 25, 2015 5:55 pm

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
Site admin


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 8 guests