ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Visually replace one character by another one automatically
@ 2007-11-27  3:07 Jeff Smith
  2007-11-27  8:18 ` Taco Hoekwater
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Smith @ 2007-11-27  3:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi again everyone!

I have a weird question. I sort of want to use ConTeXt to solve some
of my typing laziness. :-) I explain.

When typing a document, I use the normal single-quote style apostrophe
'  (UTF U+0027) - the "straight" apostrophe.

When typesetting the document, I want the apostrophe to appear like a
comma instead. The character is the single comma quotation mark (UTF
U+2019). (As both characters exist with different UTF definition ,
this is not a font issue.)

On my computer (it's a laptop), with my keyboard language settings and
all (under Ubuntu), the only apostrophe I can manage to type is the
first one. From what I can understand, my French Canadian keyboard
layout actually replaces the single quote key with something else more
important to us -- the acute accent (no, we don't use the French
azerty layout).

So right now all I can do is copy-paste the right character from the
Character Map... it's a bit impractical and unwieldy in the long run,
so this is not a good solution.

Furthermore, typing an apostrophe is second nature anyway when you've
been typing since childhood -- changing such typing habit is very
offputting AND it can create many mistakes. I don't want to think
about it. :-)

Therefore, I was wondering if there was a way to automatically replace
one character with another through some TeX magic! Changing all my
apostrophes in the input for single comma quotation mark when the
document is compiled.

Is this possible?

Thanks!
Jeff
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Visually replace one character by another one automatically
  2007-11-27  3:07 Visually replace one character by another one automatically Jeff Smith
@ 2007-11-27  8:18 ` Taco Hoekwater
  2007-11-27  9:07   ` Taco Hoekwater
  2007-11-27 15:14   ` Jeff Smith
  0 siblings, 2 replies; 9+ messages in thread
From: Taco Hoekwater @ 2007-11-27  8:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Jeff Smith wrote:
> 
> When typesetting the document, I want the apostrophe to appear like a
> comma instead. The character is the single comma quotation mark (UTF
> U+2019). (As both characters exist with different UTF definition ,
> this is not a font issue.)

This should happen automatically already. Context (well, TeX, really)
is even smarter than that: If you type 'hello', it will automatically
visualise that as ‘hello’. If this does not happen, something is not
right with your input, and you'd better post a small example.

Best wishes,
Taco
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Visually replace one character by another one automatically
  2007-11-27  8:18 ` Taco Hoekwater
@ 2007-11-27  9:07   ` Taco Hoekwater
  2007-11-27 15:14   ` Jeff Smith
  1 sibling, 0 replies; 9+ messages in thread
From: Taco Hoekwater @ 2007-11-27  9:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Taco Hoekwater wrote:
> Jeff Smith wrote:
>> When typesetting the document, I want the apostrophe to appear like a
>> comma instead. The character is the single comma quotation mark (UTF
>> U+2019). (As both characters exist with different UTF definition ,
>> this is not a font issue.)
> 
> This should happen automatically already. Context (well, TeX, really)
> is even smarter than that: If you type 'hello', it will automatically

It seems I was still half sleeping when I wrote that. The example should
be `hello', not 'hello'.
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Visually replace one character by another one automatically
  2007-11-27  8:18 ` Taco Hoekwater
  2007-11-27  9:07   ` Taco Hoekwater
@ 2007-11-27 15:14   ` Jeff Smith
  2007-11-27 15:23     ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Jeff Smith @ 2007-11-27 15:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Nov 27, 2007 3:18 AM, Taco Hoekwater <taco@elvenkind.com> wrote:
> This should happen automatically already. Context (well, TeX, really)
> is even smarter than that: If you type 'hello', it will automatically
> visualise that as 'hello'. If this does not happen, something is not
> right with your input, and you'd better post a small example.

Indeed, your answer made me check back old documents I had printed.
The comma apostrophe was there! When you don't think about those
things, you never realize them...

So I checked back a bit, and what is wrong then is not my input per
se, but my current document setup, which I don't know how to solve.

Two weeks ago, I asked about OpenType features. Mojca and Wolfgang
thus gave examples of \definefontfeature. So, since I wanted to try
out the historical ligatures in my font (dlig) alongside oldstyle
nombers, I used the following, based on what I was told:

\definefontfeature
 [myfeatures]
 [method=node,script=latn,language=dflt,liga=yes,onum=yes,kern=yes,dlig=yes]

It turns out this is the culprit. When I comment that out, the comma
apostrophes are back. :-)

This makes me very happy because after all I won't use the historical
ligatures. Therefore, I can use the oldstyle feature set and
everything works well.

That is not to say that wouldn't like to know how to solve what
happened though. For the sake of it (and some eventual document's
where this will be crucial), I would like to know what do I need to
add to \definefontfeature for the apostrophe magic to work?

Thanks!
Jeff
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Visually replace one character by another one automatically
  2007-11-27 15:14   ` Jeff Smith
@ 2007-11-27 15:23     ` Hans Hagen
  2007-11-27 16:15       ` Jeff Smith
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2007-11-27 15:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Jeff Smith wrote:
> On Nov 27, 2007 3:18 AM, Taco Hoekwater <taco@elvenkind.com> wrote:
>> This should happen automatically already. Context (well, TeX, really)
>> is even smarter than that: If you type 'hello', it will automatically
>> visualise that as 'hello'. If this does not happen, something is not
>> right with your input, and you'd better post a small example.
> 
> Indeed, your answer made me check back old documents I had printed.
> The comma apostrophe was there! When you don't think about those
> things, you never realize them...
> 
> So I checked back a bit, and what is wrong then is not my input per
> se, but my current document setup, which I don't know how to solve.
> 
> Two weeks ago, I asked about OpenType features. Mojca and Wolfgang
> thus gave examples of \definefontfeature. So, since I wanted to try
> out the historical ligatures in my font (dlig) alongside oldstyle
> nombers, I used the following, based on what I was told:
> 
> \definefontfeature
>  [myfeatures]
>  [method=node,script=latn,language=dflt,liga=yes,onum=yes,kern=yes,dlig=yes]
> 
> It turns out this is the culprit. When I comment that out, the comma
> apostrophes are back. :-)
> 
> This makes me very happy because after all I won't use the historical
> ligatures. Therefore, I can use the oldstyle feature set and
> everything works well.
> 
> That is not to say that wouldn't like to know how to solve what
> happened though. For the sake of it (and some eventual document's
> where this will be crucial), I would like to know what do I need to
> add to \definefontfeature for the apostrophe magic to work?

  tlig=yes trep=yes

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Visually replace one character by another one automatically
  2007-11-27 15:23     ` Hans Hagen
@ 2007-11-27 16:15       ` Jeff Smith
  2007-11-28 18:26         ` Henning Hraban Ramm
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Smith @ 2007-11-27 16:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Nov 27, 2007 10:23 AM, Hans Hagen <pragma@wxs.nl> wrote:

>   tlig=yes trep=yes

trep! Works perfecly.

Thank you very much!
Jeff
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Visually replace one character by another one automatically
  2007-11-27 16:15       ` Jeff Smith
@ 2007-11-28 18:26         ` Henning Hraban Ramm
  2007-11-28 19:07           ` Jeff Smith
  0 siblings, 1 reply; 9+ messages in thread
From: Henning Hraban Ramm @ 2007-11-28 18:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-11-27 um 17:15 schrieb Jeff Smith:

> On Nov 27, 2007 10:23 AM, Hans Hagen <pragma@wxs.nl> wrote:
>>   tlig=yes trep=yes
> trep! Works perfecly.

It it's only about quotes, you should consider using \quote{} and  
\quotation{} instead of typing more or less correct quotation marks.

Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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


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

* Re: Visually replace one character by another one automatically
  2007-11-28 18:26         ` Henning Hraban Ramm
@ 2007-11-28 19:07           ` Jeff Smith
  2007-11-28 21:30             ` Henning Hraban Ramm
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Smith @ 2007-11-28 19:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Nov 28, 2007 1:26 PM, Henning Hraban Ramm <hraban@fiee.net> wrote:

> It it's only about quotes, you should consider using \quote{} and
> \quotation{} instead of typing more or less correct quotation marks.

Indeed. Anyway I already use \quote. :-) My question was rather about
the apostrophe alone, like in "it's", or "don't", or "l'orange",
"l'homme", which typographically should be like the comma (i.e. the
single quotation mark). Therefore, you really have to use the symbol
itself in the input.

All's well than ends well!
Jeff
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Visually replace one character by another one automatically
  2007-11-28 19:07           ` Jeff Smith
@ 2007-11-28 21:30             ` Henning Hraban Ramm
  0 siblings, 0 replies; 9+ messages in thread
From: Henning Hraban Ramm @ 2007-11-28 21:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-11-28 um 20:07 schrieb Jeff Smith:
> On Nov 28, 2007 1:26 PM, Henning Hraban Ramm <hraban@fiee.net> wrote:
>> It it's only about quotes, you should consider using \quote{} and
>> \quotation{} instead of typing more or less correct quotation marks.
>
> Indeed. Anyway I already use \quote. :-) My question was rather about
> the apostrophe alone, like in "it's", or "don't", or "l'orange",
> "l'homme", which typographically should be like the comma (i.e. the
> single quotation mark). Therefore, you really have to use the symbol
> itself in the input.

Just write your own keyboard mapping – at least for MacOSX or Linux  
it’s rather easy.

E.g. my usual keymap gives access to all accented Latin plus Greek  
and lots of other characters - I only keep forgetting what’s where,  
though, and it still contains some bugs  ;-)



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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


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

end of thread, other threads:[~2007-11-28 21:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-27  3:07 Visually replace one character by another one automatically Jeff Smith
2007-11-27  8:18 ` Taco Hoekwater
2007-11-27  9:07   ` Taco Hoekwater
2007-11-27 15:14   ` Jeff Smith
2007-11-27 15:23     ` Hans Hagen
2007-11-27 16:15       ` Jeff Smith
2007-11-28 18:26         ` Henning Hraban Ramm
2007-11-28 19:07           ` Jeff Smith
2007-11-28 21:30             ` Henning Hraban Ramm

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