Text Formattingnarrow paragraph

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
iranacre
Posts: 7
Joined: Fri Jul 24, 2009 11:14 pm

narrow paragraph

Post by iranacre »

Hi all,

I was wondering how to make a narrow paragraph in a text and found a command \narrower. I couldn't find any description to this command but it seems to make paragraph narrower by value of \parindent variable. Any idea how to change this value?

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

narrow paragraph

Post by gmedina »

Hi,

in the following code I used a list to create an environment mypar that let's you control the nargins for your paragraphs:

Code: Select all

\documentclass{article}
\usepackage{lipsum}% just to automatically generate some text

\newenvironment{mypar}[2]
  {\begin{list}{}%
    {\setlength\leftmargin{#1}
    \setlength\rightmargin{#2}}
    \item[]}
  {\end{list}}

\begin{document}

\lipsum[1]
\begin{mypar}{1cm}{1cm}
\lipsum[1]
\end{mypar}
\lipsum[1]
\begin{mypar}{0cm}{2cm}
\lipsum[1]
\end{mypar}
\lipsum[1]
\begin{mypar}{2cm}{0cm}
\lipsum[1]
\end{mypar}
  
\end{document} 
P.S.: the \parindent value can be changed using \setlength, for example:

Code: Select all

\setlength\parindent{0em}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
iranacre
Posts: 7
Joined: Fri Jul 24, 2009 11:14 pm

Re: narrow paragraph

Post by iranacre »

Thanks, I'm using it in \newenvironment too. So, for me there's no problem to redefine \parindent variable and use \narrower. I just wanted to see any definition of the command.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

narrow paragraph

Post by gmedina »

Here's the definition (from latex.ltx):

Code: Select all

\def\narrower{%
  \advance\leftskip\parindent
  \advance\rightskip\parindent}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply