Generalshowexpl : If ”numbers=none” then margin should be 0. Why?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
latexian
Posts: 19
Joined: Wed Aug 05, 2009 7:57 am

showexpl : If ”numbers=none” then margin should be 0. Why?

Post by latexian »

Hi all,

I am using LTXexample and don't want to enable code numbering.
However, I need to change xleftmargin and xrightmargin to equal to \fboxsep such that the frame of the formated text has the same width as that of the code.
Later I noticed that these changes will not take effect because showexpl
always reset both options. You can see the showexpl source code here : http://ftp.kaist.ac.kr/tex-archive/macr ... owexpl.pdf and please locate the code snippet between 324~326.

My question is

why did the author reset those options?

I want to disable the code between 324~326, but I am wondering unseen side effect will appear.


Thank you.

regards,

LATEXIAN

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

latexian
Posts: 19
Joined: Wed Aug 05, 2009 7:57 am

showexpl : If ”numbers=none” then margin should be 0. Why?

Post by latexian »

Here is the minimum code:

Code: Select all

\documentclass{article}
\usepackage{showexpl}

\newcommand*{\MARKER}{%
	\noindent\strut\vrule%
	\hrulefill~{\scriptsize half text area}~\hrulefill\vrule%
	\hrulefill~{\scriptsize half text area}~\hrulefill\vrule%
	\marginpar{\strut\vrule\hrulefill~{\scriptsize margin area}~\hrulefill\vrule}\\}% I add line break.

\lstset{%necessary settings
   explpreset={pos=b,xleftmargin=\fboxsep,xrightmargin=\fboxsep},
   breaklines=true,           
   frame=single,      
   numbers=none}
   
\begin{document}

\MARKER
\begin{LTXexample}
something something
\end{LTXexample}
\MARKER

\end{document}
Post Reply