Questions tagged [showexpl]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 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 ...
user avatar
  • 1
0 votes
0 answers
45 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 ...
user avatar
1 vote
1 answer
26 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 ...
user avatar
  • 115
0 votes
0 answers
34 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{...
user avatar
  • 3,232
1 vote
0 answers
150 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. ...
user avatar
  • 3,232
0 votes
1 answer
99 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 ...
user avatar
3 votes
1 answer
216 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 ...
user avatar
  • 415
2 votes
0 answers
161 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 ...
user avatar
  • 8,734
5 votes
2 answers
186 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{...
user avatar
  • 8,734
0 votes
0 answers
64 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{...
user avatar
  • 8,734
7 votes
2 answers
373 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: \...
user avatar
  • 3,554
4 votes
3 answers
937 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 ...
user avatar
  • 1,103
6 votes
1 answer
414 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. \...
user avatar
  • 517
2 votes
2 answers
255 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 ...
user avatar
2 votes
1 answer
790 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} \...
user avatar
  • 10.7k
2 votes
1 answer
218 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*...
user avatar
  • 10.7k
6 votes
2 answers
232 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{...
user avatar
  • 10.7k
1 vote
1 answer
174 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 ...
user avatar
8 votes
1 answer
478 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 ...
user avatar
6 votes
2 answers
1k 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 ...
user avatar
6 votes
1 answer
165 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... \...
user avatar
  • 6,680
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 ...
user avatar
  • 878
10 votes
2 answers
327 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-&...
user avatar
7 votes
1 answer
689 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 ...
user avatar
  • 63.4k
8 votes
1 answer
413 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} {\...
user avatar
1 vote
1 answer
93 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 ...
user avatar
  • 153
7 votes
1 answer
344 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 ...
user avatar
1 vote
1 answer
79 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{...
user avatar
5 votes
2 answers
262 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[...
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{...
user avatar
  • 631
4 votes
1 answer
4k 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 ...
user avatar
14 votes
3 answers
865 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}...
user avatar
2 votes
1 answer
219 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} \...
user avatar
4 votes
2 answers
493 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 ...
user avatar
0 votes
1 answer
187 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} \...
user avatar
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}...
user avatar
8 votes
2 answers
3k 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. ...
user avatar
2 votes
1 answer
380 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,...
user avatar
3 votes
3 answers
526 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....
user avatar
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 ...
user avatar
13 votes
2 answers
1k 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 ...
user avatar
  • 128k