Re: [NTG-context] \textfraction broken?

2017-07-10 Thread Henri Menke
On Mon, 2017-07-10 at 19:34 -0400, Alan Bowen wrote:
> Adding
> 
> \definefontfeature[fraction][frac=yes]
> \definehighlight[textfraction][style={\feature[+][fraction]}] 
> 
> fixes the problem in the sample just sent.

This, and the font has to have the corresponding feature present.

> 
> Sorry for the misfire.
> 
> Alan
> 
> On Mon, Jul 10, 2017 at 1:53 PM, Alan Bowen  wrote:
> > Has there been a change to \textfraction?
> > 
> > Try
> > 1\textfraction{1/2}.
> > 
> > I get 
> > 1 /1/2
> > with ConTeXt  ver: 2017.06.30 (and earlier on the wiki)
> > 
> > Alan
> > 
> ___
> 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
> ___
___
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
___

Re: [NTG-context] \textfraction broken?

2017-07-10 Thread Alan Bowen
Adding

\definefontfeature[fraction][frac=yes]
\definehighlight[textfraction][style={\feature[+][fraction]}]

fixes the problem in the sample just sent.

Sorry for the misfire.

Alan

On Mon, Jul 10, 2017 at 1:53 PM, Alan Bowen  wrote:

> Has there been a change to \textfraction?
>
> Try
> 1\textfraction{1/2}.
>
> I get
> 1 /1/2
> with ConTeXt  ver: 2017.06.30 (and earlier on the wiki)
>
> Alan
>
___
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
___

[NTG-context] Again: breaking of formulas

2017-07-10 Thread Mathias Schickel
Dear Hans, Aditya and the list,

I have tested the new auto breaking feature for formulas and have encountered 
some issues that I have summed up in the attached file. It would be great if 
this issues could be eliminated.

Best
Mathias

 

formula-breaking.tex
Description: TeX document


formula-breaking.pdf
Description: Adobe PDF document




> Am 19.06.2017 um 09:44 schrieb Aditya Mahajan :
> 
> On Mon, 19 Jun 2017, Hans Hagen wrote:
> 
>> \setupformulas[split=yes,align=flushleft] % already there
> 
> While you are tweaking formulas, would it make sense to add a key-value 
> interface for \startformula, so that the following also works:
> 
> \startformula[split=yes, align=flushleft]
> ...
> \stopformula
> 
> We can remain backward compatible by check if the argument to formulas is an 
> assignment or not.
> 
> Aditya
> ___
> 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
> ___

___
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
___

Re: [NTG-context] Footnote in TABLE isn't rendered anywhere

2017-07-10 Thread Mathias Schickel

> Am 10.07.2017 um 12:50 schrieb Pablo Rodriguez :
> 
> On 07/08/2017 03:17 PM, Mathias Schickel wrote:
>> Dear Andreas, Pablo and the list,
>> 
>> I did read your question and answer with great interest, since I
>> encountered similar issues. Sadly your trick to get footnotes that are
>> defined in some environments like tables displayed at the bottom of the
>> page does not work if you try it using backgrounds. Here I provide a
>> minimal example that shows the problem:
> 
> Dear Mathias,
> 
> I didn’t even know that backgrounds existed in ConTeXt.
> 
> Framed texts does the trick with your sample:
> 
>\setupframedtext
>   [width=\textwidth,
>frame=on,
>rulethickness=1pt,
>corner=0,
>offset=12pt]
> 
>\starttext
>\startframedtext
>If you typeset text with background,
>the footnote workaround does not work.
>\postponenotes\footnote{So what could
>I do to get this footnote displayed?
>Use framed texts.}
>\stopframedtext
>\flushnotes
>\stoptext
> 
> But if you really need a background, I’m afraid it won’t work (or I
> don’t know how to make it work).
> 
> Just in case it might help,
> 
> Pablo

Dear Pablo,

thank you very much for your suggestion! Sadly I have noticed that framed texts 
do not break across pages (at least if I simply copy and use your code). I 
remember that I switched to backgrounds (from \definetextbackground) because I 
did get problems at page breaks. Regarding that backgrounds showed the best 
behaviour but sadly it has the described problems using footnotes.

Do you have any further suggestions how I can enable framed text to break 
across pages?

And can anyone tell me how I can get rid of the problem of backgrounds and 
footnotes?

Again, thank you very much for your kind help!

Best
Mathias
 


> -- 
> 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
> ___

___
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
___

[NTG-context] \textfraction broken?

2017-07-10 Thread Alan Bowen
Has there been a change to \textfraction?

Try
1\textfraction{1/2}.

I get
1 /1/2
with ConTeXt  ver: 2017.06.30 (and earlier on the wiki)

Alan
___
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
___

Re: [NTG-context] a string xmlpath in Lua

2017-07-10 Thread MF

> Hello list,
> is there a Lua function to get the XML path of an element as a
> string?
> 

Found. I adapted a function from lxml-tex.lua (chainpath):

function xmlpath( e, nonamespace )
  if e then
local t = { }
while e do
  local tg = e.tg
  local rt = e.__p__
  local ns = e.ns
  if tg == "@rt@" then
break
  elseif rt.tg == "@rt@" then
if nonamespace or not ns or ns == "" then
  t[ #t + 1 ] = tg
else
  t[ #t + 1 ] = ns .. ":" .. tg
end
  else
if nonamespace or not ns or ns == "" then
  t[ #t + 1 ] = tg .. "[" .. e.ei .. "]"
else
  t[ #t + 1 ] = ns .. ":" .. tg .. "[" .. e.ei .. "]"
end
  end
  e = rt
end
return table.concat( table.reverse( t ), "/" )
  else
return ""
  end
end
___
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
___

Re: [NTG-context] Footnote in TABLE isn't rendered anywhere

2017-07-10 Thread Pablo Rodriguez
On 07/08/2017 03:17 PM, Mathias Schickel wrote:
> Dear Andreas, Pablo and the list,
> 
> I did read your question and answer with great interest, since I
> encountered similar issues. Sadly your trick to get footnotes that are
> defined in some environments like tables displayed at the bottom of the
> page does not work if you try it using backgrounds. Here I provide a
> minimal example that shows the problem:

Dear Mathias,

I didn’t even know that backgrounds existed in ConTeXt.

Framed texts does the trick with your sample:

\setupframedtext
   [width=\textwidth,
frame=on,
rulethickness=1pt,
corner=0,
offset=12pt]

\starttext
\startframedtext
If you typeset text with background,
the footnote workaround does not work.
\postponenotes\footnote{So what could
I do to get this footnote displayed?
Use framed texts.}
\stopframedtext
\flushnotes
\stoptext

But if you really need a background, I’m afraid it won’t work (or I
don’t know how to make it work).

Just in case it might 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
___

Re: [NTG-context] how to hyphenate SHA512?

2017-07-10 Thread Pablo Rodriguez
On 07/08/2017 01:32 PM, Hans Hagen wrote:
> On 7/7/2017 10:28 PM, josephcan...@gmail.com wrote:
>> 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.
> 
> "better" depends on how often such a trick is needed

Many thanks for your help, Hans and Joseph.

I will play with your sample bellow to adapt it to the underscore
hyphenation to the code provided here.

Pablo


> \startluacode
> 
>  -- local shared = {
>  -- start  = 1,
>  -- length = 1,
>  -- left   = false,
>  -- right  = false,
>  -- }
> 
>  local shared = {
>  start  = 1,
>  length = 1,
>  before = utf.char(0xB7),
>  after  = nil,
>  left   = false,
>  right  = false,
>  }
> 
>  -- languages.hyphenators.traditional.installmethod("sha",
>  -- function(dictionary,word,n)
>  -- local t = { }
>  -- for i=1,#word do
>  -- t[i] = shared
>  -- end
>  -- return t
>  -- end
>  -- )
> 
>  -- or more efficient when used often:
> 
>  -- local all = { }
>  -- for i=1,512 do
>  -- all[i] = shared
>  -- end
>  -- languages.hyphenators.traditional.installmethod("sha",
>  -- function(dictionary,word,n)
>  -- return all
>  -- end
>  -- )
> 
>  -- or more obscure:
> 
>  -- local all = table.setmetatableindex({ }, function(t,k)
>  -- t[k] = shared
>  -- return shared
>  -- end)
>  --
>  -- languages.hyphenators.traditional.installmethod("sha",
>  -- function(dictionary,word,n)
>  -- return all
>  -- end
>  -- )
> 
>  -- or just (lua is fast enough anyway)
> 
>  local all = table.setmetatableindex({ }, function(t,k)
>  return shared
>  end)
> 
>  languages.hyphenators.traditional.installmethod("sha",
>  function(dictionary,word,n)
>  return all
>  end
>  )
> \stopluacode
> 
> \definehyphenationfeatures
>[sha]
>[characters=all,
> alternative=sha]
> 
> % \unexpanded\def\sha#1%
> %   {\begingroup
> %\sethyphenationfeatures[sha]%
> %#1%
> %\endgroup}
> %
> % \setuphyphenation[method=traditional]
> 
> \unexpanded\def\sha#1%
>{\begingroup
> \sethyphenationfeatures[sha]%
> \setuphyphenation[method=traditional]%
> #1%
> \endgroup}
> 
> \showframe
> 
> \starttext
> 
> \setupalign[tolerant,stretch]
> 
> \dorecurse {100} {%
>  some sha
>  \sha{8b2f3c087046c3943ace0dc4f958ef2138e58a51b40e%
> ef6fab6fa1aeb845cc257a410ab1b914bc399b4293f%
> 31c76fc2c73e5be5ea4d329f9e6820984688efec2} and
> }
> 
> \stoptext

-- 
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
___

[NTG-context] a string xmlpath in Lua

2017-07-10 Thread MF
Hello list,
is there a Lua function to get the XML path of an element as a string?

\xmlpath typesets the path, I need a similar function for Lua, but the
path should be a string to be worked on in Lua.

This is the problem originating that question: i must name (give an id
to) some anonymous XML elements (read: "without an id attribute"), and
their path is a good candidate.

To be more precise: when i parse a  element, i look for elements
representing footnotes, to prepare them with \setnotetext;
then the table contents are parsed and the footnotes' markers are
typeset with \note[footnote_id].
When there are more footnotes, i need to identify them, to give \note
the right footnote id.

Thanks,
Massi
___
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
___