6
votes
2answers
52 views

Seemingly trivial: verbatim, newenvironment, and colorbox

I am, once again, trying to achieve what seems like a trivial goal. I want to use \newenvironment to define a verbatim environment with a background color. I need to define my own environment because ...
8
votes
3answers
206 views

How can I have numbered verbatim environments?

How can I have an automatically numbered verbatim environment, just like equations? I tried putting it like this: \begin{equation} \begin{verbatim} bla... bla... bla... \end{verbatim} \end{equation} ...
7
votes
1answer
91 views

Two block commands in \newenvironment [duplicate]

What is wrong with following document? \documentclass{article} \usepackage{xepersian} \usepackage{verbatim} \newenvironment{code} {\begin{latin}\begin{verbatim}} {\end{verbatim}\end{latin}} ...
6
votes
1answer
224 views

How to scale a verbatim block in a user-defined environment?

In order to produce an ereader-friendly PDF with small page dimensions, I'd like to scale down some oversize verbatim blocks such as program output with lines too long for the small page. Then readers ...
1
vote
1answer
215 views

minted Environment Inside minipage Environment

I am having to use the minted environment inside a minipage environment quite often in my document. I wanted to write a new environment for doing this, but since minted isn't designed to be included ...
3
votes
1answer
157 views

How to combine framed and listings packages in new environment

I always use this LaTeX code to display a source code in my article. \begin{listingbox}{VB style} \begin{singlespace} \begin{lstlisting}[style=BASIC] Private Sub Form_Load() Dim tex As String ...
2
votes
2answers
213 views

Insert a character in the beginning of each line in a special verbatim environment

How can I insert a special character or a symbol in the beginning of each line in a verbatim environment? In particular, there is a constraint that applies to the verbatim environment: it must be of a ...
4
votes
4answers
691 views

Defining a new environment extending a verbatim environment

Why is it not possible to define a new environment that extends a verbatim environment? Consider, e.g.: \documentclass{article} \newenvironment{myverbatim}{\tiny\begin{verbatim}}{\end{verbatim}} ...
13
votes
2answers
609 views

Format a verbatim paragraph

How can I format a verbatim paragraph? I.e. break, fill and join input lines to produce globally balanced output with the lengths of each line approaching the target \textwidth as closely as possible. ...
15
votes
2answers
292 views

How to make AUCTeX ignore syntax highlighting within environment

I have a problem with syntax highlighting in the Emacs editor using AUCTeX. The problem occurs in particular with the Verbatim environment from the fancyvrb package. Consider the following code: ...
2
votes
2answers
370 views

Create a new environment that uses a verbatim environment

Consider the following: \documentclass{article} \usepackage{environ} \usepackage{verbatim} \usepackage{color} \NewEnviron{vred}{% \color{red} \begin{verbatim} \BODY \end{verbatim} } ...
9
votes
4answers
330 views

How to redefine an environment to produce no output?

I am using the verbatim environment with \begin{verbatim} XXXX \end{verbatim} I would like the option of redefining the verbatim environment so that nothing between \begin{verbatim} and ...
4
votes
1answer
586 views

lstlisting in a newenvironment

I have a problem with the lstlisting package. I want to define an \newenvironment with one obligatory parameter, which will be the caption name for the lstlisting. I will also have other lstlisting ...
3
votes
1answer
184 views

passing text to alltt embeded in command (extra newline needed)

I wanted to close alltt inside a command (to add some ornaments around the text), but the spaces that were used for putting the monospaced text into columns was not preserved. I found the solution ...
8
votes
1answer
1k views

I need a customized verbatim environment

I would need a verbatim environment with the following behaviour: It is centered (left and right distance to the page edge should be equal). It can be much wider than the regular text, almost using ...
2
votes
1answer
850 views

Example environment with numbering, caption, “verbatim” content

I need to use an example environment like the following. \begin{example}[My Caption, mylabel] My example text \end{example} It should show the text inside a verbatim environment, the caption (like ...
2
votes
2answers
453 views

Making more easy the itemized of item with tabulation system

Actually, isn’t not really a question. (Since my examinations get close, I don't really have the time to search for a solution to my problems.) Rather than using the common \item, I'd like to use ...
8
votes
3answers
332 views

Verbatim in environ’s \BODY

I’d like to print a TeX install guide for different OS, but the most text is the same for all OS. So I build the following \documentclass{article} \usepackage{environ} \newcommand{\mlw}[3]{} ...
9
votes
2answers
1k views

How to change color of some particular environment for entire document

I want to change color of particular environment in document. For example wherever I found verbatim environment or equation environment appears in my tex file. With some global settings, I want to ...
4
votes
1answer
687 views

Create a verbatim mdframed environment

I'd like to use and mdframed environment with verbatim in it. I've read the both documentations, googled but I've found nothing regarding this matter. MWE below: \documentclass[10pt]{article} ...
5
votes
3answers
1k views

Have verbatim code as an equation

I have a little snippet of program code / input that needs to be rendered with the exact layout as typed in (verbatim). Is it possible to have this as an equation? I tried to nest the Verbatim ...
6
votes
1answer
916 views

Using minted to define a new environment

Can I define a newenvironment that has inside it a minted environment? eg and environment that would be a quickhand for the following code: \begin{figure}[htp] \centering ...
2
votes
2answers
890 views

LaTeX verbatim environment inside lists

I am using LaTeX and I have a verbatim environment inside an enumerate one. However, there is much whitespace between the verbatim text and the following list item. What I have now is something like ...
11
votes
3answers
938 views

How to pass an optional argument to an environment with verbatim content?

This is an attempt to make clear what happened in this question of xport (now deleted, sorry). The now deleted question included code that tried to make my answer to this question of xport work for ...
1
vote
1answer
242 views

How to make my unusual environment accept one argument?

I cannot find a good title to express my question. Therefore, please parse the following code first. Minimal Code \documentclass[dvips,dvipsnames,cmyk,table]{book} ...
10
votes
1answer
2k views

verbatim useable with a newenvironment definition?

I'm trying to create a simple newenvironment allowing me to display source code in a verbatim text block with a caption, numbering etc. The solution I'm after is with the in-built LaTeX verbatim ...