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

I'm trying to make a letter template (I don't want to use the existing one) and I am trying to make an environment for the adress at the top. I want it to be a certain width and located to the right part of the page, but aligned left.

I can not figure out how to do it. Creating custom layouts and templates overall in LaTeX has brought me much headache.

I tried to do something like this:


But it doesn't work. :/

share|improve this question

It doesn't work because of many facts. First of all, TeX uses only one value for \leftskip, precisely what is current at the end of the paragraph. Secondly, your definition hides the value given to \leftskip, because every environment forms a group: so when TeX finds the end of the paragraph, it will have already forgotten the setting to \leftskip. If you want to typeset a paragraph with a non zero \leftskip you should define


The first \par ends the previous text; then we set \leftskip and then apply \noindent (which requires \ignorespaces to ignore the end of line after \begin{head}).

At the end we issue \par to end the paragraph which will be typeset with the stated setting of \leftskip. There's no need to reset \leftskip to zero, because that's already taken care of by the end of the implicit group formed by the environment.


It's better to stick to \setlength, because \leftskip is a glue parameter; there's an example in the TeXbook: try and define


and write

minuscule chances of error

You'll have a surprise. :)

share|improve this answer

The minipage is your friend

  Address \\
goes here and is\\

As an environment:


This of course assumes that \linewidth is actually defined. You could always just put in an explicit width if you prefer...

share|improve this answer

Your question was answered already in Set width of `algorithm` environment (preferably document wide). It is simply using minipages.

The final code should look something like this:


First line and yeah, the head is right aligned.\\
A second line to show the text inside is left aligned.
Well, here comes the rest of the letter.
share|improve this answer
Great stuff, thanks a lot. – Etabeeta Jul 4 '11 at 16:32

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.