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.

I would like to include ~20 emails in the appendix section of an article, so I in the article can e.g. write "...according to \ref{email1}".

If I put each email in a subsection, then I have to find a name for each of them, which I don't really want.

Each email is enclosed in \begin{verbatim} \end{verbatim}.

Is there a way to \ref these emails?

share|improve this question
    
You presumably need some kind of heading or tag so the cross reference has some visible reference to the email? If so you could just use \label as normal? –  David Carlisle Jan 29 '13 at 22:25
    
Yes, something like that would be great. A bit like how equations work with \label and \ref. –  Sandra Schlichting Jan 29 '13 at 22:40
    
But what I mean is your question isn't clear. A verbatim on its own has nothing (in the final output) to use as a reference, but if they are titled or numbered or marked in any way then most likely \label would just work. You probably need to give more indication of the required result –  David Carlisle Jan 29 '13 at 22:57

1 Answer 1

up vote 8 down vote accepted
\documentclass{article}
\usepackage{verbatim}

\newcounter{quotedemail}
\newenvironment{quotedemail}[1]
 {\refstepcounter{quotedemail}\label{#1}%
  \subsubsection*{Email message \thequotedemail}
  \verbatim}
 {\endverbatim}

\begin{document}
As we read in the quoted email message \ref{email1} ...

\begin{quotedemail}{email1}
From: foo@bar.baz
To: Sandra

Got it!

foo
\end{quotedemail}

\end{document}

enter image description here

share|improve this answer

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.