Tag Info

Hot answers tagged

2

@ Let's say we want to write a \.{CWEB} program that manipulates \.{bibtex} files. How can we do a multiline verbatim code listing? Like this? \begingroup\tt\obeylines\catcode`\{12 \catcode`\}12 @@Book{Author:2000, author={Last,First}, title={Title}, year=2000, } \endgroup


1

Based on David Carlisle's answer, I defined these macros, which allow almost verbatim input (I still have to escape a few characters). \def\beginlisting{% \par\vskip\baselineskip% \begingroup% \tt\obeylines\obeyspaces% \catcode`\{12\catcode`\}12% } \def\endlisting{% \endgroup\par% \vskip\baselineskip% } @ Let's say we want to write ...


1

The listings package has a make option: \documentclass{article} \usepackage{listings} \begin{document} \begin{lstlisting}[language=make] # I am a comment CC=g++ # CFLAGS options passed to the compiler. CFLAGS=-c -Wall all: hello hello: main.o factorial.o hello.o $(CC) main.o factorial.o hello.o -o hello clean: rm *.o hello ...



Only top voted, non community-wiki answers of a minimum length are eligible