summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/verbatimbox/verbatimbox_example.tex
blob: 66dc277c0c8ebe4ef0fbdf002cccb4ac68cdb8d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
\documentclass{article}
\usepackage{verbatimbox}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\parskip 1em

This is a test of the \textsf{verbatimbox} style package, to 
test the \verb,verbbox, environment.  I am about to call on the
\verb,verbbox, environment to see how if I can stuff \verb,verbatim,
text into a \LaTeX{} box.  Here goes...

\begin{verbbox}
      Program test
      implicit none
      integer a, x
      a = 0
      x = 1
   10 a = a + x
      if (a .eq. 100) stop
      goto 10
      end
!@#$%^&*()_+=-{}|\][<>?/\\\
\end{verbbox}

OK, I have created a \verb,verbbox, (which creates no output in and of
itself), and I now wish to see if I can stick it into a \verb,tabular,
environment.  Note, when sticking a verbbox into the \verb,tabular,
environment, use the \verb,[t], option of \verb,\theverbbox,.
\begin{center}
\begin{tabular}{| c | c | c |}
\hline
%\raisebox{0.7in}{First box of table}&%
%\theverbbox[t] &
%\raisebox{0.7in}{last box of table}\\
First box of table&%
\begin{tabular}{@{} c @{}} \theverbbox[t]\end{tabular}&
last box of table\\
\hline
\end{tabular}
\end{center}

Otherwise, if I choose, I can just stick the \verb,verbatim, box into an
\verb,fbox,,
so as to frame the result.  This latter case produces the same output as
would the \verb,boxedverbatim, environment in the \textsf{moreverb}
package.

\fbox{\theverbbox}

Being a box, I can use \verb,verbbox, output as part of a figure or
table, for example.  Bottom line: the \textsf{verbatimbox} package
provides nice flexibility in utilizing the \verb,verbatim, environment
in a variety of ways.

\end{document}