LaTex: \ifnum command

Re: LaTex: \ifnum command

by Colin Fraser -
Number of replies: 0
Picture of Documentation writers Picture of Testers
You are using the correct package, the \ifthen package. It's been a while since I looked at this, but it looks to me like it is returning what it should. You set the value of num=10, so the Num is small. 10 is an even number so it is returning "Even" correctly, and for the last \ifthenelse, you have a num value >3, which is true, then it is =10, therefore the "or" is true as well, both conditions are True, so it's returning a True value to print. The \ifnum appears to be working, so have you tried changing the value of num to 101, which means all repsonses should be different, if the \ifnum is working, of course.

The Using Tex Notation pages were written to provide a quick method of using Tex in Moodle, they weren't designed to build separate PDFs, that's a whole different kettle of tex. The Moodle tex was only there as a quick way of creating formulae in a resource e.g. a page, which would render correctly. It was never intended for anything else, and all the \usepackage inclusions are somewhere, I'm sure, but I have never found them. I do know if you want to use anything other than mimetex, you have to specify the path to your tex install, and if you have that, then you should have something like the TeXworks editor to write complete PDFs.