Generalshowexpl: strange relationship between \centering & varwidth

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
yoyoimut
Posts: 120
Joined: Mon Oct 19, 2009 6:58 am

showexpl: strange relationship between \centering & varwidth

Post by yoyoimut »

I notice the following:
  1. When varwidth is set to true, we must use justification=\centering rather than preset={\centering} to center formated contents.
  2. When varwidth is set to false, we must use preset={\centering} rather than justification=\centering to center formated contents.

Code: Select all

\documentclass{article}
\usepackage{showexpl}
\lstset{explpreset={language={[LaTeX]TeX},numbers=none,rframe={},frame=single,pos=b}}
\begin{document}

\begin{LTXexample}[varwidth=false,preset={\centering}]
with \verb+varwidth=false,preset={\centering}+
\end{LTXexample}
\vspace{2\baselineskip}

\begin{LTXexample}[varwidth=true,preset={\centering}]
with \verb+varwidth=true,preset={\centering}+
\end{LTXexample}
\vspace{2\baselineskip}

\begin{LTXexample}[varwidth=true,justification=\centering]
with \verb+varwidth=true,justification=\centering+
\end{LTXexample}
\vspace{2\baselineskip}

\begin{LTXexample}[varwidth=false,justification=\centering]
with \verb+varwidth=false,justification=\centering+
\end{LTXexample}
\end{document}
Is it a rule or a bug?

Thank you.


Yoyoimut

Recommended reading 2024:

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

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

Post Reply