<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">As an aside: is it written somewhere in the manual that all dimensions passed to tex.setmath are in sp?<div class="">(The manual is not easily searchable and I have yet to read it cover-to-cover.)<br class=""><div class="">The section about setmath says only</div><div class="">"<span style="font-size: 10pt; font-family: DejaVuSerif;" class="">The value is either a number (representing a dimension or number) or a glue spec node repre-
senting a muskip for </span><span style="font-size: 10pt; font-family: DejaVuSansMono;" class="">ordordspacing </span><span style="font-size: 10pt; font-family: DejaVuSerif;" class="">and similar spacing parameters.</span><span style="font-family: DejaVuSerif;" class=""><font size="2" class="">"</font></span></div><div class=""><span style="font-size: 10pt; font-family: DejaVuSerif;" class="">The discussion of dimension registers in Section 9.3.4 does mention sp. I must admit that as a newbie, I did not even know that scaled points exist until I reverse-engineed the values in this post and googled "</span><font face="DejaVuSerif" size="2" class="">latex 65536".</font></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 20, 2016, at 09:05, Graham Douglas <<a href="mailto:graham.douglas@readytext.co.uk" class="">graham.douglas@readytext.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><snip><br class=""><blockquote type="cite" class="">Dear Akira<br class=""><br class="">Many thanks for your help and time.<br class=""><br class="">I'll compile version 0.98, re-run all my tests and write back to the list.<br class=""><br class="">My best wishes<br class=""><br class="">Graham<br class=""></blockquote><br class="">Dear Akira<br class=""><br class="">I quickly installed your distribution of  Version 0.98.0 (TeX Live<br class="">2016/W32TeX) and ran the example below.<br class="">I now see results similar to you, PNG attached. Possibly the conclusion<br class="">is that code like this:<br class=""><br class="">\directlua{<br class="">tex.setmath("global", "fractionnumup", "display", 131072)<br class="">tex.setmath("global", "fractionnumvgap", "display", 163840)<br class="">}<br class=""><br class="">has to be called at least once in math mode for the "global" value to<br class="">work. Calling it outside math mode has no effect.<br class="">Whether it can, or should, be possible to set these values outside math<br class="">mode is a question for those with far<br class="">greater expertise than I possess.<br class=""><br class="">Thank you for your help+suggestions.<br class=""><br class="">Best wishes<br class="">Graham<br class=""><br class="">%===============================================<br class="">% Minimal example<br class="">%==============================================<br class="">\directlua{<br class="">tex.outputmode = 1<br class="">}<br class="">\edef\pdfminorversion{\pdfvariable minorversion}<br class="">\pdfminorversion=6<br class="">\documentclass[a4paper,10pt,twoside]{book}<br class="">\usepackage{amsmath}<br class="">\usepackage{fontspec}<br class="">\usepackage[math-style=TeX]{unicode-math}<br class="">\begin{document}<br class="">\def\IHb#1{{\hskip-#1bp\relax}} %kludge to fix spacing around limits on<br class="">integrals (to explore cause!)<br class="">\setmainfont{Constantia}<br class="">\setmathfont{Cambria Math}<br class=""><br class="">\noindent Example 1: Try to globally set math params in<br class="">\verb!\directlua{}! but outside math mode.\par<br class="">\noindent Result: Spacing not changed.<br class=""><br class="">\directlua{<br class="">tex.setmath("global", "fractionnumup", "display", 131072)<br class="">tex.setmath("global", "fractionnumvgap", "display", 163840)<br class="">}<br class="">\[    \int_{\IHb{3}a}^{\IHb{1.5}b}u\frac{d^2v}{dx^2}\,dx<br class="">    =\left.u\frac{dv}{dx}\right|_a^b<br class="">    -\int_{\IHb{3}a}^{\IHb{1.5}b}\frac{du}{dx}\frac{dv}{dx}\,dx.<br class="">\]<br class=""><br class="">\noindent Example 2: Use \verb!\Umath...! commands inside math.\par<br class="">\noindent Result: Works perfectly.<br class=""><br class="">\[<br class="">\Umathfractionnumup\displaystyle=2pt\Umathfractionnumvgap\displaystyle=2.5pt<br class="">    \int_{\IHb{3}a}^{\IHb{1.5}b}u\frac{d^2v}{dx^2}\,dx<br class="">    =\left.u\frac{dv}{dx}\right|_a^b<br class="">    -\int_{\IHb{3}a}^{\IHb{1.5}b}\frac{du}{dx}\frac{dv}{dx}\,dx.<br class="">\]<br class=""><br class="">\noindent Example 3: Now re-set math but again do not use<br class="">\verb!\directlua{}! or \verb!\Umath...! commands.\par<br class="">\noindent Result: Spacing not changed.<br class=""><br class="">\[    \int_{\IHb{3}a}^{\IHb{1.5}b}u\frac{d^2v}{dx^2}\,dx<br class="">    =\left.u\frac{dv}{dx}\right|_a^b<br class="">    -\int_{\IHb{3}a}^{\IHb{1.5}b}\frac{du}{dx}\frac{dv}{dx}\,dx.<br class="">\]<br class=""><br class="">\noindent Example 4: Change spacing by putting \verb!\directlua{}! code<br class="">into math expression\par<br class="">\noindent Result: Works perfectly.<br class="">\[<br class="">\directlua{<br class="">tex.setmath("global", "fractionnumup", "display", 131072)<br class="">tex.setmath("global", "fractionnumvgap", "display", 163840)<br class="">}<br class="">    \int_{\IHb{3}a}^{\IHb{1.5}b}u\frac{d^2v}{dx^2}\,dx<br class="">    =\left.u\frac{dv}{dx}\right|_a^b<br class="">    -\int_{\IHb{3}a}^{\IHb{1.5}b}\frac{du}{dx}\frac{dv}{dx}\,dx.<br class="">\]<br class=""><br class="">\noindent Example 5: Once again, do not use \verb!\directlua{}! or<br class="">\verb!\Umath...! \par<br class="">\noindent Result: Works perfectly.<br class="">\[    \int_{\IHb{3}a}^{\IHb{1.5}b}u\frac{d^2v}{dx^2}\,dx<br class="">    =\left.u\frac{dv}{dx}\right|_a^b<br class="">    -\int_{\IHb{3}a}^{\IHb{1.5}b}\frac{du}{dx}\frac{dv}{dx}\,dx.<br class="">\]<br class=""><br class="">\end{document}<br class=""><br class=""><br class=""><span id="cid:7CD34ACB-0DD0-44D1-BDEB-D4C4A48A840C@csail.mit.edu"><mathlist.png></span></div></blockquote></div><br class=""></div></div></body></html>