ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Max Chernoff via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Max Chernoff <mseven@telus.net>
Subject: Re: characters.tex.toutf bug
Date: Thu, 30 Mar 2023 15:30:46 -0600	[thread overview]
Message-ID: <7731628b237ef28f2708b471f97b2c6871c11373.camel@telus.net> (raw)
In-Reply-To: <d342099b-bf98-1a57-9950-3834f66c2c31@freedom.nl>

Hi Hans,

> it is more side effect of removing the (declared obsolete some years 
> ago) `` '' input which catched it later
> 
> i tend to remove
> 
>          for k, v in next, ligaturemapping do
>              hash[k] = v
>          end
>
> in favor of an explicit 'tquo' feature that one can enable if wanted
> 
> \definefontfeature[default][default][tlig=yes,tquo=yes,trep=yes]

That does make the output more consistent, but not in the way that I'm
wanting. My real code looks more like this:

   \definefontfeature[default][default][tlig=yes, tquo=yes, trep=yes]
   
   \startbuffer[test-bib]
   @article{one,
       author = {``Auth\v{o}r---One''},
   }
   @article{two,
       author = {``Authǒr---Two''},
   }
   \stopbuffer
   
   \usebtxdataset[test-bib.buffer]
   
   \startluacode
       for key, value in table.sortedpairs(publications.datasets.default.luadata) do
           print(key, publications.prerollcmdstring(value.author))
       end
   \stopluacode

publications.prerollcmdstring seems to run before any of the
replacements/ligatures, so with your fix I get this as the output:

   one     ``Authǒr---One''
   two     ``Authǒr---Two''
   
while with my suggested fix I get:

   one     “Authǒr—One”
   two     “Authǒr—Two”
   
I'm using a CLD document to convert a bunch of old .bib and .tex files into
Lua tables (which I'll then convert into XML). I can't modify any of the
input files, so I'll need to somehow deal with all the LaTeX-style input.
Using publications.prerollcmdstring + characters.tex.toutf seems like the
best way to do this, but I'm open to a different solution if you have any
suggestions.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2023-03-30 21:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  5:57 Max Chernoff via ntg-context
2023-03-30 11:58 ` Hans Hagen via ntg-context
2023-03-30 21:30   ` Max Chernoff via ntg-context [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7731628b237ef28f2708b471f97b2c6871c11373.camel@telus.net \
    --to=ntg-context@ntg.nl \
    --cc=mseven@telus.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).