Re: [NTG-context] start/stop executed conditionally on mode ?

2020-06-09 Thread Jan Willem Flamma
Dear list, I have seen the use of blocks mechanism with and without a start/stop combination. It is not clear to me in which cases it is required to also include a start/stop combination in this mechanism. \beginquestion\startquestionQuestion A\stopquestion\endquestion\beginanswer\startanswerAnswer A\stopanswer\endanswer Regards,Jan Willem Flamma  From: Hans HagenSent: Tuesday, 9 June 2020 09:37To: mailing list for ConTeXt users; Fabrice LSubject: Re: [NTG-context] start/stop executed conditionally on mode ? On 6/8/2020 9:53 PM, Fabrice L wrote:> > >> Le 7 juin 2020 à 23:19, Aditya Mahajan >> > a écrit :>> >> On Sun, 7 Jun 2020, Fabrice L wrote:>> >>> Dear List,>>> >>> I would like to insert a page using (ideally) start/stop >>> instructions. The problem is that this page should be inserted only >>> in a certain mode. Consulting the mailing list, I thought the >>> following code was working, but it’s not ! The code is executed in >>> the mode as expected, but the following instructions ("Some other >>> text... » in the exemple) is not typeset.>>> >>> Here is a minimal (not working!) example:>>> >>> % >>> \unexpanded\def\StartQuestionsList{>>> \startmode[ClassRoom]  \page[yes] Here are some questions: \blank>>> }>>> \unexpanded\def\StopQuestionsList{>>> \page[yes] \stopmode>>> }>>> \definestartstop[Questions][>>> before=\StartQuestionsList,>>> after=\StopQuestionsList>>> ]>>> >>> >>> \startQuestions>>> Question A….>>> Question B….>>> \stopQuestions>>> >>> Some other text...>>> % One of the oldest mechanism available ... blocks: \enablemode[classroom] % comment this \defineblock[Question] \doifmode {classroom} { \keepblocks[Question]} \starttext  Text A  \beginQuestion Question A…. \endQuestion      Text B  \beginQuestion Question B…. \endQuestion  \page  \doifnotmode {classroom} { \useblocks[Question] } \stoptext -   Hans Hagen | PRAGMA ADE   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands    tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl-___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-contextwebpage  : http://www.pragma-ade.nl / http://context.aanhet.netarchive  : https://bitbucket.org/phg/context-mirror/commits/wiki : http://contextgarden.net___ 
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] About vertical typesetting in ConTeXt

2020-06-09 Thread Jairo A. del Rio
Hi list! I'm curious about vertical typesetting in ConTeXt. As far as I
know, LuaTeX supports four text directions, but LTL is broken for Manchu
script (letters are displayed unjoined in LTL mode) and LuaMetaTeX does not
support vertical directions anymore, at least as primitives.

I found the following solution:

https://tex.stackexchange.com/a/140972/193767
I reproduce the code (in XeLaTeX), just in case

% !TEX TS-program =
xelatex\documentclass{scrartcl}\usepackage{fontspec}\newfontfamily{\dcw}[]{DaicingWhite}%\begin{document}\noindent
Line above\\% to demonstrate that the lines are being stacked as
normal\rotatebox{-90}{%\XeTeXupwardsmode1\\% successive lines will be
stacked upwards instead of downwards\begin{minipage}{4em}% this will
be the vertical length of the Mongolian section{\dcw% Font: Daicing
White
1 ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ\\% direct Unicode input of Manchu letters
2 ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ}% End font\end{minipage}\XeTeXupwardsmode0}% End rotatebox
\noindent
Line underneath\end{document}


and I see XeTeX uses the primitive \XeTeXupwardsmode and some other tricks
to get the proper display of Manchu text, so maybe MKII can do the magic
using XeTeX as an engine. How would one use ConTeXt MKIV for this task? Is
it possible to emulate \XeTeXupwardsmode in ConTeXt as a first step? Thank
you very much.

Jairo :D
___
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] problem with counters (page)

2020-06-09 Thread Alan Bowen
My efforts to set up a new page counter in the footertexts of a book are
not proving successful. The following code shows the nature of the problem.

\definecounter[volpage][type=page, way=bypage]
\starttext
\setcounter[volpage][5]
\dorecurse{3}{\startTEXpage[offset=2pc]
\input ward
\blank[medium]
\centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]}
\stopTEXpage}
\stoptext

As you will see, the counter is not incremented on pages 2 and 3.

I expect that I have missed something important. But what?

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bar within math (amended)

2020-06-09 Thread Wolfgang Schuster

Lukas/ConTeXt schrieb am 09.06.2020 um 20:28:

Hello,

it seems that bar (even with option 'continue=yes') is not rendered in place of 
'~' within math. See the sample:


\definebar[MyBar][color=green,rulethickness=2.8,order=background,offset=1.5,continue=yes]

\starttext
   1 + 2 = \startbar[MyBar]3~kN\stopbar % OK

   $1 + 2 = \startbar[MyBar]3~\text{kN}\stopbar$ % No background behind space

   $1 + 2 = 
\inframed[frame=off,background=color,backgroundcolor=green,offset=0pt,]{3~\text{kN}}$
 % OK!
\stoptext


In the sample 'kN' is a unit, which should be separated by space from the 
result (here: 3);
I am used to put the unit into the math environment and enclose it into 
\text{...}.

Is there a way to make the bar be rendered in places of blanks within math, too 
(like if it was inside $ ... $ - as the first line of the sample)?

- Note that I can use \inframed to get background filled fully, but anyway - how about 
usage of "bar" for this?


Use a textbackground to highlight parts of your text.

\definetextbackground
  [Highlight]
  [frame=off,
   background=color,
   backgroundcolor=yellow]

\starttext

\m{1 + 2 = \unit{3 kilo newton}}

\m{1 + 2 = \Highlight{\unit{3 kilo newton}}}

\stoptext

Wolfgang

___
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] Bar within math (amended)

2020-06-09 Thread Lukas/ConTeXt
Hello,

it seems that bar (even with option 'continue=yes') is not rendered in place of 
'~' within math. See the sample:


\definebar[MyBar][color=green,rulethickness=2.8,order=background,offset=1.5,continue=yes]

\starttext
  1 + 2 = \startbar[MyBar]3~kN\stopbar % OK

  $1 + 2 = \startbar[MyBar]3~\text{kN}\stopbar$ % No background behind space

  $1 + 2 = 
\inframed[frame=off,background=color,backgroundcolor=green,offset=0pt,]{3~\text{kN}}$
 % OK!
\stoptext


In the sample 'kN' is a unit, which should be separated by space from the 
result (here: 3);
I am used to put the unit into the math environment and enclose it into 
\text{...}.

Is there a way to make the bar be rendered in places of blanks within math, too 
(like if it was inside $ ... $ - as the first line of the sample)?

- Note that I can use \inframed to get background filled fully, but anyway - 
how about usage of "bar" for this?

Best regards,

Lukas\definebar[MyBar][color=green,rulethickness=2.8,order=background,offset=1.5,continue=yes]

\starttext
  1 + 2 = \startbar[MyBar]3~kN\stopbar

  $1 + 2 = \startbar[MyBar]3~\text{kN}\stopbar$

  $1 + 2 = 
\inframed[frame=off,background=color,backgroundcolor=green,offset=0pt,]{3~\text{kN}}$
\stoptext


Bar.pdf
Description: Adobe PDF document
___
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] start/stop executed conditionally on mode ?

2020-06-09 Thread Fabrice L


> Le 9 juin 2020 à 03:37, Hans Hagen  a écrit :
> 
> On 6/8/2020 9:53 PM, Fabrice L wrote:
>>> Le 7 juin 2020 à 23:19, Aditya Mahajan >> > a écrit :
>>> 
>>> On Sun, 7 Jun 2020, Fabrice L wrote:
>>> 
 Dear List,
 
 I would like to insert a page using (ideally) start/stop instructions. The 
 problem is that this page should be inserted only in a certain mode. 
 Consulting the mailing list, I thought the following code was working, but 
 it’s not ! The code is executed in the mode as expected, but the following 
 instructions ("Some other text... » in the exemple) is not typeset.
 
 Here is a minimal (not working!) example:
 
 % 
 \unexpanded\def\StartQuestionsList{
 \startmode[ClassRoom]  \page[yes] Here are some questions: \blank
 }
 \unexpanded\def\StopQuestionsList{
 \page[yes] \stopmode
 }
 \definestartstop[Questions][
 before=\StartQuestionsList,
 after=\StopQuestionsList
 ]
 
 
 \startQuestions
 Question A….
 Question B….
 \stopQuestions
 
 Some other text...
 % 
> One of the oldest mechanism available ... blocks:
> 
> \enablemode[classroom] % comment this
> 
> \defineblock[Question]
> 
> \doifmode {classroom} {
>\keepblocks[Question]
> }
> 
> \starttext
> 
>Text A
> 
>\beginQuestion
>Question A….
>\endQuestion
> 
>Text B
> 
>\beginQuestion
>Question B….
>\endQuestion
> 
>\page
> 
>\doifnotmode {classroom} {
>\useblocks[Question]
>}
> 
> \stoptext

You are right of course... In fact I already use blocks, for another purpose, 
but I did not think about this solution because I needed a lot of formatting 
(these blocks should occupy whole page, different background color…), but 
blocks can adapt to my current need (I have try this morning) using the 
\setupblock[][before=..,after=…] command. And there is a bonus; I can « collect 
» these blocks and put them all together at the end of my courses notes, this 
is perfect.


___
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] accessing xml element attributes in lua, how, if you do not want to use the .at scheme?

2020-06-09 Thread mf

Il 09/06/20 15:31, Gerben Wierda ha scritto:
I’ve been trying to find out how I can access XML node 
properties/attributes in lua other than via the .at syntactic scheme but 
using the property/attribute name as a string.


E.g., currently I do:

someVar = someNode.at.someProperty

but I would like to do something /like/

someVar = someNode[“someProperty”] or someNode.attribute(“someProperty”) 
or something where I can use the string version of the 
properties/attribute name.


It’s probably possible (after all these are all dynamic structures that 
come from data), but how exactly?




local prop = "someProperty"
someVar = someNode.at[ prop ]

Massi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] accessing xml element attributes in lua, how, if you do not want to use the .at scheme?

2020-06-09 Thread Gerben Wierda
I’ve been trying to find out how I can access XML node properties/attributes in 
lua other than via the .at syntactic scheme but using the property/attribute 
name as a string.

E.g., currently I do:

someVar = someNode.at.someProperty

but I would like to do something like

someVar = someNode[“someProperty”] or someNode.attribute(“someProperty”) or 
something where I can use the string version of the properties/attribute name.

It’s probably possible (after all these are all dynamic structures that come 
from data), but how exactly?

Thanks,

G

___
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] \startplacefigure and \startframedtext in lmtx

2020-06-09 Thread Otared Kavian
Hi all,

I just noticed that in lmtx, the commands \startplacefigure and 
\startframedtext, when used together, do not behave in the same way as they do 
in mkiv. 
I wonder whether this is a permanent change or rather a buglet.

I found a fix around the issue, but since in my document I have a certain 
number of cases where such combinations are used, I woul dlike to be sure to 
not make a mistake by changing all the instances… Here is an example:

%% begin figure-framedtext.tex
\useMPlibrary[dum]
\defineexternalfigure[dummy] 

\starttext
\startplacefigure[location=left,number=no,title={}]
\externalfigure[dummy][width=.45\textwidth]
\stopplacefigure
\dontleavehmode % if this is commented out then the text and the figure are 
placed on top of each other
\startframedtext[frame=off]
\input ward.tex
\stopframedtext
\stoptext
%% end figure-framedtext.tex

In the above example the fix is to add \dontleavehmode between the figue and 
the framedtext. If one comments out that line then the issue can be seen.

Thanks in advance for any help: Otared K.

___
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] start/stop executed conditionally on mode ?

2020-06-09 Thread Hans Hagen

On 6/8/2020 9:53 PM, Fabrice L wrote:



Le 7 juin 2020 à 23:19, Aditya Mahajan > a écrit :


On Sun, 7 Jun 2020, Fabrice L wrote:


Dear List,

I would like to insert a page using (ideally) start/stop 
instructions. The problem is that this page should be inserted only 
in a certain mode. Consulting the mailing list, I thought the 
following code was working, but it’s not ! The code is executed in 
the mode as expected, but the following instructions ("Some other 
text... » in the exemple) is not typeset.


Here is a minimal (not working!) example:

% 
\unexpanded\def\StartQuestionsList{
\startmode[ClassRoom]  \page[yes] Here are some questions: \blank
}
\unexpanded\def\StopQuestionsList{
\page[yes] \stopmode
}
\definestartstop[Questions][
before=\StartQuestionsList,
after=\StopQuestionsList
]


\startQuestions
Question A….
Question B….
\stopQuestions

Some other text...
% 

One of the oldest mechanism available ... blocks:

\enablemode[classroom] % comment this

\defineblock[Question]

\doifmode {classroom} {
\keepblocks[Question]
}

\starttext

Text A

\beginQuestion
Question A….
\endQuestion

Text B

\beginQuestion
Question B….
\endQuestion

\page

\doifnotmode {classroom} {
\useblocks[Question]
}

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] Bug in lmtx or wrong setup?

2020-06-09 Thread Jan U. Hasecke
Hi all,

I encountered a very strange problem.

I want to have section headlines expanding the whole textarea, but the
following copy text of the section shall be typeset in columns.

I have this setup and it works fine.

\setuphead
  [section]
  [
   insidesection=\startcolumns,
   aftersection=\stopcolumns,
  ]


Except for one big problem. ConTeXt (current lmtx from 2020.05.18 16:50)
sometimes has problems to make a page break. And I get the weird result
shown on the attached screenshot.

After the page break the text of the section does not continue. Instead
a number is shown. In the log file I can't find something suspicious.

When I compile the source with current context (2020.01.30 14:13) I get
something like an infinite loop. ConTeXt hangs and has to be killed with
kill pid, Ctrl-C in terminal does not work

So, in my opinion my layout or setup causes a bad situation, where
ConTeXt does not know where to make a page break. While context hangs
and warns me, lmtx runs smoothly but places a number in the text, which
is bad as I might overlook it.

I tried to make mwe but I cannot reproduce the error.

Any ideas to improve my setup? Is this a bug or the intended behaviour?

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