0

Goodnight everyone.

I am trying to define new colors to use in a tcolorbox environment. Such definitions are in the preamble of the document.

When I go to use "ama" color (the last ones that I have define) it throws me the following error: "Paragraph ended before \XC@definec@lor was complete" (line 16)

What I interpret is that the definition of the color "ama" is not being read to me, since it also throws me the error "Package xcolor Error: Undefined color `ama'. ...=dark blue,colback=ama,title=Graphic I ]" in the line where I put the tcolorbox with the color (line 20)

I've been able to recreate the error with smaller code so you can see it.

I can upload an image in which the previous lines of code are marked if they consider it necessary.

I have updated the packages (and checked for updates) in MikTeX. The text editor I use is TexStudio.

\documentclass[12pt,a4paper]{article}
\usepackage[x11names]{xcolor}
\usepackage[listings,theorems,skins,most]{tcolorbox}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}


%colors defined by me
\definecolor{naranja}{RGB}{247, 159, 80}
\definecolor{azul}{HTML}{39B0FD}  
\definecolor{azuloscuro}{HTML}{344D67}
\definecolor{rojito}{HTML{DC3535}
\definecolor{ama}{HTML}{F3ECB0}

\begin{document}

\begin{minipage}{0.5\textwidth}
    \begin{tcolorbox}[colframe=azuloscuro,colback=ama,title=Gráfico I]
        \begin{tikzpicture}
            \draw [help lines,gray] (0,0) grid (8,10);
            \draw [-stealth,ultra thick] (0,0) -- (0,10.3) node[above]{$y$};
            \draw [-stealth,ultra thick] (0,0) -- (8.3,0) node[right]{$x$};
            \foreach \y in {2,...,6}{\draw [line width=0.5mm,-stealth,yscale=0.2,domain=0:8,samples=100,red] plot (\x,{\x*\y});}
        \end{tikzpicture}
    \end{tcolorbox}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
    text only text only text only text only hello text only nly text only text only text only hello text only nly text only text only text only hello text only nly text only text only text only hello text only nly text only text only text only hello text only nly text only text only text only hello text onlynly text only text only text only hello text onlynly text only text only text only hello text onlynly text only text only text only hello text only
    \[ f(x)=\begin{cases}
        \sqrt{x^2-9} & \mbox{si} \ \ -9<x\leqslant-3 \\
        4|x-3|-1 & \mbox{si} \ \ -3<x<4 \\
        2x\mbox{sgn}(x^2-2) & \mbox{si} \ \ 5\leqslant x \leqslant 9 \\[0.2cm]
        \displaystyle \frac{6x-1}{x-9} & \mbox{si} \ \ x>9 \\ 
    \end{cases}\]
\end{minipage}

\end{document}```

1 Answer 1

1

The error is

Runaway argument?
{HTML{DC3535} \definecolor {ama}{HTML}{F3ECB0} 
! Paragraph ended before \XC@definec@lor was complete.
<to be read again> 
                   \par 
l.16 
     
?

as you are missing } in {HTML

fix line 14 to

  \definecolor{rojito}{HTML}{DC3535}

It is then error free but perhaps you need to adjust the widths

enter image description here

1
  • Thank you very much, sorry for being so clueless. I promise to be more responsible when reviewing the code. As for the scale of the graph, in my document it comes out perfect, I think it is a problem with this page.
    – Mathboy
    Commented Dec 1, 2022 at 12:11

You must log in to answer this question.

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