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 have some plain text results that I want to include into my bachelor thesis. The output looks like this:

Protein: noname Length:  611 N-terminus: OUT  Number of transmembrane
helices: 3 Transmembrane helices: 518-537 546-563 578-602 

Total entropy of the model:  17.0163 Entropy of the best path: 
17.0176

The best path:

     seq  KDAPDIDCHA INSEQENCEQ VQLQQPGAEL VKPGASVKLS CKASGYTFTS    50
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  DWIHWVKQRP GHGLEWIGEI IPSYGRANYN EKIQKKATLT ADKSSSTAFM   100
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  QLSSLTSEDS AVYYCARERG DGYFAVWGAG TTVTVSSAKT TPPSVYPLAP   150
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  GSAAQTNSMV TLGCLVKGYF PEPVTVTWNS GSLSSGVHTF PAVLQSDLYT   200
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  LSSSVTVPSS SWPSETVTCN VAHPASSTKV DKKIVPRDKD PDIDCHAINS   250
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  EQENCEDILL TQSPAILSVS PGERVSFSCR ASQSIGTDIH WYQQRTNGSP   300
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  RLLIKYASES ISGIPSRFSG SGSGTDFTLS INSVESEDIA NYYCQQSNRW   350
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  PFTFGSGTKL EIKRADAAPT VSIFPPSSEQ LTSGGASVVC FLNNFYPKDI   400
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  NVKWKIDGSE RQNGVLNSWT DQDSKDSTYS MSSTLTLTKD EYERHNSYTC   450
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  EATHKTSTSP IVKSFNRNKD CPDIDCHAIN SEQENCEMAP MLSGLLARLV   500
     pred OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO OOOOOOOOOO 

     seq  KLLLGRHGSA LHWRAAGAAT VLLVIVLLAG SYLAVLAERG APGAQLITYP   550
     pred OOoooooooo oooooooHHH HHHHHHHHHH HHHHHHHiii iiiiiHHHHH 

     seq  RALWWSVETA TTVGYGDLYP VTLWGRCVAV VVMVAGITSF GLVTAALATW   600
     pred HHHHHHHHHH HHHooooooo oooooooHHH HHHHHHHHHH HHHHHHHHHH 

     seq  FVGREQERRG H  611
     pred HHiiiiiiii i

I just don't want it to look like normal text as the reader should see immediately that this is something different. I guess I could somehow use lstlisting, the theorem package or figure, but is there a best practice for such a problem?

share|improve this question
1  
Have you considered using the Verbatim environment and adding a bit of styling? –  Sam Whited Feb 27 '13 at 15:02
1  
Welcome to TeX.SX. –  Claudio Fiandrino Feb 27 '13 at 15:13
    
@SamWhited I didn't know that environment, but it's perfect! Thx! –  ExpectoPatronum Feb 27 '13 at 15:44
    
@ExpectoPatronum Great; I'll submit as an answer :) –  Sam Whited Feb 27 '13 at 15:45
    
@ExpectoPatronum See my answer to "how to include data from a .txt". –  nnunes Feb 27 '13 at 16:04
show 2 more comments

3 Answers

up vote 5 down vote accepted

Try the verbatim or Verbatim environment (the second requires the fancyvrb package).

\documentclass{article}

\begin{document}
  \begin{verbatim}
  This is a large block of preformatted text.
   Line breaks, spaces, etc. will be preserved.
    It is roughly equivalent to the <pre /> HTML tag,
   and you can even write \LaTeX commands directly
  without fearing that they will ever be expanded.
  \end{verbatim}
\end{document}
share|improve this answer
add comment

Another option, which may or may not be to your tastes, is to use the listings package. I use it to incorporate source code into my documents. It has nifty features that you won't need like syntax highlighting, but it does take your text, offset it into a box, number the lines, and use a fixed-width font. The added benefit is that it can point to an external text file, so if you change your results you won't have to cut and paste back into your document. The use is fairly straightforward:

\usepackage{listings}

\lstinputlisting[frame=single]{../whatever.txt}

More information can be found here: wikibooks

Hope you find this useful.

edit: I should also note that this package is extremely useful if your output spans multiple pages.

share|improve this answer
1  
Welcome to TeX.sx! –  Peter Jansson Feb 27 '13 at 18:34
add comment

Here's a mild option that might be of interest:

enter image description here

\documentclass{article}
\usepackage{etoolbox,xstring}% http://ctan.org/pkg/{etoolbox,xstring}
\newcommand{\seqname}{\normalfont seq}\newcommand{\predname}{\normalfont pred}
\newcounter{seqcount}%
\newlength{\seqpredsep}\setlength{\seqpredsep}{\jot}
\newenvironment{predseq}[1]
  {\setcounter{seqcount}{0}%
   \tabular{l*{#1}{@{\hspace*{.5\tabcolsep}}l}r}}% \begin{predseq}{<num>}
  {\\[-\seqpredsep]\endtabular}% \end{predseq}
\newcommand{\seq}[1]{% \seq{..,..,..,...}
  \gdef\do##1{%
    \StrLen{##1}[\tmpcount]% capture sequence length
    \addtocounter{seqcount}{\tmpcount}% increase sequence counter
    & ##1}%
  \seqname\hspace*{\tabcolsep} \docsvlist{#1} & \theseqcount \\%
}
\newcommand{\pred}[1]{% \pred{..,..,..,...}
  \gdef\do##1{& ##1}%
  \predname\hspace*{\tabcolsep} \docsvlist{#1} \\[\seqpredsep]%
}
\begin{document}
\small\ttfamily
\begin{predseq}{5}
  \seq{KDAPDIDCHA,INSEQENCEQ,VQLQQPGAEL,VKPGASVKLS,CKASGYTFTS}
  \pred{OOOOOOOOOO,OOOOOOOOOO,OOOOOOOOOO,OOOOOOOOOO,OOOOOOOOOO}
  \seq{DWIHWVKQRP,GHGLEWIGEI,IPSYGRANYN,EKIQKKATLT,ADKSSSTAFM}
  \pred{OOOOOOOOOO,OOOOOOOOOO,OOOOOOOO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LAVLAERG,APGAQLITYP}
  \pred{OOoooooooo,oooooooHHH,HHHHHHHHHH,HHHHHHHiii,iiiiiHHHHH}
  \seq{RALWWSVETA,TTVGYGDLYP,VTLWGRCVAV,VVMVAGITSF,GLVTAALATW}
  \pred{HHHHHHHHHH,HHHooooooo,oooooooHHH,HHHHHHHHHH,HHHHHHHHHH}
  \seq{FVGREQERRG,H,{},{},{}}
  \pred{HHiiiiiiii,i,{},{},{}}
\end{predseq}
\end{document}

It uses etoolbox for list management and xstring for string calculations (or enumeration).

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.