ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] incosistent output of --- dash
@ 2024-04-06  9:43 madiazm.eoicc
  2024-04-06 10:23 ` [NTG-context] " Henning Hraban Ramm
  2024-04-06 11:08 ` Pablo Rodriguez via ntg-context
  0 siblings, 2 replies; 7+ messages in thread
From: madiazm.eoicc @ 2024-04-06  9:43 UTC (permalink / raw)
  To: ntg-context

Hi everyone,
I'm a bit puzzled because I usually don't get an em-dash when I type tree hyphens. If I use the command \emdash, no problem but when I use the hyphens some days it works... and somedays I see three small hyphens.
I tried it on overleaf and of ContextOnWeb with the same inconsistency. If I create a new file it usually works right; but when I overwrite an existing file subtituting a hyphen for three where the dash should be I sometimes get it right and sometimes wrong.
It is not the pdf viewer since I get good or bad results in all, the overleaf pdf preview tool, the context on web preview tool and the mozilla integrated pdf viewer.

Am I missing something on the use of this ligature? (the question is just out of curiosity, since I plan to create a command that adds a hairspace after or before the dash, since I don't like it to stick to some letters like "o".

thanks
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: incosistent output of --- dash
  2024-04-06  9:43 [NTG-context] incosistent output of --- dash madiazm.eoicc
@ 2024-04-06 10:23 ` Henning Hraban Ramm
  2024-04-06 11:38   ` Wolfgang Schuster
  2024-04-06 11:08 ` Pablo Rodriguez via ntg-context
  1 sibling, 1 reply; 7+ messages in thread
From: Henning Hraban Ramm @ 2024-04-06 10:23 UTC (permalink / raw)
  To: ntg-context

Am 06.04.24 um 11:43 schrieb madiazm.eoicc@gmail.com:
> Hi everyone,
> I'm a bit puzzled because I usually don't get an em-dash when I type tree hyphens. If I use the command \emdash, no problem but when I use the hyphens some days it works... and somedays I see three small hyphens.
> I tried it on overleaf and of ContextOnWeb with the same inconsistency. If I create a new file it usually works right; but when I overwrite an existing file subtituting a hyphen for three where the dash should be I sometimes get it right and sometimes wrong.
> It is not the pdf viewer since I get good or bad results in all, the overleaf pdf preview tool, the context on web preview tool and the mozilla integrated pdf viewer.
> 
> Am I missing something on the use of this ligature? (the question is just out of curiosity, since I plan to create a command that adds a hairspace after or before the dash, since I don't like it to stick to some letters like "o".

Generally, “we” try to reduce active characters as much as possible, 
that’s why -- and --- usually /don’t/ produce en or em dashes. You can 
activate these ligatures as a font feature though (AFAIR "latexhyphens", 
can’t find it…).

Some editors and some fonts do automatical replacements.

Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: incosistent output of --- dash
  2024-04-06  9:43 [NTG-context] incosistent output of --- dash madiazm.eoicc
  2024-04-06 10:23 ` [NTG-context] " Henning Hraban Ramm
@ 2024-04-06 11:08 ` Pablo Rodriguez via ntg-context
  2024-04-07 17:56   ` madiazm.eoicc
  1 sibling, 1 reply; 7+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2024-04-06 11:08 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 4/6/24 11:43, madiazm.eoicc@gmail.com wrote:
> Hi everyone,

Hi Miguel,

> […]
> Am I missing something on the use of this ligature?

I don’t think so.

In some cases you may not get the ligature for a good reason:

  \starttyping
  program --option=value file.ext
  \stoptyping

It would make no sense to get an en-dash there (but I guess you don’t
mean that).

But all OSes provide character maps to get single characters. And also
Unicodia works fine in Windows (https://mercury13.github.io/unicodia/,
just in case it might suit your needs).

Having a single character (emoji, dashes or whatever) is way more
readable than a character combination for a ligature or a TeX command.

This single-character approach also makes easier to copy and paste text
to other formats.

> (the question is just out of curiosity, since I plan to create a
> command that adds a hairspace after or before the dash, since I don't
> like it to stick to some letters like "o").
Just consider that you should add an horizontal box (or pair both space
and hyphen), otherwise you may get a line break between character and
hyphen (instead of the hair space):

  \starttext
  \startTEXpage[offset=2st]
  \hsize\zeropoint
  this —\hairspace or so\hairspace— that

  this \hbox{—\hairspace}or so\hbox{\hairspace—} that
  \stopTEXpage
  \stoptext

Just in case it might help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: incosistent output of --- dash
  2024-04-06 10:23 ` [NTG-context] " Henning Hraban Ramm
@ 2024-04-06 11:38   ` Wolfgang Schuster
  2024-04-07  5:41     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2024-04-06 11:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Henning Hraban Ramm

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

Henning Hraban Ramm schrieb am 06.04.2024 um 12:23:
> Am 06.04.24 um 11:43 schrieb madiazm.eoicc@gmail.com:
>> Hi everyone,
>> I'm a bit puzzled because I usually don't get an em-dash when I type 
>> tree hyphens. If I use the command \emdash, no problem but when I use 
>> the hyphens some days it works... and somedays I see three small 
>> hyphens.
>> I tried it on overleaf and of ContextOnWeb with the same 
>> inconsistency. If I create a new file it usually works right; but 
>> when I overwrite an existing file subtituting a hyphen for three 
>> where the dash should be I sometimes get it right and sometimes wrong.
>> It is not the pdf viewer since I get good or bad results in all, the 
>> overleaf pdf preview tool, the context on web preview tool and the 
>> mozilla integrated pdf viewer.
>>
>> Am I missing something on the use of this ligature? (the question is 
>> just out of curiosity, since I plan to create a command that adds a 
>> hairspace after or before the dash, since I don't like it to stick to 
>> some letters like "o".
>
> Generally, “we” try to reduce active characters as much as possible, 
> that’s why -- and --- usually /don’t/ produce en or em dashes. You can 
> activate these ligatures as a font feature though (AFAIR 
> "latexhyphens", can’t find it…).

The name of the option has changes a few times and the current setting 
is textcontrol=collapsehyphens.

> Some editors and some fonts do automatical replacements.

In this case it could be the wrong symbol in the document, there are 
many dashes in unicode which look similar in the input and output files.

\starttext

\startbuffer
\starttabulate[|T||||]
\NC U+0002D \NC - \NC -- \NC --- \NC\NR
\NC U+02011 \NC ‑ \NC ‑‑ \NC ‑‑‑ \NC\NR
\NC U+02012 \NC ‒ \NC ‒‒ \NC ‒‒‒ \NC\NR
\stoptabulate
\stopbuffer

\getbuffer

\setupbodyfont[pagella]

\getbuffer

\stoptext

Wolfgang


[-- Attachment #2: hyphen.tex --]
[-- Type: text/plain, Size: 295 bytes --]

\starttext

\startbuffer
\starttabulate[|T||||]
\NC U+0002D \NC - \NC -- \NC --- \NC\NR
\NC U+02011 \NC ‑ \NC ‑‑ \NC ‑‑‑ \NC\NR
\NC U+02012 \NC ‒ \NC ‒‒ \NC ‒‒‒ \NC\NR
\stoptabulate
\stopbuffer

\getbuffer

\setupbodyfont[pagella]

\getbuffer

\stoptext

[-- Attachment #3: hyphen.pdf --]
[-- Type: application/pdf, Size: 9266 bytes --]

[-- Attachment #4: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: incosistent output of --- dash
  2024-04-06 11:38   ` Wolfgang Schuster
@ 2024-04-07  5:41     ` Hans Hagen
  2024-04-07  6:04       ` vm via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2024-04-07  5:41 UTC (permalink / raw)
  To: ntg-context

On 4/6/2024 1:38 PM, Wolfgang Schuster wrote:
> Henning Hraban Ramm schrieb am 06.04.2024 um 12:23:
>> Am 06.04.24 um 11:43 schrieb madiazm.eoicc@gmail.com:
>>> Hi everyone,
>>> I'm a bit puzzled because I usually don't get an em-dash when I type 
>>> tree hyphens. If I use the command \emdash, no problem but when I use 
>>> the hyphens some days it works... and somedays I see three small 
>>> hyphens.
>>> I tried it on overleaf and of ContextOnWeb with the same 
>>> inconsistency. If I create a new file it usually works right; but 
>>> when I overwrite an existing file subtituting a hyphen for three 
>>> where the dash should be I sometimes get it right and sometimes wrong.
>>> It is not the pdf viewer since I get good or bad results in all, the 
>>> overleaf pdf preview tool, the context on web preview tool and the 
>>> mozilla integrated pdf viewer.
>>>
>>> Am I missing something on the use of this ligature? (the question is 
>>> just out of curiosity, since I plan to create a command that adds a 
>>> hairspace after or before the dash, since I don't like it to stick to 
>>> some letters like "o".
>>
>> Generally, “we” try to reduce active characters as much as possible, 
>> that’s why -- and --- usually /don’t/ produce en or em dashes. You can 
>> activate these ligatures as a font feature though (AFAIR 
>> "latexhyphens", can’t find it…).
> 
> The name of the option has changes a few times and the current setting 
> is textcontrol=collapsehyphens.
> 
>> Some editors and some fonts do automatical replacements.
> 
> In this case it could be the wrong symbol in the document, there are 
> many dashes in unicode which look similar in the input and output files.
> 
> \starttext
> 
> \startbuffer
> \starttabulate[|T||||]
> \NC U+0002D \NC - \NC -- \NC --- \NC\NR
> \NC U+02011 \NC ‑ \NC ‑‑ \NC ‑‑‑ \NC\NR
> \NC U+02012 \NC ‒ \NC ‒‒ \NC ‒‒‒ \NC\NR
> \stoptabulate
> \stopbuffer
> 
> \getbuffer
> 
> \setupbodyfont[pagella]
> 
> \getbuffer
> 
> \stoptext
detail: it is not a real fontfeature (as tlig in mkiv) but implemented 
differently with a bit more control, so we have

\nohyphencollapsing
\dohyphencollapsing

etc too as control options. These collapsed hyphens are also configured 
as valid hyphenation chars.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: incosistent output of --- dash
  2024-04-07  5:41     ` Hans Hagen
@ 2024-04-07  6:04       ` vm via ntg-context
  0 siblings, 0 replies; 7+ messages in thread
From: vm via ntg-context @ 2024-04-07  6:04 UTC (permalink / raw)
  To: ntg-context; +Cc: vm

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


\starttext

\startbuffer
\starttabulate[|T||||]
\NC U+0002D \NC - \NC -- \NC --- \NC\NR
\NC U+02011 \NC ‑ \NC ‑‑ \NC ‑‑‑ \NC\NR
\NC U+02012 \NC ‒ \NC ‒‒ \NC ‒‒‒ \NC\NR
\stoptabulate
\stopbuffer

\nohyphencollapsing
\getbuffer
\setupbodyfont[pagella]
\getbuffer

\dohyphencollapsing
\getbuffer
\setupbodyfont[pagella]
\getbuffer

\stoptext


[-- Attachment #2: Screenshot from 2024-04-07 08-03-51.png --]
[-- Type: image/png, Size: 6461 bytes --]

[-- Attachment #3: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: incosistent output of --- dash
  2024-04-06 11:08 ` Pablo Rodriguez via ntg-context
@ 2024-04-07 17:56   ` madiazm.eoicc
  0 siblings, 0 replies; 7+ messages in thread
From: madiazm.eoicc @ 2024-04-07 17:56 UTC (permalink / raw)
  To: ntg-context

thanks to all for pointing to the reason, to the collapsing command and to pablo for pointing to the hbox-trick. I will use the \emdash to ensure a right dash
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-04-07 17:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-06  9:43 [NTG-context] incosistent output of --- dash madiazm.eoicc
2024-04-06 10:23 ` [NTG-context] " Henning Hraban Ramm
2024-04-06 11:38   ` Wolfgang Schuster
2024-04-07  5:41     ` Hans Hagen
2024-04-07  6:04       ` vm via ntg-context
2024-04-06 11:08 ` Pablo Rodriguez via ntg-context
2024-04-07 17:56   ` madiazm.eoicc

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