Hot answers tagged

4

You can call \unit from within lua with context.unit and do all the formatting there: \setcharacterspacing[frenchpunctuation] \mainlanguage[fr] \language[fr] \startluacode userdata = userdata or { } function userdata.comma_value(n) -- credit http://richard.warburton.it local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:...


4

Let's start with the easiest one, \mathsf, because that one is actually already there, but the name is \mathss, just like the text switch \ss. If you prefer \mathsf, you can just assign a different name using \let. For the RSFS and EuScript fonts it is a bit more tricky, because those are legacy TFM fonts, so one has to screw with the low-level font setup ...


3

One possible algorithm would be to typeset the table in a loop, adding rows until it exceeds the remaining height available on the page. Be warned that this is pretty slow. \startbuffer[table] \bTABLE \bTABLEhead \bTR \bTD a \eTD \bTD b \eTD \bTD c \eTD \eTR \eTABLEhead \bTABLEbody \dorecurse{\the\scratchcounter}{% \bTR \bTD 1 \eTD \bTD 2 \...


2

Apparently you have to set method=one in the directions setup: \setuppapersize[A4] \mainlanguage[ar-dz] \setupdirections[bidi=global,method=one] \setupalign[r2l] \definefontfamily [myfont][serif][Amiri] [features=arabic] \setupbodyfont [myfont] \starttext نص عربي \stoptext


2

I don't know why the code in the MWE is not working. One possible fix is to remove \definelayout[2][smallheadings]. For example: \setuppapersize[A6] \definelayout[bigheader][header=0.5\textheight] \definelayout[smallheader][header=0.1\textheight] \setuplayout[smallheader] \definelayout[1][bigheader] \starttext \showframe \input knuth \input knuth \input ...


2

If you want to do it using \unit, you have to expand the call to \directlua first. I'm using \cldcontext which is essentially a shortcut for \directlua{tex.sprint(...)} (with extra bells and whistles). To expand \cldcontext before \unit I use \expanded. \setcharacterspacing[frenchpunctuation] \mainlanguage[fr] \language[fr] \setupunits [method=3] \...


1

You need to setup the columns for the register with: \setupmixedcolumns[register][direction=reverse]


1

I cannot reproduce the error with \setupnotation that you report. Try updating to the latest beta. However, I get a spew of errors from simplefonts. That module is deprecated and stopped working long time ago. It was superseded by the built-in \definefontfamily command. This example works just fine for me: \definepapersize[name][width=16.5cm,height=...


1

This is the same idea as Henri Menke's solution, but instead of adding the lines one by one, I first measure the height of the row, and then use the built-in command \getrawnoflines to get the number of lines that will fit in the remaining space. \define\calculatelines {\setbox\scratchbox\hbox{\bTABLE \bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \...


Only top voted, non community-wiki answers of a minimum length are eligible