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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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