Linked Questions

24 votes
3 answers
4k views

In LuaLaTeX, how do I pass the content of an environment to Lua verbatim?

In LuaLaTeX, how would I go about capturing the content of an environment for (verbatim) processing by Lua? For example, consider something like \begin{foobar} Hello {World} \end{foobar} I'd like ...
Anselm Lingnau's user avatar
12 votes
1 answer
1k views

How to pass a LaTeX argument verbatim to lua?

I would like to pass an argument verbatim from LaTeX to lua including LaTeX commands and end of line characters. The example below takes care of the former issue, but not of the latter. Is there a ...
JPi's user avatar
  • 13.4k
3 votes
3 answers
973 views

What's the alternative for the standard verbatim environment that can be used inside argument/does not change catcode?

How can I get something to typeset the output identical to that of a verbatim environment, e.g. of this code \documentclass[12pt]{article} \begin{document} before \begin{verbatim} 123456_789$^% \end{...
user202729's user avatar
  • 5,779
5 votes
1 answer
268 views

How to print a verbatim block at its end automatically in LuaLaTeX?

This is a follow-up question to this answer by Mico. I try to adjust his Lua code to my needs and line numbering already works. Actually there is one real usability issue and that's my question: How ...
TeXnician's user avatar
  • 33k
3 votes
2 answers
199 views

How can I print "$ formulae $" as itself?

If I type $ formulae $, then the result will be formulae But I want to type "$ formulae $" expression itself, so the result will be $ formulae $ (I mean the result include $ expressions!) Thanks ...
walkingandwalking's user avatar
2 votes
1 answer
536 views

verbatim code inside \newcommand definition

All the questions I could find on this subject are about people who want to use \verb in the argument passed to a command, or about people who want within a \newcommand to wrap one of the arguments ...
Stefan's user avatar
  • 123
3 votes
1 answer
147 views

shdoc and KOMA-Script

Why does the following example work with report, but not with scrreprt: \documentclass{scrreprt} \usepackage{shdoc} \begin{document} \begin{sh} \begin{shbox} \shline{}{Test} ...
TeXnician's user avatar
  • 33k
0 votes
2 answers
226 views

How to align multiple aligned env. containing \verb?

I need to align several R-syntax formulas as equations. I have a following code: \begin{align} &\begin{aligned} &\verb!tActKT ~ poly(I(1/nprocs), 3, raw=T) + poly(ndoms, 3, raw=T)!\\ &\...
Eenoku's user avatar
  • 523
1 vote
1 answer
226 views

About verbatim in LaTeX (and LuaTeX)

What I intend to do... Initially, I wanted to write a series of environments that help me typeset verbatim environments. For example, I would like \begin{myverb}{stylea} \end{myverb} to be equivalent ...
Alan Xiang's user avatar
  • 4,872
1 vote
1 answer
221 views

VerbatimInput gives error when file is too large [closed]

I use \VerbatimInput in package fancyvrb to wrap my text, which is loaded from external file. But when the external file is too large, it gives the following error: TeX capacity exceeded, sorry [...
firefighter's user avatar
1 vote
2 answers
93 views

lstinline in mathmode with correct font size

I often typeset mathematical formulas about computer programs (loop invariants, etc.). I typeset them in typewriter font, saying in my preamble \lstset{basicstyle=\ttfamily}. I could say $\frac{\text{\...
ysalmon's user avatar
  • 1,072
1 vote
1 answer
90 views

Typesetting Preparsed Verbatim Text/Code

Assuming that I have already parsed some text verbatim, using an xparse +v argument, what is the best way to typeset the text in a way that respects the original formatting? Note that I cannot ...
Kelly Smith's user avatar
0 votes
2 answers
57 views

Save the content of an environment containing \verb or \lstinline

I wish to copy the content of an environment into a macro (or into a temp file). Previously I use the following code: \usepackage{environ} \def\SavedContent{} \NewEnviron{savecontent}{% \BODY% ...
Jinwen's user avatar
  • 7,504
0 votes
1 answer
40 views

macros avoid linebreak if macro expands to nothing

I know this one is quite similar to this post (from me). But even with using % all over the place and \ignorespaces there is still a linebreak. See my mwe: (main2.tex) \documentclass{article} \...
atticus's user avatar
  • 515
0 votes
0 answers
38 views

\newcommand not working ("verbatim" use case) [duplicate]

I'm lazy and I want to save on typing. So I have \newcommand{\bv}{\begin{verbatim}} \newcommand{\ev}{\end{verbatim}} \bv Hi, this should be verbatim \ev in my document, but this produces an error: ...
user258532's user avatar

15 30 50 per page