From: <josephcanedo@gmail.com>
To: Pablo Rodriguez <oinos@gmx.es>,
mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: how to hyphenate SHA512?
Date: Fri, 7 Jul 2017 22:28:23 +0200 [thread overview]
Message-ID: <595feee6.c5d51c0a.cf0df.3bea@mx.google.com> (raw)
In-Reply-To: <cff7697b-e123-c008-9b8e-af4a3985f04b@gmx.es>
[-- Attachment #1.1: Type: text/plain, Size: 1837 bytes --]
A probably quick and dirty « solution », which consists in inserting a \discretionary node between each digit using some lua code. There are mostly likely better solutions for this.
Joseph
\startluacode
function sha(s)
local out = {}
for i = 1, s:len() do
out[#out + 1] = s:sub(i, i)
end
context(table.concat(out, '\\discretionary{_}{}{}'))
end
\stopluacode
\starttext
% \hsize\zeropoint
\hyphenation
%%8b2f3c087046c3943ace0dc4f958ef2138e58a51b40eef6fab6fa1aeb845cc25%
%%7a410ab1b914bc399b4293f31c76fc2c73e5be5ea4d329f9e6820984688efec2
\ctxlua{sha([[8b2f3c087046c3943ace0dc4f958ef2138e58a51b40eef6fab6fa1aeb845cc257a410ab1b914bc399b4293f31c76fc2c73e5be5ea4d329f9e6820984688efec2]])}
\stoptext
De : Pablo Rodriguez
Envoyé le :jeudi 6 juillet 2017 12:00
À : mailing list for ConTeXt users
Objet :[NTG-context] how to hyphenate SHA512?
Dear list,
I have the following sample:
\starttext
\hsize\zeropoint
hyphenation
8b2f3c087046c3943ace0dc4f958ef2138e58a51b40eef6fab6fa1aeb845cc25%
7a410ab1b914bc399b4293f31c76fc2c73e5be5ea4d329f9e6820984688efec2
\stoptext
I plan to use underscore hyphenation. How can I get the SHA512 string
hyphenated in any of its points?
Many thanks for your help,
Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
[-- Attachment #1.2: Type: text/html, Size: 4853 bytes --]
[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2017-07-07 20:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 10:00 Pablo Rodriguez
2017-07-07 20:28 ` josephcanedo [this message]
2017-07-08 6:56 ` Pablo Rodriguez
2017-07-08 8:20 ` josephcanedo
2017-07-08 11:34 ` Hans Hagen
2017-07-08 11:32 ` Hans Hagen
2017-07-10 10:44 ` Pablo Rodriguez
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=595feee6.c5d51c0a.cf0df.3bea@mx.google.com \
--to=josephcanedo@gmail.com \
--cc=ntg-context@ntg.nl \
--cc=oinos@gmx.es \
/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).