GeneralPrevent list alignment from interfering enclosed objects?

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

Prevent list alignment from interfering enclosed objects?

Post by yoyoimut »

Hi all,
listmargin.jpg
listmargin.jpg (193.13 KiB) Viewed 1145 times

Code: Select all

\documentclass{book}

\usepackage{xcolor}

%---------------------- Highlight ----------------------
%Framed box that can be splitted across page.
\usepackage{framed}
\renewenvironment{leftbar}[1][\hsize]{%
\def\FrameCommand{{%
										\color{red!70}\vrule width 5pt}%
										\hspace{0pt}%must be set to 0.
										\fboxsep=\FrameSep\colorbox{cyan!15%
								 }}%
\MakeFramed{\hsize#1\advance\hsize-\width\FrameRestore}}%
{\endMakeFramed}%
%
\newenvironment{HL}[1][\textwidth]%
{%
\par\nointerlineskip\vspace{\baselineskip}%
\begin{leftbar}[#1]%
\noindent\small%
\ignorespaces%must be put right before the contents.
}
{%
\end{leftbar}%
%\ignorespacesafterend
\par\nointerlineskip\vspace{\baselineskip}%
}


\def\dummytext{Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.}

\begin{document}

\dummytext

\begin{HL}
  \dummytext
\end{HL}


\begin{itemize}
  \item \dummytext
  \begin{HL}[\linewidth]
  	\dummytext
  \end{HL}
  \item \dummytext
\end{itemize}

\end{document}


I have an HL (highlighting) environment inside an itemize environment.
I don't want the itemize alignment to interfere the HL alignment.
My idea is to pause the itemize alignment temporarily before entering HL and resuming it after exiting HL.


My question is how to do that?


Thank you in advance.


regards,

Yuko.

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

Post Reply