ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Patrick Gundlach <pg@levana.de>
Subject: Re: setuphead(s), subject, alternative=inmargin
Date: Sun, 23 Mar 2003 15:56:03 +0100	[thread overview]
Message-ID: <87of42p1x8.fsf@gundla.ch> (raw)
In-Reply-To: <1048427656.3e7dbc88af334@mail.virtual-earth.de> (Mathias Picker's message of "Sun, 23 Mar 2003 14:54:16 +0100")

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

  reply	other threads:[~2003-03-23 14:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-21 11:56 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87of42p1x8.fsf@gundla.ch \
    --to=pg@levana.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).