Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Suppose I am writing a novel using the book class, in which a correspondence from the hero to the heroine needs to be embeded, like this:

Dear Marie,

I miss you very much, I'll come home in a week.

Yours,

Joseph

How can this be done?

share|improve this question
5  
Can you be more specific in your question? It's nice to know how you write a letter. But what is your problem? –  Dave Apr 27 '13 at 9:42
    
Hi CravingSpirit and welcome to TeX.sx. In its current form, your question might not receive many answers. Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. This may require you to show some effort on your part in terms of attempting a solution. If you have questions about what to do or if you don't quite understand what this means, please ask for clarification using the add comment function. –  Jubobs Apr 27 '13 at 9:50
2  
Welcome to TeX.sx! If you're trying to typeset a letter, you can use, for instance, the letter class (see here) or the more advanced scrlettr class. –  Jubobs Apr 27 '13 at 9:51
    
I have edited the question, thanks! –  qed Apr 27 '13 at 11:58
2  
If your question is literally about inserting a letter into a document then Change document class per page is a duplicate and shows you how to do this. But in the context of writing a novel, I don't think this is what you want, so perhaps your question is simply about how best to create a letter environment within the novel that sets the letter text off from the rest of the novel. Is that your question? –  Alan Munn Apr 27 '13 at 13:11
add comment

3 Answers 3

For some letter that easy, you can also stick to the quote environment as a base:

\documentclass{article}
%xetex specific ---- replace by any other font setting command depending on your engine
\usepackage{fontspec}
\newfontfamily{\letterfont}{Comic Sans MS}

\usepackage{lipsum}
\usepackage{environ}
\NewEnviron{letter}{%
\begin{quote}
\fbox{%
\begin{minipage}{\linewidth}
\setlength{\parskip}{\baselineskip}
\letterfont
\BODY
\end{minipage}
}
\end{quote}
}

\begin{document}
\lipsum[1-2]
\begin{letter}
Dear Marie,

I miss you very much, I'll come home in a week.

Yours,

Joseph
\end{letter}
\lipsum[3-4]


\end{document}

enter image description here

PS: I used XeLaTeX and the fontspec package for font setting. But you can replace my definition of \letterfont with any other font setting command, that you can use with your engine.

share|improve this answer
    
+1 for not over-complicating things. –  Sean Allred Apr 28 '13 at 14:50
add comment

You can write your letter with, for example, the letter class :

\documentclass{letter}
\signature{Your name}
\address{Street \\ City \\ Country}
\begin{document}
\begin{letter}{Company name \\ Street\\ City\\ Country}
\opening{Dear Sir or Madam:}
\dots
\closing{Yours Faithfully,}
\ps{P.S. Here goes your ps.}
\encl{Enclosures.}
\end{letter}
\end{document}

(example from texblog.org)

and then include the pdf outpout in your main document using the pdfpages package :

\documentclass{article}

\usepackage{pdfpages}

\begin{document}

\includepdf[pages=-,
            pagecommand=\thispagestyle{fancy}
            %if you want to have headers and footers in the included pdf pages
]{my_lettre.pdf}

\end{document}
share|improve this answer
    
That's nice. But what if the letter is a short one and not suitable for occupying a whole page? –  qed Apr 27 '13 at 12:30
    
Welcome to TeX.sx! –  Peter Jansson Apr 27 '13 at 12:36
    
If it is a very short letter as your example, you can shape it manually in your main document with locally increasing spacing... It depends of the formating you need. –  Namrod Apr 27 '13 at 13:55
add comment

Assuming you are using pdfTeX, there's a decently easy (although roundabout) way of doing this using \includegraphics and pdfcrop (standard with at least TeX Live)

\documentclass{letter}

\begin{document}
\signature{Joseph}

\begin{letter}{}

\opening{Dear Marie,}
I miss you very much, I'll come home in a week.
\closing{Yours,}
\end{letter}
\end{document}

and then pdfcrop letter.pdf, which produces letter-crop.pdf which you can include thusly

\documentclass{book}
\usepackage{graphicx,mwe}

\begin{document}
\lipsum[1]

\begin{center}
  \includegraphics[width=.9\textwidth]{letter-crop}
\end{center}

\lipsum[2]
\end{document}

for the output

output

share|improve this answer
add comment

Your Answer

 
discard

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.