Question: The following illustration of a generic box appears on p. 63 of the TeXbook:

[![A generic box](https://i.stack.imgur.com/OYHsW.png)](https://i.stack.imgur.com/OYHsW.png)

What is a box's reference point in the following pathological cases?

1. The box has either (a) no width, or (b) no height and no depth, or (c) both a and b?
2. The box has a positive width and either a positive height or a positive depth (or both), which were not explicitly assigned but calculated automatically, and one of the following cases holds.

	1. The box doesn't contain sub-boxes (but may contain other elements, e.g. glue)?
	2. The box contains at least one sub-box, but some of the sub-boxes -- possibly all of them! -- is shifted to the left or to the right, or raised or lowered?

Answer: 
Every box has height width and depth (any of which may be zero or negative) the reference point is by definition the point from which these lengths are measured. The box containing other boxes or not has no bearing on that.

Note that the height depth and width are *assignable* properties and need bear no relationship to the box contents.

If `\box0` contains some content then after

```
\ht0=5pt
\dp0=6pt
\wd0=7pt

```

the height depth and width of box 0 will be 5pt 6pt and 7pt. In horizontal mode, the box will be positioned such that its reference point is placed at the current position, and the current position will move 7pt to the right (whatever the box contents). Similarly in vertical mode the box will be placed with baselineskip glue from the previous box calculated from the previous depth and the nominal 5pt height.

---

If you do not assign the box dimensions then they will be set depending on the box contents.

if set using `\vbox` the reference point of the box is at the left edge, at the vertical position of the last box in its content (with some details to be filled in if the last item is not a box or has over-large deoth)

If set using vtop the reference point is at the left edge at the height of the reference point of the first item of the content if it is a box, or at the top of the outer box otherwise.

For \vcenter it is a at the left edge of the box positined such that placing the reference point on teh baseline centres the box on the math axis.
There are only a few ways to create boxes in TeX, and each of them has a well-defined notion of where the reference point ends up. See page 222 of *The TeXbook* (part of *Chapter 21: Making Boxes*):

> 
> Now let’s summarize all of the ways there are to specify boxes explicitly to TeX. (1) A character by itself makes a character box, in horizontal mode; this character is taken from the current font. (2) The commands `\hrule` and `\vrule` make rule boxes, as just explained. (3) Otherwise you can make hboxes and vboxes, which fall under the generic term ⟨box⟩. A ⟨box⟩ has one of the following seven forms:
> 
> 
> `\hbox`⟨box specification⟩`{`⟨horizontal material⟩`}` (see Chapter 12)  
> 
> `\vbox`⟨box specification⟩`{`⟨vertical material⟩`}` (see chapter 12)  
> 
> `\vtop`⟨box specification⟩`{`⟨vertical material⟩`}` (see Chapter 12)  
> 
> `\box`⟨register number⟩ (see Chapter 15)  
> 
> `\copy`⟨register number⟩ (see Chapter 15)  
> 
> `\vsplit`⟨register number⟩`to`⟨dimen⟩ (see Chapter 15)  
> 
> `\lastbox` (see Chapter 21)
> 
> 
> […]
> 
> 
> In math modes an additional type of box is available: `\vcenter`⟨box specification⟩{⟨vertical material⟩} (see Chapter 17).
> 
> 
> 

For each of these, there is a well-defined procedure for where the reference point ends up, based on the reference points of its constituents. Characters from a font already come w.r.t. a reference point. For the others, it's best to see this in pictures (taken from *A Beginner's Book of TeX*'s *Chapter 8: Boxes*, which I recommend reading):

[![hbox](https://i.stack.imgur.com/YWSmZ.png)](https://i.stack.imgur.com/YWSmZ.png)

[![vbox etc](https://i.stack.imgur.com/rW89n.png)](https://i.stack.imgur.com/rW89n.png)

While creating the box, you can specify the width to be positive or zero or negative (instead of letting TeX compute them from the things you put inside it). You can raise or lower boxes. You can explicitly assign the width or height or depth of a box, to change them. But in all cases the behaviour is predictable and well-defined, so the answer is just: the reference point is wherever you asked TeX to put it. :-) If you know how you made the box, you'll also know where its reference point is.