ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: dashed underbar
Date: Tue, 5 Apr 2011 22:29:50 +0200	[thread overview]
Message-ID: <F70BAFE4-04E6-4448-BFF6-2F671E21CEF7@googlemail.com> (raw)
In-Reply-To: <4D9B7673.1090608@aon.at>


Am 05.04.2011 um 22:07 schrieb Daniel Schopper:

> Dear all,
> I'm looking for a solution for dashed underlining. Hacking around I've come quite close, with the only problem that when the underlining begins at the start of a paragraph there gets an empty (grid) line inserted before it. See:
> 
> \defineoverlay [backgraphics] [\positionoverlay{backgraphics}]
> \setupbackgrounds
>  [page]
>  [background={backgraphics}]
> 
> \setupMPvariables[mpos:par][gridtype=1,gridshift=-0.5ex,gridwidth=0.1ex, gridcolor=black,fillcolor=white,linecolor=white]
> 
> \newcount\dashulinecounter \dashulinecounter=1
> 
> \definestartstop[dashuline][before={\dostartdashuline},after={\dostopdashuline}]
> \def\dostartdashuline{%
> 	\startpositionoverlay{backgraphics}%
> 	 \setMPpositiongraphic{b:uline:\the\dashulinecounter}{mpos:par}{self=uline:\the\dashulinecounter}%
> 	\stoppositionoverlay
> 	\fpos{uline:\the\dashulinecounter}%
> }
> \def\dostopdashuline{%
> 	\tpos{uline:\the\dashulinecounter}%
> 	\advance\dashulinecounter by 1%
> }
> 
> 
> \starttext
> No Line \startdashuline \dorecurse{20}{This is just a test. }\stopdashuline \par
> \startdashuline \dorecurse{20}{This is just a test. }\stopdashuline
> \stoptext
> 
> I'm sure some of you know a simpler and more elegant solution that maybe allows even dotted underlining?! Or does anyone have a hint how to get rid of the empty line?

\definetextbackground
  [dashed]
  [   location=text,
    framecolor=black,
   alternative=1,
       voffset=-\strutdp,
    background=,
         frame=off,
          dash=1]

\starttext
\startdashed\input ward \stopdashed
\stoptext

Wolfgang


___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2011-04-05 20:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05 20:07 Daniel Schopper
2011-04-05 20:29 ` Wolfgang Schuster [this message]
2011-04-05 21:07   ` Daniel Schopper
2011-04-07  8:04   ` Daniel Schopper
2011-04-08 12:55   ` dashed underbar: wiki Procházka Lukáš Ing. - Pontex s. r. o.
2011-04-08 20:30     ` Aditya Mahajan
2011-04-10 12:08       ` Mojca Miklavec
2011-04-10 15:28         ` Aditya Mahajan

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=F70BAFE4-04E6-4448-BFF6-2F671E21CEF7@googlemail.com \
    --to=schuster.wolfgang@googlemail.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).