ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* setuphead(s), subject, alternative=inmargin
@ 2003-03-21 11:56 Mathias.Picker
  2003-03-21 13:02 ` Patrick Gundlach
  0 siblings, 1 reply; 15+ messages in thread
From: Mathias.Picker @ 2003-03-21 11:56 UTC (permalink / raw)


Is this supposed to work??

I'm using ver: 2003.1.31 and try to do the following, right out of the
handbook:

\setupheads[alternative=inmargin]
\subject{Some Text}


and expected the subject to start in the margin. It does not, and I
found out that this seems to work only for numbered heads like section
et al. How do I put a subject in the margin, possibly while using a
command to make it white on black (I can do that, only it's not in the
margin....)


Thanks for any help

Mathias

-- 
                            virtual earth
 Mathias Picker
 Geschäftsführer      Gesellschaft für Wissens re/prä sentation mbH

                            Mathias.Picker@virtual-earth.de 
			    Fon +49 89  / 540 7425-1
                            Fax +49 89  / 540 7425-9

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

* Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 11:56 setuphead(s), subject, alternative=inmargin Mathias.Picker
@ 2003-03-21 13:02 ` Patrick Gundlach
  2003-03-21 13:33   ` Patrick Gundlach
                     ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Patrick Gundlach @ 2003-03-21 13:02 UTC (permalink / raw)


Mathias.Picker@virtual-earth.de writes:

> Is this supposed to work??

It is working. What do you mean by this? It is putting the number of
the head in the margin.

> How do I put a subject in the margin,

Try this one:
==================================================
% taken from core-sec.tex
\def\MyHead#1#2%
  {\vbox
     {\localheadsetup
      \begstrut % use one \strut here!
       \llap{\hbox {\ifheadnumbercontent#1 \fi 
         #2\hskip\localheadskip\hskip\linkermargeafstand}}}}

\showframe
\starttext
\setuphead[section][alternative=command,command=\MyHead]
\section{some}
\setuphead[section][alternative=command,command=\MyHead,number=no]
\section{some}
\stoptext
==================================================

Probably Hans comes up with some magic, but this might work as well.


Patrick

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

* Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 13:02 ` Patrick Gundlach
@ 2003-03-21 13:33   ` Patrick Gundlach
  2003-03-21 13:50   ` mathiasp
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: Patrick Gundlach @ 2003-03-21 13:33 UTC (permalink / raw)


Patrick Gundlach <pg@levana.de> writes:

> Try this one:

[...]


Uh, Patrick, wake up! This is crap. Perhaps a little better is:

% taken from core-sec.tex
\def\MyHead#1#2%
  {\vbox
     {\localheadsetup
      \begstrut % use one \strut here!
       \llap{\hbox {\ifheadnumbercontent{#1}\kern\numberheaddistance\fi 
         #2\hskip\linkermargeafstand}}}}

\showframe
\starttext
\setuphead[section][alternative=command,command=\MyHead]
\section{some}
\setuphead[section][alternative=command,command=\MyHead,distance=0.1pt]
\section{some}
\setuphead[section][alternative=command,command=\MyHead,number=no]
\section{some}
\stoptext


Anonymous

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

* Re: Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 13:02 ` Patrick Gundlach
  2003-03-21 13:33   ` Patrick Gundlach
@ 2003-03-21 13:50   ` mathiasp
  2003-03-21 14:02   ` Mathias Picker
  2003-03-21 14:13   ` Hans Hagen
  3 siblings, 0 replies; 15+ messages in thread
From: mathiasp @ 2003-03-21 13:50 UTC (permalink / raw)


Zitat von Patrick Gundlach <pg@levana.de>:

> Mathias.Picker@virtual-earth.de writes:
> 
> > Is this supposed to work??
> 
> It is working. What do you mean by this? It is putting the number of
> the head in the margin.

:-) Yes, but subject has no number...

I want to put the subject (text!) across margin and text. I don't know if that
is even possible.....
It should look somewhat like the latex refart classes, e.g.

      margin|text


 My Subject header here with more and more text

             And the text here
             (more and more text)
> 
> > How do I put a subject in the margin,
> 
> [snipped example]
>
> Probably Hans comes up with some magic, but this might work as well. [snip]

Hopefully :-)

Thanks, Mathias

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

* Re: Re: setuphead(s), subject, alternative=inmargin
@ 2003-03-21 14:02   ` Mathias Picker
  2003-03-21 14:55     ` Patrick Gundlach
  0 siblings, 1 reply; 15+ messages in thread
From: Mathias Picker @ 2003-03-21 14:02 UTC (permalink / raw)


Hi Patrick,

Zitat von Patrick Gundlach <pg@levana.de>:

> Mathias.Picker@virtual-earth.de writes:
> 
> > Is this supposed to work??
> 
> It is working. What do you mean by this? It is putting the number of
> the head in the margin.

:-) Yes, but subject has no number...

I want to put the subject (text!) across margin and text. I don't know if that
is even possible.....
It should look somewhat like the latex refart classes, e.g.

      margin|text


 My Subject header here with more and more text

             And the text here
             (more and more text)
> 
> > How do I put a subject in the margin,
> 
> [snipped example]
>
> Probably Hans comes up with some magic, but this might work as well. [snip]

Hopefully :-)

Thanks, Mathias




----- Ende der weitergeleiteten Nachricht -----

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

* Re: Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 13:02 ` Patrick Gundlach
                     ` (2 preceding siblings ...)
  2003-03-21 14:02   ` Mathias Picker
@ 2003-03-21 14:13   ` Hans Hagen
  2003-03-21 14:42     ` Patrick Gundlach
  3 siblings, 1 reply; 15+ messages in thread
From: Hans Hagen @ 2003-03-21 14:13 UTC (permalink / raw)


At 02:02 PM 3/21/2003 +0100, you wrote:

>Probably Hans comes up with some magic, but this might work as well.

there is the magical command \margintext

I leave it to patrick to explore the following:

\starttext

\margintext{patrick}
\margintext{who's that}

\input tufte

\margintext{patrick}
\stackposdown \margintext{who's that}

\input tufte

\setupinmargin[2][line=2]

\margintext{patrick}
\margintext{who's that}

\input tufte

\stoptext

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 14:13   ` Hans Hagen
@ 2003-03-21 14:42     ` Patrick Gundlach
  2003-03-21 15:03       ` Hans Hagen
  0 siblings, 1 reply; 15+ messages in thread
From: Patrick Gundlach @ 2003-03-21 14:42 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:

Hello Hans,

> I leave it to patrick to explore the following:
>
> \starttext
>
> \margintext{patrick}
> \margintext{that's me}


Well, I was playing with this before (while looking for the answer for
Mathias), but I did not get any margintext. Now I know that it works
only when there is some text associated with it.

I didn't get any margin macro to work in \MyHead (tried
\inleft,..). But I didn't feel like looking for the reason (yet).


Patrick

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

* Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 14:02   ` Mathias Picker
@ 2003-03-21 14:55     ` Patrick Gundlach
  2003-03-23 13:54       ` Mathias Picker
  0 siblings, 1 reply; 15+ messages in thread
From: Patrick Gundlach @ 2003-03-21 14:55 UTC (permalink / raw)


Mathias Picker <Mathias.Picker@virtual-earth.de> writes:

Hello,

> I don't know if that is even possible..... 

sure it is possible. Why not?

> It should look somewhat
> like the latex refart classes, e.g.
>
>       margin|text
>
>
>  My Subject header here with more and more text
>
>              And the text here
>              (more and more text)


Please show us where the subject header should begin. Should it start
at the left edge of the margin or where?

Refering to some LaTeX class is not very helpful, since the
ConTeXt-source-readers don't use LaTeX very often :) 

Try this one. If it does not do what you want, please be exact about
your specification!

[Mostly taken from a source Hans has posted (x-steps style)]:

\def\MyHead#1#2%
  {\vbox
     {\localheadsetup
      \begstrut % is this really needed?
       \hbox {\hskip-\marginwidth\hskip-\margindistance
       \ifheadnumbercontent{#1}\kern\numberheaddistance\fi 
         #2}}}


Patrick

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

* Re: Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 14:42     ` Patrick Gundlach
@ 2003-03-21 15:03       ` Hans Hagen
  2003-03-21 15:27         ` Patrick Gundlach
  0 siblings, 1 reply; 15+ messages in thread
From: Hans Hagen @ 2003-03-21 15:03 UTC (permalink / raw)


At 03:42 PM 3/21/2003 +0100, you wrote:
>Hans Hagen <pragma@wxs.nl> writes:
>
>Hello Hans,
>
> > I leave it to patrick to explore the following:
> >
> > \starttext
> >
> > \margintext{patrick}
> > \margintext{that's me}
>
>
>Well, I was playing with this before (while looking for the answer for
>Mathias), but I did not get any margintext. Now I know that it works
>only when there is some text associated with it.
>
>I didn't get any margin macro to work in \MyHead (tried
>\inleft,..). But I didn't feel like looking for the reason (yet).

you're lucky: a few days ago i added a key: margintext=yes to the setuphead 
command that will enable flushing of margin texts

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 15:03       ` Hans Hagen
@ 2003-03-21 15:27         ` Patrick Gundlach
  2003-03-21 16:24           ` Hans Hagen
  0 siblings, 1 reply; 15+ messages in thread
From: Patrick Gundlach @ 2003-03-21 15:27 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:

Hello,

> you're lucky: a few days ago i added a key: margintext=yes to the
> setuphead command that will enable flushing of margin texts

And how shoud it be used?

\setuphead[...][margintext=yes,command=MyHead]

\def\MyHead#1#2{\margintext{#1,#2}}  is not the way to go, is it?

ConTeXt  ver: 2003.3.17  fmt: 2003.3.18  int: english  mes: english


Patrick

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

* Re: Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 15:27         ` Patrick Gundlach
@ 2003-03-21 16:24           ` Hans Hagen
  2003-03-21 17:47             ` Patrick Gundlach
  2003-03-21 17:58             ` Patrick Gundlach
  0 siblings, 2 replies; 15+ messages in thread
From: Hans Hagen @ 2003-03-21 16:24 UTC (permalink / raw)


At 04:27 PM 3/21/2003 +0100, you wrote:
>Hans Hagen <pragma@wxs.nl> writes:
>
>Hello,
>
> > you're lucky: a few days ago i added a key: margintext=yes to the
> > setuphead command that will enable flushing of margin texts
>
>And how shoud it be used?
>
>\setuphead[...][margintext=yes,command=MyHead]
>
>\def\MyHead#1#2{\margintext{#1,#2}}  is not the way to go, is it?

no, it's just flushing previous ones; maybe the next solution will prevent 
a sleepless night:

\starttext

\setuphead
   [subsubsection]
   [alternative=text,distance=0pt,command=\MyHead]

\def\MyHead#1#2{\inleftmargin{#1 #2}}

\subsubsection{patrick}

\input tufte

\stoptext

normally text will put the head in from of the text, so here we let the 
command lap it to the left; of course we need to nil the distance; so, 
actually it fits will into the normal configuration.

so, if you cook up a nice keyword for this alternative, i will show you how 
easy it is added as alternative -)

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 16:24           ` Hans Hagen
@ 2003-03-21 17:47             ` Patrick Gundlach
  2003-03-21 17:58             ` Patrick Gundlach
  1 sibling, 0 replies; 15+ messages in thread
From: Patrick Gundlach @ 2003-03-21 17:47 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:

> no, it's just flushing previous ones; maybe the next solution will
> prevent a sleepless night:

Great!

So we have two different setups now (well, there are 100s more) :

%      |left  || textarea
%      |margin||                           |     |
%      |      ||                           |     |
%somelonghead*||We thrive in ...           |     |   (#1)
%      |      ||                           |     |
%      |      ||                           |     |
%      |      ||                           |     |
%      |*somehead nextsection              |     |   (#2)
%      |      ||                           |     |
%      |      ||We thrive in ...           |     |


* is the point of alignment.

#1 is covered by \inleftmargin #1 #2 

#2 is covered by MyHead which I've posted earlier.

It would be nice to have some kind of "numberdistance", which goes
between number and head  (1____firstsection). 



> normally text will put the head in from of the text, so here we let
> the command lap it to the left; of course we need to nil the distance;
> so, actually it fits will into the normal configuration.

OK, I have tested *without* text in the section ...

> so, if you cook up a nice keyword for this alternative, 



alternative=a,b,c :) 

#1: marginright  (= right aligned in margin) and #2: marginleft
 (since I am a bit confused by the naming of right- and leftalign in
 ConTeXt, this will be the other way round, I guess).

> i will show
> you how easy it is added as alternative -)

Since I had a quick look in core-sec.tex I could guess how to add the
keywords. The most difficult part would be the translation to dutch
(margelinks?) 


Patrick

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

* Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 16:24           ` Hans Hagen
  2003-03-21 17:47             ` Patrick Gundlach
@ 2003-03-21 17:58             ` Patrick Gundlach
  1 sibling, 0 replies; 15+ messages in thread
From: Patrick Gundlach @ 2003-03-21 17:58 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:

Hello again,

> \setuphead
>    [subsubsection]
>    [alternative=text,distance=0pt,command=\MyHead]
>
> \def\MyHead#1#2{\inleftmargin{#1 #2}}

shouldn't the distance go between the number and the #2? In the
\inleftmargin case it goes bewteen left margin and #2. In the normal
case, it is between the text and number.

Patrick

... slightly confused 

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

* Re: Re: setuphead(s), subject, alternative=inmargin
  2003-03-21 14:55     ` Patrick Gundlach
@ 2003-03-23 13:54       ` Mathias Picker
  2003-03-23 14:56         ` Patrick Gundlach
  0 siblings, 1 reply; 15+ messages in thread
From: Mathias Picker @ 2003-03-23 13:54 UTC (permalink / raw)


Hi Patrick, 
 
first, thanks! This solved my problem 90%. BIG Thanks!! 
 
 
If you're interested in why and what's missing: 
 
Zitat von Patrick Gundlach <pg@levana.de>: 
 
> Mathias Picker <Mathias.Picker@virtual-earth.de> writes: 
>  
> Hello, 
>  
> > I don't know if that is even possible.....  
>  
> sure it is possible. Why not? 
 
As you probably guessed, I'm quite new at this :-) 
 
> [snip] 
> Please show us where the subject header should begin. Should it start 
> at the left edge of the margin or where? 
 
Yes, and I didn't specify it because _my_ problem was how to cross the 
margin/text boundary. I didn't know it was so easy (shifting a hbox by 
\hskip-dimen)  
 
> Refering to some LaTeX class is not very helpful, since the 
> ConTeXt-source-readers don't use LaTeX very often :)  
 
:-) You're right, obviously.. 
 
  
> Try this one. If it does not do what you want, please be exact about 
> your specification! 
 
That's most of what I wanted!! Great. I'm still puzzling over how to change 
the width of the hbox to \textwidth+\marginwidth\margindistance, but for now 
I'm saved. Why do I want a wider hbox? I print white fonts on black 
background, so the left shifted \hbox with a width of (I assume) \textwidth  
looks different from what I wanted. But it works for now... 
 
 
Have a nice week, 
 
Mathias 

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

* Re: setuphead(s), subject, alternative=inmargin
  2003-03-23 13:54       ` Mathias Picker
@ 2003-03-23 14:56         ` Patrick Gundlach
  0 siblings, 0 replies; 15+ messages in thread
From: Patrick Gundlach @ 2003-03-23 14:56 UTC (permalink / raw)


Mathias Picker <Mathias.Picker@virtual-earth.de> writes:

Hello Mathias,

> first, thanks! This solved my problem 90%. BIG Thanks!! 

good to hear, but usually the rest 10% are the most difficult ;-)

> That's most of what I wanted!! Great. I'm still puzzling over how to change 
> the width of the hbox to \textwidth+\marginwidth\margindistance, but for now 
> I'm saved. Why do I want a wider hbox? I print white fonts on black 
> background, so the left shifted \hbox with a width of (I assume) \textwidth  
> looks different from what I wanted. But it works for now... 


OK, just in case you run pdfetex (see the e in between pdf and tex ;-})
you can use the \dimexpr ( .... )  primitive:


\def\MyHead#1#2%
  {\vbox
     {\localheadsetup
      \begstrut % is this really needed?
       \hbox {\hskip-\marginwidth\hskip-\margindistance 
         \framed[width=\dimexpr(\marginwidth+\margindistance+\textwidth),
               align=right, %raggedright
               frame=off,
               offset=2pt,
               background=color,
               backgroundcolor=black,
               foregroundcolor=white,
               ]{%
          \ifheadnumbercontent{#1}\kern\numberheaddistance\fi 
         #2}}}}


%\showframe
\starttext
\setuphead[section][alternative=command,number=no,command=\MyHead,style=\bf]
\section{some quick fox jump over very lazy dogs}
\input tufte
\stoptext


If you don't use pdfetex, you might think of switching. Or you could
do some calculation to achieve the same.

> Have a nice week, 

You, too.

Patrick

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

end of thread, other threads:[~2003-03-23 14:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-21 11:56 setuphead(s), subject, alternative=inmargin Mathias.Picker
2003-03-21 13:02 ` Patrick Gundlach
2003-03-21 13:33   ` Patrick Gundlach
2003-03-21 13:50   ` mathiasp
2003-03-21 14:02   ` Mathias Picker
2003-03-21 14:55     ` Patrick Gundlach
2003-03-23 13:54       ` Mathias Picker
2003-03-23 14:56         ` Patrick Gundlach
2003-03-21 14:13   ` Hans Hagen
2003-03-21 14:42     ` Patrick Gundlach
2003-03-21 15:03       ` Hans Hagen
2003-03-21 15:27         ` Patrick Gundlach
2003-03-21 16:24           ` Hans Hagen
2003-03-21 17:47             ` Patrick Gundlach
2003-03-21 17:58             ` Patrick Gundlach

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).