ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: About formatting the "Fonts out of ConTEXT" manual
Date: Tue, 15 Aug 2017 12:35:24 +0200	[thread overview]
Message-ID: <CACyK-ep_cig5M8OdxvJHZXX6tgiLo=694iJisymAqvNHoYao+g@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1657 bytes --]

Hi Hans,
I love the style used for this manual. I tried to do the same thing, but
it's a long way off !
I tried to find the source code to inspire me :-)
I did this :

\startuniqueMPgraphic{titled}
  path p ;
  p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
  pickup pencircle scaled 1mm ;
  linecap := squared ;
  drawoptions(withcolor \MPcolor{darkred}) ;
  draw ulcorner p -- urcorner p ;
  setbounds currentpicture to p ;
\stopuniqueMPgraphic

\defineoverlay[titled][\uniqueMPgraphic{titled}]

\startuseMPgraphic{triangledone}
fill lltriangle scaled 4cm withcolor darkred;
\stopuseMPgraphic

\defineoverlay[triangledone][\useMPgraphic{triangledone}]

\def\Triangledone#1%
  {\framed
      [background=triangledone,frame=off,offset=overlay]
  {\tfb\color[white]{\bf#1}}}

\startuseMPgraphic{triangledtwo}
fill lrtriangle scaled 4cm withcolor darkred;
\stopuseMPgraphic

\defineoverlay[triangledtwo][\useMPgraphic{triangledtwo}]

\def\Triangledtwo#1%
  {\framed
      [background=triangledtwo,frame=off,offset=overlay]
      {\tfb\color[white]{\bf#1}}}

\setupheadertexts[margin][][\Triangledone\pagenumber][\Triangledtwo\pagenumber][]

\setupfootertexts[margin][]
                 [{\framed
                     [background=titled,frame=off,offset=8pt,align=left,
                      width=\dimexpr\leftmarginwidth-\leftedgewidth\relax]
                      {\darkred\getmarking[section]}}]

\setuppagenumbering[alternative=doublesided,location=]

\setuphead
   [section]
   [color=darkred]

\starttext

\startchapter[title={First Chapter}]
\startsection[title={First section}]
\dorecurse{5}{\input knuth}
\stoptext

Thank you
Fabrice

[-- Attachment #1.2: Type: text/html, Size: 2533 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2017-08-15 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15 10:35 Fabrice Couvreur [this message]
2017-08-16  0:13 ` Henri
2017-08-16  0:16 ` Henri
2017-08-16  9:00   ` Fabrice Couvreur

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='CACyK-ep_cig5M8OdxvJHZXX6tgiLo=694iJisymAqvNHoYao+g@mail.gmail.com' \
    --to=fabrice1.couvreur@gmail.com \
    --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).