Re: [NTG-context] floats side by side

2020-08-08 Thread Henning Hraban Ramm


> Am 08.08.2020 um 18:32 schrieb Wolfgang Schuster 
> :
> 
> Henning Hraban Ramm schrieb am 08.08.2020 um 17:51:
>> Hello again,
>> I need to place several figures side by side (e.g. pictures of persons).
>> I know I can use combinations, but I need the figures with captions included 
>> in the usual numbering of figures and not one number & caption for the 
>> combination.
>> How can I achieve this?
> 
> Use a float combination:
> 
> \startplacefigure[location=none]
>\startfloatcombination[2*1]
>\startplacefigure[title={Left dummy}]
>\externalfigure[dummy]
>\stopplacefigure
>\startplacefigure[title={Right dummy}]
>\externalfigure[dummy]
>\stopplacefigure
>\stopfloatcombination
> \stopplacefigure

Thank you very much!

It works like it should.

I learn something new about ConTeXt every day.

Hraban
___
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] floats side by side

2020-08-08 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 08.08.2020 um 17:51:

Hello again,

I need to place several figures side by side (e.g. pictures of persons).
I know I can use combinations, but I need the figures with captions included in the 
usual numbering of figures and not one number & caption for the combination.
How can I achieve this?


Use a float combination:

\useMPlibrary[dum]

\starttext

\input ward

\startplacefigure[title={Dummy}]
\externalfigure[dummy]
\stopplacefigure

\input jojomayer

\startplacefigure[location=none]
\startfloatcombination[2*1]
\startplacefigure[title={Left dummy}]
\externalfigure[dummy]
\stopplacefigure
\startplacefigure[title={Right dummy}]
\externalfigure[dummy]
\stopplacefigure
\stopfloatcombination
\stopplacefigure

\input weisman

\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] floats side by side

2020-08-08 Thread Henning Hraban Ramm
Hello again,

I need to place several figures side by side (e.g. pictures of persons).
I know I can use combinations, but I need the figures with captions included in 
the usual numbering of figures and not one number & caption for the combination.
How can I achieve this?

Best, Hraban
___
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] context --luatex does not redirect to LuaTeX

2020-08-08 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 08.08.2020 um 17:17:

Hi again!

When context --luatex is used with current version: 2020.08.07 23:37 
LuaMetaTeX is still used. --engine=luatex has no effect, either. Is that 
a bug? Thanks


I have no problems using LuaTeX on Windows.

You can try a new installation and check again.

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] context --luatex does not redirect to LuaTeX

2020-08-08 Thread Jairo A. del Rio
Hi again!

When context --luatex is used with current version: 2020.08.07 23:37
LuaMetaTeX is still used. --engine=luatex has no effect, either. Is that a
bug? Thanks

Cordially,

Jairo :)
___
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] Using \applytosplitstringwordspaced and allies

2020-08-08 Thread Jairo A. del Rio
Thank you very much! Something else happens:

\applytosplitstringwordspaced\somemacro{Content and {\tt typewriter} more
content}

either ignores braced groups or ignores macros AND prints braces "{" and
"}" as if it were in verbatim mode depending on the content being on the
document or loaded via Lua, even when context.escape is used. How to keep
{\it braced content}? Thank you in advance.

Jairo :)

El sáb., 8 de ago. de 2020 a la(s) 08:34, Hans Hagen (j.ha...@xs4all.nl)
escribió:

> On 8/8/2020 12:00 PM, Wolfgang Schuster wrote:
> > Jairo A. del Rio schrieb am 08.08.2020 um 10:14:
> >> Hi, list! :D
> >> I've found \applytosplitstringwordspaced and many other commands
> >> reading on the mailing list and TeX StackExchange. An issue with those
> >> is: the following does not work:
> >>
> >> \applytosplitstringwordspaced\somemacro{\input knuth}
> >>
> >> It only works with explicit TeX "words". How to circumvent this
> >> inconvenience? Thanks in advance.
> >
> > You can't feed knuth.tex to the command because it contains multiple
> > paragraphs but even when your file contains only a single paragraph it
> > isn't perfect because the linebreak after the last line contains as
> > extra word (seen in the first paragraph below).
> >
> > To use \input as argument for \applytosplitstringwordspaced you need a
> > few \expandafter's to ensure the file is read before the argument is
> > passed to Lua. A easier method is to move everything to Lua where you
> > read the file and put it in a string, afterward you can use the CLD
> > mechanism to call \applytosplitstringwordspaced from Lua.
> >
> > \unexpanded\def\somemacro#1{[#1]}
> >
> > \starttext
> >
> >
> \expandafter\applytosplitstringwordspaced\expandafter\somemacro\expandafter{\input
>
> > weisman }
> >
> > \blank
> >
> > \startluacode
> >
> > -- local ward = io.loaddata(resolvers.findfile("ward.tex"))
> > local ward =
> string.fullstrip(io.loaddata(resolvers.findfile("ward.tex")))
> >
> > context.applytosplitstringwordspaced ( "\\somemacro", ward )
> >
> > \stopluacode
> >
> > \stoptext
> just a remark: knuth.tex is tricky becauss it also has \TeX and \ and
> such, so one needs to escape it, as in:
>
> context.applytosplitstringwordspaced (
>"\\somemacro",
>context.escape(ward)
> )
>
>
> -
>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
>
> ___
>
___
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] Defining \qed (was: Bug with \wordright...)

2020-08-08 Thread Otared Kavian
Hi Wolfgang,

Thanks for your explanations and the correct definition of the close symbol in 
an enumeration.
Following up the discussions with Hans, in order to put a close sympbol at the 
end of a formula, I have the following for the definition of \qed:

%% begin example-qed.tex
\showframe
\definesymbol[Fin][\mathematics{\square}]
\def\qed{%
\ifmmode
\inrightmargin{\hskip-7.5mm\symbol[Fin]} % --> attention here
\else
\dontleavehmode\wordright{\symbol[Fin]}
\fi}

\setupformulas[location=left]

\starttext

One sees that
\placeformula
\startformula
   a^2 + b^2 = c^2
\stopformula
which is the Pythagoras theorem. \qed

Another proof of Pythagors theorem is based on the figure below in which one 
sees that:
\placeformula
\startformula
(a+b)^2 = c^2 + 2ab \quad \imply \quad a^2 + b^2 = c^2. \qed
\stopformula

\stoptext
%% end example-qed.tex

Now how can I replace « \hskip-7.5mm » (which was found by trial and error…) in 
a robust manner so that the close symbols in the formulas are vertically 
aligned with the close symbols in the text?
In other terms can one compute automatically the amount of negative \hskip so 
that the definition is correct when one changes the font size and the layout?

Thanks in advance: Otared

> On 5 Aug 2020, at 21:15, Wolfgang Schuster 
>  wrote:
> […]
> 
> Below is a cleaner version to put a symbol at the end of each proof. The 
> \blank setting in the \PlaceProofSymbol definition moves the symbol back in 
> the math formula to avoid the vertical space between them, you can remove it 
> but I would at leas use \blank[back] to get rid of the empty line between the 
> formula and the symbol.
> 
> \define[1]\PlaceProofSymbol
>  {\blank[back,overlay]%
>   \dontleavehmode\wordright{#1}}
> 
> \defineenumeration
>  [proof]
>  [ closesymbol={\symbol[square]},
>   closecommand=\PlaceProofSymbol]
> 
> \starttext
> 
> \startproof
>  \startformula
>a^2 + b^2 = c^2
>  \stopformula
> \stopproof
> 
> \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
> ___

___
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] Using \applytosplitstringwordspaced and allies

2020-08-08 Thread Hans Hagen

On 8/8/2020 12:00 PM, Wolfgang Schuster wrote:

Jairo A. del Rio schrieb am 08.08.2020 um 10:14:

Hi, list! :D
I've found \applytosplitstringwordspaced and many other commands 
reading on the mailing list and TeX StackExchange. An issue with those 
is: the following does not work:


\applytosplitstringwordspaced\somemacro{\input knuth}

It only works with explicit TeX "words". How to circumvent this 
inconvenience? Thanks in advance.


You can't feed knuth.tex to the command because it contains multiple 
paragraphs but even when your file contains only a single paragraph it 
isn't perfect because the linebreak after the last line contains as 
extra word (seen in the first paragraph below).


To use \input as argument for \applytosplitstringwordspaced you need a 
few \expandafter's to ensure the file is read before the argument is 
passed to Lua. A easier method is to move everything to Lua where you 
read the file and put it in a string, afterward you can use the CLD 
mechanism to call \applytosplitstringwordspaced from Lua.


\unexpanded\def\somemacro#1{[#1]}

\starttext

\expandafter\applytosplitstringwordspaced\expandafter\somemacro\expandafter{\input 
weisman }


\blank

\startluacode

-- local ward = io.loaddata(resolvers.findfile("ward.tex"))
local ward = string.fullstrip(io.loaddata(resolvers.findfile("ward.tex")))

context.applytosplitstringwordspaced ( "\\somemacro", ward )

\stopluacode

\stoptext
just a remark: knuth.tex is tricky becauss it also has \TeX and \ and 
such, so one needs to escape it, as in:


context.applytosplitstringwordspaced (
  "\\somemacro",
  context.escape(ward)
)


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


Re: [NTG-context] About the numbering of theorems

2020-08-08 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you
Fabrice

Le ven. 7 août 2020 à 19:45, Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> a écrit :

> Fabrice Couvreur schrieb am 07.08.2020 um 16:30:
> > Hello,
> > I have a little problem with the numbering of theorems when there is no
> > subsection. I would like to know :
> >
> > Theorem 1.1
> > Theorem 1.2
> >
> > Theorem 2.3
> > Theorem 2.4
> >
> > Thank you
> > Fabrice
>
> Use a conversion set to set the number conversion for you sections and
> remove the conversion setting (\setuphead[...][conversion=...]) from the
> setups.
>
> \defineconversionset [fabrice] [n,n,R,n] [n]
>
> \setupheads
>[sectionconversionset=fabrice]
>
> 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
>
> ___
>
___
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] Wrong counting of lines and paragraphs

2020-08-08 Thread Wolfgang Schuster

Marcus Vinicius Mesquita schrieb am 07.08.2020 um 21:10:

Dear list,

In the MWE below you don't get lines and paragraphs numbered correctly:

[...]

Have I hit a bug?


No, this is a side effect from your sections which start the paragraphs.

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
___


Re: [NTG-context] Using \applytosplitstringwordspaced and allies

2020-08-08 Thread Wolfgang Schuster

Jairo A. del Rio schrieb am 08.08.2020 um 10:14:

Hi, list! :D
I've found \applytosplitstringwordspaced and many other commands reading 
on the mailing list and TeX StackExchange. An issue with those is: the 
following does not work:


\applytosplitstringwordspaced\somemacro{\input knuth}

It only works with explicit TeX "words". How to circumvent this 
inconvenience? Thanks in advance.


You can't feed knuth.tex to the command because it contains multiple 
paragraphs but even when your file contains only a single paragraph it 
isn't perfect because the linebreak after the last line contains as 
extra word (seen in the first paragraph below).


To use \input as argument for \applytosplitstringwordspaced you need a 
few \expandafter's to ensure the file is read before the argument is 
passed to Lua. A easier method is to move everything to Lua where you 
read the file and put it in a string, afterward you can use the CLD 
mechanism to call \applytosplitstringwordspaced from Lua.


\unexpanded\def\somemacro#1{[#1]}

\starttext

\expandafter\applytosplitstringwordspaced\expandafter\somemacro\expandafter{\input 
weisman }


\blank

\startluacode

-- local ward = io.loaddata(resolvers.findfile("ward.tex"))
local ward = string.fullstrip(io.loaddata(resolvers.findfile("ward.tex")))

context.applytosplitstringwordspaced ( "\\somemacro", ward )

\stopluacode

\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] Using \applytosplitstringwordspaced and allies

2020-08-08 Thread Jairo A. del Rio
Hi, list! :D
I've found \applytosplitstringwordspaced and many other commands reading on
the mailing list and TeX StackExchange. An issue with those is: the
following does not work:

\applytosplitstringwordspaced\somemacro{\input knuth}

It only works with explicit TeX "words". How to circumvent this
inconvenience? Thanks in advance.

Regards,

Jairo :)
___
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
___