Tag Info

New answers tagged

4

You could use the listings package: Code \documentclass{book} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{lmodern}% better font than default \usepackage{tgcursor}% tt font with bold/italic styles \usepackage{listings} \lstset{ language=R, basicstyle=\ttfamily } \begin{document} \appendix \chapter{Some R code} Some code ...


3

You can fix the problem by adding fragile: \documentclass{beamer} \begin{document} \begin{frame}[fragile]{Title} Some text \verb+\int+ \end{frame} \end{document}


4

You have to add [fragile] option to \begin{frame}. I have also added the options font=\tiny,text width=0.45\textwidth to the mybox style. Code: \documentclass[table,xcolor=pdftex,dvipsnames]{beamer} \usepackage{tikz} \usetikzlibrary{shapes,snakes} \begin{document} \begin{frame}[fragile] \frametitle{Testing verbatim} \tikzstyle{mybox} = [draw=red, ...


4

Unfortunately, space characters cannot reliably be copied from a PDF. This answer on Superuser is bang on: The problem with PDF is that it doesn't really encode text. All it does is pretty much saying "Put those glyphs there, and those glyphs there". It's a format intended for print and high-fidelity document preview on screen but not so much to ...


8

verbatim is a display environment so after it you are in vertical (par) mode so you can use vertical spacing commands such as \bigskip (although you should almost never need to do this, the correct spacing should be specified in your class file). Conversely \\ is a command to be used in horizontal (LR) mode it forces a break in the current line. There is ...


2

The error message is nothing to do with verbatim Undefined control sequence. ...{Get Current Date} from the \testbf \testbf should presumably be \textbf


3

This may or may not be what you are looking for. Here I put the verbatim in a box structure (which means it can't break across a page boundary). I then inlay (with \stackinset) the "caption" over the box in the general area of relevance. \documentclass{article} \usepackage{verbatimbox,stackengine,xcolor} \begin{document} \begin{verbbox} *** Settings *** ...


8

I'm sure you'll appreciate this devious trick: \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{graphicx} \usepackage{fancyvrb} %A more wedge-like caret for use in code. \newcommand\pow{% \hspace{-1pt}% \raisebox{-1pt}{\scalebox{1.2}{\textsf{\textasciicircum}}}% \hspace{-1pt}% } \newcommand{\makehatpow}{% \begingroup\lccode`~=`^ ...



Top 50 recent answers are included