ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* RE: FWD: \inmargin, \setupindenting, and overfull boxes
@ 2005-05-09 15:36 Idris Samawi Hamid
  0 siblings, 0 replies; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-09 15:36 UTC (permalink / raw)


Hi Hans

Could you send me/post a copy of the modified macro/file (I'm at a 
mission-critical stage on a project and don't want to install a new beta 
before it's 
done unless absolutely necessary->)

Also, is there a similar \dontcomplain fix for \start-\stopalignment[left] 
(underfull hbox)?

Idris
>===== Original Message From Hans Hagen <pragma@wxs.nl> =====
>> If there are a lot of margin notes, this can clutter the output
>> considerably, and that's not so much a problem, but an annoyance.
>> I've run into this as well, in context as well as in latex and
>> in my own macros. The problem is usually something like:
>
>i've added a \dontcomplain to the main macro now

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: FWD: \inmargin, \setupindenting, and overfull boxes
  2005-05-08 21:29   ` Taco Hoekwater
@ 2005-05-09  9:49     ` Hans Hagen
  0 siblings, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2005-05-09  9:49 UTC (permalink / raw)


Taco Hoekwater wrote:

> If there are a lot of margin notes, this can clutter the output
> considerably, and that's not so much a problem, but an annoyance.
> I've run into this as well, in context as well as in latex and
> in my own macros. The problem is usually something like:

i've added a \dontcomplain to the main macro now

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: FWD: \inmargin, \setupindenting, and overfull boxes
@ 2005-05-08 21:36 Idris Samawi Hamid
  0 siblings, 0 replies; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-08 21:36 UTC (permalink / raw)


>===== Original Message From Hans Hagen <pragma@wxs.nl> =====
>can you make me a minimal example showing the problem?

Sure, here are 2: both produce overfull hboxes.

All the best
Idris
======================================
\setupoutput[pdftex]%

\setupindenting[medium]

\starttext

\input knuth \inmargin{This is a test.}

\stoptext
========================================

================log=====================
systems : begin file test at line 5
(c:\CONTEXT\tex\texmf-local/tex/context/sample/knuth.tex)
Overfull \hbox (17.62474pt too wide) in paragraph at lines 7--7
[][]

\hbox(10.41603+4.05064)x0.0
.\hbox(0.0+0.0)x17.62474
.\hbox(10.41603+4.05064)x0.0
.\rule(10.41603+4.05064)x0.0
.\glue 0.0 plus 1.0fil minus 1.0fil
.\penalty 10000
.\glue(\parfillskip) 0.0 plus 1.0fil
.\glue(\rightskip) 0.0
===========================================

===========================================
\setupoutput[pdftex]%

\definestartstop
[quote]
[before={\startnarrower[1*left,1*right]\blank[big]},
after={\stopnarrower\blank[big]}]

\starttext

\startquote

\input knuth \inmargin{This is a test.}

\stopquote

\stoptext
==============================================

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: FWD: \inmargin, \setupindenting, and overfull boxes
  2005-05-08 20:04 ` Hans Hagen
@ 2005-05-08 21:29   ` Taco Hoekwater
  2005-05-09  9:49     ` Hans Hagen
  0 siblings, 1 reply; 16+ messages in thread
From: Taco Hoekwater @ 2005-05-08 21:29 UTC (permalink / raw)


Hans Hagen wrote:
> 
> can you make me a minimal example showing the problem?

Idris' original example shows the 'problem':

   \setupindenting[medium]
   \starttext
   \input knuth \inmargin{This is a test.}
   \stoptext

The output will be fine, but there will be one  'Overfull hbox'
message printed on the terminal for each \inmargin command.

If there are a lot of margin notes, this can clutter the output
considerably, and that's not so much a problem, but an annoyance.
I've run into this as well, in context as well as in latex and
in my own macros. The problem is usually something like:

    \vbox{\hsize 0pt \dontleavehmode}

Greetings, Taco

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: FWD: \inmargin, \setupindenting, and overfull boxes
  2005-05-07 20:00 Idris Samawi Hamid
@ 2005-05-08 20:04 ` Hans Hagen
  2005-05-08 21:29   ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Hans Hagen @ 2005-05-08 20:04 UTC (permalink / raw)


Idris Samawi Hamid wrote:
> CORRECTION: should be
> 
> ===============================================
> \let\normalinmargin\inmargin
> \def\inmargin#1{{\parindent0pt \normalinmargin{#1}}}
> 
> \def\INMARGIN#1{{\advance\leftskip by -2\parindent
>                 \inmargin{#1}
>                 \advance\rightskip by -2\parindent}}
> ===============================================

can you make me a minimal example showing the problem?

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: FWD: \inmargin, \setupindenting, and overfull boxes
  2005-05-07 14:21 Idris Samawi Hamid
@ 2005-05-08  7:46 ` Taco Hoekwater
  0 siblings, 0 replies; 16+ messages in thread
From: Taco Hoekwater @ 2005-05-08  7:46 UTC (permalink / raw)


Idris Samawi Hamid wrote:
> Taco, any more hacks up your sleeve?
> ;-)
> 
> And thank you very much for the last ones!

It seems you have a working solution now, but
I'll look into this next week to see if I we can
come up with a more permanent solution.

Greetings, Taco

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: FWD: \inmargin, \setupindenting, and overfull boxes
@ 2005-05-07 20:00 Idris Samawi Hamid
  2005-05-08 20:04 ` Hans Hagen
  0 siblings, 1 reply; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-07 20:00 UTC (permalink / raw)


CORRECTION: should be

===============================================
\let\normalinmargin\inmargin
\def\inmargin#1{{\parindent0pt \normalinmargin{#1}}}

\def\INMARGIN#1{{\advance\leftskip by -2\parindent
                \inmargin{#1}
                \advance\rightskip by -2\parindent}}
===============================================

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: FWD: \inmargin, \setupindenting, and overfull boxes
@ 2005-05-07 19:48 Idris Samawi Hamid
  0 siblings, 0 replies; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-07 19:48 UTC (permalink / raw)


Hi Taco and all,

I found a temporary solution: Given a \start-\stopnarrower environment like

===============================================
\definestartstop
  [quote]
  [before={\startnarrower[1*middle]\blank[big]},
    after={\stopnarrower\blank[big]}]
===============================================

Then the following will avoid the overfull box:

===============================================
\let\normalinmargin\inmargin
\def\inmargin#1{{\parindent0pt \normalinmargin{#1}}}

\def\INMARGIN#1{\advance\leftskip by -2\parindent
                \inmargin{#1}
                \advance\rightskip by -2\parindent}
===============================================

Of course this solution is not general, and depends on the actual setup of 
\start-\stopnarrower. The general problem with \inmargin appears to be that 
all parindents need to be reset.

I could not find a correct way to incorporate my solution above into Taco's 
original definition. If any of you have a better idea, please let me know!

Best
Idris

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: FWD: \inmargin, \setupindenting, and overfull boxes
@ 2005-05-07 14:21 Idris Samawi Hamid
  2005-05-08  7:46 ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-07 14:21 UTC (permalink / raw)


Hi Taco and all,

More on \inmargin and overfull boxes: If I define, e.g. a quote \start-stop 
the overfull boxes come back, even with Taco's definition:

======================================================
\setupoutput[pdftex]%
\setupindenting[medium]

\let\normalinmargin\inmargin
\def\inmargin#1{{\parindent0pt\normalinmargin{#1}}}

\definestartstop
  [quote]
  [before={\startnarrower[1*left,1*right]\blank[big]},
    after={\stopnarrower\blank[big]}]

\starttext

\startquote

\input knuth \inmargin{This is a test.}

\input knuth {\parindent0pt\inmargin{This is a test.}}

\stopquote

\stoptext
======================================================

Taco, any more hacks up your sleeve?
;-)

And thank you very much for the last ones!

Best
Idris

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: FWD: \inmargin, \setupindenting, and overfull boxes
  2005-05-07 13:30 Idris Samawi Hamid
@ 2005-05-07 13:47 ` Taco Hoekwater
  0 siblings, 0 replies; 16+ messages in thread
From: Taco Hoekwater @ 2005-05-07 13:47 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users

Idris Samawi Hamid wrote:
> I placed your definition in a \start-\stopenvironment file. The \inmargins are 
> in \product files each of which calls the environment file in its preamble. If 
> I compile just one product (say the second \product from the project), there 
> appears to be no problem. But if I compile the entire project, TeX chokes on 
> that same product.
> 
> Do you think this may be the problem?

Yes, because the environment file is read twice, you need a guard against redefining the redefinition. Placing a guard around it, like this, should work:

  \expandafter\ifx\csname normalinmargin \endcsname  \relax \else
    \let\normalinmargin\inmargin
    \def\inmargin#1{{\parindent0pt \normalinmargin{#1}}}
  \fi

(yes, that is an ugly hack, but it is one I can write withour actually having to test it before sending :))

Greetings, Taco

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: FWD: \inmargin, \setupindenting, and overfull boxes
@ 2005-05-07 13:30 Idris Samawi Hamid
  2005-05-07 13:47 ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-07 13:30 UTC (permalink / raw)


>===== Original Message From Taco Hoekwater <taco@elvenkind.com> =====
>Idris Samawi Hamid wrote:
>> Hi Taco,
>>
>> Ok your hack works for small files but in my larger work this is causing 
TeX's
>> capacity to overload (indeed, I don't think I've run into this particular
>> overload message before; does the `255' signify some ceiling here?):
>
>The definition is not recursive, but it should not be executed more
>than once because it saves the definition of \inmargin. Perhaps
>you have the \let line inside another macro or inside a buffer that
>is called more than once something similar.

I placed your definition in a \start-\stopenvironment file. The \inmargins are 
in \product files each of which calls the environment file in its preamble. If 
I compile just one product (say the second \product from the project), there 
appears to be no problem. But if I compile the entire project, TeX chokes on 
that same product.

Do you think this may be the problem?

Best
Idris

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: FWD: \inmargin, \setupindenting, and overfull boxes
  2005-05-07  2:55 Idris Samawi Hamid
@ 2005-05-07  9:14 ` Taco Hoekwater
  0 siblings, 0 replies; 16+ messages in thread
From: Taco Hoekwater @ 2005-05-07  9:14 UTC (permalink / raw)


Idris Samawi Hamid wrote:
> Hi Taco,
> 
> Ok your hack works for small files but in my larger work this is causing TeX's 
> capacity to overload (indeed, I don't think I've run into this particular 
> overload message before; does the `255' signify some ceiling here?):

The definition is not recursive, but it should not be executed more 
than once because it saves the definition of \inmargin. Perhaps 
you have the \let line inside another macro or inside a buffer that 
is called more than once something similar.

If you can't figure out what goes wrong, send me a file please?

Taco

^ permalink raw reply	[flat|nested] 16+ messages in thread

* RE: FWD: \inmargin, \setupindenting, and overfull boxes
@ 2005-05-07  2:55 Idris Samawi Hamid
  2005-05-07  9:14 ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-07  2:55 UTC (permalink / raw)


Hi Taco,

Ok your hack works for small files but in my larger work this is causing TeX's 
capacity to overload (indeed, I don't think I've run into this particular 
overload message before; does the `255' signify some ceiling here?):

=======================================================
! TeX capacity exceeded, sorry [grouping levels=255].
\normalinmargin #1->{
                     \parindent 0pt \normalinmargin {#1}}
\normalinmargin ...indent 0pt \normalinmargin {#1}
                                                  }
\normalinmargin ...indent 0pt \normalinmargin {#1}
                                                  }
\normalinmargin ...indent 0pt \normalinmargin {#1}
                                                  }
\normalinmargin ...indent 0pt \normalinmargin {#1}
                                                  }
\normalinmargin ...indent 0pt \normalinmargin {#1}
                                                  }
...
=====================================================

Although if I implement this manually it does not overload TeX:

===================================================
\setupoutput[pdftex]%

\setupindenting[medium]

%\let\normalinmargin\inmargin
%\def\inmargin#1{{\parindent0pt \normalinmargin{#1}}}

\starttext

\input knuth {\parindent0pt\inmargin{This is a test.}}

\stoptext
===================================================

Something about that pseudo-recursive definition I suppose? It may take a 
while for me to narrow this new problem down to a small file, but I can 
privately send you the larger files if you care to look at this.

Thnx 4 all your help.

Best
Idris

>===== Original Message From Taco Hoekwater <taco@elvenkind.com> =====
>Hi Idris,
>
>It's definately a \parindent, but I cannot figure whence it came.
>Anyway, if you need an immediate fix, the following hack works:

============================
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Fwd: \inmargin, \setupindenting, and overfull boxes
  2005-05-06  6:46   ` Taco Hoekwater
@ 2005-05-06 14:44     ` Idris Samawi Hamid
  0 siblings, 0 replies; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-06 14:44 UTC (permalink / raw)


Hi Taco,

On Fri, 06 May 2005 08:46:04 +0200, Taco Hoekwater <taco@elvenkind.com> 
wrote:

> Hi Idris,
>
> It's definately a \parindent, but I cannot figure whence it came.
> Anyway, if you need an immediate fix, the following hack works:
>
>    \let\normalinmargin\inmargin
>    \def\inmargin#1{{\parindent0pt \normalinmargin{#1}}}

Thank you for the fix; I'll test it after work.

This is interesting, because the original output looks fine in the 
argument to \inmargin, there is no actual indentation going on...

Thnx again
Idris

>> ------- Forwarded message -------
>> Dear cartel,
>> Here is one for you-) If you uncomment the \setupindenting you will get 
>> an
>> overfull hbox; a real nuisance when you have dozens of \inmargin's...

-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Fwd: \inmargin, \setupindenting, and overfull boxes
  2005-05-05 16:35 ` Fwd: " Idris Samawi Hamid
@ 2005-05-06  6:46   ` Taco Hoekwater
  2005-05-06 14:44     ` Idris Samawi Hamid
  0 siblings, 1 reply; 16+ messages in thread
From: Taco Hoekwater @ 2005-05-06  6:46 UTC (permalink / raw)


Hi Idris,

It's definately a \parindent, but I cannot figure whence it came.
Anyway, if you need an immediate fix, the following hack works:

   \let\normalinmargin\inmargin
   \def\inmargin#1{{\parindent0pt \normalinmargin{#1}}}

Greetings, Taco

Idris Samawi Hamid wrote:
> Hi gang,
> I sent this about ten days ago; trying again:-)
> 
> Best
> Idris
> 
> ------- Forwarded message -------
> Dear cartel,
> Here is one for you-) If you uncomment the \setupindenting you will get an
> overfull hbox; a real nuisance when you have dozens of \inmargin's...
> 
> Awaiting advice:-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Fwd: \inmargin, \setupindenting, and overfull boxes
  2005-04-27  2:18 Idris Samawi Hamid
@ 2005-05-05 16:35 ` Idris Samawi Hamid
  2005-05-06  6:46   ` Taco Hoekwater
  0 siblings, 1 reply; 16+ messages in thread
From: Idris Samawi Hamid @ 2005-05-05 16:35 UTC (permalink / raw)


Hi gang,
I sent this about ten days ago; trying again:-)

Best
Idris

------- Forwarded message -------
Dear cartel,
Here is one for you-) If you uncomment the \setupindenting you will get an
overfull hbox; a real nuisance when you have dozens of \inmargin's...

Awaiting advice:-)

Best
Idris

======================================
\setupoutput[pdftex]%

%\setupindenting[medium]

\starttext

\input knuth \inmargin{This is a test.}

\stoptext
========================================

================log=====================
systems         : begin file test at line 5
(c:\CONTEXT\tex\texmf-local/tex/context/sample/knuth.tex)
Overfull \hbox (17.62474pt too wide) in paragraph at lines 7--7
[][]

\hbox(10.41603+4.05064)x0.0
.\hbox(0.0+0.0)x17.62474
.\hbox(10.41603+4.05064)x0.0
..\rule(10.41603+4.05064)x0.0
..\glue 0.0 plus 1.0fil minus 1.0fil
.\penalty 10000
.\glue(\parfillskip) 0.0 plus 1.0fil
.\glue(\rightskip) 0.0
===========================================

-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2005-05-09 15:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-09 15:36 FWD: \inmargin, \setupindenting, and overfull boxes Idris Samawi Hamid
  -- strict thread matches above, loose matches on Subject: below --
2005-05-08 21:36 Idris Samawi Hamid
2005-05-07 20:00 Idris Samawi Hamid
2005-05-08 20:04 ` Hans Hagen
2005-05-08 21:29   ` Taco Hoekwater
2005-05-09  9:49     ` Hans Hagen
2005-05-07 19:48 Idris Samawi Hamid
2005-05-07 14:21 Idris Samawi Hamid
2005-05-08  7:46 ` Taco Hoekwater
2005-05-07 13:30 Idris Samawi Hamid
2005-05-07 13:47 ` Taco Hoekwater
2005-05-07  2:55 Idris Samawi Hamid
2005-05-07  9:14 ` Taco Hoekwater
2005-04-27  2:18 Idris Samawi Hamid
2005-05-05 16:35 ` Fwd: " Idris Samawi Hamid
2005-05-06  6:46   ` Taco Hoekwater
2005-05-06 14:44     ` Idris Samawi Hamid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).