Questions tagged [showexpl]

showexpl is a package for including example LaTeX code together with its output

Filter by
Sorted by
Tagged with
2 votes
2 answers
71 views

The caption package interferes with the showexpl package

When the caption package is loaded, it messes up the cross-referencing of listings typeset using the showexpl package. The \ref command prints the number of the section in which the LTXexample is ...
Alex's user avatar
  • 23
0 votes
1 answer
62 views

How can I align frames vertically with option [frame=single] when using showexpl in LaTeX?

When I use the option [frame=single] for LTXexample, the frame around the LaTeX code gets poor vertical alignment with respect to the formatted output, especially for one-line coding. How can we get ...
xdyang's user avatar
  • 11
0 votes
0 answers
141 views

showexpl: latex gives an error (undefined control sequence) when using showexpl (LTXexample environment) in files with external .sty files

I am quite new to LaTeX and recently started learning tikz. I use 'showexpl' and 'listings' package to generate examples of tikz codes and their outputs in overleaf. Almost all of my files preamble ...
Radiation Genesis's user avatar
1 vote
1 answer
29 views

Ruined styles when adding empty explpreset

I'm trying to show LaTeX commands using package showexpl. In the documentation of the package, it says that explpreset has a default value of . I think the sentence in documentation is not completed ...
haur576's user avatar
  • 150
0 votes
0 answers
49 views

Error while using LTXinputExample in frontmatter

When I use the command LTXinputExample from the package showexpl at the frontmatter section of a book, I got the following error message: Missing number, treated as zero. \LTXinputExample{...
FHZ's user avatar
  • 3,919
1 vote
0 answers
281 views

What is the best approach to insert a LaTeX example source with preamble?

Introduction I was preparing some examples of how to use LaTeX and then I found out the package showexpl (showexpl) which worked much better than others such as verbatim, moreverb and fancyvrb-ex. ...
FHZ's user avatar
  • 3,919
0 votes
1 answer
162 views

How to get the image and code in showexpl package separate and break the code to new page when ended page?

In listings and showexpl package, my problem is the code is go over the page and one another problem is that how can the image and the code be seperate that the image in previous page and the code in ...
Nguyen Thy's user avatar
3 votes
1 answer
323 views

Single and multiple lines for a verbatim argument from a NewDocumentCommand

I want to create a command that display a given LaTeX code and its formatted output. So far I've noticed that the showexpl packages does a good job, since you can use those styles that have been ...
gfe's user avatar
  • 415
2 votes
0 answers
209 views

Emergency stop trying to base a new environment on the showexpl/LTXexample environment

Yesterday I posted a question asking how to apply certain formatting features to the environment LTXexample of the package showexpl. Seeing as the question failed to elicit answers, I tried to attack ...
Evan Aad's user avatar
  • 11k
5 votes
2 answers
209 views

How to add vertical space between a showexpl/LTXexample environment and the surrounding text as well as the caption?

The following LaTeX document: \documentclass{amsart} \usepackage{showexpl} \begin{document} Lorem ipsum dolor sit amet, ut ius vero dolores. \begin{LTXexample}[caption=Example] \documentclass{...
Evan Aad's user avatar
  • 11k
0 votes
0 answers
69 views

Footnotes not displayed with showexpl

The following LaTeX document: \documentclass{amsart} \usepackage{showexpl} \begin{document} \begin{LTXexample} \documentclass{amsart} \begin{document} Hello\footnote{Hola}, world! \end{...
Evan Aad's user avatar
  • 11k
7 votes
2 answers
399 views

How to use showexpl with tufte-handout

I'm working on a document using the tufte-handout class in which I need to include some examples of LaTeX code for which I try to work with the package showexpl in the way it appears in my MWE: \...
Aradnix's user avatar
  • 3,725
4 votes
3 answers
1k views

Adding space after listings example

I'm using the showexpl package for creating codes with the displayed result. For the example settings I used pos=b, placing the output below the code, which is what I want. The problem is that now I ...
han-tyumi's user avatar
  • 1,152
6 votes
1 answer
498 views

Highlighting a backslash with showexpl or listings

Is there a way to highlight a single backslash (\) within LaTeX code with listings or showexpl? In the following example, \LaTeX is correctly highlighted, but not the following backslash. \...
lotomat's user avatar
  • 527
2 votes
2 answers
268 views

How to center the graphic of LTXexample?

Scenario I want to write a tutorial on PSTricks, but because latex-dvips-ps2pdf (see the code shown in First Attempt section) makes my effort to prevent reader from copying the listing numbers no ...
kiss my armpit's user avatar
2 votes
1 answer
931 views

showexpl not showing caption of a lstlisting within

How can I make the LTXexample environment to show the caption (like it does with other environments) of a lstlisting that is inside it. Consider the following code \documentclass{article} \...
adn's user avatar
  • 11.2k
2 votes
1 answer
234 views

Create a LTXexample environment ala figure*

How can I patch LTXexample to have the behavior of span two columns when used as LTXexample* (like using figure* in a twocolumn mode document)? Thus, the following code doesn't work due to the figure*...
adn's user avatar
  • 11.2k
6 votes
2 answers
239 views

`showexpl` doesn't work with accents

It seems that showexpl removes the accents when it is processing them. How can I make it to use accented letters? Is there a replacement or a similar package that is more robust? \documentclass{...
adn's user avatar
  • 11.2k
1 vote
1 answer
179 views

How can I change the syntax of showexpl's graphic key?

I'm trying to rewrite the option graphic from showexpl package, I have reviewed the source code showexpl.sty but, fail to find the modification, the package use keyval (or xkeyval) and listings for ...
Pablo González L's user avatar
8 votes
1 answer
502 views

How can I color braces in showexpl?

I want to use showexpl and have the LaTeX code printed with colored braces. I can do this within a lstlisting environment by adding a literate option like in the example below, but not within a ...
user48240's user avatar
6 votes
2 answers
2k views

graphic in tcblisting

I'm using the package tcolorbox to create a file with examples Latex, I have reviewed the options tcblisting environment and use these: text outside listing listing outside text listing above text ...
Pablo González L's user avatar
6 votes
1 answer
185 views

\centering and showexpl

Consider the following MWE, where the table is clearly not centered by \centering. Actually, moving \centering outside the table environment give the desired output, but that's no good... \...
Holene's user avatar
  • 6,900
7 votes
1 answer
4k views

\lstset{numbers=none} not working

I'm trying to have LaTeX examples in a document. I use the showexpl package which lets me use the listings package options. Because all fragments are short, line numbers are redundant. The following ...
Herthog's user avatar
  • 928
10 votes
2 answers
330 views

How to make a \only<> like macro to be used at the end of line and escape it?

I want to produce a tutorial showing code and its rendered output step by step. The requirements are as follows. The source code should be kept simple. \LTXexample \begin{tikzpicture}%\only<1-&...
kiss my armpit's user avatar
7 votes
1 answer
717 views

Package showexpl throws "Label ... multiply defined" [closed]

With the following MWE you will get a warning Label lst:HalloWelt multiply defined. In the MWE I have added the calls for packages showlabels and refcheck to show the used labels and to check ...
Mensch's user avatar
  • 65.3k
8 votes
1 answer
437 views

How to prevent LTXexample from ignoring the paragraph indentation?

How to prevent LTXexample from ignoring the paragraph indentation? \documentclass[preview,border=3pt]{standalone} \usepackage{etoolbox} \edef\keptparindent{\the\parindent} \patchcmd{\preview} {\...
kiss my armpit's user avatar
1 vote
1 answer
106 views

rframe is not working in showexpl

the option rframe=empty has not effect in showexpl. Here is a WME \documentclass{article} \usepackage{showexpl} \begin{document} Here is: \begin{LTXexample}[rframe=empty] \begin{center} Hello ...
ernesto's user avatar
  • 163
7 votes
1 answer
347 views

Can you make the "graphic" option of LTXinputExample able to render all pages of a multi-page PDF file?

I have a source code named source.tex which produces a PDF file consisting of more than one page. The source code will be displayed by LTXinputExample as a formatted text and the corresponding output ...
kiss my armpit's user avatar
1 vote
1 answer
90 views

How to resize a graphic attached to LTXinputExample?

I want to attach a PDF output of a source code using graphic option of LTXinputExample. Shortly speaking, how to resize the attached graphic? \documentclass{article} \usepackage{filecontents} \begin{...
kiss my armpit's user avatar
5 votes
2 answers
272 views

How to remove the unbalanced white space below the top rule of the formatted output?

How to remove the unbalanced white space below the top rule of the formatted output? \documentclass{article} \usepackage[a4paper,margin=25mm]{geometry} \usepackage{xcolor,showexpl} \usepackage[...
kiss my armpit's user avatar
9 votes
1 answer
4k views

Inline LaTeX code and result of the code (similar to showexpl)

I would like to write a macro that works somewhat like showexpl but just reproduces the LaTeX code and the results of the code in a way that I can use inline. \documentclass{article} \usepackage{...
tgkolda's user avatar
  • 704
4 votes
1 answer
5k views

How to change the \fboxsep and \fboxrule of LTXexample's rframe?

The formatted output is enclosed by rframe. But for a certain case, the grid label of pspicture goes beyond the frame. The grid label of pspicture might be rendered outside TeX engine so TeX does not ...
kiss my armpit's user avatar
14 votes
3 answers
968 views

How to align the top lines of frames?

I want to align the top lines of the left and right frames. How to do it? \documentclass[12pt]{book} \usepackage[a4paper,margin=25mm,showframe=true]{geometry} \usepackage{xcolor} \usepackage{accsupp}...
kiss my armpit's user avatar
2 votes
1 answer
224 views

How to execute \LTXexample repeatitively with a looping macro such that its counter value gets rendered in both input/output parts?

The following code is the simplified version of my real scenario. It might look trivial. I forgot to say that the following code is the Minimal Not Working Example (MNWE): \documentclass{article} \...
Display Name's user avatar
  • 46.9k
4 votes
2 answers
528 views

What is explpreset actually for?

showexpl package is intended to show (La)TeX, TikZ, PSTricks codes and their coressponding rendered outputs at the same time (either horizontally or vertically). Note that it cannot be used to ...
Display Name's user avatar
  • 46.9k
0 votes
1 answer
191 views

How to align the top frame edges of source and formatted text with the same horizontal line? [closed]

The following code will be referred multiple times in my questions later. Patching is needed to make the frames of both source code and formatted text inside the text width. \documentclass{article} \...
Display Name's user avatar
  • 46.9k
3 votes
2 answers
2k views

Emphasizing a string in code example using showexpl

I am writing documentation for a package using the showexpl package which in turn uses the listings package. When using listing I can highlight a portion of the code like this: \documentclass{article}...
Nickolay Kolev's user avatar
8 votes
2 answers
4k views

Fixed Width Font with LTXexample environment

Not sure why this problem has eluded me but I can't seem to get fixed width font in the code portion. I thought that this question on how to change code font would do the trick but it doesn't for me. ...
Peter Grill's user avatar
2 votes
1 answer
399 views

Without using minipage, can we resize both input and output boxes of LTXexample?

\documentclass[dvipsnames]{article} \usepackage{xcolor} \usepackage[margin=50mm]{geometry} \usepackage{showexpl} \usepackage{etoolbox} \makeatletter \patchcmd{\SX@codeInput}{xleftmargin=0pt,...
Display Name's user avatar
  • 46.9k
3 votes
3 answers
551 views

Is it possible to separate the input and output of LTXexample such that I can put each in a table cell?

My objective is to create a long tabular list of PSTricks inputs and their corresponding outputs side by side. The table consists of 3 columns, i.e., Number column, Input column, & Output column....
Display Name's user avatar
  • 46.9k
6 votes
2 answers
3k views

How to control the left margin for the formatted text produced by LTXexample?

I want to use both LaTeX code snippet using LTXexample and C# code snippet using lstlisting in my book. If you see my screenshot below, lstlisting behaves well but LTXexample does not. How to prevent ...
Display Name's user avatar
  • 46.9k
13 votes
2 answers
2k views

How to use showexpl with an external class?

The showexpl package defines LTXexample environment which allows to define a latex code and shows its result side by side. The problem is that it uses the same document class where the LaTeX code is ...
Ignasi's user avatar
  • 136k