I'm trying to add custom blocks in addition to the ones already defined by scratch3

I made a top-level file customblocks.sty that currently contains

\definecolor{customcolor}{RGB}{100, 50, 200}

I just tried my best to copy and modify from the scratch3.sty definitions, which look like:


I import my custom package in my preamble


Then I try to use it later on


But I get lots of errors, I think ultimately caused by

Undefined control sequence.
\ovalcustom ->\scr
l.10 \item \ovalcustom

The control sequence at the end of the top line of your error message
was never \def'ed

How can I actually add more blocks on top of the scratch3 package?

1 Answer 1


At the top of scratch3.sty you'll see a block of code that (mainly) does


and restores it at the end.

that makes _ a letter so that \scr_normalblock is seen as a command with name scr_normalblock

You are using the code in a scope where _ is a math subscript so
\scr_normalblock is \scr _{n} ormalblock looking for an undefined command \scr

  • That makes sense and seems to be what I'm encountering while trying different things in my sty file. So should I copy/paste those relevant definitions from top of scratch3.sty into my file? How much of it is relevant, there are some \long\def... lines following which I cannot follow at all
    – minseong
    Commented Apr 12, 2021 at 19:35
  • @theonlygusti yes it is defing \scr_restorecatcode which you can call right at the end to put everything back to normal. Commented Apr 12, 2021 at 19:47

You must log in to answer this question.

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