ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* "overscored" or "overlined" text … (or whatever it should be called)
@ 2012-01-25 12:14 Robert Blackstone
  2012-01-25 12:17 ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Blackstone @ 2012-01-25 12:14 UTC (permalink / raw)
  To: ntg-context

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

Dear all,

I am trying to reproduce with ConTeXt an old french text that contains numerous abbreviations, mostly of two types:
- words cut off by means of a "period", with the last letter of the complete word as a superscript above the period.
- "overscores"
  --either for single characters, for instance in words with double consonances, like "comme". One of these is sometimes omitted and replaced by an "overscore" on the previous vowel
  -- or on an entire abbreviation, such as "coe" for "comme" and "nre" for "notre"; they become coe and nre overscored.

Now I would like to reproduce these as closely as possible.

For the "period + superscript letter" I found  a solution: \lohi[]{\cdot}{t} (for superscript t), nearly perfect. The only imperfection I can see is that the dot sits slightly below the baseline. Is there a way to get it on the baseline?

The overscore on a single character presents no problem.

For an overscore on a complete word I have not found a solution. 
Three individual overscores on a three-letter word give a broken line; I do not know how to merge the three line components. (Incidentally, this hack does not work with mkiv)

The other solution I have tried is to put the word in a frame with a top-frame only. But this way the word (abbreviation) hangs underneath the base-line. 
Using \inframed instead of \framed  makes no difference. There appears not to be something like \setupinframed.

I have attached an example.

Thanks in advance for any help.

Regards,

Robert Blackstone


[-- Attachment #2: overscore-test1.tex --]
[-- Type: application/octet-stream, Size: 1179 bytes --]


\setupframed[location=middle,width=fit,topframe=on,leftframe=off,rightframe=off,bottomframe=off,strut=no]
\starttext

Lo{\" u}is, par la grace de Dieu, Roy de France et de Navarre, {\` a} nos am{\' e}s et feaux Conseillers[,] les gens tenant nos Cours de Parlem\lohi[]{\cdot}{t}[,] M\lohi[]{~\cdot}{res} des requ{\^ e}tes ord\lohi[]{~\cdot}{es} de {\= n}{\= r}{\= e}   H{\^ o}tel, Grand Conseil, Prev{\^ o}t de Paris, Baillifs, senechaux, leurs Lieuten\lohi[]{~\cdot}{ts}  civils, et autres nos Justiciers qu'il appartiendra salut. Notre bien aim{\' e} Jaques Hotteterre l'un des Musiciens de {\= n}{\= r}{\= e}  Chambre pour la Fl.\  Trav\lohi[]{~\cdot}{re}  nous a fait exposer qu'il desireroit donner au public divers Ouvrages de Musiq; tant vocale, qu'instrumentale, et pour les Fl.\ Traversieres a 2.\ ou plus\lohi[]{~\cdot}{rs}  parties de sa composition, s'il nous plaisoit de luy accorder nos lettres de Privil
 {\' e}ge pour la ville de Paris seulement.  
\bigskip
Unacceptable alternatives for  {\= n}{\= r}{\= e}: de \framed{nre}   H{\^ o}tel, de \inframed{nre}   H{\^ o}tel, de \framed[height=0.7em]{nre} H{\^ o}tel, de \high{\framed{nre}}   H{\^ o}tel, 

\stoptext 

[-- Attachment #3: 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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 12:14 "overscored" or "overlined" text … (or whatever it should be called) Robert Blackstone
@ 2012-01-25 12:17 ` Hans Hagen
  2012-01-25 17:04   ` Philipp A.
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2012-01-25 12:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Robert Blackstone

On 25-1-2012 13:14, Robert Blackstone wrote:
> Dear all,
>
> I am trying to reproduce with ConTeXt an old french text that contains numerous abbreviations, mostly of two types:
> - words cut off by means of a "period", with the last letter of the complete word as a superscript above the period.
> - "overscores"
>    --either for single characters, for instance in words with double consonances, like "comme". One of these is sometimes omitted and replaced by an "overscore" on the previous vowel
>    -- or on an entire abbreviation, such as "coe" for "comme" and "nre" for "notre"; they become coe and nre overscored.

\overbar{test}

btw, never do a \setupframed globally as it will infect many derived 
frames components ... best do a \defineframed ... then

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 12:17 ` Hans Hagen
@ 2012-01-25 17:04   ` Philipp A.
  2012-01-25 18:02     ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Philipp A. @ 2012-01-25 17:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

while we are at it: how to do do strikethrough text? there is a changelog
on contextgarden which says it was added, but \strike or \strikethrough are
not defined.

i have (a diagonal) one here, but it doesn’t really work in math mode (the
text inside is normal). that being said, is there something like
\ifthiswascalledinmathmode{then}{else}?

\def\strike#1{\tikz[baseline=(c.base)]{
    \node[inner sep=0pt] (c) {#1};
    \draw (c.south west) -- (c.north east);
}}

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

[-- 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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 17:04   ` Philipp A.
@ 2012-01-25 18:02     ` Hans Hagen
  2012-01-25 19:20       ` Philipp A.
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2012-01-25 18:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 25-1-2012 18:04, Philipp A. wrote:
> while we are at it: how to do do strikethrough text? there is a changelog
> on contextgarden which says it was added, but \strike or \strikethrough are
> not defined.
>
> i have (a diagonal) one here, but it doesn’t really work in math mode (the
> text inside is normal). that being said, is there something like
> \ifthiswascalledinmathmode{then}{else}?

\ifmmode

> \def\strike#1{\tikz[baseline=(c.base)]{
>      \node[inner sep=0pt] (c) {#1};
>      \draw (c.south west) -- (c.north east);
> }}

probably more efficient:

\startuniqueMPgraphic{strikeme}
     path p ; p := OverlayBox topenlarged -ExHeight bottomenlarged 
-ExHeight ;
     draw llcorner p -- urcorner p withcolor OverlayColor ;
\stopuniqueMPgraphic

\defineoverlay[strikeme][\uniqueMPgraphic{strikeme}]

\defineframed[StrikeMe][background=strikeme,frame=off,offset=0pt,location=low,backgroundcolor=blue]

\starttext

\dorecurse{100}{test \StrikeMe{now \recurselevel} test $\StrikeMe{x}$ 
test \StrikeMe{$x$} test }

\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 18:02     ` Hans Hagen
@ 2012-01-25 19:20       ` Philipp A.
  2012-01-25 20:13         ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Philipp A. @ 2012-01-25 19:20 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


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

2012/1/25 Hans Hagen <pragma@wxs.nl>

> \ifmmode
>

thanks. that was obvious…

$\StrikeMe{x}$
>

unfortunately this does the same as my tikz version: it exits math mode:

$\StrikeMe{\ifmmode math mode! \else no math mode :( \fi} \ifmmode math
mode. \else wat \fi$

returns

no math mode :( *mathmode.*

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

[-- 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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 19:20       ` Philipp A.
@ 2012-01-25 20:13         ` Wolfgang Schuster
  2012-01-25 20:17           ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2012-01-25 20:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


Am 25.01.2012 um 20:20 schrieb Philipp A.:

> 2012/1/25 Hans Hagen <pragma@wxs.nl>
> \ifmmode
> 
> thanks. that was obvious…
> 
> $\StrikeMe{x}$
> 
> unfortunately this does the same as my tikz version: it exits math mode:
> 
> $\StrikeMe{\ifmmode math mode! \else no math mode :( \fi} \ifmmode math mode. \else wat \fi$
> 
> returns
> 
> no math mode :( math mode.

\framed puts the content in a \hbox and when you put a \hbox in a math environment the text in the box is typeset in text mode, this feature is used for the \text command. To get now the content of the \StrikeMe command in math mode a different definition.

\defineframed[StrikeMeFrame][background=strikeme,frame=off,offset=0pt,location=low,backgroundcolor=blue]

\define[1]\StrikeMe
  {\ifmmode
     \StrikeMeFrame{$#1$}%
   \else
     \StrikeMeFrame{#1}%
   \fi}

Wolfgang

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

[-- 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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 20:13         ` Wolfgang Schuster
@ 2012-01-25 20:17           ` Aditya Mahajan
  2012-01-25 23:53             ` Philipp A.
  2012-01-26 23:38             ` Hans Hagen
  0 siblings, 2 replies; 10+ messages in thread
From: Aditya Mahajan @ 2012-01-25 20:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

On Wed, 25 Jan 2012, Wolfgang Schuster wrote:

>
> Am 25.01.2012 um 20:20 schrieb Philipp A.:
>
>> 2012/1/25 Hans Hagen <pragma@wxs.nl>
>> \ifmmode
>>
>> thanks. that was obvious…
>>
>> $\StrikeMe{x}$
>>
>> unfortunately this does the same as my tikz version: it exits math mode:
>>
>> $\StrikeMe{\ifmmode math mode! \else no math mode :( \fi} \ifmmode math mode. \else wat \fi$
>>
>> returns
>>
>> no math mode :( math mode.
>
> \framed puts the content in a \hbox and when you put a \hbox in a math 
> environment the text in the box is typeset in text mode, this feature is 
> used for the \text command. To get now the content of the \StrikeMe 
> command in math mode a different definition.
>
> \defineframed[StrikeMeFrame][background=strikeme,frame=off,offset=0pt,location=low,backgroundcolor=blue]
>
> \define[1]\StrikeMe
>  {\ifmmode
>     \StrikeMeFrame{$#1$}%
>   \else
>     \StrikeMeFrame{#1}%
>   \fi}

Better is to use: \StrikeMeFrame{\mathsurround\zeropoint$#1$}. But for 
this to work in subscripts and superscripts, you must use math palette. 
IIRC, \mframed does that. In principle:

\mframed[background=strikeme]{...}

should work (untested).

@Hans: Can we have \definemframed etc as well?

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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 20:17           ` Aditya Mahajan
@ 2012-01-25 23:53             ` Philipp A.
  2012-01-26  0:22               ` Aditya Mahajan
  2012-01-26 23:38             ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Philipp A. @ 2012-01-25 23:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

2012/1/25 Aditya Mahajan <adityam@umich.edu>

> Better is to use: \StrikeMeFrame{\mathsurround\zeropoint$#1$}. But for
> this to work in subscripts and superscripts, you must use math palette.
> IIRC, \mframed does that. In principle:
>
> \mframed[background=strikeme]{**...}
>
> should work (untested).
>
> @Hans: Can we have \definemframed etc as well?
>
> Aditya
>

so this should work?

‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒

\startuniqueMPgraphic{strikeme}
   path p ; p := OverlayBox topenlarged -ExHeight bottomenlarged -ExHeight ;
   draw llcorner p -- urcorner p withcolor OverlayColor ;
\stopuniqueMPgraphic

\defineoverlay[strikeme][\uniqueMPgraphic{strikeme}]

\def\strike#1{%
\ifmmode%
\mframed[background=strikeme,frame=off]{#1}%
\else%
\inframed[background=strikeme,frame=off]{#1}%
\fi}

\starttext
\startformula
{\strike2a + \strike ab \over \strike a} = a
\stopformula

Works in text, \strike{two}too!

\stoptext

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

[-- 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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 23:53             ` Philipp A.
@ 2012-01-26  0:22               ` Aditya Mahajan
  0 siblings, 0 replies; 10+ messages in thread
From: Aditya Mahajan @ 2012-01-26  0:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

On Thu, 26 Jan 2012, Philipp A. wrote:

> 2012/1/25 Aditya Mahajan <adityam@umich.edu>
>
>> Better is to use: \StrikeMeFrame{\mathsurround\zeropoint$#1$}. But for
>> this to work in subscripts and superscripts, you must use math palette.
>> IIRC, \mframed does that. In principle:
>>
>> \mframed[background=strikeme]{**...}
>>
>> should work (untested).
>>
>> @Hans: Can we have \definemframed etc as well?
>>
>> Aditya
>>
>
> so this should work?
>
> ‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒
>
> \startuniqueMPgraphic{strikeme}
>   path p ; p := OverlayBox topenlarged -ExHeight bottomenlarged -ExHeight ;
>   draw llcorner p -- urcorner p withcolor OverlayColor ;
> \stopuniqueMPgraphic
>
> \defineoverlay[strikeme][\uniqueMPgraphic{strikeme}]
>
> \def\strike#1{%
> \ifmmode%
> \mframed[background=strikeme,frame=off]{#1}%
> \else%
> \inframed[background=strikeme,frame=off]{#1}%
> \fi}
>
> \starttext
> \startformula
> {\strike2a + \strike ab \over \strike a} = a
> \stopformula
>
> Works in text, \strike{two}too!
>
> \stoptext


Don't use {... \over ...} as it will mess up the calculation of math 
style. \frac{...}{...} is more robust.

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] 10+ messages in thread

* Re:  "overscored" or "overlined" text … (or whatever it should be called)
  2012-01-25 20:17           ` Aditya Mahajan
  2012-01-25 23:53             ` Philipp A.
@ 2012-01-26 23:38             ` Hans Hagen
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2012-01-26 23:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 25-1-2012 21:17, Aditya Mahajan wrote:

> @Hans: Can we have \definemframed etc as well?

sure, the next beta will have ...

\starttext

     \dontleavehmode test \mframed{x} test $x^{\mframed{x}}$ test 
\inmframed{x} test $x^{\inmframed{x}}$ test

     \definemathframed[whatever][location=low]

     \dontleavehmode test \whatever{x} test 
$x^{\whatever[framecolor=red]{x}}$ test

 
\definemathframed[another][whatever][background=color,backgroundcolor=blue,foregroundcolor=white]

     \dontleavehmode test \another{x} test 
$x^{\another[framecolor=red]{x}}$ test

\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 10+ messages in thread

end of thread, other threads:[~2012-01-26 23:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-25 12:14 "overscored" or "overlined" text … (or whatever it should be called) Robert Blackstone
2012-01-25 12:17 ` Hans Hagen
2012-01-25 17:04   ` Philipp A.
2012-01-25 18:02     ` Hans Hagen
2012-01-25 19:20       ` Philipp A.
2012-01-25 20:13         ` Wolfgang Schuster
2012-01-25 20:17           ` Aditya Mahajan
2012-01-25 23:53             ` Philipp A.
2012-01-26  0:22               ` Aditya Mahajan
2012-01-26 23:38             ` Hans Hagen

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