Re: [NTG-context] external figure sizing

2015-05-09 Thread Hans Hagen

On 5/9/2015 10:26 PM, Csikos Bela wrote:

Hello list members:

I would like to make a photo montage (4x3 images on one page) using
\placefigure, \externalfigure and combinations. The images should be scaled to 
the
same size, eg to .25\textwith and .3\textheight so that the  aspect ratios of 
the images
are kept and the appropriate value is used for width or height. That is the 
smaller value
from .25\textwith and .3\textheight is used for the image size.

Using only \useexternalfigure[Fig1][1.jpg][width=.25\textwidth] may not give 
the correct
result if the image requires size adjustment by height and vice versa. Defining 
both
width and height results in exact resizing and the aspect ratio is not 
maintained.

How can this be solved?


\useMPlibrary[dum]

\showframe

\starttext

\setuplayout[middle]

\defineexternalfigure[quarter][factor=max]

\vbox{\dorecurse{4}{\hbox{\hsize.25\textwidth\vsize.25\textheight\dorecurse{4}{\externalfigure[dummy][quarter]

\page

\setuppapersize[A4,landscape] \setuplayout[middle]

\vbox{\dorecurse{4}{\hbox{\hsize.25\textwidth\vsize.25\textheight\dorecurse{4}{\externalfigure[dummy][quarter]

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Changing font for math function

2015-05-09 Thread Hans Hagen

On 5/9/2015 4:16 PM, Aditya Mahajan wrote:

On Sat, 9 May 2015, Aditya Mahajan wrote:


On Sat, 9 May 2015, Hans Hagen wrote:


i've added (uploading beta now)

\setupmathematics
  [functionstyle=\ss,
   functioncolor=red]

\starttext
\startformula
  f = \sin i\omega x^{\sin(x^{\sin(y)})}
\stopformula
\stoptext

best test this because Mojca will at some point push into tex live
(at which moment we have a current)


Thanks. This works correctly on a small test. I will test this more
thoroughly.


\sin etc should not behave like \text{...}. \text should adapt to the
surrounding style while \mathoptext should not. In particular, in the
following

   {\ss $\sin x$}
   {\bf $\sin x$}

\sin should be in normal text upright font and not adapted to the
surrounded
text.

Is it possible to set a value of functionstyle so that the surrounding
text font
styles are ignored (but the font size is not).


does

\setupmathematics
  [functionstyle=\normalrm,
   functioncolor=red]

work ok? (\rm is redefined in math mode so we need the outer one)

we could have some keywords for this if needed


I realize that this takes us back to the old 'bold-math-in-section-heads'
debate. With the current implementation:

 \setuphead[section][style=bold]
 \section{$\sin x$}

sin is bold, and if you implement the change that I am suggesting, then
\sin
will not be bold in section titles. If someone prefers \sin to be bolded in
section headers, he would have to add
\setupmathematics[functionstyle=\bf] in
the section style as well.


the next stage of the math font project will provide some real bold 
fonts (so bold alphabets get heavy variants)



Aditya
___

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
___



--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] external figure sizing

2015-05-09 Thread Csikos Bela
Hello list members:

I would like to make a photo montage (4x3 images on one page) using
\placefigure, \externalfigure and combinations. The images should be scaled to 
the
same size, eg to .25\textwith and .3\textheight so that the  aspect ratios of 
the images
are kept and the appropriate value is used for width or height. That is the 
smaller value
from .25\textwith and .3\textheight is used for the image size.

Using only \useexternalfigure[Fig1][1.jpg][width=.25\textwidth] may not give 
the correct
result if the image requires size adjustment by height and vice versa. Defining 
both
width and height results in exact resizing and the aspect ratio is not 
maintained.

How can this be solved?

Thanks,

bcsikos

___
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] external figure sizing

2015-05-09 Thread Peter Münster
On Sat, May 09 2015, Csikos Bela wrote:

 \placefigure, \externalfigure and combinations. The images should be scaled 
 to the
 same size, eg to .25\textwith and .3\textheight so that the  aspect ratios of 
 the images
 are kept and the appropriate value is used for width or height.

What is the appropriate value?


 That is the smaller value from .25\textwith and .3\textheight is used
 for the image size.

The smaller value from .25\textwith and .3\textheight does only depend
on the layout, but not on the image.


This is perhaps, what you need:  maxwidth=..., maxheight=...

-- 
   Peter
___
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] issue with \doifdefined

2015-05-09 Thread Wolfgang Schuster

 Am 09.05.2015 um 12:36 schrieb Pablo Rodriguez oi...@gmx.es:
 
 Dear list,
 
 I have the following sample:
 
\def\abcde{123}
\starttext
\doifdefinedelse{\abcd}{defined}{undefined}
\stoptext
 
 \doifdefined crashes when the command isn’t defined.
 
 Sorry, but isn’t this command supposed to check whether the command is
 defined or not?

You have to omit the backslash in the first argument of the command, e.g. 
\doifdefinedelse{abcd}{…}{…}

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

Re: [NTG-context] Changing font for math function

2015-05-09 Thread Hans Hagen

On 5/9/2015 2:03 AM, Aditya Mahajan wrote:

Hi,

There is a question on TeX.SX asking how to change the font of \sin,
\cos, etc.

http://tex.stackexchange.com/q/243893/323

I looked at the code, and there does not appear to be an easy solution.
The \mathfunctionlabeltext command has \mathupright hard coded.

One option is to keep this configurable using \setupmathematics, perhaps
mfunction=(normal|italic|sans).

In any case, I think that the current implementation is a bug. The
default font for mathfunctionlabeltext should be typeset in the bodyfont.


this is evil (as it's unpredictable, so no support for side effects):

% \prependtoks \rm \to \everymathematics

i've added (uploading beta now)

\setupmathematics
  [functionstyle=\ss,
   functioncolor=red]

\starttext
\startformula
  f = \sin i\omega x^{\sin(x^{\sin(y)})}
\stopformula
\stoptext

best test this because Mojca will at some point push into tex live (at 
which moment we have a current)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Changing font for math function

2015-05-09 Thread Wolfgang Schuster

 Am 09.05.2015 um 13:46 schrieb Hans Hagen pra...@wxs.nl:
 
 On 5/9/2015 2:03 AM, Aditya Mahajan wrote:
 Hi,
 
 There is a question on TeX.SX asking how to change the font of \sin,
 \cos, etc.
 
 http://tex.stackexchange.com/q/243893/323
 
 I looked at the code, and there does not appear to be an easy solution.
 The \mathfunctionlabeltext command has \mathupright hard coded.
 
 One option is to keep this configurable using \setupmathematics, perhaps
 mfunction=(normal|italic|sans).
 
 In any case, I think that the current implementation is a bug. The
 default font for mathfunctionlabeltext should be typeset in the bodyfont.
 
 this is evil (as it's unpredictable, so no support for side effects):
 
 % \prependtoks \rm \to \everymathematics

Is there no better way to use upright letters in math except the line above?

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

Re: [NTG-context] Changing font for math function

2015-05-09 Thread Hans Hagen

On 5/9/2015 2:03 AM, Aditya Mahajan wrote:

Hi,

There is a question on TeX.SX asking how to change the font of \sin,
\cos, etc.

http://tex.stackexchange.com/q/243893/323

I looked at the code, and there does not appear to be an easy solution.
The \mathfunctionlabeltext command has \mathupright hard coded.

One option is to keep this configurable using \setupmathematics, perhaps
mfunction=(normal|italic|sans).


oh, is that ever needed? italic sin?


In any case, I think that the current implementation is a bug. The
default font for mathfunctionlabeltext should be typeset in the bodyfont.


Are you sure? In many cases the math font is different from the bodyfont.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] issue with \doifdefined

2015-05-09 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\def\abcde{123}
\starttext
\doifdefinedelse{\abcd}{defined}{undefined}
\stoptext

\doifdefined crashes when the command isn’t defined.

Sorry, but isn’t this command supposed to check whether the command is
defined or not?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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] Changing font for math function

2015-05-09 Thread Wolfgang Schuster

 Am 09.05.2015 um 02:03 schrieb Aditya Mahajan adit...@umich.edu:
 
 Hi,
 
 There is a question on TeX.SX asking how to change the font of \sin, \cos, 
 etc.
 
 http://tex.stackexchange.com/q/243893/323
 
 I looked at the code, and there does not appear to be an easy solution. The 
 \mathfunctionlabeltext command has \mathupright hard coded.
 
 One option is to keep this configurable using \setupmathematics, perhaps 
 mfunction=(normal|italic|sans).
 
 In any case, I think that the current implementation is a bug. The default 
 font for mathfunctionlabeltext should be typeset in the body font.


MkII used the math font too for \sin etc. but you where able to change it with 
the “text” key from \definetypeface.

% engine=pdftex

\definetypeface [mathfunction] [rm] [serif] [modern]   [default]
\definetypeface [mathfunction] [ss] [sans]  [modern]   [default]
\definetypeface [mathfunction] [mm] [math]  [palatino] [default] [text=ss]

\setupbodyfont[mathfunction]

\starttext
$sin \sin$
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] issue with \doifdefined

2015-05-09 Thread Pablo Rodriguez
On 05/09/2015 12:59 PM, Wolfgang Schuster wrote:
 Am 09.05.2015 um 12:36 schrieb Pablo Rodriguez:
 [...]
 \doifdefined crashes when the command isn’t defined.

 Sorry, but isn’t this command supposed to check whether the command is
 defined or not?
 
 You have to omit the backslash in the first argument of the command,
 e.g. \doifdefinedelse{abcd}{…}{…}

Many thanks for your help, Wolfgang.

Everything is clear now.


Pablo
-- 
http://www.ousia.tk
___
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] Changing font for math function

2015-05-09 Thread Wolfgang Schuster

 Am 09.05.2015 um 15:00 schrieb Hans Hagen pra...@wxs.nl:
 
 On 5/9/2015 1:56 PM, Wolfgang Schuster wrote:
 
 Am 09.05.2015 um 13:46 schrieb Hans Hagen pra...@wxs.nl 
 mailto:pra...@wxs.nl
 mailto:pra...@wxs.nl mailto:pra...@wxs.nl:
 
 On 5/9/2015 2:03 AM, Aditya Mahajan wrote:
 Hi,
 
 There is a question on TeX.SX asking how to change the font of \sin,
 \cos, etc.
 
 http://tex.stackexchange.com/q/243893/323
 
 I looked at the code, and there does not appear to be an easy solution.
 The \mathfunctionlabeltext command has \mathupright hard coded.
 
 One option is to keep this configurable using \setupmathematics, perhaps
 mfunction=(normal|italic|sans).
 
 In any case, I think that the current implementation is a bug. The
 default font for mathfunctionlabeltext should be typeset in the bodyfont.
 
 this is evil (as it's unpredictable, so no support for side effects):
 
 % \prependtoks \rm \to \everymathematics
 
 Is there no better way to use upright letters in math except the line above?
 
 for functions one can now use:
 
 \setupmathematics
  [functionstyle=\rm]
 
 and for other changes the normal alphabet changing commands. For text one has 
 the text commands. Keep in mind that in the regular math stream we don't 
 think of fonts but of alphabets


The bold and italic symbols/letters aren’t a problem because the have their own 
unicode points but for the normal upright characters there should be proper key 
(like the lcgreek and ucgreek keys) which prevent ConTeXt to make them into 
italic characters. The \everymathematics hack works but isn’t very nice.

\setupmathematics[lcgreek=normal]

\setupbodyfont[cambria]

%\appendtoks \rm \to \everymathematics

\starttext

\m{α훂훼휶}

\m{D퐃퐷푫}

\m{{\rm D}퐃퐷푫}

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

Re: [NTG-context] Changing font for math function

2015-05-09 Thread Hans Hagen

On 5/9/2015 1:56 PM, Wolfgang Schuster wrote:



Am 09.05.2015 um 13:46 schrieb Hans Hagen pra...@wxs.nl
mailto:pra...@wxs.nl:

On 5/9/2015 2:03 AM, Aditya Mahajan wrote:

Hi,

There is a question on TeX.SX asking how to change the font of \sin,
\cos, etc.

http://tex.stackexchange.com/q/243893/323

I looked at the code, and there does not appear to be an easy solution.
The \mathfunctionlabeltext command has \mathupright hard coded.

One option is to keep this configurable using \setupmathematics, perhaps
mfunction=(normal|italic|sans).

In any case, I think that the current implementation is a bug. The
default font for mathfunctionlabeltext should be typeset in the bodyfont.


this is evil (as it's unpredictable, so no support for side effects):

% \prependtoks \rm \to \everymathematics


Is there no better way to use upright letters in math except the line above?


for functions one can now use:

\setupmathematics
  [functionstyle=\rm]

and for other changes the normal alphabet changing commands. For text 
one has the text commands. Keep in mind that in the regular math stream 
we don't think of fonts but of alphabets


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Changing font for math function

2015-05-09 Thread Aditya Mahajan

On Sat, 9 May 2015, Hans Hagen wrote:


i've added (uploading beta now)

\setupmathematics
  [functionstyle=\ss,
   functioncolor=red]

\starttext
\startformula
  f = \sin i\omega x^{\sin(x^{\sin(y)})}
\stopformula
\stoptext

best test this because Mojca will at some point push into tex live (at 
which moment we have a current)


Thanks. This works correctly on a small test. I will test this more 
thoroughly.


Aditya
___
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] Changing font for math function

2015-05-09 Thread Aditya Mahajan

On Sat, 9 May 2015, Aditya Mahajan wrote:


On Sat, 9 May 2015, Hans Hagen wrote:


i've added (uploading beta now)

\setupmathematics
  [functionstyle=\ss,
   functioncolor=red]

\starttext
\startformula
  f = \sin i\omega x^{\sin(x^{\sin(y)})}
\stopformula
\stoptext

best test this because Mojca will at some point push into tex live (at 
which moment we have a current)


Thanks. This works correctly on a small test. I will test this more 
thoroughly.


\sin etc should not behave like \text{...}. \text should adapt to the 
surrounding style while \mathoptext should not. In particular, in the 
following


  {\ss $\sin x$}
  {\bf $\sin x$}

\sin should be in normal text upright font and not adapted to the surrounded
text.

Is it possible to set a value of functionstyle so that the surrounding text font
styles are ignored (but the font size is not).

I realize that this takes us back to the old 'bold-math-in-section-heads'
debate. With the current implementation:

\setuphead[section][style=bold]
\section{$\sin x$}

sin is bold, and if you implement the change that I am suggesting, then \sin
will not be bold in section titles. If someone prefers \sin to be bolded in
section headers, he would have to add \setupmathematics[functionstyle=\bf] in
the section style as well.

Aditya
___
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 in xtables?

2015-05-09 Thread Pablo Rodriguez
Dear list,

the following sample shows a weird issue:

\starttext
\startbuffer[somextable]
\startxtable[option=stretch, align=center]
\startxrow
\startxcell[width=.2\textwidth] a \stopxcell
\startxcell b \stopxcell
\startxcell c \stopxcell
\startxcell[width=.2\textwidth] d \stopxcell
\stopxrow
\stopxtable
\stopbuffer

\startxtable[option=stretch, align=center]
\startxrow
\startxcell a \stopxcell
\startxcell b \stopxcell
\startxcell c \stopxcell
\startxcell d \stopxcell
\stopxrow
\stopxtable

This is the next paragraph.

\getbuffer[somextable]

This is the next paragraph.
\stoptext

If the width is specified for some xcells (but not all), extra blank
space will be added after the xtable when got from a buffer.

Isn’t it a bug?

BTW, shouldn’t the xcells with no width specified be wider than the ones
that have [width=.2\textwidth]?

(I may be missing something, because I think the width for the xcells
with no specified width should be .3\textwidth.)

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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] Newbie needs help getting started

2015-05-09 Thread Johan Råde

On 2015-05-08 19:23, Hans Hagen wrote:


if mtxrun.exe is in your path, then you can just run:

mtxrun --autogenerate --script context %*

and don't need to setup anything


If I add both LaTeX and ConTeXt to my path,
then there are conflicts between the two TeX installations.
The point of calling ConTeXt through a bat file that first calls 
setuptex is to avoid having to add ConTeXt to my path.


--Johan

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