Tagged Questions
8
votes
1answer
487 views
Handling \ifnum's “! Missing number, treated as zero.”
Let's say I have a variable, which may - or may NOT - be a number; how can I handle the cases when it isn't a number, without crashing with "! Missing number, treated as zero." ?
In practical terms, ...
3
votes
1answer
145 views
How to compare two dates using TeX primitives
This is a follow up to TeX capacity exceeded while parsing a date string
I want to compare two dates, say today's date and a due date. I have the due date information stored (as number strings) in ...
6
votes
2answers
941 views
LaTeX: Use command argument in conditional?
I'm in the process of writing a command that outputs a certain text only if its argument is a nonzero number. I'd like to be able to write something like:
\newcommand{mycommand}[1]{
\if{#1 != 0}
Some ...
4
votes
2answers
502 views
Compare a character to a character code?
How can one compare a character (e.g. "U") with a character code in a certain font (e.g. "\char85").
I'd expect the following to work:
\documentclass{article}
\usepackage{ifthen}
\begin{document}
...