TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I write a line of text at a given column? I'm using a monospace font and I have interest in how can I can specify a column number to start from there. For example:

Line started at column zero
    Line started at column five 
        Line started at column nine

I only found how to specify an horizontal space in LaTeX units but not in columns. This question comes to my mind playing with a code chunk that I have in a listing environment from where I found that I could insert normal text at an exact column position

    |@Efectively this line start at five position@|

The |@ and@| are my escape characters. Then I ask myself can I do the same without listing?

share|improve this question

You can use the tabbing environment for this:

This is at the right margin\\
\>This is at the first tab stop\\
\>\>This is at the second tab stop\\
\>\>\>This is at the third tab stop\\

enter image description here

share|improve this answer
Is 1em exactly two tt-font characters wide? It looks like it from your image. – Martin Scharrer May 17 '11 at 23:53

A rudimentary version of a command allowing you to specify the indentation as a value depending on the width of a character in mono-spaced font:




\StCol{Line started at column zero}\\
\StCol[4]{Line started at column five}\\
\StCol[8]{Line started at column nine}


share|improve this answer
The \settowidth should be in the \StCol macro so that different font sizes are taken into account. Alan Munn's answer makes me think that .5em is one tt-font character wide. If this is the case #1\mylen count be replaced by #1\dimexpr .5em\relax. – Martin Scharrer May 17 '11 at 23:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.