I want to make a package that has a bunch of commands that I define in all of my Problem Sets. I'm running into an issue where the compiler does not recognize commands that I define that have an argument. Here is a brain-dead simple example of something that isn't compiling and I can't seem to find out why.
This is my style file, aptly named mystyle.sty
:
\ProvidesPackage{mystyle}
\newcommand{\test}{\Huge}
\newcommand{\hding}[1]{#1\newline\normaltext}
mystyle.sty
has two commands in it. \test just makes the text Huge, and \hding
appends a newline and changes the font back to normal. My brain-dead simple .tex
file is as follows:
\documentclass{paper}
\usepackage{mystyle}
\begin{document}
Hello World!
%\hding{Hello World!} Hello World!
\test Hello World!
\end{document}
With just the test function, everything works fine. But if I try to compile with the \hding
function uncommented, the compiler yells at me with the following error:
! Undefined control sequence.
\hding #1->#1\newline \normaltext
l.7 \hding{Hello World!}
Hello World!
What is going on? What am I not understanding?
\normaltext
. Perhaps you're thinking of\textnormal
. And by the way, welcome to TeX.SX! You can have a look at our starter guide to familiarise yourself further with our format.\hding #1->#1\newline \normaltext
) which means that the undefined control sequence is one of the commands used within the definition of\hding
rather than\hding
itself.