Error in tcolorbox Missing endcsname inserted
up vote
0
down vote
favorite
I am trying to a fancy theorem type for my notes. I like tcolorbox examples. But the one that I like most is giving me an error.
Missing endcsname inserted.
This one is on page 360 of the tcolorbox manual. I do not understand why I am getting this error and how to fix. There was a similar question
https://tex.stackexchange.com/questions/174017/compile-error-missing-endcsname-inserted-with-code-and-tcolorbox
But it did not solve my problem. The result should be like this

I have added the code below. Please help me.
documentclass[11pt]{article}
usepackage{varioref}
usepackage{cleveref}
tcbuselibrary{skins}
newtcbtheorem[use counter from=Definition]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
tcolorbox
add a comment |
up vote
0
down vote
favorite
I am trying to a fancy theorem type for my notes. I like tcolorbox examples. But the one that I like most is giving me an error.
Missing endcsname inserted.
This one is on page 360 of the tcolorbox manual. I do not understand why I am getting this error and how to fix. There was a similar question
https://tex.stackexchange.com/questions/174017/compile-error-missing-endcsname-inserted-with-code-and-tcolorbox
But it did not solve my problem. The result should be like this

I have added the code below. Please help me.
documentclass[11pt]{article}
usepackage{varioref}
usepackage{cleveref}
tcbuselibrary{skins}
newtcbtheorem[use counter from=Definition]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
tcolorbox
One obvious point: you're not even loadingtcolorbox.
– marmot
Nov 27 at 2:52
@marmot I am actually loading tcolorbox package I just forgot to put it here
– Kumarm
Nov 27 at 3:03
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to a fancy theorem type for my notes. I like tcolorbox examples. But the one that I like most is giving me an error.
Missing endcsname inserted.
This one is on page 360 of the tcolorbox manual. I do not understand why I am getting this error and how to fix. There was a similar question
https://tex.stackexchange.com/questions/174017/compile-error-missing-endcsname-inserted-with-code-and-tcolorbox
But it did not solve my problem. The result should be like this

I have added the code below. Please help me.
documentclass[11pt]{article}
usepackage{varioref}
usepackage{cleveref}
tcbuselibrary{skins}
newtcbtheorem[use counter from=Definition]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
tcolorbox
I am trying to a fancy theorem type for my notes. I like tcolorbox examples. But the one that I like most is giving me an error.
Missing endcsname inserted.
This one is on page 360 of the tcolorbox manual. I do not understand why I am getting this error and how to fix. There was a similar question
https://tex.stackexchange.com/questions/174017/compile-error-missing-endcsname-inserted-with-code-and-tcolorbox
But it did not solve my problem. The result should be like this

I have added the code below. Please help me.
documentclass[11pt]{article}
usepackage{varioref}
usepackage{cleveref}
tcbuselibrary{skins}
newtcbtheorem[use counter from=Definition]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
tcolorbox
tcolorbox
asked Nov 27 at 2:41
Kumarm
22819
22819
One obvious point: you're not even loadingtcolorbox.
– marmot
Nov 27 at 2:52
@marmot I am actually loading tcolorbox package I just forgot to put it here
– Kumarm
Nov 27 at 3:03
add a comment |
One obvious point: you're not even loadingtcolorbox.
– marmot
Nov 27 at 2:52
@marmot I am actually loading tcolorbox package I just forgot to put it here
– Kumarm
Nov 27 at 3:03
One obvious point: you're not even loading
tcolorbox.– marmot
Nov 27 at 2:52
One obvious point: you're not even loading
tcolorbox.– marmot
Nov 27 at 2:52
@marmot I am actually loading tcolorbox package I just forgot to put it here
– Kumarm
Nov 27 at 3:03
@marmot I am actually loading tcolorbox package I just forgot to put it here
– Kumarm
Nov 27 at 3:03
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
This is too long for a comment. You have several issues:
- you are not loading tcolorbox package
- you need to add
tcbuselibrary{theorems}
- you have not defined
mathbb
- the
use counter from=Definitiondoes not work because you have not defined a definition environment. As per the comments, I have replaced this withno counterto remove the numbering.
The following code compiles and perhaps does what you want:
documentclass[11pt]{article}
usepackage{amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins,theorems}
usepackage{cleveref}
newtcbtheorem[no number]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
The output is:

Edit
To remove both the theorem name and number and just have the box itself, it is better to use newtcolorbox, to give:

Here is the updated code:
documentclass[11pt]{article}
usepackage{amsmath,amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins}
usepackage{cleveref}
newtcolorbox{YetAnotherTheorem}[1]%
{enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=0mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
colbacktitle=yellow!50!white,colback=red!5!white,
title=#1,
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $mathbf{n}$ Variable}
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
In my full document I havetcolorboxloded, I just forgot to put here. I havetheoremsloaded as well. It did not work. When I copy this and create a new document this works.
– Kumarm
Nov 27 at 3:08
1
@Kumarm From your comment it is not clear to me, has this solved your issue? For me I think that theendcsnameerror was caused by theuse counter from=Definition. Perhaps this was your problem? In any case, this was all that I changed in thenewtcbtheoremdefinition.
– Andrew
Nov 27 at 3:18
Yes you are right after replacinguse counter from=Definitionwithnumber within=sectionthis works. However actually I do not want the numbers at all when I deleteuse counter from=Definitionpart it still gives me 1. Can you help me how to get rid of the numbering at all.
– Kumarm
Nov 27 at 3:23
@Kumarm To remove the numbering, replacenumber within=sectionwithno counter. I'll edit my post.
– Andrew
Nov 27 at 3:27
I know that this was the issue because I was just about to post a very similar answer in which just addednewtcbtheorem{Definition}{Theorem}% {colback=white,colframe=red!50!black,fonttitle=bfseries, separator sign={ $blacktriangleright$}}{theo}to solve the issue, this also works. BTW, I'd useboldmathfor the theorem title to make$n$bold as well.
– marmot
Nov 27 at 3:28
|
show 3 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
This is too long for a comment. You have several issues:
- you are not loading tcolorbox package
- you need to add
tcbuselibrary{theorems}
- you have not defined
mathbb
- the
use counter from=Definitiondoes not work because you have not defined a definition environment. As per the comments, I have replaced this withno counterto remove the numbering.
The following code compiles and perhaps does what you want:
documentclass[11pt]{article}
usepackage{amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins,theorems}
usepackage{cleveref}
newtcbtheorem[no number]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
The output is:

Edit
To remove both the theorem name and number and just have the box itself, it is better to use newtcolorbox, to give:

Here is the updated code:
documentclass[11pt]{article}
usepackage{amsmath,amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins}
usepackage{cleveref}
newtcolorbox{YetAnotherTheorem}[1]%
{enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=0mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
colbacktitle=yellow!50!white,colback=red!5!white,
title=#1,
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $mathbf{n}$ Variable}
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
In my full document I havetcolorboxloded, I just forgot to put here. I havetheoremsloaded as well. It did not work. When I copy this and create a new document this works.
– Kumarm
Nov 27 at 3:08
1
@Kumarm From your comment it is not clear to me, has this solved your issue? For me I think that theendcsnameerror was caused by theuse counter from=Definition. Perhaps this was your problem? In any case, this was all that I changed in thenewtcbtheoremdefinition.
– Andrew
Nov 27 at 3:18
Yes you are right after replacinguse counter from=Definitionwithnumber within=sectionthis works. However actually I do not want the numbers at all when I deleteuse counter from=Definitionpart it still gives me 1. Can you help me how to get rid of the numbering at all.
– Kumarm
Nov 27 at 3:23
@Kumarm To remove the numbering, replacenumber within=sectionwithno counter. I'll edit my post.
– Andrew
Nov 27 at 3:27
I know that this was the issue because I was just about to post a very similar answer in which just addednewtcbtheorem{Definition}{Theorem}% {colback=white,colframe=red!50!black,fonttitle=bfseries, separator sign={ $blacktriangleright$}}{theo}to solve the issue, this also works. BTW, I'd useboldmathfor the theorem title to make$n$bold as well.
– marmot
Nov 27 at 3:28
|
show 3 more comments
up vote
1
down vote
accepted
This is too long for a comment. You have several issues:
- you are not loading tcolorbox package
- you need to add
tcbuselibrary{theorems}
- you have not defined
mathbb
- the
use counter from=Definitiondoes not work because you have not defined a definition environment. As per the comments, I have replaced this withno counterto remove the numbering.
The following code compiles and perhaps does what you want:
documentclass[11pt]{article}
usepackage{amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins,theorems}
usepackage{cleveref}
newtcbtheorem[no number]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
The output is:

Edit
To remove both the theorem name and number and just have the box itself, it is better to use newtcolorbox, to give:

Here is the updated code:
documentclass[11pt]{article}
usepackage{amsmath,amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins}
usepackage{cleveref}
newtcolorbox{YetAnotherTheorem}[1]%
{enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=0mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
colbacktitle=yellow!50!white,colback=red!5!white,
title=#1,
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $mathbf{n}$ Variable}
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
In my full document I havetcolorboxloded, I just forgot to put here. I havetheoremsloaded as well. It did not work. When I copy this and create a new document this works.
– Kumarm
Nov 27 at 3:08
1
@Kumarm From your comment it is not clear to me, has this solved your issue? For me I think that theendcsnameerror was caused by theuse counter from=Definition. Perhaps this was your problem? In any case, this was all that I changed in thenewtcbtheoremdefinition.
– Andrew
Nov 27 at 3:18
Yes you are right after replacinguse counter from=Definitionwithnumber within=sectionthis works. However actually I do not want the numbers at all when I deleteuse counter from=Definitionpart it still gives me 1. Can you help me how to get rid of the numbering at all.
– Kumarm
Nov 27 at 3:23
@Kumarm To remove the numbering, replacenumber within=sectionwithno counter. I'll edit my post.
– Andrew
Nov 27 at 3:27
I know that this was the issue because I was just about to post a very similar answer in which just addednewtcbtheorem{Definition}{Theorem}% {colback=white,colframe=red!50!black,fonttitle=bfseries, separator sign={ $blacktriangleright$}}{theo}to solve the issue, this also works. BTW, I'd useboldmathfor the theorem title to make$n$bold as well.
– marmot
Nov 27 at 3:28
|
show 3 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
This is too long for a comment. You have several issues:
- you are not loading tcolorbox package
- you need to add
tcbuselibrary{theorems}
- you have not defined
mathbb
- the
use counter from=Definitiondoes not work because you have not defined a definition environment. As per the comments, I have replaced this withno counterto remove the numbering.
The following code compiles and perhaps does what you want:
documentclass[11pt]{article}
usepackage{amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins,theorems}
usepackage{cleveref}
newtcbtheorem[no number]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
The output is:

Edit
To remove both the theorem name and number and just have the box itself, it is better to use newtcolorbox, to give:

Here is the updated code:
documentclass[11pt]{article}
usepackage{amsmath,amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins}
usepackage{cleveref}
newtcolorbox{YetAnotherTheorem}[1]%
{enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=0mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
colbacktitle=yellow!50!white,colback=red!5!white,
title=#1,
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $mathbf{n}$ Variable}
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
This is too long for a comment. You have several issues:
- you are not loading tcolorbox package
- you need to add
tcbuselibrary{theorems}
- you have not defined
mathbb
- the
use counter from=Definitiondoes not work because you have not defined a definition environment. As per the comments, I have replaced this withno counterto remove the numbering.
The following code compiles and perhaps does what you want:
documentclass[11pt]{article}
usepackage{amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins,theorems}
usepackage{cleveref}
newtcbtheorem[no number]{YetAnotherTheorem}{Theorem}%
{theorem style=change apart,enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
title style={top color=yellow!50!white,bottom color=red!5!white,
middle color=yellow!50!white},
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}{theo}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $n$ Variable}{mittelwertsatz_n2}% Es sei $ninmathbb{N}$, $Dsubseteqmathbb{R}^n$ eine offene Menge und
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
The output is:

Edit
To remove both the theorem name and number and just have the box itself, it is better to use newtcolorbox, to give:

Here is the updated code:
documentclass[11pt]{article}
usepackage{amsmath,amssymb}
usepackage{varioref}
usepackage{tcolorbox}
tcbuselibrary{skins}
usepackage{cleveref}
newtcolorbox{YetAnotherTheorem}[1]%
{enhanced,arc=0mm,outer arc=0mm,
boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
titlerule=0mm,toptitle=0mm,bottomtitle=0mm,top=0mm,
colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
colbacktitle=yellow!50!white,colback=red!5!white,
title=#1,
fonttitle=bfseriessffamilynormalsize,fontupper=normalsizeitshape,
}
begin{document}
begin{YetAnotherTheorem}{Mittelwertsatz f"{u}r $mathbf{n}$ Variable}
$fin C^{1}(D,mathbb{R})$. Dann gibt es auf jeder Strecke
$[x_0,x]subset D$ einen Punkt $xiin[x_0,x]$, so dass gilt
begin{equation*}
f(x)-f(x_0) = operatorname{grad} f(xi)^{top}(x-x_0)
end{equation*}
end{YetAnotherTheorem}
end{document}
edited Nov 27 at 3:44
answered Nov 27 at 2:55
Andrew
29.9k34380
29.9k34380
In my full document I havetcolorboxloded, I just forgot to put here. I havetheoremsloaded as well. It did not work. When I copy this and create a new document this works.
– Kumarm
Nov 27 at 3:08
1
@Kumarm From your comment it is not clear to me, has this solved your issue? For me I think that theendcsnameerror was caused by theuse counter from=Definition. Perhaps this was your problem? In any case, this was all that I changed in thenewtcbtheoremdefinition.
– Andrew
Nov 27 at 3:18
Yes you are right after replacinguse counter from=Definitionwithnumber within=sectionthis works. However actually I do not want the numbers at all when I deleteuse counter from=Definitionpart it still gives me 1. Can you help me how to get rid of the numbering at all.
– Kumarm
Nov 27 at 3:23
@Kumarm To remove the numbering, replacenumber within=sectionwithno counter. I'll edit my post.
– Andrew
Nov 27 at 3:27
I know that this was the issue because I was just about to post a very similar answer in which just addednewtcbtheorem{Definition}{Theorem}% {colback=white,colframe=red!50!black,fonttitle=bfseries, separator sign={ $blacktriangleright$}}{theo}to solve the issue, this also works. BTW, I'd useboldmathfor the theorem title to make$n$bold as well.
– marmot
Nov 27 at 3:28
|
show 3 more comments
In my full document I havetcolorboxloded, I just forgot to put here. I havetheoremsloaded as well. It did not work. When I copy this and create a new document this works.
– Kumarm
Nov 27 at 3:08
1
@Kumarm From your comment it is not clear to me, has this solved your issue? For me I think that theendcsnameerror was caused by theuse counter from=Definition. Perhaps this was your problem? In any case, this was all that I changed in thenewtcbtheoremdefinition.
– Andrew
Nov 27 at 3:18
Yes you are right after replacinguse counter from=Definitionwithnumber within=sectionthis works. However actually I do not want the numbers at all when I deleteuse counter from=Definitionpart it still gives me 1. Can you help me how to get rid of the numbering at all.
– Kumarm
Nov 27 at 3:23
@Kumarm To remove the numbering, replacenumber within=sectionwithno counter. I'll edit my post.
– Andrew
Nov 27 at 3:27
I know that this was the issue because I was just about to post a very similar answer in which just addednewtcbtheorem{Definition}{Theorem}% {colback=white,colframe=red!50!black,fonttitle=bfseries, separator sign={ $blacktriangleright$}}{theo}to solve the issue, this also works. BTW, I'd useboldmathfor the theorem title to make$n$bold as well.
– marmot
Nov 27 at 3:28
In my full document I have
tcolorbox loded, I just forgot to put here. I have theorems loaded as well. It did not work. When I copy this and create a new document this works.– Kumarm
Nov 27 at 3:08
In my full document I have
tcolorbox loded, I just forgot to put here. I have theorems loaded as well. It did not work. When I copy this and create a new document this works.– Kumarm
Nov 27 at 3:08
1
1
@Kumarm From your comment it is not clear to me, has this solved your issue? For me I think that the
endcsname error was caused by the use counter from=Definition. Perhaps this was your problem? In any case, this was all that I changed in the newtcbtheorem definition.– Andrew
Nov 27 at 3:18
@Kumarm From your comment it is not clear to me, has this solved your issue? For me I think that the
endcsname error was caused by the use counter from=Definition. Perhaps this was your problem? In any case, this was all that I changed in the newtcbtheorem definition.– Andrew
Nov 27 at 3:18
Yes you are right after replacing
use counter from=Definition with number within=section this works. However actually I do not want the numbers at all when I delete use counter from=Definition part it still gives me 1. Can you help me how to get rid of the numbering at all.– Kumarm
Nov 27 at 3:23
Yes you are right after replacing
use counter from=Definition with number within=section this works. However actually I do not want the numbers at all when I delete use counter from=Definition part it still gives me 1. Can you help me how to get rid of the numbering at all.– Kumarm
Nov 27 at 3:23
@Kumarm To remove the numbering, replace
number within=section with no counter. I'll edit my post.– Andrew
Nov 27 at 3:27
@Kumarm To remove the numbering, replace
number within=section with no counter. I'll edit my post.– Andrew
Nov 27 at 3:27
I know that this was the issue because I was just about to post a very similar answer in which just added
newtcbtheorem{Definition}{Theorem}% {colback=white,colframe=red!50!black,fonttitle=bfseries, separator sign={ $blacktriangleright$}}{theo} to solve the issue, this also works. BTW, I'd use boldmath for the theorem title to make $n$ bold as well.– marmot
Nov 27 at 3:28
I know that this was the issue because I was just about to post a very similar answer in which just added
newtcbtheorem{Definition}{Theorem}% {colback=white,colframe=red!50!black,fonttitle=bfseries, separator sign={ $blacktriangleright$}}{theo} to solve the issue, this also works. BTW, I'd use boldmath for the theorem title to make $n$ bold as well.– marmot
Nov 27 at 3:28
|
show 3 more comments
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461931%2ferror-in-tcolorbox-missing-endcsname-inserted%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
One obvious point: you're not even loading
tcolorbox.– marmot
Nov 27 at 2:52
@marmot I am actually loading tcolorbox package I just forgot to put it here
– Kumarm
Nov 27 at 3:03