Discussion:
Indentations
(too old to reply)
Samuel Hennuyer
2003-11-06 10:02:12 UTC
Permalink
I would much like to indent parts of formated text, through several pages.

How must I do ?

More precise, I am looking for the best environnement to indent and align things.

Thank you all.
Rowland McDonnell
2003-11-07 20:57:52 UTC
Permalink
Post by Samuel Hennuyer
I would much like to indent parts of formated text, through several pages.
How must I do ?
More precise, I am looking for the best environnement to indent and align things.
There are *lots* of different ways of indenting and aligning `things' in
LaTeX.

Could you perhaps be a little clearer about exactly what you're trying
to do?

Maybe the quote or quotation environment is what you're after?

Rowland.
--
Remove the animal for email address: ***@dog.physics.org
PGP pub key 0x62DCCA78 Sorry - the spam got to me
http://www.mag-uk.org
UK biker? Join MAG and help keep bureaucracy at bay
Samuel Hennuyer
2003-11-12 17:05:58 UTC
Permalink
Post by Rowland McDonnell
Could you perhaps be a little clearer about exactly what you're trying
to do?
Maybe the quote or quotation environment is what you're after?
I want to Indent even formatted text !!!
That is to say, how do you do for indenting a text included in an
environnement ?

The first one who manages to give me the right mark which makes a left
margin powerfully changeable, will WIN !
Ben
2003-11-12 18:09:22 UTC
Permalink
Post by Samuel Hennuyer
Post by Rowland McDonnell
Could you perhaps be a little clearer about exactly what you're trying
to do?
Maybe the quote or quotation environment is what you're after?
I want to Indent even formatted text !!!
That is to say, how do you do for indenting a text included in an
environnement ?
OK, Does the code below help?

--------[code]--------
documentclass{article}

\newenvironment{myindent}{%
\begin{list}{}{\setlength{\labelwidth}{0pt}\setlength{\leftmargin}{1in}}%
\item[] {}}%
{\end{list}}
\begin{document}
text text text text text text text text text text text text text
text text text text text text text text text text text text text
text text text text text text text text text text text text text

\begin{myindent}
text text text text text text text text text text text text
text text text text text text text text text text text text text
text text text text text text text text text text text text text
text text text text text text text text text text text
\end{myindent}

\begin{tabbing}
abc\=abc\=abc\= \kill
how \\
\> does \\
\> \> this \\
\> looks? \\
\> \> \> huh? \\
\end{tabbing}

\begin{myindent}
\begin{tabbing}
abc\=abc\=abc\= \kill
how \\
\> does \\
\> \> this \\
\> looks? \\
\> \> \> huh? \\
\end{tabbing}%
\end{myindent}

\end{document}
--------[end of code]--------

I'm sure that it's completely `legal'. I have some bad feelings about the
\item[]{} line, but it seems to work with no errors. Of course, you can also
use:

\newcommand{\myindent}[1]{%
\begin{list}{}{\setlength{\labelwidth}{0pt}\setlength{\leftmargin}{1in}}%
\item[] {#1} %
\end{list}%
}

and then:

\myindent{%
\begin{whatever}..
\end{whatever}%
}

HTH, Ben
--
Real address: first name at robotics dot stanford dot edu
Ben
2003-11-12 18:12:38 UTC
Permalink
"Ben" wrote in message
Post by Ben
I'm sure that it's completely `legal'.
Should read ``I'm *not* sure that...''

Sorry,
Ben
--
Real address: first name at robotics dot stanford dot edu
Maurizio Loreti
2003-11-12 17:45:27 UTC
Permalink
Post by Samuel Hennuyer
Post by Rowland McDonnell
Could you perhaps be a little clearer about exactly what you're trying
to do?
Maybe the quote or quotation environment is what you're after?
I want to Indent even formatted text !!!
That is to say, how do you do for indenting a text included in an
environnement ?
Use some kind of list environment, like \begin{quote}...\end{quote}
does.
Post by Samuel Hennuyer
The first one who manages to give me the right mark which makes a left
margin powerfully changeable, will WIN !
The first beginner that will read a manual will WIN !
--
Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html
Dept. of Physics, Univ. of Padova, Italy ROT13: ***@cq.vasa.vg
Rowland McDonnell
2003-11-13 02:11:15 UTC
Permalink
Post by Samuel Hennuyer
Post by Rowland McDonnell
Could you perhaps be a little clearer about exactly what you're trying
to do?
Maybe the quote or quotation environment is what you're after?
I want to Indent even formatted text !!!
That is to say, how do you do for indenting a text included in an
environnement ?
Both the quote and the quotation environments allow you to put
environments inside them.

Ben's reply gives you an example of how to use the list environment to
create a new environment with a particular indentation. Is that what
you want?
Post by Samuel Hennuyer
The first one who manages to give me the right mark which makes a left
margin powerfully changeable, will WIN !
Well, the right mark is I think a pointer in the direction of a LaTeX
manual. I *suspect* you should read up on the list environment - but
it's a bit difficult to tell because you haven't been very clear about
exactly what it is you want.

Rowland.
--
Remove the animal for email address: ***@dog.physics.org
PGP pub key 0x62DCCA78 Sorry - the spam got to me
http://www.mag-uk.org
UK biker? Join MAG and help keep bureaucracy at bay
Ben
2003-11-13 16:47:14 UTC
Permalink
[...] example of how to use the list environment to
create a new environment with a particular indentation.
I've tried to do something similar with \trivlist, but for some reason it
doesn't fully work.

Using LaTeX syntax:

\newenvironment{myindent}{%
\begin{trivlist}\setlength{\leftmargin}{1in}\item[]{}}%
{\end{trivlist}}

yields no results.

While using TeX syntax (taken and modified from latex.ltx's commands):

\def\myindent{\trivlist \leftskip 1in\item\relax}
\def\endmyindent{\endtrivlist}

does work for paragraphs, but _not_ for a nested tabbing environment (the
one I used in my previous post). Why is that, and what's wrong with the
first code?

BTW, what is the correct use of \item in those definitions? Should one use
\item or \item[] or \item[]{}. AFAICT, it seems that they all work.

Cheers,
Ben.
--
Real address: first name at robotics dot stanford dot edu
Rowland McDonnell
2003-11-13 21:12:44 UTC
Permalink
Post by Ben
[...] example of how to use the list environment to
create a new environment with a particular indentation.
I've tried to do something similar with \trivlist, but for some reason it
doesn't fully work.
\newenvironment{myindent}{%
\begin{trivlist}\setlength{\leftmargin}{1in}\item[]{}}%
{\end{trivlist}}
yields no results.
Eh? Yes it does: it defines a new environment. That environment works
as it was intended to, given the instructions you gave LaTeX. Quite
*why* it does what it does when you use it is a different matter.

I suspect that:

\newenvironment{myindent}{%
\begin{trivlist}\advance\leftskip by 1in\item[]}%
{\end{trivlist}}

might be more to your taste.
Post by Ben
\def\myindent{\trivlist \leftskip 1in\item\relax}
\def\endmyindent{\endtrivlist}
does work for paragraphs, but _not_ for a nested tabbing environment (the
one I used in my previous post). Why is that, and what's wrong with the
first code?
Depends on what you mean by `work'. I don't know why this is, and the
only way I can find out is by reading LaTeX's source code and finding
out how the tabbing environment ticks. But I suspect that the problem
is related to the way trivlist sets various LaTeX typesetting parameters
to zero. Might list be more suitable than trivlist?
Post by Ben
BTW, what is the correct use of \item in those definitions? Should one use
\item or \item[] or \item[]{}. AFAICT, it seems that they all work.
If you read the manual, you will find that the optional argument is
non-optional in the case of the trivlist environment - so item[] is
required. I'm not sure exactly how all this argument passing works in
full detail - but from observation, it seems that \item[] is the right
thing to put in your environment definition.

<grin> A tip from a voodoo programmer[1] of long standing: it's usually
worth copying the form of anything relevant you find in the LaTeX kernel
if you can't get your version to work. Sacrificing a chicken under your
computer's nose can also be just as useful at times.

Rowland.

[1] http://catb.org/~esr/jargon/html/V/voodoo-programming.html; voodoo
programmers like me don't understand *anything*[2], just guess and see
what works.

[2] A slight exaggeration. I can sometimes understand the Clangers.
--
Remove the animal for email address: ***@dog.physics.org
PGP pub key 0x62DCCA78 Sorry - the spam got to me
http://www.mag-uk.org
UK biker? Join MAG and help keep bureaucracy at bay
Ben
2003-11-13 23:02:23 UTC
Permalink
Post by Rowland McDonnell
Post by Ben
\newenvironment{myindent}{%
\begin{trivlist}\setlength{\leftmargin}{1in}\item[]{}}%
{\end{trivlist}}
yields no results.
Eh? Yes it does: it defines a new environment. That environment works
as it was intended to, given the instructions you gave LaTeX. Quite
*why* it does what it does when you use it is a different matter.
OK, I stand corrected. What I *meant* is that it doesn't do what the OP
wanted.
Post by Rowland McDonnell
\newenvironment{myindent}{%
\begin{trivlist}\advance\leftskip by 1in\item[]}%
{\end{trivlist}}
might be more to your taste.
Thanks for the hint. Yet this, too, doesn't `push' the tabbing environment.

[snip]
Post by Rowland McDonnell
Depends on what you mean by `work'. I don't know why this is, and the
only way I can find out is by reading LaTeX's source code and finding
out how the tabbing environment ticks. But I suspect that the problem
is related to the way trivlist sets various LaTeX typesetting parameters
to zero.
Makes sense[1].
Post by Rowland McDonnell
Might list be more suitable than trivlist?
Even so, I would still like to know how to do it.

[snip]
Post by Rowland McDonnell
If you read the manual, you will find that the optional argument is
non-optional in the case of the trivlist environment - so item[] is
required.
Ooh, Now I see. Sorry about that.

[snip]
Post by Rowland McDonnell
<grin> A tip from a voodoo programmer[1] of long standing: it's usually
worth copying the form of anything relevant you find in the LaTeX kernel
if you can't get your version to work. Sacrificing a chicken under your
computer's nose can also be just as useful at times.
Suggestion taken. Fire's ready.

Much appreciated,
Ben

[1] which is to say `Now I can see the sense that it was making all along'
--
Real address: first name at robotics dot stanford dot edu
Rowland McDonnell
2003-11-14 00:13:12 UTC
Permalink
Post by Ben
Post by Rowland McDonnell
Post by Ben
\newenvironment{myindent}{%
\begin{trivlist}\setlength{\leftmargin}{1in}\item[]{}}%
{\end{trivlist}}
yields no results.
Eh? Yes it does: it defines a new environment. That environment works
as it was intended to, given the instructions you gave LaTeX. Quite
*why* it does what it does when you use it is a different matter.
OK, I stand corrected. What I *meant* is that it doesn't do what the OP
wanted.
Which is a very different matter. I'm not just nit-picking - the point
is that *something* happened with the above code, and it's often useful
to know *what* happened in order to figure out what to do next.
Post by Ben
Post by Rowland McDonnell
\newenvironment{myindent}{%
\begin{trivlist}\advance\leftskip by 1in\item[]}%
{\end{trivlist}}
might be more to your taste.
Thanks for the hint. Yet this, too, doesn't `push' the tabbing environment.
Grmph. Okay, so I read the source. The problem is that the tabbing
environment itself creates a trivlist to do its dirty work - and that
trivlist resets the changes you've made. I've had a look at the
definition of the quotation environment, and two things are obvious: the
list environment is very different to the way it was when LaTeX 2.09
stalked the Earth, so the user docs I have on the subject are useless;
and I don't know how to modify it to do what you want. btw, playing
around with parameters like \rightmargin directly often causes problems,
so I'm not surprised my idea broke.

I think the thing for you to do would be to look at how the quotation
environment (and similar?) is defined (classes.dtx), and then read
ltlist.dtx and a LaTeX manual to find out how to get the list
environment to do what you want; or to find out that it can't do what
you want.

I've just had a play, and one thing strikes me: the parameter which the
list environment uses to set the left margin is the appropriate
\leftmarginN parameter - set by the documentclass. I can't see why, if
all else fails, you shouldn't try a local modification of \leftmargini
coupled with a new environment based on list to give you that initial
1in jump you want.

[snip]
--
Remove the animal for email address: ***@dog.physics.org
PGP pub key 0x62DCCA78 Sorry - the spam got to me
http://www.mag-uk.org
UK biker? Join MAG and help keep bureaucracy at bay
Donald Arseneau
2003-11-14 02:16:28 UTC
Permalink
Post by Rowland McDonnell
Which is a very different matter. I'm not just nit-picking - the point
is that *something* happened with the above code, and it's often useful
to know *what* happened in order to figure out what to do next.
Oh yes you were. It is obvious that the desire was for an indented
environment, and the definition did not provide indentation.
Post by Rowland McDonnell
list environment is very different to the way it was when LaTeX 2.09
Not really. I can't think of any way that it changed.

\trivlist is for a *very* trivial paragraph object. Better use
\list for an indented environment, with assignments to \leftmargin
and \rightmargin in the appropriate argument.

\begin{list}{}{\setlength\leftmargin\parindent \setlength\rightmargin\parindent}
\item\relax
...
\end{list}

or copy the quotation environment

Donald Arseneau ***@triumf.ca
Rowland McDonnell
2003-11-14 02:17:39 UTC
Permalink
Post by Donald Arseneau
Post by Rowland McDonnell
Which is a very different matter. I'm not just nit-picking - the point
is that *something* happened with the above code, and it's often useful
to know *what* happened in order to figure out what to do next.
Oh yes you were. It is obvious that the desire was for an indented
environment, and the definition did not provide indentation.
Indentation, yes; but to be used exactly how? I wasn't sure of that.
Post by Donald Arseneau
Post by Rowland McDonnell
list environment is very different to the way it was when LaTeX 2.09
Not really. I can't think of any way that it changed.
In that case, I'll have to re-RTFM very carefully, because I found
references to list style parameters in 2e source code that I couldn't
find any mention of in Lamport's 2.09 book.
Post by Donald Arseneau
\trivlist is for a *very* trivial paragraph object. Better use
\list for an indented environment, with assignments to \leftmargin
and \rightmargin in the appropriate argument.
I thought I'd tried that, and couldn't get it to work. Hmm. I must
have been very stupid about it.
Post by Donald Arseneau
\begin{list}{}{\setlength\leftmargin\parindent
\setlength\rightmargin\parindent}
\item\relax
...
\end{list}
or copy the quotation environment
I tried that, but got baffled. I've got something that nearly works
right now, but I can't figure out why the following:

\documentclass[12pt,a4paper]{article}

\makeatletter

\newenvironment{myindent}{%
\begin{list}{}{\setlength{\leftmargin}{1in}
\listparindent=\parindent
\itemindent\listparindent
\parsep\z@ \@plus\p@
\setlength\rightmargin\parindent% maybe not required
\item\relax}}%
{\end{list}}

\makeatother

\begin{document}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem

\begin{myindent}
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis at
vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper
suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem
vel eum iriure dolor in hendrerit in vulputate velit esse molestie
consequat.
\end{myindent}

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis.

\end{document}

puts a bit of extra space above the myindent environment but not below.
Any ideas?

Rowland.
--
Remove the animal for email address: ***@dog.physics.org
PGP pub key 0x62DCCA78 Sorry - the spam got to me
http://www.mag-uk.org
UK biker? Join MAG and help keep bureaucracy at bay
Donald Arseneau
2003-11-14 07:06:14 UTC
Permalink
Post by Ben
\newenvironment{myindent}{%
\begin{list}{}{
[...]
\setlength\rightmargin\parindent% maybe not required
\item\relax}}%
}\item\relax}%

(The item can't be part of the "settings" argument.)

Donald Arseneau ***@triumf.ca
Rowland McDonnell
2003-11-14 18:05:36 UTC
Permalink
Post by Donald Arseneau
Post by Ben
\newenvironment{myindent}{%
\begin{list}{}{
[...]
\setlength\rightmargin\parindent% maybe not required
\item\relax}}%
}\item\relax}%
(The item can't be part of the "settings" argument.)
Dur. Obvious. Thanks - that works nicely.

Rowland.
--
Remove the animal for email address: ***@dog.physics.org
PGP pub key 0x62DCCA78 Sorry - the spam got to me
http://www.mag-uk.org
UK biker? Join MAG and help keep bureaucracy at bay
Continue reading on narkive:
Loading...