Re: [NTG-context] Orphans and widows for specific paragraph groups

2016-06-17 Thread Aditya Mahajan

On Fri, 17 Jun 2016, Wolfgang Schuster wrote:


Pavneet Arora 
17. Juni 2016 um 14:22
I tried to use Aditya's suggestion (which was for Natural Tables) to
keep paragraphs on the same page:

\noindent{\blank[samepage]}

but I don't seem to have much success with the MWE I posted earlier.

Try as a might, I cannot seem to keep the paragraph head "{\ss\tfc
English (Grade 12)}" and the hairline together. I can, however, keep
the hairline and the following lorem text together, but I need all three
elements to float as a group: the paragraph header, hairline, and
paragraph body.

Would anyone have any suggestions on how to accomplish this?

You can put everything in a framedtext to keep it together.


Or, just put everything in a TABLE (that does not split, by default):

\setupbodyfont[9pt]
\setupindenting[yes,medium,next]
\setupwhitespace[small]

\startsetups subjects
  \setupTABLE[frame=off, align={normal,hyphenated}]
  \setupTABLE[column][1][width=0.3\textwidth]
  \setupTABLE[column][2][width=0.7\textwidth]
  \setupTABLE[row][1][style=\ssc, bottomframe=on, toffset={2\bigskipamount}]
\stopsetups

\starttext

\blank[8*big, force]

\dorecurse{10}
  {\startTABLE[setups=subjects]}]
 \NC ENG4U \NC English (Grade 12) \NC\NR
 \NC[nc=2] \input{lorem.tex}  \NC\NR
   \stopTABLE}

\stoptext

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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread Mojca Miklavec
On 17 June 2016 at 14:16, Pavneet Arora wrote:
> I am stuggling with getting ConTeXt to run from inside a php script
> under Apache.  First off, let me say that the installation works fine
> from the command line as a logged in user.
>
> Initially, I tried to do it inline:
>
>   cmd = ". /opt/context/tex/setuptex /opt/context/tex/setuptex; cd 
> $spool_dir; context $full_input_filename";
>   system($cmd);

Unrelated to the problem, but ...

Instead of sourcing setuptex you should just add
/opt/context/tex/texm-linux64 (or whawever folder that is) to the
environmental variable PATH.

The setuptex script doesn't do anything else and is just a convenience
script for users. In scripting you should better set PATH. You can
also manually set TEXMFCACHE if you want. Not that it matters much,
but I don't know why one would want the overhead of running an
additional script each time.

Mojca
___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread Henning Hraban Ramm

Am 2016-06-17 um 20:57 schrieb Pavneet Arora :

> $ chmod -R www-data:www-data context
> 
> So ConTeXt is installed in .../www/public/context.
> 
> Now I can source:
> 
>  $ . .../www/public/context/tex/setuptex .../www/public/context/tex
> 
> and it all works.

Please document this in the wiki (I had similar problems, should have done it 
at that time…)

E.g. "Webserver_Setup", linked from 
http://wiki.contextgarden.net/ConTeXt_Standalone#Unix-like_platforms_.28Linux.2FMacOS_X.2FFreeBSD.2FSolaris.29

I’ll add my setup behind a Django/Nginx installation.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)
GPG Key ID 1C9B22FD

___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread Pavneet Arora
Ah, we were thinking along the same lines! ;)

I had just initiated a local install inside .../www/public when I 
received your email, which is in fact the DocumentRoot for this website, 
and did:

$ chmod -R www-data:www-data context

So ConTeXt is installed in .../www/public/context.

Now I can source:

  $ . .../www/public/context/tex/setuptex .../www/public/context/tex

and it all works.

Many thanks, Luigi, for all of your suggestions.

On 17Jun16, luigi scarso wrote:
> (off list)
> 
> On Fri, Jun 17, 2016 at 3:39 PM, Pavneet Arora 
> wrote:
> 
> > That is really the crux of the issue, since www-data does *not* have a
> > login shell.  It is used only by apache.
> >
> > Can setuptex be made to point to the home directory explicitly where the
> > website is housed, e.g., '/home/wwwuser' with user 'wwwuser'?
> >
> 
> Is it an option to make a context installation only for apache ?
> I mean a context that is owned by www-data (if this is the apache user),
> into a folder readable by apache.
> 
> -- 
> luigi

-- 
Pavneet Arora   m: +1 (647) 406-6843
Waroc Informatikt: +1 (416) 937-9276
___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread Hans Hagen

On 6/17/2016 3:39 PM, Pavneet Arora wrote:

That is really the crux of the issue, since www-data does *not* have a
login shell.  It is used only by apache.

Can setuptex be made to point to the home directory explicitly where the
website is housed, e.g., '/home/wwwuser' with user 'wwwuser'?

On 17Jun16, luigi scarso wrote:

Is  texmf-cache writable by www-data ?
When logged as  www-data, the cache writable should  be the
/home/www-data/luatex-cache/<..> folder, while the standard one is used as
readonly folder

Just make a test: in www-data home
# . /opt/context/tex/setuptex /opt/context/tex
then make a simple "Hello world" test.tex and  read the log.


you can try

/pathtomtxrun/mtxrun --tree=/home/tex context 

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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] Orphans and widows for specific paragraph groups

2016-06-17 Thread Wolfgang Schuster

Pavneet Arora 
17. Juni 2016 um 14:22
I tried to use Aditya's suggestion (which was for Natural Tables) to
keep paragraphs on the same page:

\noindent{\blank[samepage]}

but I don't seem to have much success with the MWE I posted earlier.

Try as a might, I cannot seem to keep the paragraph head "{\ss\tfc
English (Grade 12)}" and the hairline together. I can, however, keep
the hairline and the following lorem text together, but I need all three
elements to float as a group: the paragraph header, hairline, and
paragraph body.

Would anyone have any suggestions on how to accomplish this?

You can put everything in a framedtext to keep it together.

\setupbodyfont[9pt]

\setupindenting[yes,medium,next]
\setupwhitespace[small]

\definetabulate[subjectpar][|f{\ssc}w(.3\textwidth)|f{\ssc}p|]
\setuptabulate 
[subjectpar][after={\blackrule[width=\textwidth,height=\linewidth]\noindentation}]


\defineframedtext
  [subjectblock]
  [frame=off,
   width=max,
   offset=0pt,
   before={\blank[2*big]}]

\starttext

\blank[8*big, force]

\dorecurse{10}
  {\startsubjectblock
 \startsubjectpar
 \NC ENG4U \NC English (Grade 12) \NC\NR
 \stopsubjectpar
 \input{lorem.tex}
   \stopsubjectblock}

\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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread Pavneet Arora
That is really the crux of the issue, since www-data does *not* have a 
login shell.  It is used only by apache.

Can setuptex be made to point to the home directory explicitly where the 
website is housed, e.g., '/home/wwwuser' with user 'wwwuser'?

On 17Jun16, luigi scarso wrote:
> Is  texmf-cache writable by www-data ?
> When logged as  www-data, the cache writable should  be the
> /home/www-data/luatex-cache/<..> folder, while the standard one is used as
> readonly folder
> 
> Just make a test: in www-data home
> # . /opt/context/tex/setuptex /opt/context/tex
> then make a simple "Hello world" test.tex and  read the log.
> 

-- 
Pavneet Arora   m: +1 (647) 406-6843
Waroc Informatikt: +1 (416) 937-9276
___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread luigi scarso
On Fri, Jun 17, 2016 at 2:42 PM, Pavneet Arora 
wrote:

> Unfortunately, while the mtxrun command works for a shell user:
>
>   $ mtxrun -script base --variables | grep cache
>   resolvers   | lists |   env: $SELFAUTOPARENT/texmf-cache
>   resolvers   | lists |   var: $SELFAUTOPARENT/texmf-cache
>   resolvers   | lists |   exp: /opt/context/tex/texmf-cache
>   resolvers   | lists |   res: /opt/context/tex/texmf-cache
>
> the result is the same for www-data:
>
>   $ sudo -u www-data bash -c ". /opt/context/tex/setuptex
> /opt/context/tex; mtxrun --script base --variables | grep cache"
>   resolvers   | caches | fatal error: there is no valid writable cache
> path defined
>
> I have to think that setuptex isn't able to set up the runtime
> environment for www-data, somehow?
>
>
Is  texmf-cache writable by www-data ?
When logged as  www-data, the cache writable should  be the
/home/www-data/luatex-cache/<..> folder, while the standard one is used as
readonly folder

Just make a test: in www-data home
# . /opt/context/tex/setuptex /opt/context/tex
then make a simple "Hello world" test.tex and  read the log.

-- 
luigi
___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread Pavneet Arora
Unfortunately, while the mtxrun command works for a shell user:

  $ mtxrun -script base --variables | grep cache
  resolvers   | lists |   env: $SELFAUTOPARENT/texmf-cache
  resolvers   | lists |   var: $SELFAUTOPARENT/texmf-cache
  resolvers   | lists |   exp: /opt/context/tex/texmf-cache
  resolvers   | lists |   res: /opt/context/tex/texmf-cache

the result is the same for www-data:

  $ sudo -u www-data bash -c ". /opt/context/tex/setuptex /opt/context/tex; 
mtxrun --script base --variables | grep cache"
  resolvers   | caches | fatal error: there is no valid writable cache path 
defined

I have to think that setuptex isn't able to set up the runtime 
environment for www-data, somehow?

On Fri, Jun 17, 2016 at 2:25 PM, Pavneet Arora 
wrote:

> That is what I suspect as well.  How do I find out which cache path is
> being used?
>
> Thanks.
>
>
$ mtxrun --script base --variables |grep cache


-- 
Pavneet Arora   m: +1 (647) 406-6843
Waroc Informatikt: +1 (416) 937-9276
___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread luigi scarso
On Fri, Jun 17, 2016 at 2:25 PM, Pavneet Arora 
wrote:

> That is what I suspect as well.  How do I find out which cache path is
> being used?
>
> Thanks.
>
>
$ mtxrun --script base --variables |grep cache



-- 
luigi
___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread Pavneet Arora
That is what I suspect as well.  How do I find out which cache path is 
being used?

Thanks.

On 17Jun16, luigi scarso wrote:
> On Fri, Jun 17, 2016 at 2:16 PM, Pavneet Arora 
> wrote:
...
> > > When I trap the output, I get the following error in the log file:
> >
> >   resolvers   | caches | fatal error: there is no valid writable cache
> > path defined
> >
> > I also attempted this manually at a bash prompt resulting in the same
> > error:
> >
> >   sudo -u www-data bash -c bin/proccontext.sh $FILENAME
> >
> > What would be the correct design pattern to invoke ConTeXt from a web
> > application?  This is all under Ubuntu 14.04, BTW.
> >
> > advTHANKSance
> >
> >
> permissions ?
> 
> -- 
> luigi

-- 
Pavneet Arora   m: +1 (647) 406-6843
Waroc Informatikt: +1 (416) 937-9276
___
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] Orphans and widows for specific paragraph groups

2016-06-17 Thread Pavneet Arora
I tried to use Aditya's suggestion (which was for Natural Tables) to 
keep paragraphs on the same page:

  \noindent{\blank[samepage]}

but I don't seem to have much success with the MWE I posted earlier.

Try as a might, I cannot seem to keep the paragraph head "{\ss\tfc 
English (Grade 12)}" and the hairline together.  I can, however, keep 
the hairline and the following lorem text together, but I need all three 
elements to float as a group:  the paragraph header, hairline, and 
paragraph body.

Would anyone have any suggestions on how to accomplish this?

Many thanks.

On 09Jun16, Pavneet Arora wrote:
...

 MWE

\definefontfamily[mainface][rm][Latin Modern Roman]
\definefontfamily[mainface][ss][Latin Modern Sans]
\definefontfamily[mainface][tt][Latin Modern Typewriter]
\definefontfamily[mainface][mm][Latin Modern Math]

\setupbodyfont[mainface,9pt]

% Set up default paragraph indenting and spacing.
\setupindenting[yes,
medium,
next]
\setupwhitespace[small]

% Set up paragraph environment for subject header.
\defineparagraphs 
[subjectpar][
n=2,
before={\blank[2*big]}]
\setupparagraphs
[subjectpar]
[1]
[width=.3\textwidth]

\starttext
\blank[8*big, force]
\dorecurse{10}{
\blank[2*big]
\noindentation
\startsubjectpar
{\ss\tfc ENG4U}
\subjectpar
%% Need to keep the following together as a unit.
{\ss\tfc English (Grade 12)}
\stopsubjectpar
\noindentation
\vskip-2em\hairline
\setupindenting[yes,
medium,
next]
\dorecurse{1}{
\input lorem.tex

}
}
\stoptext

 MWE

-- 
Pavneet Arora   m: +1 (647) 406-6843
Waroc Informatikt: +1 (416) 937-9276
___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread luigi scarso
On Fri, Jun 17, 2016 at 2:16 PM, Pavneet Arora 
wrote:

> I am stuggling with getting ConTeXt to run from inside a php script
> under Apache.  First off, let me say that the installation works fine
> from the command line as a logged in user.
>
> Initially, I tried to do it inline:
>
>   cmd = ". /opt/context/tex/setuptex /opt/context/tex/setuptex; cd
> $spool_dir; context $full_input_filename";
>   system($cmd);
>
> which returns exit status 2, "Incorrect usage".
>
> Then I created a small bash script with the following lines:
>
>   #!/usr/bin/env bash
>
>   . /opt/context/tex/setuptex /opt/context/tex
>   context $1
>
> When I trap the output, I get the following error in the log file:
>
>   resolvers   | caches | fatal error: there is no valid writable cache
> path defined
>
> I also attempted this manually at a bash prompt resulting in the same
> error:
>
>   sudo -u www-data bash -c bin/proccontext.sh $FILENAME
>
> What would be the correct design pattern to invoke ConTeXt from a web
> application?  This is all under Ubuntu 14.04, BTW.
>
> advTHANKSance
>
>
permissions ?

-- 
luigi
___
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] Invoking ConTeXt from inside php web appliction

2016-06-17 Thread Pavneet Arora
I am stuggling with getting ConTeXt to run from inside a php script 
under Apache.  First off, let me say that the installation works fine 
from the command line as a logged in user.

Initially, I tried to do it inline:

  cmd = ". /opt/context/tex/setuptex /opt/context/tex/setuptex; cd $spool_dir; 
context $full_input_filename";
  system($cmd);

which returns exit status 2, "Incorrect usage".

Then I created a small bash script with the following lines:

  #!/usr/bin/env bash

  . /opt/context/tex/setuptex /opt/context/tex
  context $1

When I trap the output, I get the following error in the log file:

  resolvers   | caches | fatal error: there is no valid writable cache path 
defined

I also attempted this manually at a bash prompt resulting in the same 
error:

  sudo -u www-data bash -c bin/proccontext.sh $FILENAME

What would be the correct design pattern to invoke ConTeXt from a web 
application?  This is all under Ubuntu 14.04, BTW.

advTHANKSance


-- 
Pavneet Arora   m: +1 (647) 406-6843
Waroc Informatikt: +1 (416) 937-9276
___
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] Latin setupmathematics

2016-06-17 Thread Hans Åberg

> On 17 Jun 2016, at 06:20, Alan BRASLAU  wrote:
> 
> On Fri, 17 Jun 2016 01:02:48 +0200
> Hans Åberg  wrote:
> 
>> The idea is avoiding clashes between variables and constants, like
>> this:
>> 
>> \starttext
>> 
>> \setupmathematics[default=normal]
>> 
>> $푒 = ∑_{푖=1}^∞ e^{i-푖}$
>> 
>> \setupmathematics[default=italic]
>> 
>> $푒 = ∑_{푖=1}^∞ e^{i-푖}$
> 
> Very, very poor mathematical style...
> 
> If you really want to use a variable "e", this would call for the use
> of the function \exp() to be readable.

Unicode has added characters to enable such writing. Also, \exp is already 
defined to “exp”, for example for the exponential map in differential geometry:
\startformula
  \exp_x: M_x → M
\stopformula

Here, the “:” expands in original TeX as a ratio operator, but Unicode has a 
special symbol for that, ∶ RATIO U+2236.


___
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] Flushleft formula

2016-06-17 Thread Hans Hagen

On 6/17/2016 12:18 AM, Aditya Mahajan wrote:

On Thu, 16 Jun 2016, Hans Hagen wrote:


On 6/16/2016 6:58 PM, Aditya Mahajan wrote:

 Hi,

 Something has changed with respect to the align=flushleft option for
 formulas. Earlier (tested with 2016.05.08), align=flushleft did not
 remove the leftskip, but now it does.


it doesn't but somehow it's not effective

(indeed spacing was updated, some more - future - possibilities and
bester handling in boxes and such)


And some stage, it will be nice to discuss the possiblility of adding
background to formulas, especially aligned formulas. Similar to some of
the examples in http://texdoc.net/texmf-dist/doc/latex/mathtools/empheq.pdf


actually, backgrounds were a reason for some changes but the code that 
does that is not yet integrated (still considering the interface)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | 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
___