I thought it was a great idea to keep a handy shop pencil in the miter slot of my router table or table saw, but it would often threaten to roll away, or just got in the way of one activity or another and I’d end up moving it around. I finally came up with a simple solution that works for me.
I took a hunk of 2×3 and drilled 1/2 inch holes in it, nearly all the way through. I then cut the 2×3 to give me a 1-1/2 in x 1-1/2 in block with a hole in it. These I attached in several places in my shop, one by the tablesaw, one by the router station, two on my mobile work bench and one on my drill press stand.
I realize I could still take the pencil far from its home, but at least it will have a home which is better than on top of my workbench.
-- Ni faru ion el ligno!