4
votes
1answer
106 views

Adding Non-breaking space after single character in text mode

Is it possible in LaTeX (2e) to create macro or other processing command that will add non-breaking space after single character in text mode? Example: A new example here will add a "tilde", after ...
3
votes
2answers
2k views

Insert symbols inside verbatim mode LaTeX

I cannot insert mathematics symbols inside a verbatim mode in LaTeX. This how I do: \usepackage{alltt} \begin{verbatim} 1- Train triggers model \( X_{i} \) -> Y_j (X_i: source phrase ...
6
votes
1answer
445 views

How to write math symbols in a verbatim?

Basically I have a section that is describing my algorithm in a pseudo code kind of way, and so I want that text to look like the verbatim text except I still want to be able to use math symbols. Is ...
5
votes
3answers
258 views

Underscore vs. subscript in new command with fancyvrb

I'm using fancyvrb to have math in my verbatim environment as suggested here. I use a math escape command like so: \newcommand{\m}[1]{$#1$} But underscores are not being type set as subscripts, they ...
2
votes
1answer
340 views

Putting math inside a verbatim environment without altering the formatting

In a verbatim code listing, I want to use inline math in comments with the same formatting that I get for inline math in body text. I can use a math environment, but the spacing is weird. In this ...
3
votes
1answer
579 views

Using math mode escapes with listings enabled fancyvrb

I am trying to escape math mode within Verbatim, using this answer. This works fine, until I use the listings package with fancyvrb=true \documentclass{article} \usepackage{fancyvrb} ...
3
votes
1answer
2k views

Changing color of text snippet in a verbatim environment

Is it possible to change color of part of the text that is in a verbatim environment? Lets say I have this verbatim section. I want to change the color of the marked lines into blue. ...
5
votes
3answers
1k views

verbatim subscript in mathmode

I want to produce a formula in Math-Mode which is something like \pi_{film_title}(\sigma_{release_year > 2006}(film)) where film_title, release_year, and film are in verbatim so far I was using ...
8
votes
1answer
943 views

Maple package for Latex

I'm translating the book PHYSICS WITH MAPLE by Wang. It contains some codes and outputs from Maple of course. I was wondering do we have a package such as mcode or matlab-to-tikz ( MATLAB) for Maple ...
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
2answers
213 views

Disable shortvrb in math mode

I have enabled shortvrb so that I can enclose text in pipes to write small pieces of code. Unfortunately this conflicts with math mode when I write $|A|$ to indicate the cardinality of a set. How can ...
7
votes
1answer
255 views

How to output math environment code alongside typeset math?

I have a preamble which defines lots of symbols and a LaTeX document for testing them. In particular, I have source like this: \[\wlength{abc} = 3\] \[\lang{A} = \lang{\varphi}\] \[\kplus{L} \defeq ...