ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* dashed underbar
@ 2011-04-05 20:07 Daniel Schopper
  2011-04-05 20:29 ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Schopper @ 2011-04-05 20:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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?
Cheers,
Daniel
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2011-04-10 15:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-05 20:07 dashed underbar Daniel Schopper
2011-04-05 20:29 ` Wolfgang Schuster
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

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