Re: [NTG-context] consecutive full stops in "num" bib style after "et al"

2019-07-29 Thread Sanjoy Mahajan
On 2019-07-29 15:18, Alan Braslau  wrote:

>>   \setupbibtex[database=tmp]
>>   \setuppublications[alternative=num]
>
> You are using the old mkii bibtex module.

You're right.  I'm too afraid of changing to the new way, at least for
the book that I've just submitted for copyediting. For the next book,
I'll try some experiments with the new way.

-Sanjoy
___
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] consecutive full stops in "num" bib style after "et al"

2019-07-29 Thread Sanjoy Mahajan
In the "num" bibliography style, bibliography entries that get "et
al."ed (the author list is too long and "et al." is inserted) end up
with two full stops in a row.  Here's a minimal example:

  \setupbibtex[database=tmp]
  \setuppublications[alternative=num]

  \setuppublicationlist[artauthoretallimit=3, authoretaldisplay=3,
editoretaldisplay=3, artauthoretaldisplay=3,
  %  authoretaltext={ et al},
  %  artauthoretaltext={ et al},
  ]

  \starttext

  Test \cite[Larkin:1980].

  \blank[big]

  \placepublications[criterium=text]

  \stoptext

(The tmp.bib file is attached.)  The bibliography entry is:

  [1] Jill Larkin, John McDermott and Dorothea P. Simon et al.. Expert and
  novice performance in solving physics problems. Science,
  208(4450):1335--1342, 1980.

The doubled full stop can be fixed by commenting in the two lines

  %  authoretaltext={ et al},
  %  artauthoretaltext={ et al},

Should these commented-in settings be the default for the "num" style
(because it'll always put one more full stop between the author list and
the title)?

Another workaround is never to use et al.  But that idea failed when I
had to cite the Nobel-Prize-winning gravity-wave paper ("Observation of
Gravitational Waves from a Binary Black Hole Merger").  It has, I think,
1000 authors!

-- 
-Sanjoy


Save Long Wharf Park in Boston Harbor!


Six reasoning tools to make hard problems easy.

@Article{Larkin:1980,
  title={Expert and novice performance in solving physics problems},
  author={Larkin, Jill and McDermott, John and Simon, Dorothea P. and Simon, Herbert A.},
  journal={Science},
  volume=208,
  number=4450,
  pages={1335--1342},
  year=1980,
}
___
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] registers: subentry indentation different from word--number gap?

2019-07-12 Thread Sanjoy Mahajan
I don't think the current behavior is a bug, so the following is a
feature request:

With the following fairly minimal example

  \setupregister[index][indicator=no, distance=0.5em]

  \starttext

  ABC\index{x}DEF\index{x+yyz}

  \blank
  \placeindex
  \stoptext

the distance parameter sets (1) the hanging indentation of the 'yyz'
subentry and also (2) the distance between an entry and its pagenumber.
(That's what a look at strc-reg.mkiv shows too.)

It's a matter of taste, but my eye thinks that 0.5em is right for no. 2,
but too small for no. 1 -- whereas the default (1em) is just right for
no. 1 but too large for no. 2.

Thus, could the two dimensions be decoupled and bcome settable
indepently?  Perhaps keep 'distance' for the entry--pagenumber distance
(no. 2), which is its meaning on the wiki, and invent 'subdistance' for
the hanging indent (no. 1)?

I've just realized a cheap hack to do the same, so maybe it's not worth
messing with backward compatability by adding a new parameter.  The hack:

  \def\blah#1{#1\hskip-0.5em}
  \setupregister[index][indicator=no, distance=1em, textcommand=\blah]

-- 
-Sanjoy


Save Long Wharf Park in Boston Harbor!


Six reasoning tools to make hard problems easy.
___
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] [DKIM Failure] Re: reference containing parentheses causes trouble

2019-07-10 Thread Sanjoy Mahajan
On 2019-07-10 13:04, Peter Rolf  wrote:

> Hi Sanjoy,
>
> I think it's just the 'normal' limitations you have when setting a
> variable/id name. Special characters, like parenthesis, are not allowed
> here.

Peter,

I think that's right, but there are small differences.  For example,
variables in most languages don't allow hyphens, because they are
interpreted as minus signs.  But ConTeXt references do allow them (and I
use them all the time).  That may be why I expected free reign to use
any characters in the reference (except, as you say, for whitespace!)
and wrote my script accordingly to turn problem titles into references
(by replacing whitespace with a hyphen).

-Sanjoy
___
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] index page ranges where start page == end page

2019-07-09 Thread Sanjoy Mahajan
The following probably well known minimal example

  \starttext
  \startregister[index][key1]{an entry}\input knuth\stopregister[index][key1]

  \placeindex

  \stoptext

produces the index entry "an entry 1--1", where the page range should be
just a single page.

A question (and then two workarounds): Could ConTeXt automatically
change such page ranges to the single page ("an entry 1")?

Meanwhile, a couple of workarounds:

In the MkII (pre-lua) days, I wrote a shell/sed/awk/perl script that
converted the .pdf file to text, grepped for (strings that are likely to
be) page ranges, and spat out lines where the page range should be a
page.  (Those days were so long ago that I've forgotten the script's
language.)  Then I would manually find and change the corresponding
\startregister[index] in the source to a plain \index (and delete the
corresponding \stopregister).

In these MkIV days, with the index data in a lua table, I've been
playing with the following python2 script that parse the .tuc file to
spit out the same information slightly more reliably.  In the next
step, coming soon, the script will check that each \seeindex entry
points to an actual entry and also that each \seeindex{also ...} entry
originates from an actual entry (otherwise it shouldn't be "also").

The script requires the slpp package;

  pip install git+https://github.com/SirAnthony/slpp

The parser in the script has a bug in that it doesn't handle minus signs
in the lua table, maybe everywhere or maybe only some of them, so the
script replaces them with "_" before sending the data to the parser (a
terrible hack).

To run the script:

  python check-index.py < file.tuc

Here is check-index.py:

# parse lua-format index-entry table extracted from book.tuc to check
# that each xref points to an actual entry, and that, further, "see
# also" src entries have at least one page ref (perhaps in subtree)

# due to bug in slpp parser: replace "-" (minus signs) in data with "_"

from slpp import slpp as lua
from sys import stdin,stderr
import re

def tuclist2entry(l):
return '+'.join(l)

data = []
intro_re = r'utilitydata.structures.registers.collected\s*='
in_register_data = False
for l in stdin:
if re.match(intro_re, l):
in_register_data = True
data.append(re.sub(intro_re,'',l))
elif in_register_data:
data.append(l)
if re.match(r'}$', l):
in_register_data = False
data = re.sub("-", "_", ''.join(data))
dict = lua.decode(data)
index = dict['index']

entries = []
xrefs   = []
for entry in index['entries']:
src = [x[0] for x in entry['list']]
refs = entry['references']
if 'seeword' in entry:
dest = entry['seeword']['text']
xrefs.append((src,dest))
else:
page = refs['realpage']
if refs.get('lastrealpage',None) == page:
print "silly range:", tuclist2entry(src)
entries.append(src)

for xref in  xrefs:
print tuclist2entry(xref[0]),'->', xref[1]
___
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] reference containing parentheses causes trouble

2019-07-09 Thread Sanjoy Mahajan
Dear List,

Warning: The following may be a bug or feature or just my
misunderstanding!  It seems that parentheses cause trouble in
references. MNWE:

  \starttext
  \section[sec:one(two)]{One}

  As you see in sec.~\in[sec:one(two)],

  \stoptext

The "in sec.~\in[sec:one(two)]" typesets as "in sec. ??" and the log
shows:

  references  > start missing references

  references  >1  [][sec:one(two)]

  references  > stop missing references

(It all works fine upon deleting "(two)" throughout.)

Is this behavior known and expected?  If it is, I'll add a note to the
"References" page on the wiki.

-Sanjoy
___
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] chapter-number prefixes on figure, etc, numbers, even in unnumbered section appearing in TOC

2019-05-31 Thread Sanjoy Mahajan
Dear List,

The following, it seems, is a recurring question, which I had hoped to
solve by digging in the test suite
 -- but no luck.

The problem is to have figures, list items, problems, etc. numbered with
a chapter prefix (e.g. Figure 7.18) even in unnumbered sections that
appear in the TOC.

1. Using \subject as the section command, the figure number is correctly
prefixed, but the section itself doesn't appear in the TOC.

2. Using \section, the figure number is also correctly prefixed, and the
section appears in the TOC, but the section gets numbered (e.g. Section
2.7).

In one of the earlier threads, which are "Prefix for figure number lost
in unnumbered subsection"
, "Unnumbered
subject in TOC, numbered exercises in text"
, and
"incrementnumber vs. prefixsegments"
, Hans suggested
looking in the test suite for fine control of the prefix segments.

I have done that, and the best MNWE that I can come up with is a
modification of doc/context/tests/mkiv/sections/figures-001.tex in the
test suite (see code below), but it also fails:

* When incrementnumber=list (as in the code), the TOC lists that
section, but the figure 5 doesn't get a chapter-number prefix.

* When incrementnumber=no (recreating \subject), the TOC is not correct,
but figure 5 gets its prefix.

* And wWhen incrementnumber-yes (recreating \section), the TOC lists
that section, but the section gets a number.

Is there a modification to what I tried that gets all the aspects right
(TOC entry, unnumbered, chapter prefix on figures, etc. within)?

-Sanjoy

The code:

\setupcaption[figure][way=bytext,prefixset=1:2]
\definehead[unnumberedsection][section]
\setuphead [unnumberedsection][incrementnumber=list]

\starttext
\placelist[chapter,section,unnumberedsection]

\chapter{One}
\placefigure{one}{1}

\section{Two}
\placefigure{two}{2}

\chapter{Three}
\placefigure{three}{3}
\placefigure{four}{4}

\unnumberedsection{Four}

\placefigure{five}{5}

\stoptext
___
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] right figure at bottom of page can narrow text block on whole next page

2019-02-06 Thread Sanjoy Mahajan
> This has come up a few times on this list. Hans has stated a reluctance 
> to make a change or add an option to discard the unused vertical space 
> (see https://www.mail-archive.com/ntg-context@ntg.nl/msg21273.html from 
> March 2007, and most recently 
> https://www.mail-archive.com/ntg-context@ntg.nl/msg86872.html in January 
> 2018).

Thank you for those pointers.

> The workaround that Hans suggests in that last post , adding the flag
> 'high', almost resolves the issue in your example.

Right -- or just shifting the figure upward by one paragraph or so.  In
a long document like a book, pagebreaks need to be adjusted by hand at
the end anyway to avoid long stretches of unused bottom space.
Adjusting the figure placements slightly can become part of that
process.

-Sanjoy
___
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] hysteresis with content in blocks (one strike and you can be out forever)

2019-02-06 Thread Sanjoy Mahajan
> You can set dimensions with the measure system
>
> %\definemeasure [TestValue] [20pt]
>
> \starttext
> \measure{TestValue}
> \stoptext
>
> and other values with \setvariables
>
> %\setvariables [test] [abc=20]

Probably the .tuc hystersis can jump up and bite one in the rear end in
other ways.  But \definemeasure and \setvariables do solve the issue in
my example.  They were also new to me and should prove useful for my
style files.  (The amount of ConTeXt still to learn is very large...)

-Sanjoy
___
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] hysteresis with content in blocks (one strike and you can be out forever)

2019-02-06 Thread Sanjoy Mahajan
Apologies for the cutesy subtitle.  In plainer English, the information
saved in the .tuc file can make it so that a valid ConTeXt file doesn't
compile merely because of what it contained when it was compiled before.

Here is a MIE (minimal illustrative example), on Linux amd64, 2019.01.28 beta:

1. Make the following file:

== file: testhysteresis.tex ===
\defineblock[foo]

\starttext

\def\abc{20}
\beginfoo
Use \abc
\endfoo

\useblocks[foo]

\stoptext
== stop: testhysteresis.tex ===

2. Compile it with "context --nonstopmode testhysteresis.tex" (which
   will work fine).

3. Modify it so that it doesn't define or use \abc (and so that it is
   still valid):

== file: testhysteresis.tex ===
\defineblock[foo]

\starttext

\beginfoo
Use
\endfoo

\useblocks[foo]

\stoptext
== stop: testhysteresis.tex ===

4. Without deleting testhysteresis.tuc, recompile with "context
   --nonstopmode testhysteresis.tex".  This run fails with the fatal error:

 tex error   > tex error on line 1 in file virtual://block.foo.1: ! 
Undefined control sequence

 l.1 Use \abc

   The cause seems to be that testhysteresis.tuc contains (from the run
   it step 2 above):

 utilitydata.structures.blocks.collected={
  {
   ["data"]="Use \\abc",
   ["index"]=1,
   ["metadata"]=3,
   ["references"]={
["section"]=0,
   },
  },
 }

5. Delete testhysteresis.tuc.

6. Now "context --nonstopmode testhysteresis.tex" works fine.

One workaround is always to delete the .tuc file before running context.
But that approach seems like overkill (although in my scripts that I use
for running expeirments with blocks etc., I take this approach), and
maybe there is a simpler way.

Best,
-Sanjoy
___
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] constructing block content partly with lua

2019-02-06 Thread Sanjoy Mahajan
On 2019-02-05 17:21, Hans Hagen  wrote:

> i'm not sure what you want but thsi might give a clue

> ...
> \startluacode
> buffers.assign("temp","test 2")
> structures.blocks.save("foo",nil,nil,"temp")
> \stopluacode

Ah, thanks, that looks like what I need, or at least part of it, and
will keep me busy making more experiments.

-Sanjoy
___
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] constructing block content partly with lua

2019-02-05 Thread Sanjoy Mahajan
On 2019-02-05 16:24, Hans Hagen  wrote:

>> \startluacode
>>context.beginanswer()
>>context("\\onearg{Test parameter}")
>
> does
>
> context.onearg("Test parameter")
>
> work?

Sorry, I forgot to say that I had tried that version too but also with
no luck.  Also, either version of onerg works as expected if I delete
the context.beginanswer() and the \endanswer lines.

-Sanjoy
___
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] constructing block content partly with lua

2019-02-05 Thread Sanjoy Mahajan
Dear List,

I've been trying to construct part of a block's content programmatically
with Lua.  Despite many experiments and much rereading of the cld manual
(especially chapter 3 on functions), the following attempt fails for
reasons that perplex me.  Below is the MNWE (Minimal NonWorking
Example).  It fails with these lines in the log file:

  structure   > sectioning > subject @ level 3 : 0.0.0 -> Answers

  tex error   > tex error on line 1 in file virtual://block.answer.1: ! 
Undefined control sequence

  l.1 \oneargTestparameter


That is, when the "answer" block is included via \useblocks, somehow the
beginning of the answer, which should be "\onearg{Test parameter}", has
its curly braces and spaces elided.

What characteristic(s) of the Lua interface am I missing?  Thank you if
you happen to where I've gone wrong.  I've also tried steppers without
much luck (and, admittedly, without really understanding their use).

=== testluabeginblock.tex ===
\defineblock[answer]
\hideblocks[answer]

\def\onearg#1{{\bf #1}}
\def\noarg{{\it fixed argument}}

\starttext

\startluacode
  context.beginanswer()
  context("\\onearg{Test parameter}")
\stopluacode
This is part of the answer.

\endanswer

\subject{Answers}

\useblocks[answer]

\stoptext
=== end testluabeginblock.tex ===

-Sanjoy



___
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] test-suite wiki page

2019-02-04 Thread Sanjoy Mahajan
On 2019-02-01 17:57, Taco Hoekwater  wrote:

> Yes, foundry.supelec.fr is officially dead now (and that project with
> it)

>> 2. I did find the (a?) test suite on the PRAGMA site at
>>    as a 7zip file.  Is that
>>   the correct location to point people to (apologies for the awful
>>   construction of that sentence)?
>
> Better is to link to the actual file on Pragma’s site.

Thanks -- these points are now reflected in the
 page.

-Sanjoy
___
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] [DKIM Failure] Re: getting ConTeXt results back to Lua (for typesetting solutions at end of document)

2019-02-01 Thread Sanjoy Mahajan
On 2019-02-01 07:58, "Mikael P. Sundqvist"  wrote:

> this is what I learned from the list to use. I'm sorry, but the names
> sound a bit Swedish, but I'm sure you can change that. 

The Swedish is not a problem.  Swedish, like Dutch, seems to be (English
+ German)/2.  Or sqrt(English*German) if, like me, you prefer the
geometric mean.

> This way it was also easy to add different types like hints, answers
> and solutions and get clickable letters accordingly.

Thank you.  I'll incorporate pieces into my setups.  If it ends up an
improvement over what's on the wiki, I'll also wikify.

-Sanjoy
___
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] test-suite wiki page

2019-02-01 Thread Sanjoy Mahajan
In another thread, Hans had pointed me to the examples of blocks in the
test suite.  That leads to my following two questions before I revise
the associated wiki page:

1. The wiki page about the test suite
    contains dead links to
    for the project
   homepage and to  for
   the mailing list.

   Are those now officially dead; or, more directly stated, would there
   be any objections if I clean up that wiki page to remove those dead
   links?

2. I did find the (a?) test suite on the PRAGMA site at
    as a 7zip file.  Is that
   the correct location to point people to (apologies for the awful
   construction of that sentence)?

-Sanjoy
___
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] getting ConTeXt results back to Lua (for typesetting solutions at end of document)

2019-02-01 Thread Sanjoy Mahajan
On 2019-02-01 09:48, Hans Hagen  wrote:

> given that context originally was made for typesetting educational
> materials including questions, answers, explanations ... how about
> looking at the 'blocks' mechanism (there are some examples in the test
> suite under blocks)

They are very helpful; thank you.  Those and Mikail's example are also
inspiring me to provide a hint and a solution for each problem, not just
a solution.

By the way, in the test suite (from the PRAGMA site), blocks-001.tex
crashes the 2019.01.28 beta here on my Debian amd64 system, with the
following error on the terminal (no log file is even produced):

 $ mycontext blocks-001.tex
 /home/sanjoy/context/2019.01.28-beta/tex/texmf-linux-64/bin/context
 /home/sanjoy/context/2019.01.28-beta/tex/texmf-linux-64/bin/luatex
 ...ta/tex/texmf-context/scripts/context/lua/mtx-context.lua:427: attempt to 
call a nil value (global 'restart')

(The two file paths that are printed first are for my own debugging,
 to ensure that the run is using the context and luatex binaries from
 the minimals installation.)

The culprit seems to be the "% engine=luatex" first line.  At least,
deleting it fixes the problem.  Meanwhile, blocks-003.tex doesn't have
it, and it runs fine.

About the test-suite wiki page...actually, I'll start a new thread for
that topic as it's not directly related to problems/solutions/blocks.

-Sanjoy
___
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] getting ConTeXt results back to Lua (for typesetting solutions at end of document)

2019-01-31 Thread Sanjoy Mahajan
Thank you, Matthias and Wolfgang, for the examples/solutions.

If I understand them right, there must be one solution for each exercise
(otherwise the solution numbering gets out of sync).  Or do the
coupling= options in Matthias's example remove that restriction?  In my
experiments with the examples, deleting the first solution
unsynchronized the exercise--solution numbering, no matter how I fiddled
with the coupling keys.

In the ideal pedagogical world, I'd write a solution for each exercise.
But reality might intervene, so I still wonder if the solutions can
automatically know and include the exercise number (perhaps by placing
\startanswer..\stopanswer inside \startexercise..\stopexercise and using
\getnumber[exercise]).  If there is a clever way, that's great.  But,
the nature of TeX as a macro language may preclude the \getnumber code
being evaluated just when one wants.

Regards,
-Sanjoy
___
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] getting ConTeXt results back to Lua (for typesetting solutions at end of document)

2019-01-31 Thread Sanjoy Mahajan
Dear List,

I'm trying to have problem solutions automatically collected, each with
its corresponding problem number, e.g. 2.3, and then typeset at the end
of a document.  Thus, I imagine something like

\startproblem{A problem title}  % Problem 1.1
A question

\startsolution
An answer
\stopsolution

\stopproblem

And then the solution(s) would appear at the end (with the "1.1"
remembered from when the problem was typeset):

  Solution to Problem 1.1.

  An answer

It seems that buffers are the way to do this.  But I cannot quite get
the automatic numbering to work.  The delayed evaluation and information
passing between lua and ConTeXt has me confused and tangled in a knot.

Below is a minimal almost-working example.  The issue is in the line

  {\ctxlua{userdata.addTempToBuffer('#1', [==[\getnumber[problem]]==])}}

which ends up putting the verbatim string "\getnumber[problem]" into the
temp buffer, rather than the typeset result, which would be something
like 1.1 or 1.2.

I've read the cld-mkiv.pdf manual, but I must be missing a simple
solution to getting ConTeXt to send back the result of
\getnumber[problem].  I've also tried the analogous
context.getnumber({"problem"}), though without success.

Does anyone see what I am missing?

Many thanks!

-Sanjoy

\defineenumeration[problem]
  [title=yes, text=Problem, way=bychapter, prefix=chapter]
\defineenumeration[solution][problem]
\setupenumeration [solution][text={Solution to problem}, number=no]

\def\test#1{[#1]}

% appendbuffer modified from Sietse Brouwer's on mailing list (Jan 15, 2013)
\startluacode
userdata = userdata or { }
function userdata.addTempToBuffer(buffername, problem)
buffers.append(
buffername,
'\\startsolution{' .. problem .. '}\n' .. 
buffers.getcontent('APPENDTEMP') .. '\n\\stopsolution\n\n'
)
end
\stopluacode

\def\startappendbuffer[#1]%
  {\def\stopappendbuffer%
  {\ctxlua{userdata.addTempToBuffer('#1', [==[\getnumber[problem]]==])}}
   \dostartbuffer[APPENDTEMP][startappendbuffer][stopappendbuffer]}

\starttext

\chapter{One}

\startproblem{Test}
  Test problem
\startappendbuffer[soln]
Solution
\stopappendbuffer
\stopproblem

\startproblem{Test}
Test problem
\startappendbuffer[soln]
Solution
\stopappendbuffer
\stopproblem

\typebuffer[soln]

\stoptext
___
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] right figure at bottom of page can narrow text block on whole next page

2019-01-29 Thread Sanjoy Mahajan
Dear List,

A figure near the bottom of the page can narrow the text block on the
whole next page.  I noticed the problem when typesetting my (next) book.
But the book is more a maximal than a minimal example.  However, from it
I made the minimal example included below that uses no external figures.

Figure 2 is the bottom of the page and the paragraph flows to its left
with a correspondingly narrower text block.  So far, so good.  But the
text block also narrows for the entirity of page 2 and for the first
two lines of page 3.  

I've found the problem on the MkIV 2019.01.07 and 2019.01.28 betas (all
on Debian amd64), as well as on the live ConTeXt (which is the
2019.01.28 beta).

-Sanjoy

== start margin-figure-region.tex =
\definepapersize[bookcrop][width=137mm,height=221mm]
\setuppapersize [bookcrop][bookcrop]

\setuplayout[marking=on, 
  location=middle,
  backspace=13.5mm,
  width=middle,
  topspace=32bp, 
  header=10bp, headerdistance=26bp,
  footerdistance=16bp, footer=10bp,
  height=578bp,
]

\setupinterlinespace[line=1.3em]
\setupbodyfont[times,10bp]

\starttext

\input knuth

Silly para

Silly para

\placefigure[right]{}{\framed[width=100bp,height=75.75bp]{\null}}

\input knuth

\dorecurse{8}{\par Silly para}

\placefigure[right]{}{\framed[width=100bp,height=60.75bp]{\null}}

\dorecurse{32}{Silly text }

\dorecurse{3}{\input knuth \par}

\stoptext
== end margin-figure-region.tex =
___
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] getting metafun positions within (displayed) math mode

2017-11-17 Thread Sanjoy Mahajan
[Sorry for probably breaking the threading -- long story with not using
the mailing-list administrative interface correctly at first.]

Aditya writes:

> No time for a detailed answer, but what you need is the following:
> ...

Thank you -- that should work.  I won't have many of these equation
beasts, and I can annotate them with \mathop, \mathord, etc. without
much trouble.  If I get ambitious, I'll look into the LuaTeX parsing.
But I fear that there aren't enough such equations to force me into
learning that much of the internals.

Maybe there's even an easier way with \mpos creating some kind of
callback, whereby LuaTeX talks back to it after typesetting the math
node?  Perhaps it adds a field to the node tree (if that's the right
word).  But I am rapidly spiraling beyond my LuaTeX understanding...

Nigel King writes:

> Wow. I learnt about Maxwell's Equation 48 years ago. I never
> understood it then nor on the intervening time despite sometimes
> helping design antennas. The picture and its annotation definitely
> helps creating clarity. For my twopenneth the effort is very
> worthwhile.

The _Maxwell's Equations_ book is really good.  I hope that mine can be
two-thirds as good.

-Sanjoy
___
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] getting metafun positions within (displayed) math mode

2017-11-16 Thread Sanjoy Mahajan
Dear ConTeXters,

For my sins, and to make students unhappy all over the world, I am
writing another book: _A Student's Guide to Newton's Laws of Motion_
(for Cambridge University Press, aka CUP).  As partial compensation, I
convinced CUP that I may typeset it in ConTeXt and deliver them PDF.

Being hopefully a guide actually useful to students, it will annotate
every symbol in important equations, a feature cribbed from the first
book of the _Student's Guide_ series, Dan Fleisch's _A Student's Guide
to Maxwell's Equations_.

I've attached an image of what such an annotated equation looks like
(from page 2 of Fleisch's book).  It's like a labeled part diagram (say,
for a laptop), where each part (here, each symbol) is connected with an
line to its explanation.

I'm trying to do so with a combination of ConTeXt, MetaPost/MetaFun,
TikZ, and whatever else might work.  But I am a bit stuck at the
following spot.

My plan is to use MetaFun to get the coordinates of each symbol in a
(displayed) equation and then, with MetaFun, connect those symbols to
mini-paragraphs of explanation that surround the equation.

But I am stuck on how to use \hpos in math mode. I'd like to do
something like:

\startformula
\hpos{n1}{\sum}_{\hpos{n2}{0}}^{\hpos{n3}{1}}
\stopformula

to get the locations of the nodes n1, n2, and n3 without interfering
with the math typesetting -- e.g., the engine should still know that
\sum is in display-math mode, so it should be large and have its sub-
and super-scripts below and above it, rather than next to it.

However, the \hpos hides its argument in an \hbox, and thus hides it
from the math layout.  Thus, I have to do something like this minimal
example:

\starttext
\startformula
  \sum_0^1  % what it should look like
  \quad
  \hpos{n1}{$\displaystyle\sum$}_{\hpos{n2}{$0$}}^{\hpos{n3}{$1$}}
\stopformula
\stoptext

The hpos'ed version after the \quad looks different, even after the
\displaystyle hack.

Is there a version of \hpos for math mode?  That would be the cleanest
solution, because who knows what else would be needed for other cases,
even if the limits can be placed correctly.

Or is there a better way to annotate equations?

(TikZ seems to have the same issue, in that it cannot see into equations.)

Regards,
-- 
-Sanjoy


Save Long Wharf Park in Boston Harbor!


Six reasoning tools to make hard problems easy.

___
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] location of old ConTeXt versions?

2015-11-10 Thread Sanjoy Mahajan
Thanks, Mojca.  Inspired by your suggestions, I did the following (which
should work on Ubuntu too, but I am using Debian testing
a.k.a. stretch):

$ dpkg --add-architecture i386
$ apt update
$ apt install libc6-i386

and voila my old binaries from the minimal worked!

There were other issues that aren't so easy to solve:

1. asymptote meanwhile is at version 2.35 instead of 2.31, which affects
   figure sizes slightly.

2. graphviz and dot (for all the tree diagrams) were at version 2.26 and
   are now at 2.28, which affects figure sizes somewhat and their layout
   slightly.

3. Inkscape was 0.48 and is now 0.91.  That affected the conversion from
   svg to eps of one figure.  That I worked around by just using the
   previously converted eps figure instead of the svg.

All the changes above can affect the page and line breaks, but I tweaked
a bit until that didn't happen.

It does show a general problem with large complex documents regarding
software versions.  ConTeXt is the fastest-changing component, but the
other components also change, and one needs a way to preserve the entire
software stack.

That's a software-engineering problem, and maybe others have found
solutions?

My first book (_Street-Fighting Mathematics_) is frozen with its typos
because I cannot reproduce its stack at all, so all the new printings
get the old typos.  Through bad luck, at the time (2009) I happened to
have a never-released version of the tex fonts, now long overwritten by
proper versions, and I also didn't use a ConTeXt minimal back then, so I
don't have the other binaries and TeX in the right form.

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

Re: [NTG-context] location of old ConTeXt versions?

2015-11-10 Thread Sanjoy Mahajan
Peter Münster  writes:

> I have context-2014.03.25-16:58 and context-2014.06.22-19:58.  If you
> want, I can prepare 1 or 2 tar-files (or zip) for you.

Peter,

I appreciate the kind offer.

I remember trying both those versions last year, and they produced
different page and line breaks.  But, I just found out how to rescue the
situation by installing 32-bit compatability libraries (see my previous
msg in this thread).

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

Re: [NTG-context] location of old ConTeXt versions?

2015-11-10 Thread Sanjoy Mahajan
luigi scarso  writes:

> Have you seen this site ?
>
> http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/

Thanks -- that might help!  I'm going to try texlive 2010: The last PDF
of that book was generated on 2010/05/01 using pdftex and ConTeXt
2009.11.06.

The ancient unreleased font that I used might prevent it from working,
but my fingers are crossed.

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

[NTG-context] location of old ConTeXt versions?

2015-11-10 Thread Sanjoy Mahajan
Dear ConTeXters,

In order to correct an embarrassing thinko (wrong units of
acceleration!) in my book for its next printing, I need to regenerate
the PDF changing only that one spot.

Thus, I am looking for an old ConTeXt version, 2014.05.17.  The latest
versions find different page and line breaks. I haven't been able to
convince them to rediscover the old breaks (which were carefully
optimized over a few miserable weeks back in 2014).

I have the 2014.05.17 minimal on my old laptop, a i386 32-bit Linux
laptop (2006 vintage).  I joined the 2010 decade recently and now use
64-bit laptop; the 32-bit minimals don't work on it.

The wiki, at
,
says that the old versions are available at
, where I found only
the latest versions.

Could you point me to a linux/64-bit minimal for 2014.05.17?  I'll
update the wiki accordingly. (If the old versions are gone, I'll dig out
my old laptop and regenerate it that way, or try convincing the laptop
to use 32-bit executables as well.)

Best,
-- 
-Sanjoy


Save Long Wharf Park in Boston Harbor!


Six reasoning tools to make hard problems easy.
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] example of better linebreak with 2014.05.17 compared to 2014.07.07

2014-07-09 Thread Sanjoy Mahajan
Out of curiosity and as a ConTeXt stress test, I installed 2014.07.07
MkIV and recompiled my book with it, and looked at the pixel-by-pixel
comparison between it and the version compiled with 2014.05.17.

There were many changes.  I am going through them one at a time in case
any could be bugs in luatex or context.  (I noticed several good changes
where pages fit more precisely into their height.)

Here is a change that might be a bug.  It uses the following minimal
example:

\setupbodyfont[palatino]
\showframe
\setuplayout[width=5.4286in]

\starttext

Let's see whether this estimate is reasonable.  According to the
plane's technical documentation, the 747-400's four engines together
can provide roughly 1~meganewton of thrust.

\stoptext

With 2014.05.17, the linebreaks are as follows, with no overfull boxes:

  Let's see whether this estimate is reasonable. According to the plane's
  technical documentation, the 747-400's four engines together can provide
  roughly 1 meganewton of thrust.

With 2014.07.07, the linebreaks are as follows, but with an overfull box:

  Let's see whether this estimate is reasonable. According to the plane's tech-
  nical documentation, the 747-400's four engines together can provide roughly
  1 meganewton of thrust.  

The roughly on the second line protrudes a good way into the margin.
From the log file:

  Overfull \hbox (8.80678pt too wide) in paragraph at lines 7--10
  \3palatino-12pt-rm-tf-0--0 ni-cal doc-u-men-ta-tion, the 747-400’s four 
en-gines to-gether can pro-vide roughly

Both runs use luatex 0.79.1 (svn rev 5033), which I compiled by hand and
then did 'context --make' to regenerate the formats.

Is this change in linebreaking intended, or could it be an unintended
consequence of another change (and therefore maybe problematic)?

Perhaps related, the PDF files behave differently with copying and
pasting.  Copying the paragraph from the 2014.05.17 file, I get spaces
between the words.  Copying from the 2014.07.07 file, I get no spaces
between the words (using mupdf).  (The difference may be due to the
smaller interword spaces, whose size may have fallen below a threshold
that mupdf uses.)

I've attached the uncompressed PDFs (each about 14K).

-Sanjoy



test_region20140517.pdf
Description: version with 2014.05.17


test_region20140707.pdf
Description: version with 2014.07.07
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] example of better linebreak with 2014.05.17 compared to 2014.07.07

2014-07-09 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 it can happen if patterns or fonts changed ...so, best make two small 
 test files and we can look into it with tracing

There's just one test file for both (see below).  I think I verified
that the texgyrepagella font is the same in both context minimals.  But
maybe the hyphenation patterns did change.

 how does the tex file look

I made the following minimal example (same for both versions):

\setupbodyfont[palatino]
\showframe
\setuplayout[width=5.4286in]

\starttext

Let's see whether this estimate is reasonable.  According to the
plane's technical documentation, the 747-400's four engines together
can provide roughly 1~meganewton of thrust.

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-07 Thread Sanjoy Mahajan
Wolfgang Schuster schuster.wolfg...@gmail.com writes:

 math-stc.mkvi:

   %
 - \ifx\currentmathtext\empty
 + \ifx\m_math_stackers_text_middle\empty
 \setbox\scratchboxthree\emptyhbox

Is this change still also needed (in addition to the luatex fix)?

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-07 Thread Sanjoy Mahajan
Sanjoy Mahajan san...@mit.edu writes:

 I've been finding many unexplained 0.5pt or so differences, which may
 be related to the underbrace problem. ...  What I keep finding is that
 pages long after where I make a small change somehow get changed, with
 roughly one-pixel shifts to parts of the page.

These small shifts were also caused by the underbrace luatex bug (these
pages all had underbraces on them)---many birds with one stone.

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-07 Thread Sanjoy Mahajan
luigi scarso luigi.sca...@gmail.com writes:

 Under linux you can also try diffpdf

Thanks -- I'd forgotten about that and just tried it.  If you are
looking for pixel-level changes, my script makes it easier to see
exactly what the changes are.  On the other hand, diffpdf is more
polished than my script.

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-06 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 After a day of testing, tracing, wondering etc Luigi and I figured out 
 what was the problem it tooks us lots of debug prints -). Indeed there 
 is a bug in luatex. 

Great detective work!

 So, some random value (not entirely random as it depends on what mem 
 area the glue node is allocated from and that is kind of stable in a 
 run) was added which results in the effects you noticed.

Ah, so running it 3 times would allocate the glue node from higher
and higher mem, and thereby making the not-so-random value larger and
larger.

 So, once this fix moves upstream you can check your suspicious cases. 
 Luigi will push it in our experimental branch and I suppose that Taco 
 will then push it into trunk and after that you can compile

Once it in the luatex trunk, I will check it right away.  I am also
happy to test the experimental branch if you give me a pointer to it.

 or wait till the garden carries it.

Do you mean in the minimals?

 Thanks for noticing!

For sure.  I am very happy that it is fixed, and fixed before I have to
give in my absolute final PDF file.  

My only worry is that the carefully tuned page breaks, some of which are
sensitive to 1pt insertions of vertical space, might change once the
underbraces return to their homes.  But I'll tweak it with a bit of
vertical space.

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-06 Thread Sanjoy Mahajan
 Once it in the luatex trunk, I will check it right away.

I just compiled and installed luatex 0.79.1 r5033, remade the formats,
and the result passes my underbrace tests (the 30,000 iterations and the
examples in my book mss).

Thank you for the great debugging.

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-04 Thread Sanjoy Mahajan
Wolfgang Schuster schuster.wolfg...@gmail.com writes:

 It does also depend on the width of the text because when I use 48pt
 in the example below the height of the brace is always the same but
 with 49pt the height increases after the first page.

An interesting bug.  That's also consistent with my experiments, in which

  \underbrace{\hbox{ }}_{\rho} 

triggers the problem, but 

  \underbrace{\hbox{}}_{\rho}

does not.

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Sanjoy Mahajan
I thought the problem might lie with the general
\definemathunderextensible (math-stc.mkvi), because underbrace is
defined as

\definemathunderextensible  [vfenced] [underbrace][FE3DF]  % 
[023DF]

Other underextensibles include \underbar:

\definemathunderextensible  [vfenced] [underbar]  [FE33F]
% [203E]

So I tried my example replacing \underbrace with \underbar but the
alignment comes out fine (and \overbrace works fine too).  So that
debugging idea didn't work, except to indicate that something special
about underbrace isn't working right.

Does anyone have suggestions for further debugging ideas?

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Sanjoy Mahajan
 math-stc.mkvi:

 \unexpanded\def\math_stackers_make_double#top#bottom#category#codepoint#codeextra#text%
   ...
 - \ifx\currentmathtext\empty
 + \ifx\m_math_stackers_text_middle\empty
 \setbox\scratchboxthree\emptyhbox
   \else

Thanks for looking into this, Wolfgang.

I made this change to math-stc.mkvi in the 2014.05.17 beta, then remade
the MkIV format with

  mtxrun --selfupdate
  mtxrun --generate
  luatools --generate
  context --make

Then I ran context on my test file (with 3 as the \dorecurse count).

However, the offset underbraces remain.  I'm attaching a image from
p. 2128, by which point the offset is 20 or 30pt.  I am fairly sure I am
running the newly created version, because remaking the format included
these lines:

  open source  1  256  
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/math-stc.mkvi
  loading  ConTeXt Math Macros / Stackers
  close source 1  256  
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/math-stc.mkvi

and the log output from running the minimal.tex shows that the the fmt
is indeed dated 2014.7.3:

  mtx-context | run 1: luatex 
--fmt=/home/sanjoy/context/2014.05.17-beta/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en
 --jobname=minimal 
--lua=/home/sanjoy/context/2014.05.17-beta/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui
 --no-parse-first-line --c:currentrun=1 --c:fulljobname=./minimal.tex 
--c:input=./minimal.tex --c:kindofrun=1 --c:maxnofruns=8 cont-yes.mkiv
  This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 4972) 
   \write18 enabled.
  open source  1  1  
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/cont-yes.mkiv

  ConTeXt  ver: 2014.05.17 23:46 MKIV beta  fmt: 2014.7.3  int: english/english


-Sanjoy

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

Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Sanjoy Mahajan
 context --make does a --generate so you can skip that and the luatools 
 run is not needed either (selfupdate is seldom needed too)

So 'context --make' is all one needs?  I'll update the wiki.

 we get a .5pt height difference somewhere (nothing else different in a 
 trace) ... smells like a luatex bug (testing that now)

That is my suspicion as well.  But I couldn't reproduce it with plain
luatex.  Though maybe I needed to use equation numbers, however that is
done in plain tex (the context run doesn't show the problem without the
\placeformula).

I suspect some internal state is getting slightly corrupted and getting
progressively worse with the 30,000 repetitions.

I've been finding many unexplained 0.5pt or so differences, which may be
related to the underbrace problem.  The context, so to speak, is that I
am putting in the last edits to the book, after having gone through and
checked every page many times.  So I want to ensure that none of the
small changes has a big effect, but I don't want to check every page
again (or I'll vomit).

Thus, I run my compare-pdfs.sh script on the previous and the latest
pdf. It renders each page to a B/W png (using mupdf) and then compares
corresponding pages using 'compare' (one of the ImageMagick tools).  Any
differing pixels are in red, and the shared pixels are in very light
gray.  Then all the pages with enough differences are viewed with 'feh',
in order of most-to-least differences.  And I check that nothing major
has changed.

What I keep finding is that pages long after where I make a small change
somehow get changed, with roughly one-pixel shifts to parts of the page.
I'm attaching an example pixel diff.  It shows changes on p.72 of the
mss.  However, the only change to the source code was on p.58 (and was
designed not to change any page breaks, which it didn't).  That same
page (p.72) often gets similar changes with all kinds of small changes.

[Note to me: In case I need to recreate the source for debugging
purposes, it's the change from rev 41ff54 to 2467d5]

In case the script is useful to others (earlier versions are in the
contexttest repository somewhere), I am attaching it.  I use it as
follows with a bash command line.  (The awk in the pipeline makes sure
that only pages with some difference make it to the viewer.)

DPI=72 compare-pdfs.sh old.pdf new.pdf | tee book-print.compare72dpi | awk '{if 
(($3  0.02)) print;}' | sort -nr -k3 | awk '{print $1}' | xargs -r feh

-Sanjoy

#! /bin/bash

# Usage: $0 file1.pdf file2.pdf
#
#   compares file1.pdf and file2.pdf by rendering each page and using
#   the 'compare' ImageMagick utility
#
# Copyright 2007-2014 Sanjoy Mahajan.  Licensed under the GNU GPL version 3
# or (at your option) any later version.
#
# HISTORY
#   2014-06-22: Use mudraw instead of pdftoppm.  GPL v3+
#   2009-09-30: Fix capture of dB output; don't use a viewer; use pdftoppm
#   2007-01-15: First version
#

if [ -z $DPI ]; then
DPI=72
fi
ext=png

if [ -z $1 -o -z $2 ]; then
  echo Usage: $0 file1.pdf file2.pdf
  exit 3
fi

# generate the many page images in a temporary directory
d=`mktemp -d`
mkdir -p $d/a $d/b
mudraw -r $DPI -g -o $d/a/%03d.$ext $1
mudraw -r $DPI -g -o $d/b/%03d.$ext $2
wait

# find the union of the page numbers (in case one pdf has more pages)
pages=`ls $d/{a,b}/*.$ext | sed s%.*/\([0-9][0-9]*\).$ext%\1% | sort -un`
# compare each page
for p in $pages ; do
  if ! [ -e $d/a/$p.$ext ] ; then
echo $p: missing from $1
continue
  fi
  if ! [ -e $d/b/$p.$ext ] ; then
echo $p: missing from $2
continue
  fi
  echo -n $d/diff-$p.$ext $p 
  compare -metric mae $d/{a,b}/$p.$ext $d/diff-$p.$ext 21
done
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-06-29 Thread Sanjoy Mahajan
Dear list,

As I copyedited my book, I noticed examples where the underbraces in
math formulas were not aligned vertically, especially toward the end of
the book.  Eventually I realized it was not due to my growing
copyediting skill, and I have made the following minimal example showing
the problem (I am using 2014.05.17 MkIV):

\setupformulas[indentnext=auto, spacebefore=none, spaceafter=none]

\starttext

\dorecurse{3000}{
\placeformula\startformula
\underbrace{\hbox{}}_{\rho} =
\underbrace{\hbox{  }}_{\rho}
\stopformula
}

\stoptext

It'll produce a 162-page file.  On the formulas on page 1, the two
underbraces in each equation are aligned.  But there seems to be some
kind of slow leak, because the underbraces become ever more misaligned.
By page 162, they are visibly misaligned by maybe 3pt.  If I increase
the recursion count to 3, on page 2129 the misalignment is about 30pt.

Taking out the \placeformula makes the misalignment go away.

I tried to reproduce the problem with plain LuaTeX, using the tex file
below, but the underbraces came out aligned.

\newcount\foo
\foo=3000
\loop
$$
\underbrace{\hbox{}}_{\rho} =
\underbrace{\hbox{  }}_{\rho}
$$
\advance \foo -1
\ifnum \foo0
\repeat

\end

Any thoughts on this very strange issue?

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


Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-06-29 Thread Sanjoy Mahajan
Here is a 72dpi rendering of the last page (with recursion count=3).

-Sanjoy

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

Re: [NTG-context] second-level seeindex entry nested too deeply

2014-06-23 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 can you play with:

 \unprotect

 \unexpanded\def\startregisterseewords
{\par % \ifhmode\crlf\fi
 \begingroup
 \setfalse\c_strc_registers_page_done
 \dostarttagged\t!registerpage\empty
 \useregisterstyleandcolor\c!pagestyle\c!pagecolor}

 \unexpanded\def\stopregisterseewords
{\dostoptagged
 \endgroup}

 \protect

That fixed the original test file.  But the problem resurfaced upon adding
one more level of nesting (the more nesting... line).  Here's the
revised minimal example.

\unprotect

\unexpanded\def\startregisterseewords
   {\par % \ifhmode\crlf\fi
\begingroup
\setfalse\c_strc_registers_page_done
\dostarttagged\t!registerpage\empty
\useregisterstyleandcolor\c!pagestyle\c!pagecolor}

\unexpanded\def\stopregisterseewords
   {\dostoptagged
\endgroup}

\protect

\setupregister[index][n=1]

\starttext

hello \index{area}area and \index{area+ellipse}area of an ellipse

more nesting \index{area+ellipse+today}area of an ellipse today

\seeindex{area+United Kingdom}{United Kingdom, area}

\blank[3*big]

\placeindex[criterium=all]

\stoptext

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


[NTG-context] small indexing glitch if index entry has extra {}

2014-06-23 Thread Sanjoy Mahajan
Here's a small glitch with indexing, which I ran into by chance and
enclose a minimal example.  Because of the extra {} in the entry
\index{{two dimensional}} the index duplicates the entry:

  t
  two dimensional 1
  two dimensional 1

\setupregister[index][n=1]

\starttext

\index{two  
  dimensional}test1

test \index{{two dimensional}}test2

\blank[3*big]

\placeindex[criterium=all]

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


[NTG-context] second-level seeindex entry nested too deeply

2014-06-22 Thread Sanjoy Mahajan
I think the following minimal example is giving an incorrect index.  As
ascii, the index comes out as

a
  area 1
ellipse 1
  see United Kingdom, area

whereas the see United Kingdom, area should be indented the same
as the ellipse second-level entry.  It comes out okay if I delete the
\index{area+ellipse} entry.

(P.S. What's the setupregister key that puts the see ... entry in
italic?  I seem to have turned it off in my environment file somewhere.
Oh, it's 'pagestyle', but then how can one separately set the style of
the pagenumbers from the style of the see ...?)

That aside, here's the example (run with 2014.05.17 MkIV):

\setupregister[index][n=1]

\starttext

hello \index{area}area and \index{area+ellipse}area of an ellipse

\seeindex{area+United Kingdom}{United Kingdom, area}

\blank[3*big]

\placeindex[criterium=all]

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


[NTG-context] distinguishing index entries according to function by using \setupregister

2014-06-07 Thread Sanjoy Mahajan
In MkII, one could configure the index to have different types of page
entries, e.g. roman and italic, by using \setupregister, as in the
example at http://wiki.contextgarden.net/Command/setupregister.  That
doesn't work with a fairly recent MkIV (2014.05.17 beta).

I see that it's a long-standing feature request:

http://www.mail-archive.com/ntg-context%40ntg.nl/msg67495.html

So, it is probably not on the short-term feature list.  But, if it is on
the list, please let me know, as I'll keep using it for my textbook!

Otherwise, I'll just make all the page entries the same style.  The
perfect is the enemy of the good, especially after 19 years...

(Right now with 2014.05.17 beta, using the feature, say as
\index[definition::]{commutativity}commutativity, gives an entry
alphabetized according to the definition:: key.)

Regards,
-Sanjoy
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] distinguishing index entries according to function by using \setupregister

2014-06-07 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 hm, it's already an old (mkiv) feature

 we have a better and mnore powerful mechanism now

 \defineprocessor[bf][style=bold]
 \defineprocessor[it][style=italic]

Thanks for this, and sorry for the noise.  I didn't even see that
material on the Registers wiki page, because I stopped looking after
seeing the \setupregister command help.  But I've updated that help to
refer (for MkIV) to the Registers#Processors section.

-Sanjoy


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


Re: [NTG-context] internal mptopdf converter skips some glyphs in labels

2014-06-05 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 you see the message:
 LuaTeX warning (file cmr10): Font cmr10 at 3000 not found

You are right, though I had unwisely ignored it (weak excuse below).

 so you need to load a map file that matches the used fonts:
 \loadmapfile[mkiv-base]

That does fix it, thanks.

The warning message, which is helpful, seems to happen only with a
relatively recent LuaTeX.  In my earlier tests, with 0.78, there wasn't
a message, and also with the luatex in Debian's TL2014 there isn't one
(which is why I ignored it).

Debian's TL has luatex beta-0.79.1 (TeX Live 2014/Debian) (rev 4971)

The version in the context standalone is just a bit later:

beta-0.79.1 (TeX Live 2014/dev) (rev 4972) 

Hard to believe that one svn revision makes all the difference, but
maybe it does.

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


Re: [NTG-context] internal mptopdf converter skips some glyphs in labels

2014-06-05 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 Alternatively, you can consider making your mp graphics like this:

 \startMPpage
some code
 \stopMPpage

 This will use the regular font system, gives access to everything 
 context as well, and makes it possible to opentype fonts. The resulting 
 (cropped) graphic can of course be included. One can also have more of 
 them:

That's an improvement on what I am doing.  (Though I may be getting lots
of ConTeXt and OpenType fonts, by using a preamble with

  verbatimtex %cont-en
  ...
  etex

)

Right now my figure source (blah.mpfig, say) is what would go in between
begin/endfig.  The Makefile wraps it in begin/endfig, and includes a
header.mp with all the definitions hopefully consistent with the main
document's environment (terrible, I know), writes out blah.mp, which is
run through metapost and mptopdf.

The disadvantage of incorparating everything into the .tex may be the
edit--compile cycle gets much longer for the figures, because you have
to compile the whole document or component to see the revised figure.
(My rule of thumb is that typing is about 10 times faster than
handwriting, unless one has to do equations, in which case you lose a
factor of 3; or if you have to make figures, in which case you lose the
other factor of 3 (3^2=10), and maybe more.)

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


[NTG-context] larger dot using \dot?

2014-06-04 Thread Sanjoy Mahajan
Dear list,

Is there an easy way to enlarge (and maybe slightly raise) the dot in,
for example, $\dot V$?  

I tried using \overset with an external figure (a pdf of a filled
circle), but the \hbox inside \overset meant that subscripts weren't
tucked in.  I also failed with metafun.

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


Re: [NTG-context] internal mptopdf converter skips some glyphs in labels

2014-06-04 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 This is with Context 2013.05.28 00:36 MKIV (TL2013 on Debian).

 the beta works ok .. are there any messages with respect to missing 
 fonts or map files?

FYI, with recent betas (2014.05.17 from a context standalone or
2014.05.21 from Debian TL2014), I still find the problem with the
internal mptopdf converter dropping glyphs.  I work around it in the
Makefile (convert using mptopdf externally).  However, in case it is
worth tracking down, here is the original report with the minimal
example.

==

The internal mptopdf converter in MkIV omits some glyphs in the labels.
Here's a minimal example (test.tex):

\starttext

\externalfigure[testfig.1][frame=on]
\blank
\externalfigure[testfig-1.pdf][frame=on]

\stoptext

And testfig.1 is produced by testfig.mp

beginfig(1)
label(btex $\Omega$ etex, (0,0));
currentpicture := currentpicture scaled 5;
endfig;
end

Here's testfig.1 to save a step in debugging:

%!PS
%%BoundingBox: -18 -18 18 18 
%%HiResBoundingBox: -17.98805 -17.0195 17.98798 17.0195 
%%Creator: MetaPost 1.803
%%CreationDate: 2013.08.09:1612
%%Pages: 1
%*Font: cmr10 49.81323 9.96265 0a:8
%%BeginProlog
%%EndProlog
%%Page: 1 1
 0 0 0 setrgbcolor
-17.98805 -17.0195 moveto
(\012) cmr10 49.81323 fshow
showpage
%%EOF

Then do:

  mptopdf testfig.1
  context test.tex
  xpdf test.pdf

The first framed box, using the internal mps-pdf conversion, is empty.
The second framed go, using the pdf file produced by mptopdf, correctly
contains \Omega.

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


[NTG-context] larger dot for \dot ?

2014-05-20 Thread Sanjoy Mahajan
My students complain that the dot in, for example, $\dot M$ is too small
and that they easily miss it.  So I have been trying to make a bigger
one, but haven't found a solution that plays nicely with the surrounding
math.

For example,

  \def\mydot{\overset{\externalfigure[dot.pdf]}} %bigger than usual one
  \def\Vdot{\mydot V}
  \starttext
  $\rho\Vdot\omega$  % loose spacing

  $\rho V\omega$ % tighter spacing
  \stoptext

where dot.pdf is a circle of radius 0.8bp (attached).

But the \Vdot gets wrapped in an hbox (inside \overset), so the
surrounding space is too large.

I also tried a metafun approach

  \startuniqueMPgraphic{math:mydot}
fill unitcircle scaled 2 shifted 
(OverlayWidth/2-1,OverlayHeight+OverlayOffset);
path q;
q:= unitsquare xscaled OverlayWidth yscaled (OverlayHeight+OverlayOffset+1);
setbounds currentpicture to q;
  \stopuniqueMPgraphic

  \definemathornament [mathmydot] [mp=math:mydot]

  \starttext

  $\rho\mathmydot{V}\omega$

  $\rho V\omega$

  $\rho\mathmydot{V}_0^2\omega$

  $\rho\dot{V}_0^2\omega$

  \stoptext

The $\rho\mathmydot{V}\omega$ looks good.  But the subscripted _0 is not
tucked under the V, because the bounds of the character are now a
rectangle that doesn't know about its shape.  I think for a similar
reason the superscripted 2 is quite high.

Is there more math-friendly (and elegant) way to get a fatter dot?

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


Re: [NTG-context] numerator is too high in \frac{3}{4}, in palatino

2014-05-17 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 these are font properties and using a consistent opentype math versus
 a bunch of loosely related type one fonts makes a difference

But shouldn't TeXGyrePagellaMath qualify?

 I've added:

 \starttext

  $\displaystyle 1+{2g\over3}+{2\over3}$ \blank

  \setupmathfractions[topdistance=0pt]

  $\displaystyle 1+{2g\over3}+{2\over3}$ \blank

  \setupmathfractions[bottomdistance=0pt]

  $\displaystyle 1+{2g\over3}+{2\over3}$ \blank

  \setupmathfractions[topdistance=0pt,bottomdistance=0pt]

  $\displaystyle 1+{2g\over3}+{2\over3}$ \blank

 \stoptext

Thanks, Hans.  That is very useful.  

I also recompiled my textbook draft using the latest beta (2014.05.17),
and it works very well.  I tried the topdistance and bottomdistance and
they are mostly working.  To my eye, with topdistance=6pt, the {1\over2}
looks very good again.

However, the settings don't seem to affect fractions inside square
roots.  Here's an example (the 20pt setting is to exaggerate the
possible effect), using 2014.05.17 beta.

\starttext
\placeformula\startformula
\dfrac{ag}{bcd}\quad{ag\over bcd}
\stopformula
\placeformula\startformula
\sqrt{1\over \dfrac{a}{bcd}}
\quad
\sqrt{\dfrac{1}{\dfrac{a}{bcd}}}
\stopformula

\setupmathfractions [topdistance=20pt]

\placeformula\startformula
\dfrac{ag}{bcd}\quad{ag\over bcd}
\stopformula
\placeformula\startformula
\sqrt{1\over \dfrac{a}{bcd}}
\quad
\sqrt{\dfrac{1}{\dfrac{a}{bcd}}}
\stopformula

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


[NTG-context] workaround for another too-low symbol in Pagella?

2014-05-09 Thread Sanjoy Mahajan
Here's another math symbol that I think is too low: the vertical bar in
Palatino/Pagella.  Here's an almost-minimal example.  I've left in the
surrounding text, to show how it's used (in probability, as P(H|E)).

I think the bottom of the bar is correct, but the tip of the bar doesn't
reach to the top of the H or E.

\setupbodyfont[palatino]
\starttext
\placeformula\startformula
\text{P}(
H\,|\, E
)
\stopformula
\stoptext

Again, I don't think it's a ConTeXt problem, but rather a Pagella
problem.  But is there a recommended ConTeXt workaround?  Maybe a
metafun symbol?

-Sanjoy

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


Re: [NTG-context] Vertical alignment of \placefigure[right]

2014-05-07 Thread Sanjoy Mahajan
 I would like to vertically shift the placement of figures
 (\placefigure[right]...), so that the upper side of the figure would
 be aligned with the top of the first line in a paragraph as opposed to
 the bottom [of the first line?] of the first paragraph.

Ah, I can finally answer a question.  The key is high:

\starttext
\hrule
\placefigure[right,high]{Caption}{\framed[width=5cm,height=4cm]{}}
\input knuth
\stoptext

But that seems too easy.  Is it what you want?

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


Re: [NTG-context] Vertical alignment of \placefigure[right]

2014-05-07 Thread Sanjoy Mahajan
I use high in combination with zero spacing afterwards, in order to
tighten the text flowing around the figure.  Compare the two variants
below.  (I confess to not knowing the difference between
sidespaceafter and spaceafter, but both seem to have the same
effect.)

\starttext
{\setupfloats[sidespaceafter=0pt]
\hrule
\placefigure[right,high]{Caption}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

}
\vskip1cm

\hrule
\placefigure[right,high]{Caption}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

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


Re: [NTG-context] Vertical alignment of \placefigure[right]

2014-05-07 Thread Sanjoy Mahajan
Here are a few more keys.  I don't fully understand their effect, but I
found them in strc-flt.mkvi (p.s. shouldn't that be .mkiv ?).

In the final grid examples, I extended the figure height to 4.5cm, to
show the effect of the grid, which seems to be that the bottom of the
figure aligns with a baseline.  The top can then protrude, if the height
is not a multiple of the line height.  But, if the figure heights are
right, it would look good in combination with
\setupfloats[sidespaceafter=0pt].

-Sanjoy

\starttext

\hrule
\placefigure[right]{Caption}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\vskip1cm
\hrule
\placefigure[right,fit]{Fit}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\page

\hrule
\placefigure[right,depth]{Depth}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\vskip1cm

\hrule
\placefigure[right,height]{Height}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\page

\hrule
\placefigure[right,halfline]{Halfline}{\framed[width=5cm,height=4.3cm]{}}
\input knuth

\vskip1cm

\hrule
\placefigure[right,grid]{Grid}{\framed[width=5cm,height=4.5cm]{}}
\input knuth

\page

\hrule
\setupfloats[sidespaceafter=0pt]
\placefigure[right,grid,high,none,nonumber]{Grid+high}{\framed[width=5cm,height=4.5cm]{}}

The {\bf grid+high figure} \input tufte \input knuth


\stoptext

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


[NTG-context] \pm set too low in MkIV?

2014-05-06 Thread Sanjoy Mahajan
Continuing my recent theme of finding glyphs too low or too high:

The \pm symbol looks like it is set too low, in MkIV.

\setuppagenumbering[location=]
\starttext
$\pm2$
\stoptext

The minus part of the sign lies below the baseline, which looks odd
relative to the horizontal stroke of the 2.

In MkII it is fine, as is the equivalent latex or plain tex (using
LatinModern).

I don't know whether the problem lis in the font metrics or in the
positioning by MkIV, because I haven't yet been able to convince tex,
latex, lualatex, or luatex to use the same font (LM math).

In MkIV, the font is  (from pdffonts):

  NSOXNN+LatinModernMath-Regular   CID Type 0C   Identity-H

Can anyone confirm the problem?

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


Re: [NTG-context] \pm set too low in MkIV?

2014-05-06 Thread Sanjoy Mahajan
Thanks for the testing.  I just tried it too. The live context uses MkIV
2012.05.30.  It also gets a different set of fonts:

VNVCGN+LMMathSymbols10-Regular   Type 1Custom  
LFHPBE+LMRoman12-Regular CID Type 0C   Identity-H  

I still wonder whether the placement is due to the new LM Math font.

-Sanjoy

Mikael P. Sundqvist mic...@gmail.com writes:

 I can confirm that it is too low in latest standalone. It looks OK at
 http://live.contextgarden.net/, though.

 I can also add that \surd is way too low in latest standalone (and
 only a bit to low in mkiv on http://live.contextgarden.net/, and OK in
 mkii on http://live.contextgarden.net/).

 \setuppagenumbering[location=]
 \starttext
 $\pm2$ and $\surd(1+2)$.
 \stoptext

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


Re: [NTG-context] \pm set too low in MkIV?

2014-05-06 Thread Sanjoy Mahajan
 the + aligns on the math axis so one can argue if the type-one variant 
 is ok ... so we would need a smaller (less height) + then which would 
 look visually weird

Plain TeX doesn't align the plus/minus to the math axis.  Rather, the
minus is aligned to the baseline, and the horizontal stroke of the plus
is above the baseline.  I agree that it looks a bit strange with the
horizontal stroke of the plus sign not aligned with the horizontal
stroke of the plus/minus.  Bt it looks even more jarring to have the
minus below the baseline, because the baseline is such a strong visual
line.

I don't think I've ever the minus below the baseline in a math book, and
it looks very wrong to my eye.

Pagella looks worse than the others, because it has a vertical gap
between the minus and the plus sign, so the depth below the baseline is
even larger.

 (all can be achieved ... but the idea of lm/gyre fonts is to provide an 
 acceptable consistent set ... at some point we can think of variants - 
 or maybe the fonts have a variant already)

I realize that it's not a ConTeXt problem, but is there a ConTeXt
workaround?  Or better to go to the TeX guts and compute the depth of
the box, then use \raise{}?

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


Re: [NTG-context] numerator is too high in \frac{3}{4}, in palatino

2014-05-05 Thread Sanjoy Mahajan
I just compared MkII and MkIV in this respect, and the MkII fraction
looks more symmetric (more correct) than the MkIV version.

Here is the MkII code:

\usetypescript[palatino][ec]
\setupbodyfont[palatino]
\starttext
\startformula
{3\over4}\quad {1\over2}
\stopformula
\stoptext

I've attached  (cropped) images to show the difference.

Another difference is in the fonts.  For the MkII version, pdffonts gives

  IVJLXF+TeXGyrePagella-RegularType 1Custom   yes 
yes no   4  0
  IVJLXF+TeXGyrePagella-RegularType 1Custom   yes 
yes no   5  0


For the MkIV version, pdffonts shows a math font (maybe for the
thicker fractional bar):

  EUEJAR+TeXGyrePagella-RegularCID Type 0C   Identity-H   yes 
yes yes 18  0
  UPBTGS+TeXGyrePagellaMath-RegularCID Type 0C   Identity-H   yes 
yes yes 19  0


If you have suggestions for how to change, slightly, the numerator and
denominator placement when using alatino, let me know.

Maybe the entire problem is that the division line is thicker in
Palatino math than in the text font, and maybe sits below the math axis
(so it gets too close to the denominator)?

-Sanjoy

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

[NTG-context] numerator is too high in \frac{3}{4}, in palatino

2014-05-01 Thread Sanjoy Mahajan
I've noticed the following issue with how high the numerator is placed,
but only when using Palatino:

\setupbodyfont[palatino]
\starttext
\startformula
{3\over4}\quad {1\over2}
\stopformula
\stoptext

The 3 and the 1 sit quite high above the division line, esp. in
comparison with the gap below the line (above the 4 and the 2).

The place okay without the \setupbodyfont[palatino], so maybe it is
something incorrect in the font parameters?

The fonts are (from 'pdffonts'):

EUEJAR+TeXGyrePagella-RegularCID Type 0C   Identity-H   yes yes 
yes 18  0
UPBTGS+TeXGyrePagellaMath-RegularCID Type 0C   Identity-H   yes yes 
yes 19  0

And it is compiled with 2014.03.27 20:04 MKIV.

Is there a way to adjust the spacing, or an alternative workaround?

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


Re: [NTG-context] \setupmathradical[sqrt] crunches denominator in an \over fraction

2014-04-24 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 indeed. this is what (sort of) happens in case of a plugged in renderer:

 \sqrt{#1} - ...\mathstylehbox{#1}... - ...\hbox{\stylecommand #1}...

 when #a = a \over b the style gets applied to the a only as \over 
 creates two (pseudo) groups i.e. the \over isolates a and b

   \sqrt{{k\over m}}\quad \sqrt{\displaystyle{k\over m}}

 would work ok

Ah, I understand.  The extra-braces solution, \sqrt{{k\over m}}, is
simple and I can retain my \over habits.

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


[NTG-context] \setupmathradical[sqrt] crunches denominator in an \over fraction

2014-04-21 Thread Sanjoy Mahajan
I have been trying out the newish
\setupmathradical[sqrt][alternative=mp], which has been very nice
because of the fine control over the radical sign.

I've noticed that it crunches the denominator in \sqrt{a\over b}
For example:

\starttext
\placeformula\startformula
\sqrt{k\over m}\quad \sqrt{\displaystyle{k\over m}}
\stopformula

\setupmathradical[sqrt][alternative=mp]

\placeformula\startformula
\sqrt{k\over m}\quad \sqrt{\displaystyle{k\over m}}
\stopformula

\stoptext

In the first line, the fractions come out fine.  In the second line, the
first k\over m has a small, inline-math m in the denominator but a
display-math k in the numerator.  The second sqrt is fine.

Is the problem that my plain-TeX habits, from decades using \over,
should be over, and that \frac is the recommended way?

(This is with the 2014.03.27 beta.)

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


Re: [NTG-context] \triangledown placed too low in Palatino

2014-04-15 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 So \triangle is a math ord and \bigtriangleup a math bin.

 For compatibility, that should probably stay true in ConTeXt too---even
 the low placement of \bigtriangledown, which I don't understand but
 which does reproduce plain TeX's placement.

 why? if compatibility means 'not useable' we should fix it

Thus, a question for the purer mathematicians on the list: Are there
uses for the lower placement of \bigtriangledown?  As a physicists, I
have used that shape only for the gradient operator (for which one has
\nabla).  But maybe it is used in, say, category theory with a lower
placement?

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


Re: [NTG-context] pagecolormodel problem

2014-04-15 Thread Sanjoy Mahajan
 can someone confirm, that this code fails with a recent ConTeXt version?

It fails for me with 2014.03.27 (luatex 0.78.2).

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


Re: [NTG-context] \triangledown placed too low in Palatino

2014-04-14 Thread Sanjoy Mahajan
 I can change things but will only do that when all you mathematicians 
 have some agreement about it ...

Otared points out that the distinction between \triangle and
\bigtriangleup comes from plain TeX.  plain.tex has these definitions:

\mathchardef\triangle=0234
\mathchardef\bigtriangleup=2234

So \triangle is a math ord and \bigtriangleup a math bin.

For compatibility, that should probably stay true in ConTeXt too---even
the low placement of \bigtriangledown, which I don't understand but
which does reproduce plain TeX's placement.

 Btw, it is still on my agenda to provide a mechanism for switching
 between math dictionaries (i.e. group symbols in group switch if needed
 different properties) so that one can switch between logic,
 statistics, streetfighting or whatever math.

Hm, like different dialects of a language.  Plain TeX definitely speaks
a pure-mathematician dialect.  It would be interesting to see what
symbol groups are useful in other dialects.

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


Re: [NTG-context] Averaged integrals

2014-04-14 Thread Sanjoy Mahajan
Janne Junnila janne.junn...@gmail.com writes:

 On a related note: It seems to me that \ointclockwise and
 \ointctrclockwise produce results opposite to what their names would
 indicate.

It seems wrong to me as well.  It could be a problem in a mapping
internal to context (or maybe the font).  char-def.lua gives, for
example,

 [0x2232]={
  category=sm,
  description=CLOCKWISE CONTOUR INTEGRAL,
  direction=on,
  linebreak=al,
  mathclass=limop,
  mathname=ointclockwise,
  unicodeslot=0x2232,
 },

The Unicode slot number is correct.  If you look up that Unicode character

http://www.fileformat.info/info/unicode/char/2232/index.htm

it has a clockwise arrow.  But, as you say,

\starttext
$\ointclockwise$
\stoptext

shows an anticlockwise arrow.

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


Re: [NTG-context] \triangledown placed too low in Palatino

2014-04-12 Thread Sanjoy Mahajan
Otared Kavian ota...@gmail.com writes:

 The \triangle operator is used for instance in the « symmetric
 difference » of two subsets

Ah, good to learn something about pure mathematics.  In my mathematics
degree, my tutor said, You are very good at the applied material,
which was not meant as a compliment.

So \triangle should be a \mathop rather than a \mathord?  Right now, as
Aditya pointed out, it's a \mathord (ordinary), in contrast to
\bigtriangleup, which is the same character but typeset as a binary
operator (binary). From char-def.lua :

 [0x25B3]={
  adobename=whiteuppointingtriangle,
  category=so,
  cjkwd=a,
  description=WHITE UP-POINTING TRIANGLE,
  direction=on,
  linebreak=ai,
  mathspec={
   {
class=ordinary,
name=triangle,
   },
   {
class=binary,
name=bigtriangleup,
   },
  },
  unicodeslot=0x25B3,
 },

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

[NTG-context] \triangledown placed too low in Palatino

2014-04-10 Thread Sanjoy Mahajan
I just noticed that the gradient operator (\triangledown) ends up too
low when using Palatino:

\setupbodyfont[palatino]
\starttext
$\triangledown T$
\stoptext

It seems about 3pt too low.  Without the \setupbodyfont[palatino], the
placement is fine.

(tested with 2013.05.28 and 2014.03.27 betas)

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


Re: [NTG-context] \triangledown placed too low in Palatino

2014-04-10 Thread Sanjoy Mahajan
Jannik,

You are right.  \nabla looks much nicer and is placed correctly.  (I
still think the \triangledown placement is slightly off.)

My environment files from MkII days have \def\nabla{\triangledown}, so I
never tried the true \nabla until your suggestion.

Thank you.

-Sanjoy

Jannik Voges researchj...@icloud.com writes:

 I think you are using the wrong symbol. Or at least I would prefer
 \nabla as gradient operator.


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


Re: [NTG-context] \triangledown placed too low in Palatino

2014-04-10 Thread Sanjoy Mahajan
 I cannot say whether the wrong placement is due to the wrong font
 metrics or the wrong mapping (mathop vs mathord) by ConTeXt.

I tried '\triangle T' (often used as the Laplacian operator, instead of
writing it out as \nabla^2).  That one comes out fine, even though
\triangledown does not.  But they seem to have similar kinds of
defintions/mappings:

From luatex-math.tex :

\def\triangle  {\Umathchar  25B3 }
\def\triangledown  {\Umathchar  200025BD }

So it must be a wrong font metric?

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


[NTG-context] page reference to figure fails when figure location is none

2014-04-06 Thread Sanjoy Mahajan
Using a recent MkIV beta (2014.03.27), it seems that a page reference to
a figure fails if the figure location is none.  Here is a minimal
example:

  \starttext

  \input knuth

  \placefigure[none][regularref]{}{\pagereference[workaroundref]
  \externalfigure[cow.pdf]}

  \input knuth

  See \at{page}[workaroundref]  or \at{page}[regularref]

  \stoptext

The log file has

  references   unknown reference '[][regularref]'

and the .pdf file has

  See page 1 or page ??

That is, the \at{page}[regularref] doesn't work.  (But the workaround
reference does work.)

If the figure's location key is changed from none to nonumber or
just deleted, then the regularref page reference works.

It also works with MkII (with or without none), so I am guessing that
it is a bug in MkIV.

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


Re: [NTG-context] page reference to figure fails when figure location is none

2014-04-06 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 more a side effect .. in mkii we store refs independently, in mkiv they 
 can also travel with other properties (like lists and here we have no 
 list entry

 in the next beta this will work ok

That make sense.  I will try it out.

I have found a few other buglets with placefigure for which I will make
minimal examples.

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


[NTG-context] mirrored leftmarginwidth in enumerations

2014-03-30 Thread Sanjoy Mahajan
If anyone has a suggestion for putting enumeration texts toward the
right edge of the left margin, I would be grateful.

In MkII enumerations, I would put a triangle (fig.2) in the left margin
using

\defineenumeration
  [pause]
  [title=no,
text={\externalfigure[fig.2][height=1em]},
location=inleft,
number=no,
  ]

The triangle was automatically aligned toward the right side of the left
margin (fill glue on the left), which was what I wanted, on even and odd
pages.

In MkIV, the marginal text is automatically aligned to the left side.
I restored the MkII effect using this hack (using a  instead of the
triangle, to make the example more self contained):

\defineenumeration
  [pause]
  [title=no,
   text={\hbox to \leftmarginwidth{\hfil $$}},
number=no,
alternative=inleft,
  ]

But I just realized that the hack doesn't work for double-sided layouts.

Using the leftmarginwidth is correct on the odd pages, but it is too big
for the even pages.  Thus, on page 2 of the example below, the 
overlaps the question text.

Is there a more idiomatic MkIV replacement for my hack?  Or is my hack
okay, but ConTeXt should be updated to interpret leftmarginwidth to mean
the leftmarginwidth, as appropriate for an odd or an even page?

Here is the example:

\setuplayout[marking=on,location=middle,
  backspace=1.25in,
  leftmargindistance=0.125in, leftmargin=0.625in,
  width=4.75in,
  rightmargindistance=0.25in, rightmargin=0.25in,
 ]

\setuppagenumbering[alternative={doublesided}]

\defineenumeration
  [pause]
  [title=no,
   text={\hbox to \leftmarginwidth{\hfil $$}},
number=no,
alternative=inleft,
  ]
  
\def\question#1{\startpause\relax #1 \stoppause}

\showframe

\starttext
\question{hello}
\page
\question{hello}
\stoptext
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mirrored leftmarginwidth in enumerations

2014-03-30 Thread Sanjoy Mahajan
Wolfgang Schuster schuster.wolfg...@gmail.com writes:

 \defineenumeration
   [pause]
   [title=no,
text={\symbol[triangle]},
width=fit,
number=no,
alternative=inleft]

Thank you.  That works beautifully.  Is my understanding right, that
width=fit is what makes the head (here the triangle symbol) fit into its
zone (here, the left margin)?  How does it know to put the space on the
left side of the triangle, rather than on the right side?

Once I understand enough to not say nonsense, I'll wikify an example.

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


Re: [NTG-context] lower superscripts in MkIV -- too low?

2014-03-28 Thread Sanjoy Mahajan
 we have a more modern implementation in the next beta

I tested the following with various flavors:

$
 x\mathstrut_{3} x_{3} 
 x^3 x\mathstrut^3 
 x^\circ x\mathstrut^\circ 
 20\mathstrut^\circ 20^\circ
$

Flavors that I tried: 

2014.03.27 MkIV
2014.02.14 MkIV
2013.06.07 MkII (from latest beta)
pdfTeX 1.40.14 (from Debian TL 2013)

(wrapping in \(start|stop)text or ending with \bye, as appropriate).

My observations:

The MkII and pdftex subscripts look too high.  I know that's
sacreligious, since it is what Knuth must have intended, and I am
surprised that I didn't notice it before.

The 2014.02.14 MkIV subscript with the strut looks too low, although the
x^3 with the strut looks reasonable, or is maybe just slightly too high.
The x^\circ looks fine.  The x\mathstrut^\circ is too high.  But the
20\mathstrut^\circ looks right (and looks too low without the strut).

In 2014.03.27 MkIV, the subscript- and subscript heights are unchanged
by the strut.  The subscript heights look right.  The superscript
heights all look okay, except for the 20\mathstrut^\circ, which is too
low (same height as without the strut).  In earlier versions, one could
raise the \circ using a \mathstrut, but that no longer has an effect.

The other change, and maybe I am hallucinating this one, is that the
horizontal spacing between the x and the 3 is now slightly different
with and without the strut: It is tighter with the strut.  I think it
looks better without the strut, but am not sure.

So, overall I think it has improved.  I also wonder:

1. about the right horizontal spacing (how tight it should be)

2. how to raise the \circ in 20^\circ

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


Re: [NTG-context] Broken bibliographies in 2014-03-07 beta

2014-03-28 Thread Sanjoy Mahajan
With the latest beta (2014.03.27), my bibliography example below now
works fine.  Thank you for fixing that.  Now I shall run the whole book
mss through the same beta.

-Sanjoy

Sanjoy Mahajan san...@mit.edu writes:

 Here's the example:

  test10.tex ===
 \usemodule[bib]
 \setupbibtex[database=testrefs, sort=author]
 \setuppublications[alternative=num, sorttype=bbl]

 \starttext

 Hi \cite[Abelson:1996]

 \blank
 \placepublications[criterium=text]

 \stoptext
  test10.tex ===

 and the bib file

 == testrefs.bib 
 @Book{Abelson:1996,
   author = {Harold Abelson and Gerald Jay Sussman with Julie Sussman},
   title =  {Structure and Interpretation of Computer Programs},
   publisher =  {MIT Press},
   year =   1996,
   edition ={2nd}}
 == testrefs.bib 
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] lower superscripts in MkIV -- too low?

2014-03-22 Thread Sanjoy Mahajan
 However as Hans pointed out, regarding maths typesetting in mkiv
 there are also some font related issues.
 we have a more modern implementation in the next beta

I realized that this would also fix my issue with the superscripted
degree symbol coming out too low (which I had mysteriously thought was
only for that symbol).  

I will happily test the new beta on a myriad of superscripts that haunt
my .tex files.

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


[NTG-context] lower superscripts in MkIV -- too low?

2014-03-21 Thread Sanjoy Mahajan
Dear math typesetting aficianados,

In the following example,

\starttext
$x^3\ x\mathstrut^3$
\stoptext

the superscript without the strut is about 2pt lower than with the
strut, using MkIV.  With MkII or plain TeX, they are the same height
(at the higher position obtained by using the \mathstrut in MkIV).

My eye tells me that the higher position looks more right.  Do others
agree?  Or, if it's a matter of taste, is the difference configurable
so that one can get the MkII behavior even without the \mathstrut?

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


[NTG-context] how to make a \lambdabar (like \hbar)

2014-03-10 Thread Sanjoy Mahajan
\hbar is used a lot in physics.  Once in a while, one also uses
\lambdabar to mean \lambda/2\pi.  It's Unicode description is 'LATIN
SMALL LETTER LAMBDA WITH STROKE' (U+019B).

I've been using this hack

  \def\lambdabar{\lambda\kern-1ex\raise0.65ex\hbox{-}}

But it's not beautiful.  Is there a better way to get a lambdabar
into (or from) the math fonts?  I tried

  \def\lambdabar{\Umathchar  019B }

by analogy with the definition of \hbar in luatex-math.tex, but it
produces a blank space.  There must be no entry for it in the regular
(or Palatino) math fonts.

For reference, the following thread had a discussion about \hbar

http://www.ntg.nl/pipermail/ntg-context/2013/070810.html

and \hbar works well (using MkIV 2014.02.14).

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


Re: [NTG-context] how to make a \lambdabar (like \hbar)

2014-03-10 Thread Sanjoy Mahajan
Aditya Mahajan adit...@umich.edu writes:

  \def\lambdabar{\lambda\kern-1ex\raise0.65ex\hbox{-}}

 Is this the canonical name for the glyph used by AMS?

Good question.  The AMS files don't seem to have it (the symbol is
hardly used by mathematicians).  But revtex4 defines it (for latex), in
/usr/local/texlive/2013/texmf-dist/tex/latex/revtex4/revsymb.sty

An example of using it:

\documentclass{revtex4-1}
\begin{document}
$\lambdabar$
\end{document}

 The right way is to update char-def.lua as

   {
adobename=lambdastroke,
category=ll,
description=LATIN SMALL LETTER LAMBDA WITH STROKE,
direction=l,
linebreak=al,
mathclass=variable,
mathname=lambdabar,
unicodeslot=0x019B,
   },

I have put that in and ran 'context --make' pending the font update.

 The easiest solution will be to file a bug report with the TeX Gyre 
 project. This is an easy glyph to add.

I'll do that.  If you know of it, could you point me to their bug tracker
(or best way to file a bug report)?  I roamed the GUST site without
finding it.

 Otherwise, you can use a different font as fall back for lambdabar, but 
 that will not match the regular lambda from Palatino. If you create the 
 glyph on your own, as in your definition above, then you have to play 
 around with the length of the bar to make make it pretty.

That seems to be what revtex does (it has quite a complicated
definition).

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


Re: [NTG-context] Broken bibliographies in 2014-03-07 beta

2014-03-10 Thread Sanjoy Mahajan
 Bibliographies are no longer generated. 

I can confirm this problem with a simple bibliography-usage test file.

 With the stable version, the same section reads:

  Database file #1: sample.bib
  You've used 4 entries,

I also just tried it on the 2012.02.14 beta, which works fine.  So it
must be due to a recent change.

-Sanjoy

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


Re: [NTG-context] Broken bibliographies in 2014-03-07 beta

2014-03-10 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 in bibl-tra.lua:

 local template = [[
 \citation{*}
 \bibstyle{cont-%s}
 \bibdata{%s}
 ]]

There was a local template = utilities.strings.striplong([[ .. so I
got rid of the call to utilities.strings.striplong(), then ran
context --make but the bibliography still didn't come out.  The pdf
file just has Hi [[error 2]]

Here's the example:

 test10.tex ===
\usemodule[bib]
\setupbibtex[database=testrefs, sort=author]
\setuppublications[alternative=num, sorttype=bbl]

\starttext

Hi \cite[Abelson:1996]

\blank
\placepublications[criterium=text]

\stoptext
 test10.tex ===

and the bib file

== testrefs.bib 
@Book{Abelson:1996,
  author =   {Harold Abelson and Gerald Jay Sussman with Julie Sussman},
  title ={Structure and Interpretation of Computer Programs},
  publisher ={MIT Press},
  year = 1996,
  edition =  {2nd}}
== testrefs.bib 

The log file has:

publications loading database from 'test10.bbl'
(test10.bbl)
publications warning: unknown cite argument 'Abelson:1996' on line '4'

and test10.bbl is an empty file.

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


[NTG-context] \rm in math mode should give text roman

2014-03-10 Thread Sanjoy Mahajan
I don't think it's right that \rm in math mode means \mathrm.  Or, at
least, plain.tex assumes that \rm gives text roman, e.g. from plain.tex
(line 1067),

\def\arctan{\mathop{\rm arctan}\nolimits}

Thus, the following example has the arctan text in Euler math.  

This problem doesn't occur with Latin Modern or with Palatino, because
somehow (I'm not quite sure how) they have \rm inside math meaning text
roman.

\usetypescriptfile[euler]

\definetypeface [mainface] [rm] [serif] [pagella][default]
\definetypeface [mainface] [ss] [sans]  [modern] [default]  [rscale=1.075]
\definetypeface [mainface] [tt] [mono]  [dejavu] [default]  [rscale=0.9]
\definetypeface [mainface] [mm] [math]  [pagellaovereuler][default]
\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]

\setupbodyfont[mainface]

\starttext
\startformula
\arctan x
\stopformula
\stoptext
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Euler with fallback

2014-03-03 Thread Sanjoy Mahajan
Aditya Mahajan adit...@umich.edu writes:

 This is to announce that the latest beta supports creating virtual math 
 fonts with fallback. The main test case is to use Euler font with missing 
 characters taken from Pagella but the mechanism is general and can be used 
 to replace a specific set of math glyphs from a font.

 This feature is not extensively tested. As such it will be useful if 
 everyone interested in math fallback mechanism could test this out and 
 report any bugs or inconsistencies.

One inconsistency or maybe bug is that text subscripts come out in Euler
instead of Palatino.  

Here's an example (using 2014.02.14 beta).  The Sun subscript using
_{\tf Sun} or _{\rm Sun} was in Palatino in the corresponding MkII
setup, but is in Euler now.  The workaround of an hbox with \tfxx or
\tfx doesn't get quite the right size.

\usetypescriptfile[euler]

\definetypeface [mainface] [rm] [serif] [pagella]  [default]
\definetypeface [mainface] [tt] [mono]  [dejavu]   [default]
[rscale=0.9]
\definetypeface [mainface] [mm] [math]  [pagellaovereuler] [default]

\setupbodyfont[mainface]

\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]

\starttext

\placeformula\startformula
M_{\rm Sun}\quad M_{\hbox{\tfx Sun}} \quad M_{\hbox{\tfxx Sun}} \quad M_{\tf 
Sun}
\stopformula

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


Re: [NTG-context] Euler with fallback

2014-03-03 Thread Sanjoy Mahajan
Aditya,

 Here's an example (using 2014.02.14 beta).  The Sun subscript using
 _{\tf Sun} or _{\rm Sun} was in Palatino in the corresponding MkII
 setup, but is in Euler now.  The workaround of an hbox with \tfxx or
 \tfx doesn't get quite the right size.

 That is because in math mode, \rm is symonym with \mathrm etc. The 
 standard way to write this is _{\text{Sun}}.

I agree about \rm.  However, _{\tf blah} once (in MkII) selected the
text font.  e.g.

\starttext
\placeformula\startformula
M_{\tf Sun}
\stopformula
\stoptext

Is the II-IV change in \tf semantics intended?  It's not hard to adjust
for by using 'sed'.  I raise the issue only in case the change is not
intended.

Actually, the example just as above (i.e. using modern fonts) works fine
works in MkII and MkIV.  It also works if \setupbodyfont[palatino] is
inserted as the first line.

It's fails only when using Palatino with Euler (at least, in the way
that I did it).

That data doesn't say what the right behavior is.  But it may help you
decide.

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


[NTG-context] using environments with project structure (in MkIV)

2014-03-01 Thread Sanjoy Mahajan
I'm having trouble using project structure and font loading together in
MkIV.  Here's how the problem arises.

As Aditya and Wolfgang have pointed out, the recommended way to set up
fonts in MkIV is before \starttext or \startcomponent.  For a component,
the setups usually go in an environment file that is referenced by the
project file, and the project file is mentioned with a \project, e.g.

\startcomponent test
\project testproject
\input knuth
\stopcomponent

However, the \project line has to come *after* \startcomponent.  If it
comes before \startcomponent, then context doesn't process the component
file at all, and no PDF file is generated.  An example:

\project testproject
\startcomponent test
\input knuth
\stopcomponent

(with testproject.tex containing \startproject blah \stopproject)

A workaround is to replace the \project line with \environment env where
env is what testproject would have included anyway.  e.g.

\environment env
\startcomponent test
\input knuth
\stopcomponent

Here, env.tex has all the setups including the font setups (and one
would do the same in the product file, i.e. in the file that includes
the components, by putting \environment env before the \startproduct).

The first problem is that it seems some of the functionality of
products, projects, and components is lost.  But maybe that's a matter
of taste.

Another problem is that env.tex doesn't know that one is compiling a
product or component---thus, the system modes *product and *component
are not defined while reading env.tex.

Is there another way of doing project structure that I am missing?

My update to the wiki page on project structure (on putting \project
before \startcomponent) seems to be wrong, and I'll fix it once I
understand what to do!

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


[NTG-context] how to set the CropBox in MkIV?

2014-02-23 Thread Sanjoy Mahajan
What is the MkIV/LuaTeX way to set the CropBox?
In MkII/PDFTeX, I used

  \pdfpagesattr = {/CropBox [54 72 558 720]}

With MkIV, I've tried 

  \pdfcompresslevel 0
  \pdfbackendsetpagesattribute{CropBox}{[54 72 558 720]}
  \starttext
  \input knuth
  \stoptext

but that set the CropBox as a string, and didn't override the A4 setting:

  /Type/Pages /CropBox ([54 72 558 720])/Count 1/Kids[16 0 R]

I also tried

  \pdfcompresslevel 0
  \startluacode
  local box = lpdf.array{54, 72, 558, 720}
  lpdf.addtopagesattributes(CropBox,box)
  \stopluacode

  \starttext
  \input knuth
  \stoptext

and that produced an improved line in the Pages object:

  /Type/Pages /CropBox [ 54 72 558 720 ]/Count 1/Kids[16 0 R]

but the actual cropbox for the page is unchanged (A4), probably because
the page object itself (object #16) overrides the CropBox with this:

  /CropBox [ 0. 0. 595.2756 841.8898 ]

(This is all with the 2014.02.14 beta.)

Regards,
-Sanjoy
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] superscripted \circ slightly too low?

2014-02-19 Thread Sanjoy Mahajan
The superscripted degree symbol in $10^\circ$ comes out slightly low.
e.g.

\starttext

\placeformula\startformula
10^\circ \quad 10\mathstrut^\circ
\stopformula

\placeformula\startformula
x^7\quad x\mathstrut^7
\stopformula

\stoptext

I'm not quite sure what's right, but my eye says that the
$10\mathstrut^\circ$ looks better.  (And now I worry that all my
superscripts are too low, but that could be my just being a worry wart.)

Is the slightly lower superscript positioning a conscious choice with
MkIV math?  Or maybe there's a magic parameter to adjust it?

I made some tests with other tex engines.  In tex, pdftex, and latex, it
comes out higher (as if \mathstrut were there).  In pdflatex, it comes
out slightly low.

I noticed this isssue because my asymptote figures had the higher
positioning, whereas the main context document had the lower positioning
(and asymptote was using latex to generate the labels).

-- 
-Sanjoy

http://savelongwharfpark.org/
Save Long Wharf Park in Boston Harbor!

http://streetfightingmath.com/
Six reasoning tools to make hard problems easy.
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] bug/issue with components and preamble (Re: Euler with fallback)

2014-02-18 Thread Sanjoy Mahajan
Sanjoy Mahajan san...@olin.edu writes:

 The wiki page for Project Structure has always shown setups (via
 \project ... ) going after the \startcomponent or \startproduct.  I've
 edited the examples to have setups before the
 \start(product|component).  If I did it wrong, let me know.

My change doesn't work, because of how components handle project files
(which also turns out to explain why I was seeing the Euler font when
you didn't).  The problem is that context doesn't generate a pdf file if
the \project line comes before the \startcomponent.  Thus, I was seeing
a pdf file from a previous version of the test file (where the font
setup came after the \startcomponent).

Here are the two test files (testproject2.tex and test6.tex):

 testproject2.tex 
\startproject testproject
\stopproject
==

(If testproject2.tex is empty, then the problem does not occur.)

== test6.tex =
\project testproject2
\startcomponent test

\input knuth

\placeformula\startformula
a^2 + b^2 = c^2
\stopformula

\stopcomponent
==

Here is the log file.  It says 'result saved in test6.pdf' but no pdf
file is actually saved.

(/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2014.02.14 17:07 MKIV beta  fmt: 2014.2.15  int: english/english

system   'cont-new.mkiv' loaded
(/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-new.mkiv)
system   files  jobname 'test6', input './test6', result 'test6'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
(/home/sanjoy/sfse/test6.tex 
(testproject2.tex{/home/sanjoy/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fontspreloading latin modern fonts (second stage)
{/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts'fallback modern rm 12pt' is loaded
 ) ) )

system   structure  start used structure

used structure   text: test6
used structure project: testproject

system   structure  stop used structure


system   files  start used files

used file   1: filename=cont-yes.mkiv filetype=tex 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-yes.mkiv 
usedmethod=otherwise
used file   2: filename=cont-new.mkiv filetype=tex 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-new.mkiv 
usedmethod=otherwise
used file   3: filename=lang-us.lua filetype=scripts 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/patterns/lang-us.lua
 usedmethod=otherwise
used file   4: filename=/home/sanjoy/sfse/test6.tex 
foundname=/home/sanjoy/sfse/test6.tex usedmethod=direct
used file   5: filename=testproject2.tex foundname=testproject2.tex 
usedmethod=direct
used file   6: filename=mkiv-base.map filetype=map format=map 
foundname=/home/sanjoy/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map
 usedmethod=database
used file   7: filename=lm.lfg filetype=tex 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/fonts/lm.lfg 
usedmethod=otherwise
used file   8: filename=lm-math.lfg filetype=tex 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/fonts/lm-math.lfg 
usedmethod=otherwise
used file   9: filename=lm-math.map filetype=map format=map 
foundname=/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-math.map 
usedmethod=database
used file  10: filename=lm-rm.map filetype=map format=map 
foundname=/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map 
usedmethod=database
used file  11: filename=lmroman12-regular filetype=otf format=otf 
foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf
 usedmethod=database
used file  12: filename=latinmodern-math.otf filetype=opentypefonts 
foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf
 usedmethod=database
used file  13: filename=latinmodern-math.otf filetype=otf format=otf 
foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf
 usedmethod=database

system   files  stop used files


system   options  start commandline options

used option  currentrun=2
used option  fulljobname=./test6.tex
used option  input=./test6.tex
used option  kindofrun=2
used option  maxnofruns=8
used option  no-parse-first-line=true
used option  nonstopmode=true
used option  passon=-file-line-error -recorder -interaction nonstopmode

system   options  stop commandline options

system   options  start commandline files

used file   1: ./test6.tex

system   options  stop commandline files


publications start used btx commands


publications stop used btxcommands

Re: [NTG-context] Euler with fallback

2014-02-17 Thread Sanjoy Mahajan
Wolfgang,

Thank you for the preamble.  It works well standalone.

For some reason it doesn't work with components.  I think I've seen this
problem before but can't remember the resolution.  Here's a minimal
example (with 2014.02.14 beta).  The text comes out in Euler.  The same
happens putting the font setup in a project file and referring to it
with \project.

\startcomponent test

\usetypescriptfile[euler]

\definetypeface [mainface] [rm] [serif] [pagella]  [default]
\definetypeface [mainface] [tt] [mono]  [dejavu]   [default]
[rscale=0.9]
\definetypeface [mainface] [mm] [math]  [pagellaovereuler] [default]

\setupbodyfont[mainface,10.5pt]

\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]


\input knuth

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


Re: [NTG-context] Euler with fallback

2014-02-17 Thread Sanjoy Mahajan
 Put your font definitions before \startcomponent or better put them
 in a environment file and load this file before \startcomponent.

Sorry, I should have said that I had tried that, but it has the same
problem (Euler font for everything).

\usetypescriptfile[euler]

\definetypeface [mainface] [rm] [serif] [pagella]  [default]
\definetypeface [mainface] [tt] [mono]  [dejavu]   [default]
[rscale=0.9]
\definetypeface [mainface] [mm] [math]  [pagellaovereuler] [default]

\setupbodyfont[mainface,10.5pt]

\appendtoks \rm \to \everymathematics
\setupmathematics[lcgreek=normal, ucgreek=normal]

\startcomponent test

\input knuth

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


Re: [NTG-context] Euler with fallback

2014-02-17 Thread Sanjoy Mahajan
 I can’t reproduce this, when I process your example the text is
 typeset with the pagella font.

You are right.  I am not sure what I had done, but it works as you say.

I also put the font setup in an environment file that is loaded by
testproject.tex, and that also works.

  \project testproject
  \startcomponent test

  \input knuth

  \stopcomponent

Because of font loading, is this recommended way to use components
(rather than the old way of the \project line after \startcomponent)?
If so, I'll make a note on the wiki.

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

Re: [NTG-context] Euler with fallback

2014-02-17 Thread Sanjoy Mahajan
 Because of font loading, is this recommended way to use components
 (rather than the old way of the \project line after \startcomponent)?
 If so, I'll make a note on the wiki.

 This does not only apply to component etc. but also to normal files because
 context sets and resets some values with \starttext etc. and to avoid some
 problems it’s better to put all setup commands before it.

Agreed.  The wiki page for Project Structure has always shown setups
(via \project ... ) going after the \startcomponent or \startproduct.
I've edited the examples to have setups before the
\start(product|component).  If I did it wrong, let me know.

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

Re: [NTG-context] Euler with fallback

2014-02-16 Thread Sanjoy Mahajan
Aditya Mahajan adit...@umich.edu writes:

 This is to announce that the latest beta supports creating virtual math 
 fonts with fallback. The main test case is to use Euler font with missing 
 characters taken from Pagella but the mechanism is general and can be used 
 to replace a specific set of math glyphs from a font.

 This feature is not extensively tested. As such it will be useful if 
 everyone interested in math fallback mechanism could test this out and 
 report any bugs or inconsistencies.

I would like to test and hopefully use this setup for _Street-Fighting
Science and Engineering_.  It should also give the setup a thorough
workout.  But I can't quite get the preamble right.

The test file below typesets text and math in palatino.

  \usetypescriptfile[euler-with-pagella]
  \definebodyfontenvironment[10.5pt]
  \setupbodyfont[palatino,10.5pt]

  \starttext

  \input knuth

  \placeformula\startformula
  a^2 + b^2 = c^2.
  \stopformula

  \stoptext

If I add

  \appendtoks \rm \to \everymathematics
  \setupmathematics[lcgreek=normal, ucgreek=normal]

just before \starttext, the math is typeset in roman pagella.

What am I doing silly?

Also, one of my reservations about using Euler for math, which readers
complained about in _Street-Fighting Mathematics_, is that v and \nu
(kinematic viscosity) look so similar.  Do you know any way to make them
more distinguishable, e.g. by substituting a different character?

-Sanjoy


 To use this feature you have to use `pagellaovereuler` as your math font. 
 For example, to use Euler with DejaVu fonts, use:


 \usetypescriptfile[euler]
 \starttypescript[mainface]
   \definetypeface[mainface][rm][serif][dejavu]  [default]
   \definetypeface[mainface][ss][sans] [dejavu]  [default]
   \definetypeface[mainface][tt][mono] [dejavu]  [default]
   \definetypeface[mainface][mm][math] [pagellaovereuler][default]
 \stoptypescript

 \setupbodyfont[mainface]

 \appendtoks \rm \to \everymathematics
 \setupmathematics
 [lcgreek=normal, ucgreek=normal]


 There is a built-in typescript `euler-with-pagella` to use 
 `pagellaovereuler` as the math font and `pagella` as the text font.
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] missing underbrace using palatino with latest beta (2013.12.26)

2014-02-15 Thread Sanjoy Mahajan
 With 2013.12.26 12:50 MKIV beta, the underbrace disappears.  With a
 bigger target (e.g. xyz instead of x) or with the default font, the
 underbrace returns.

 fixed in next beta (border case math font issue)

It works in the 2014.02.14 beta.  Sorry it took so long to test.

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


Re: [NTG-context] underbraces slightly too narrow (with MkIV 2013.05.28)

2014-02-15 Thread Sanjoy Mahajan
Hans Hagen pra...@wxs.nl writes:

 anyhow, i've now defined then in a different way (ok, some more trickery 
 had to be applied as it's one of these aspects of open type math that 
 still inherits old stuff) so in a next version you can do this:

 \setupmathstackers[vfenced][hoffset=10pt]

Tested with 2014.02.14 beta, and it is a big improvement.  Again, sorry
it took so long to test.

If I use hoffset=3pt, it seems that some underbraces get 3-pt borders
but others don't.  For example,

\setupmathstackers[vfenced][hoffset=3pt]

\starttext

\placeformula\startformula
\underbrace{15\,\tf cm}_{L}
\times
\underbrace{15}_{L}
\stopformula

\stoptext


The second underbrace has the 3-pt borders, but the first one looks more
like a 0-pt border (though hoffset=0pt makes it have a negative border).

Is it due to quantization, in that the extensibles grow in fixed-size
units?

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


[NTG-context] writetolist doesn't include sectionnumber in mkiv?

2014-02-15 Thread Sanjoy Mahajan
With MkIV, I'm having trouble getting \writetolist to include
sectionnumbers.  Or at least, I cannot get the typeset list to include
the sectionnumbers (but maybe writetolist sent in the information).

Here's a minimal example, which is almost exactly the example from the
wiki at http://wiki.contextgarden.net/Command/setuplist.  The only change
is that I've included [order=command] so that the \hrule ends up at the
right place.

\definelist[Reprints][criterium=all]

\starttext
  \section{Sec 1}
  \writetolist[Reprints]{1.}{List entry A}
  \subsection{Subsec 1}
  \writebetweenlist[Reprints]{\hrule}
  \writetolist[Reprints]{2.}{List entry B}
  \completelist[Reprints][order=command]
\stoptext


When typeset (I'm using the 2014.02.14 beta), the completelist looks
like:


List entry A   1

List entry B   1

But the 1. and 2. didn't show up in the left column.

I tried adding \setuplist[Reprints][sectionnumber=yes] but that didn't
help.  Does one need to define an alternative that includes
sectionnumbers?

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


Re: [NTG-context] internal mptopdf conversion fails on older mps file (using MkIV, beta 2013.12.26)

2014-01-03 Thread Sanjoy Mahajan
 weird, there used to be a procset line ... anyhow, maybe this works ok 
 at your end (meta-pdf.lua):
 ...

That fixes it!

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


[NTG-context] internal mptopdf conversion fails on older mps file (using MkIV, beta 2013.12.26)

2014-01-02 Thread Sanjoy Mahajan
The MkIV internal mptopdf converter fails on the following minimal example.
Here is the tex:

--- cut test2.tex here -
\enabletrackers[graphics.conversion,graphics.inclusion,fonts.mapfiles,fonts.loading,fonts.missing,fonts.mapping]
\starttext
\externalfigure[fig.1][frame=on]
\blank
\externalfigure[fig-1.pdf][frame=on]
\stoptext
--- cut test2.tex here -

And here is the figure, which was produced with mpost 0.993 (and also
converted to fig-1.pdf using the 'mptopdf' command):

 cut fig.1 here 
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 10 10 
%%HiResBoundingBox: 0 0 9.96262 9.96262 
%%Creator: MetaPost 0.993
%%CreationDate: 2009.10.21:1318
%%Pages: 1
%%BeginProlog
/bd{bind def}bind def
/hlw{0 dtransform exch truncate exch idtransform pop setlinewidth}bd
/vlw{0 exch dtransform truncate idtransform setlinewidth pop}bd
/l{lineto}bd/r{rlineto}bd/c{curveto}bd/m{moveto}bd/p{closepath}bd/n{newpath}bd
/C{setcmykcolor}bd/G{setgray}bd/R{setrgbcolor}bd/lj{setlinejoin}bd/ml{setmiterlimit}bd
/lc{setlinecap}bd/S{stroke}bd/F{fill}bd/q{gsave}bd/Q{grestore}bd/s{scale}bd/t{concat}bd
/sd{setdash}bd/rd{[] 0 setdash}bd/P{showpage}bd/B{q F Q}bd/W{clip}bd
%%EndProlog
%%Page: 1 1
 0.7 G
n 0 0 m
0 9.96262 l
9.96262 4.98131 l
 p F
P
%%EOF
 cut fig.1 here 

Running it through MkIV with the 2013.12.26 beta (or the stable context)
produces an empty frame for the inclusion of fig.1, but the correct
triangle for the inclusion of fig-1.pdf.  The empty frame has the
correct size, so the parser is getting at least as far as the bounding
box.

If I regenerate fig.1 using a recent metapost (1.803), the mps file is
simpler, and it is incorporated correctly by context.

 cut fig.1 produced with recent metapost here 
%!PS
%%BoundingBox: 0 0 10 10 
%%HiResBoundingBox: 0 0 9.96262 9.96262 
%%Creator: MetaPost 1.803
%%CreationDate: 2014.01.02:1250
%%Pages: 1
%%BeginProlog
%%EndProlog
%%Page: 1 1
 0.7 setgray
newpath 0 0 moveto
0 9.96262 lineto
9.96262 4.98131 lineto
 closepath fill
showpage
%%EOF
 cut fig.1 produced with recent metapost here 

Here is the source file:

--- cut fig.mp here -
def darkshaded = withgreyscale 0.70 enddef;
beginfig(1)
  fill (origin--(0,1)--(1,1/2)--cycle) scaled 10pt darkshaded;
endfig;
--- cut fig.mp here -

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


[NTG-context] underbrace under stacked math error with latest beta (2013.12.26)

2013-12-27 Thread Sanjoy Mahajan
A minimal example:

--- cut 
\def\2#1#2{\vcenter{\halign{\hfil ##\hfil\cr #1\cr#2\cr}}}
\def\ptwo#1#2{\left(\2{#1}{#2}\right)}

\starttext

\startformula
\underbrace{\ptwo{specific}{heat}}_{1}
\stopformula

\stoptext
--- cut 

It works with 2013.05.28 00:36 MKIV current, correctly producing 

( specific )
  heat

(with bigger parens) with an underbrace and a 1 underneath the brace.

With 2013.12.26 12:50 MKIV beta, I get this error:

  ! Illegal parameter number in definition of \m_math_stackers_text_middle.

  system   tex  error on line 7 in file /home/sanjoy/sfse/test3.tex: 
Illegal parameter number in definition of  ...

   1 \def\2#1#2{\vcenter{\halign{\hfil ##\hfil\cr #1\cr#2\cr}}}
   2 \def\ptwo#1#2{\left(\2{#1}{#2}\right)}
   3 
   4 \starttext
   5 
   6 \startformula
   7   \underbrace{\ptwo{specific}{heat}}_{1}
   8 \stopformula
   9 
  10 \stoptext
  11 

  to be read again 
  \hfil 
  \2#1#2l-\vcenter {\halign {\hfil ##\hfil 
   \cr #1\cr #2\cr }}
  \ptwo #1#2l-\left (\2{#1}{#2}
   \right )
  \math_stackers_make_double ...kers_text_middle {#6
}\edef \p_offset 
{\mathsta...
  l.7 \underbrace{\ptwo{specific}{heat}}
  _{1}

I've attached the log file.

The \ptwo{specific}{heat} by itself is fine.  Only when it is wrapped
in the \underbrace does the problem occur.

-Sanjoy

(/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2013.12.26 12:50 MKIV beta  fmt: 2013.12.26  int: english/english

system   'cont-new.mkiv' loaded
(/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-new.mkiv)
system   files  jobname 'test3', input './test3', result 'test3'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
(/home/sanjoy/sfse/test3.tex{/home/sanjoy/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fontspreloading latin modern fonts (second stage)
fontstypescripts  unknown library 'loc'
{/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts'fallback modern rm 12pt' is loaded
backend  xmp  using file 
'/home/sanjoy/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pagesflushing realpage 1, userpage 1
 ) 
)/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf

system   structure  start used structure

used structure   text: test3

system   structure  stop used structure


system   files  start used files

used file   1: filename=cont-yes.mkiv filetype=tex 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-yes.mkiv 
usedmethod=otherwise
used file   2: filename=cont-new.mkiv filetype=tex 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/base/cont-new.mkiv 
usedmethod=otherwise
used file   3: filename=lang-us.lua filetype=scripts 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/patterns/lang-us.lua
 usedmethod=otherwise
used file   4: filename=/home/sanjoy/sfse/test3.tex 
foundname=/home/sanjoy/sfse/test3.tex usedmethod=direct
used file   5: filename=mkiv-base.map filetype=map format=map 
foundname=/home/sanjoy/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map
 usedmethod=database
used file   6: filename=lm.lfg filetype=tex 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/fonts/lm.lfg 
usedmethod=otherwise
used file   7: filename=lm-math.lfg filetype=tex 
foundname=/home/sanjoy/context/tex/texmf-context/tex/context/fonts/lm-math.lfg 
usedmethod=otherwise
used file   8: filename=lm-math.map filetype=map format=map 
foundname=/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-math.map 
usedmethod=database
used file   9: filename=lm-rm.map filetype=map format=map 
foundname=/home/sanjoy/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map 
usedmethod=database
used file  10: filename=lmroman12-regular filetype=otf format=otf 
foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf
 usedmethod=database
used file  11: filename=latinmodern-math.otf filetype=opentypefonts 
foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf
 usedmethod=database
used file  12: filename=latinmodern-math.otf filetype=otf format=otf 
foundname=/home/sanjoy/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf
 usedmethod=database
used file  13: filename=lpdf-pdx.xml filetype=tex 

[NTG-context] missing underbrace using palatino with latest beta (2013.12.26)

2013-12-27 Thread Sanjoy Mahajan
A minimal example:

--- cut ---
\setupbodyfont[palatino,12pt]

\starttext

\startformula
\underbrace{x}_{1}
\stopformula

\stoptext
--- cut ---

It works fine with 2013.05.28 00:36 MKIV current.

With 2013.12.26 12:50 MKIV beta, the underbrace disappears.  With a
bigger target (e.g. xyz instead of x) or with the default font, the
underbrace returns.
-- 
-Sanjoy
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


  1   2   3   4   5   >