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

* Re: dashed underbar
  2011-04-05 20:07 dashed underbar Daniel Schopper
@ 2011-04-05 20:29 ` Wolfgang Schuster
  2011-04-05 21:07   ` Daniel Schopper
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2011-04-05 20:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: dashed underbar
  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.
  2 siblings, 0 replies; 8+ messages in thread
From: Daniel Schopper @ 2011-04-05 21:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Well, that was really simple… Any chance to get this working also with 
dots? (Where could I find more on those features? I guess anch-pgr.mkiv 
which seems quite complicated…)
Thanks a lot!



Am 05.04.11 22:29, schrieb Wolfgang Schuster:
> \definetextbackground
>    [dashed]
>    [   location=text,
>      framecolor=black,
>     alternative=1,
>         voffset=-\strutdp,
>      background=,
>           frame=off,
>            dash=1]
>
> \starttext
> \startdashed\input ward \stopdashed
> \stoptext
___________________________________________________________________________________
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

* Re: dashed underbar
  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.
  2 siblings, 0 replies; 8+ messages in thread
From: Daniel Schopper @ 2011-04-07  8:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Sorry to bother you again… Unfortunately this doesn't work out right in 
descriptions: after the
first line the underlining starts at the left margin not with the other 
indented lines. Anything one can do about this? Thanks!

\definetextbackground
   [dashed]
   [   location=text,
     framecolor=black,
      alternative=1,
        voffset=-1.2\strutdp,
     background=,
          frame=off,
           dash=1]
\definedescription
    [desc]
    [     width=2em,
      headstyle=normal]
\starttext
\startdesc{Desc:}\startdashed\input ward\stopdashed\stopdesc
\stoptext


> \definetextbackground
>    [dashed]
>    [   location=text,
>      framecolor=black,
>     alternative=1,
>         voffset=-\strutdp,
>      background=,
>           frame=off,
>            dash=1]
>
> \starttext
> \startdashed\input ward \stopdashed
> \stoptext
___________________________________________________________________________________
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

* Re: dashed underbar: wiki
  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   ` Procházka Lukáš Ing. - Pontex s. r. o.
  2011-04-08 20:30     ` Aditya Mahajan
  2 siblings, 1 reply; 8+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2011-04-08 12:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 843 bytes --]

Hello,

I tried to add the Wolfgang's solution to wiki, the last example on

http://wiki.contextgarden.net/TextBackground

But the rendered example doesn't show any (dashed) background, although the standalone test file does.

Why?

If the example was rendered otherwise than in reality, it wouldn't have sense to keep it on wiki...

Lukas


> \definetextbackground
>   [dashed]
>   [   location=text,
>     framecolor=black,
>    alternative=1,
>        voffset=-\strutdp,
>     background=,
>          frame=off,
>           dash=1]
>
> \starttext
> \startdashed\input ward \stopdashed
> \stoptext
>
> Wolfgang


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: t-DashUB.mkiv --]
[-- Type: application/octet-stream, Size: 248 bytes --]

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

\starttext
  \startdashed\input ward \stopdashed
\stoptext

[-- Attachment #3: t-DashUB.pdf --]
[-- Type: application/pdf, Size: 8622 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: dashed underbar: wiki
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Aditya Mahajan @ 2011-04-08 20:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 559 bytes --]

On Fri, 8 Apr 2011, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

> Hello,
>
> I tried to add the Wolfgang's solution to wiki, the last example on
>
> http://wiki.contextgarden.net/TextBackground
>
> But the rendered example doesn't show any (dashed) background, although the 
> standalone test file does.
>
> Why?

The underbar is drawn using metapost. The wiki still uses MkII, and does 
not have write18 enabled. So, you need to add \runMPgraphicsfalse in the 
file (I think that that should be added to cont-usr.tex on the wiki).

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: dashed underbar: wiki
  2011-04-08 20:30     ` Aditya Mahajan
@ 2011-04-10 12:08       ` Mojca Miklavec
  2011-04-10 15:28         ` Aditya Mahajan
  0 siblings, 1 reply; 8+ messages in thread
From: Mojca Miklavec @ 2011-04-10 12:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Patrick Gundlach

2011/4/8 Aditya Mahajan wrote:
> On Fri, 8 Apr 2011, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>
>> Hello,
>>
>> I tried to add the Wolfgang's solution to wiki, the last example on
>>
>> http://wiki.contextgarden.net/TextBackground
>>
>> But the rendered example doesn't show any (dashed) background, although
>> the standalone test file does.
>>
>> Why?
>
> The underbar is drawn using metapost. The wiki still uses MkII, and does not
> have write18 enabled. So, you need to add \runMPgraphicsfalse in the file (I
> think that that should be added to cont-usr.tex on the wiki).

I have added that command before \starttext in the wiki extension.

Aditya - can you please test it?

Mojca
___________________________________________________________________________________
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

* Re: dashed underbar: wiki
  2011-04-10 12:08       ` Mojca Miklavec
@ 2011-04-10 15:28         ` Aditya Mahajan
  0 siblings, 0 replies; 8+ messages in thread
From: Aditya Mahajan @ 2011-04-10 15:28 UTC (permalink / raw)
  To: Mojca Miklavec; +Cc: mailing list for ConTeXt users, Patrick Gundlach

[-- Attachment #1: Type: TEXT/PLAIN, Size: 922 bytes --]

On Sun, 10 Apr 2011, Mojca Miklavec wrote:

> 2011/4/8 Aditya Mahajan wrote:
>> On Fri, 8 Apr 2011, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>>
>>> Hello,
>>>
>>> I tried to add the Wolfgang's solution to wiki, the last example on
>>>
>>> http://wiki.contextgarden.net/TextBackground
>>>
>>> But the rendered example doesn't show any (dashed) background, although
>>> the standalone test file does.
>>>
>>> Why?
>>
>> The underbar is drawn using metapost. The wiki still uses MkII, and does not
>> have write18 enabled. So, you need to add \runMPgraphicsfalse in the file (I
>> think that that should be added to cont-usr.tex on the wiki).
>
> I have added that command before \starttext in the wiki extension.
>
> Aditya - can you please test it?

If I remove \runMPgraphicsfalse from the last example on 
http://wiki.contextgarden.net/TextBackground, I do not get the underbar.

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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://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).