I have not been using latex in a while and I would like to try to implement the tips & tricks given in this video during the TUG conference by Jean Luc Doumont : http://www.youtube.com/watch?v=vkBCeOBbAmM
I tried to implement the first trick: xy positioning
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\begin{document}
\def\xy#1#2#3{\setbox0=\hbox to\z@{%
\kern#1\raise#2\hbox{#3}\hss}%
\ht0=\z@\dp0=\z@\box0}
%testing the command
\xy 1 5 b
\end{document}
unfortunately I get the following error log
! Undefined control sequence.
\xy #1#2#3->\setbox 0=\hbox to\z
@{\kern #1\raise #2\hbox {#3}\hss }\ht 0=\z...
l.29 \xy 1 5 b
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
@
l.29 \xy 1 5 b
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
@
l.29 \xy 1 5 b
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing { inserted.
<to be read again>
@
l.29 \xy 1 5 b
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
(If you're confused by all this, try typing `I}' now.)
! Illegal unit of measure (pt inserted).
<to be read again>
\raise
l.29 \xy 1 5 b
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\hbox
l.29 \xy 1 5 b
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Undefined control sequence.
\xy ...{\kern #1\raise #2\hbox {#3}\hss }\ht 0=\z
@\dp 0=\z @\box 0
l.29 \xy 1 5 b
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
@
l.29 \xy 1 5 b
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
@
l.29 \xy 1 5 b
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Undefined control sequence.
\xy ...raise #2\hbox {#3}\hss }\ht 0=\z @\dp 0=\z
@\box 0
l.29 \xy 1 5 b
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
@
l.29 \xy 1 5 b
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
@
l.29 \xy 1 5 b
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing } inserted.
<inserted text>
}
l.32 \end{document}
and I can't figure out what is the mistake since I never programmed macros before.
\makeatletter
and\makeatother
. See What do \makeatletter and \makeatother do for detailspicture
environment with its\put
macro.