Re: [NTG-context] Character spacing and url

2015-04-13 Thread Wolfgang Schuster

 Am 10.04.2015 um 15:31 schrieb Hans Hagen pra...@wxs.nl:
 
 On 4/10/2015 12:26 PM, Wolfgang Schuster wrote:
 Hi Hans,
 
 the character spacing mechanism should be disabled for certain commands 
 because it produces unwanted spaces
 when you want to typeset a URL.
 
 
 \setcharacterspacing[frenchpunctuation]
 
 \useurl[google][https://www.google.com]
 
 \starttext
 
 text: «text»
 
 \goto{\hyphenatedurl{https://www.google.com}}[url(https://www.google.com)]\vrule
 
 \goto{\resetcharacterspacing\hyphenatedurl{https://www.google.com}}[url(https://www.google.com)]\vrule
 
 \url[google]\vrule
 
 \resetcharacterspacing\url[google]\vrule
 
 \stoptext
 
 like this?
 
 \appendtoks
\resetfontfeature
\resetcharacterspacing
 \to \everyhyphenatedurl

Looks good.

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] \hyphenatedurl problem

2015-04-13 Thread Rik Kabel

On 2015-04-13 13:19, Pablo Rodriguez wrote:

On 04/11/2015 07:20 AM, Rik wrote:

With versions from 20150325 and earlier, the following example code
produced nicely wrapped URLs. With current betas, the URLs do not wrap.

Hi Rik,

with beta from 2015.04.12 15:41, urls are wrapped.

Just in case it helps,


Pablo




(Perhaps this is what Wolfgang meant when he wrote, in a reply in the
thread _Turning off French character spacing_:

 The \url and \hyphenatedurl need to be fixed

but I do not know that for sure.)

 \setupinteraction[state=start]
 \starttexdefinition href #1
   \goto{\hyphenatedurl{#1}}[url(#1)]
 \stoptexdefinition
 
\useURL[aUrl][https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable]
 
\useURL[bUrl][https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable][][\hyphenatedurl{https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable}]
 \starttext
 goto href macro:
 
\href{https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable}\par
 useURL without hyphenatedurl \from[aUrl]\par
 useURL with hyphenatedurl \from[bUrl]\par
 \stoptext

Yes, I saw that this morning before I headed out.

Thank you, Hans, for the fix.

--
Rik
___
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] ConTeXt-defined colours broken in TikZ in MkIV with latest betas

2015-04-13 Thread Christian Prim
Hi

I can confirm this bug. It worked fine for me a week before. It seems to be
a bug in one of the latest beta.

Thanks for fixing it
Christian

2015-04-13 19:45 GMT+02:00 Mojca Miklavec mojca.miklavec.li...@gmail.com:

 Hi,

 The following example works in MkII and it works in TeX Live 2014, but
 it fails with the latest beta (it draws a black rectangle instead of
 using the defined colour):

 \usemodule[tikz]
 \starttext
 \definecolor[mycol][r=0.9,g=0.8,b=0.8]
 \starttikzpicture
 \fill[mycol] (0, 0) rectangle (2,4);
 \stoptikzpicture
 \stoptext

 It would be really nice to fix this in time for TeX Live 2015.

 Thank you,
 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

 ___
___
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] epub-mkiv-demo.epub

2015-04-13 Thread Hans Hagen

On 4/13/2015 3:37 PM, Piotr Kopszak wrote:


ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(26,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.


we can probably catch that one


epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(38,120): MathML
should either have an alt text attribute or annotation-xml child
element.


but this is crap .. i see no tex user adding an alternate to each formula

in fact, the epub script has the option to turn the mathml into svg, 
this was added after google decided to kick out mathml (ok, we could 
push some svg into the annotation-xml i guess)


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] ConTeXt-defined colours broken in TikZ in MkIV with latest betas

2015-04-13 Thread Mojca Miklavec
Hi,

The following example works in MkII and it works in TeX Live 2014, but
it fails with the latest beta (it draws a black rectangle instead of
using the defined colour):

\usemodule[tikz]
\starttext
\definecolor[mycol][r=0.9,g=0.8,b=0.8]
\starttikzpicture
\fill[mycol] (0, 0) rectangle (2,4);
\stoptikzpicture
\stoptext

It would be really nice to fix this in time for TeX Live 2015.

Thank you,
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] How to exclude certain figures from list of figures in ConTeXt?

2015-04-13 Thread Wolfgang Schuster

 Am 12.04.2015 um 20:53 schrieb Geert Verhaag verhaagg...@ziggo.nl:
 
 Hi,
 
 I was wondering whether it is possible to exclude certain figures of a 
 document using the \placelistoffigures command in ConTeXt?
 
 For example those that start having a reference like ['fig:figure:exclude‘]?


You can create a new float environment which inherits all values (including the 
counter) from the figure environment.

\setupexternalfigures[location=default]

\definefloat[nofigure][nofigures][figure]

\starttext

\placelist[figure]

\blank[4*line]

\startplacefigure[title=A duth cow]
\externalfigure[cow][width=6cm]
\stopplacefigure

\startplacenofigure[title=A duth mill]
\externalfigure[mill][width=6cm]
\stopplacenofigure

\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] bug in \sethyphenatedurlafter, \sethyphenatedurlbefore and \sethyphenatedurlnormal?

2015-04-13 Thread Hans Hagen

On 4/13/2015 7:17 PM, Pablo Rodriguez wrote:

On 04/10/2015 09:32 AM, Hans Hagen wrote:

On 4/9/2015 9:23 PM, Pablo Rodriguez wrote:

Hans,

the minimal sample doesn’t compile with latest beta from 2015.04.08 21:31:

  \sethyphenatedurlafter{./-_}
  \define[1]\url{{\tt\goto{\hyphenatedurl{#1}}[url(#1)]}}
  \starttext
  \url{http://contextgarden.net}
  \stoptext

It compiles fine with beta from 2015.03.25 22:13.

I’m afraid this might be a bug.

Many thanks for your help,


fixed .. i also added a trivial extension you might like:


Many thanks for the fix and the extension, Hans.


[...]
so there is now a hyphenmin settings too (the functionality was there
already but not control over it).


Would it be possible to have hyphenmin in \setuplanguage?

I think it also makes sense there, besides lefthyphenmin and righthyphenmin.


It relates more to the alternative hyphenator and hyphenation methods 
which are imo document properties and not language specific. Actually 
the values *min in the language blob are there mostly because patterns 
can have these limitations.


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] how to insert symbols into document?

2015-04-13 Thread Wolfgang Schuster

 Am 13.04.2015 um 01:29 schrieb Csikos Bela bcsikos...@freemail.hu:
 
 Hello context users:
 
 I would like to insert symbols into my document, especially black-diamond and 
 losenge
 symbols. I read symbols page at contextgarden but still don't know how to do 
 it.
 
 I also tried \showsymbolset[was] etc but the symbols but I did not find these 
 (and many
 other symbols either) in the output pages.
 
 I found that symb-imp-mis.mkiv file defines this symbol (line 49) but I don't 
 know how to
 make it show. Do I have to load specific symbol fonts? If yes how can I find 
 out which font has the given symbols? 
 
 What I tried so far included:
 
 % begin code
 \usesymbols[imp-mis]
 \starttext
 
 ◆
 
 \blackdiamond
 
 \symbol [blackdiamond]
 % end code
 
 None of these show anything.

The symbols in the file symb-imp-mis.mkiv are loaded by default because context 
uses
them for the itemise environment but a few of them have to be enabled before 
you can
use them and even then you need a font which contains them, e.g. DejaVu.

 begin example
\setupbodyfont[dejavu]

\setupsymbolset[text]

\starttext

\starttabulate[|l|c|]
\NC \bf Name  \NC \bf Symbol  \NC\NR
\TB
\NC bullet\NC \symbol [bullet]\NC\NR
\NC dash  \NC \symbol [dash]  \NC\NR
\NC star  \NC \symbol [star]  \NC\NR
\NC triangle  \NC \symbol [triangle]  \NC\NR
\NC circle\NC \symbol [circle]\NC\NR
\NC square\NC \symbol [square]\NC\NR
\NC diamond   \NC \symbol [diamond]   \NC\NR
\TB
\NC blacktriangle \NC \symbol [blacktriangle] \NC\NR
\NC blacksquare   \NC \symbol [blacksquare]   \NC\NR
\NC blackdiamond  \NC \symbol [blackdiamond]  \NC\NR
\TB
\NC 1 \NC \symbol [1] \NC\NR
\NC 2 \NC \symbol [2] \NC\NR
\NC 3 \NC \symbol [3] \NC\NR
\NC 4 \NC \symbol [4] \NC\NR
\NC 5 \NC \symbol [5] \NC\NR
\NC 6 \NC \symbol [6] \NC\NR
\NC 7 \NC \symbol [7] \NC\NR
\NC 8 \NC \symbol [8] \NC\NR
\stoptabulate

\stoptext
 end example

When you need characters like the mentioned losenge you should better look for 
a font
which contains it and create a new typeface for it or set a fallback font which 
add the
characters to the main font of your document.

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] ConTeXt-defined colours broken in TikZ in MkIV with latest betas

2015-04-13 Thread Hans Hagen

On 4/13/2015 7:45 PM, Mojca Miklavec wrote:

Hi,

The following example works in MkII and it works in TeX Live 2014, but
it fails with the latest beta (it draws a black rectangle instead of
using the defined colour):

\usemodule[tikz]
\starttext
\definecolor[mycol][r=0.9,g=0.8,b=0.8]
\starttikzpicture
\fill[mycol] (0, 0) rectangle (2,4);
\stoptikzpicture
\stoptext

It would be really nice to fix this in time for TeX Live 2015.


Hm, i'm a bit puzzled why some suggested patched are nto in the 
distribution. Anyway, attached a more modern variant


you need a beta that i just uploaded because i found out that when tijz 
predefines some mixed colors it assumes rgb color space


your example then runs ok here

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
-
% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
%
% Adapted for colors and pdf resources by Hans Hagen. There can be a few more
% optimizations but they are not critital.

\pgfutil@format@is@contexttrue

% an aux files, needed for reading back coordinates

\def\pgfutil@aux@read@hook{%
  \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
  \csname newwrite\endcsname\pgfutil@auxout
  \csname openout\endcsname\pgfutil@auxout\jobname.pgf\relax
}

% no need for x colors (users can load it if needed)

\def\pgfutil@color#1{%
  \pgfutil@colorlet{.}{#1}%
  \pgfsysprotocol@getcurrentprotocol\pgfutil@emu@temp%
  {%
\pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
\pgfsysprotocol@bufferedtrue%
\pgfsetcolor{.}%

\expandafter\pgfsys@outerinvoke\expandafter{\pgfsysprotocol@currentprotocol}%
  }%
  \pgfsysprotocol@setcurrentprotocol\pgfutil@emu@temp%
  \aftergroup\pgfutil@reset@color%
}

\def\pgfutil@extractcolorspec#1#2{%
  \def#2{{#1}}%
}

\def\pgfutil@convertcolorspec#1#2#3{%
  
\edef#3{\expandafter\expandafter\expandafter\pgfutil@emu@select\csname\string\color@#1\endcsname}%
}

\def\pgfutil@doifcolorelse#1#2#3{%
  \expandafter\ifx\csname\string\color@#1\endcsname\relax%

\doifcolorelse{#1}{\let\pgf@next=\pgfutil@firstoftwo}{\let\pgf@next=\pgfutil@secondoftwo}%
  \else
\let\pgf@next=\pgfutil@firstoftwo%
  \fi%
  \pgf@next{#2}{#3}%
}

\def\pgfutil@reset@color{%
  \pgfsysprotocol@getcurrentprotocol\pgfutil@emu@temp%
  {%
\pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
\pgfsysprotocol@bufferedtrue%
\pgfsetcolor{.}%

\expandafter\pgfsys@outerinvoke\expandafter{\pgfsysprotocol@currentprotocol}%
  }%
  \pgfsysprotocol@setcurrentprotocol\pgfutil@emu@temp%
}

\expandafter\def\csname\string\color@.\endcsname{\xcolor@{}{}{rgb}{0,0,0}}

\def\pgfutil@colorlet#1#2{%
  \edef\pgf@marshal{#2}%
  \expandafter\pgfutil@in@\expandafter!\expandafter{\pgf@marshal}%
  \ifpgfutil@in@%
% compute mixture
{%
  \expandafter\pgfutil@emu@mix\pgf@marshal!white!\@nil%
  
\xdef\pgf@marshal{\noexpand\def\expandafter\noexpand\csname\string\color@#1\endcsname{%
  
\noexpand\xcolor@{}{}{rgb}{\pgf@sys@tonumber\pgf@xa,\pgf@sys@tonumber\pgf@xb,\pgf@sys@tonumber\pgf@xc}}}%
}%
\pgf@marshal%
  \else%
\expandafter\ifx\csname\string\color@#2\endcsname\relax%
  \pgfutil@registerrgb{#2}%
\fi%

\edef\pgf@marshal{\noexpand\let\expandafter\noexpand\csname\string\color@#1\endcsname=%
  \expandafter\noexpand\csname\string\color@#2\endcsname}%
\pgf@marshal%
  \fi%
}

\def\pgfutil@emu@mix#1!#2!#3!#4\@nil{%
  \expandafter\ifx\csname\string\color@#1\endcsname\relax%
\pgfutil@registerrgb{#1}%
  \fi%
  \expandafter\ifx\csname\string\color@#3\endcsname\relax%
\pgfutil@registerrgb{#3}%
  \fi%
  
\expandafter\expandafter\expandafter\pgfutil@emu@unpack\csname\string\color@#1\endcsname%
  \pgf@ya=\pgf@xa%
  \pgf@yb=\pgf@xb%
  \pgf@yc=\pgf@xc%
  
\expandafter\expandafter\expandafter\pgfutil@emu@unpack\csname\string\color@#3\endcsname%
  \c@pgf@counta=#2\relax%
  \c@pgf@countb=100\relax%
  \advance\c@pgf@countb by-\c@pgf@counta\relax%
  \pgf@xa=\c@pgf@countb\pgf@xa%
  \advance\pgf@xa by\c@pgf@counta\pgf@ya%
  \divide\pgf@xa by 100\relax%
  \pgf@xb=\c@pgf@countb\pgf@xb%
  \advance\pgf@xb by\c@pgf@counta\pgf@yb%
  \divide\pgf@xb by 100\relax%
  \pgf@xc=\c@pgf@countb\pgf@xc%
  \advance\pgf@xc by\c@pgf@counta\pgf@yc%
  \divide\pgf@xc by 100\relax%
}

\def\pgfutil@emu@unpack#1#2#3#4#5{%
  \pgfutil@emu@@unpack#5\@nil%
}

\def\pgfutil@emu@@unpack#1,#2,#3\@nil{%
  \pgf@xa=#1pt%
  \pgf@xb=#2pt%
  \pgf@xc=#3pt%
}

\def\pgfutil@emu@select#1#2#3#4#5{#5}

% goody


Re: [NTG-context] (hindi) font questions

2015-04-13 Thread Harald Koenig
On Apr 10, Wolfgang Schuster wrote:

 You forgot the “range” setting for the fallback font which tells context 
 which glyphs should be taken from the font.

opps sorry!  
I only removed the range after my first attempt didn't succeed...

now it's working fine, but only after copying the font to 
tex/texmf-local/fonts/truetype/
and running context --generate.  
thanks!!!


for my first naiive approach with \definefont it was ok/sufficient
to keep the TTF file in the local project's directory.

why is not true for your \definefallbackfamily solution ?


thanks again!!

Harald
-- 
I hope to die  ___   _
before I *have* to use Microsoft Word.,   0--,|/OOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen._/  /  /OOO\
\  \/OOO\
  \ O|//
   \/\/\/\/\/\/\/\/\/
Harald Koenig   //  / \\  \
koe...@tat.physik.uni-tuebingen.de ^   ^
___
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] bug in \sethyphenatedurlafter, \sethyphenatedurlbefore and \sethyphenatedurlnormal?

2015-04-13 Thread Pablo Rodriguez
On 04/13/2015 07:41 PM, Hans Hagen wrote:
 On 4/13/2015 7:17 PM, Pablo Rodriguez wrote:
 [...]
 Would it be possible to have hyphenmin in \setuplanguage?

 I think it also makes sense there, besides lefthyphenmin and righthyphenmin.
 
 It relates more to the alternative hyphenator and hyphenation methods 
 which are imo document properties and not language specific. Actually 
 the values *min in the language blob are there mostly because patterns 
 can have these limitations.

Many thanks for the explanation, Hans.

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] Writing between lines

2015-04-13 Thread Otared Kavian

 On 13 Apr 2015, at 18:30, Hans Hagen pra...@wxs.nl wrote:
 
 […]
 pushing stuff in between will probably mess up spacing etc etc so if you 
 follow that route just accept that your proof is not what you will eventually 
 get
 
 anyway, i added some ref tracing to the upcoming beta
 
 (1) \showreferences : just shows labels of references as well as destinations
 (2) \usemodule[references-show] : does the same but also shows a list per page
 
 both work ok with
 
 \enabletrackers[nodes.references,nodes.destinations]

Dear Hans,

Many thanks for your new solution! Indeed a built-in feature is much much 
better than a poor hack…
As soon as the upcoming beta is available, I'll experiment the new feature and 
then I’ll wikify about it.

Best regards: OK
___
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] bug in \sethyphenatedurlafter, \sethyphenatedurlbefore and \sethyphenatedurlnormal?

2015-04-13 Thread Pablo Rodriguez
On 04/10/2015 09:32 AM, Hans Hagen wrote:
 On 4/9/2015 9:23 PM, Pablo Rodriguez wrote:
 Hans,

 the minimal sample doesn’t compile with latest beta from 2015.04.08 21:31:

  \sethyphenatedurlafter{./-_}
  \define[1]\url{{\tt\goto{\hyphenatedurl{#1}}[url(#1)]}}
  \starttext
  \url{http://contextgarden.net}
  \stoptext

 It compiles fine with beta from 2015.03.25 22:13.

 I’m afraid this might be a bug.

 Many thanks for your help,
 
 fixed .. i also added a trivial extension you might like:

Many thanks for the fix and the extension, Hans.

 [...]
 so there is now a hyphenmin settings too (the functionality was there 
 already but not control over it).

Would it be possible to have hyphenmin in \setuplanguage?

I think it also makes sense there, besides lefthyphenmin and righthyphenmin.

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] \hyphenatedurl problem

2015-04-13 Thread Pablo Rodriguez
On 04/11/2015 07:20 AM, Rik wrote:
 With versions from 20150325 and earlier, the following example code
 produced nicely wrapped URLs. With current betas, the URLs do not wrap.

Hi Rik,

with beta from 2015.04.12 15:41, urls are wrapped.

Just in case it helps,


Pablo



 (Perhaps this is what Wolfgang meant when he wrote, in a reply in the
 thread _Turning off French character spacing_:
 
 The \url and \hyphenatedurl need to be fixed
 
 but I do not know that for sure.)
 
 \setupinteraction[state=start]
 \starttexdefinition href #1
   \goto{\hyphenatedurl{#1}}[url(#1)]
 \stoptexdefinition
 
 \useURL[aUrl][https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable]
 
 \useURL[bUrl][https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable][][\hyphenatedurl{https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable}]
 \starttext
 goto href macro:
 
 \href{https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable}\par
 useURL without hyphenatedurl \from[aUrl]\par
 useURL with hyphenatedurl \from[bUrl]\par
 \stoptext
 
 -- 
 Rik Kabel
 
 
 
 
 ___
 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
 ___
 


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

[NTG-context] How to exclude certain figures from list of figures in ConTeXt?

2015-04-13 Thread Geert Verhaag

Hi,

I was wondering whether it is possible to exclude certain figures of a 
document using the \placelistoffigures command in ConTeXt?


For example those that start having a reference like 
['fig:figure:exclude']?


Gerard

___
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] Writing between lines

2015-04-13 Thread Otared Kavian
Hi all,

How can one write in small print something between lines, in an efficient 
manner?
I have come up with the following:
\define[1]\betweenlines{${\rlap{{\mbox{\darkgray{\infofont 
#1}}}\atop{}}\atop{}}$}
in order to make visible certain informations just above a cited reference. But 
the use of \atop which a macro for mathmode, together with \mbos, doesn’t seem 
a wise idea. 

has any one a better idea how to obtain the same result?

A minimal example of its use follows
Best regards: OK

 begin write-between-lines.tex
\define[1]\betweenlines{${\rlap{{\mbox{\darkgray{\infofont 
#1}}}\atop{}}\atop{}}$}

\def\placeformularef[#1]{\doifmode{proofreading}%
{\inrightmargin{\infofont #1}}%
\placeformula[#1]}

\definereferenceformat[Eqref][left=(,right=)] 
\def\eqref[#1]{\betweenlines{#1}\Eqref[#1]}

\setupformulas[location=right]

\enablemode[proofreading]

\starttext
We have
\placeformularef[eq:Square]
\startformula
a^2 + 2ab + b^2 = (a + b)^2,
\stopformula
for $a,b\in {\Bbb C}$. Also,
\placeformularef[eq:Identity]
\startformula
\alpha^2 -2\alpha\beta + \beta^2 \NC = (\alpha - \beta)^2. 
\stopformula  
Note that \eqref[eq:Square] is true whenever we have $ab = ba$ for $b,a \in 
{\Bbb A}$. This is not the case when ${\Bbb A}$ is the ring of the matrices.
It is clear that \eqref[eq:Identity] is a consequence of \eqref[eq:Square].

\stoptext
 begin write-between-lines.tex
___
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] how to insert symbols into document?

2015-04-13 Thread Csikos Bela
Otared Kavian  írta:

 On 13 Apr 2015, at 01:29, Csikos Bela  wrote:
 
 Hello context users:
 
 I would like to insert symbols into my document, especially black-diamond 
 and losenge
 symbols. I read symbols page at contextgarden but still don't know how to do 
 it.
 
 I also tried \showsymbolset[was] etc but the symbols but I did not find 
 these (and many
 other symbols either) in the output pages.
 
 I found that symb-imp-mis.mkiv file defines this symbol (line 49) but I 
 don't know how to
 make it show. Do I have to load specific symbol fonts? If yes how can I find 
 out which font has the given symbols? 
 
 What I tried so far included:
 
 % begin code
 \usesymbols[imp-mis]
 \starttext
 
 ◆
 
 \blackdiamond
 
 \symbol [blackdiamond]
 % end code
 
 None of these show anything.

Hi,

You can use the mathmode to access those characters, as in the following 
example:

\starttext
This is \type{$\blacklozenge$} $\blacklozenge$

This is \type{$\lozenge$} $\lozenge$
\stoptext

Hi,

The above example works.
But if I try it with \blackdiamond, I get error and context stops:

This is the tex file:

% begin code
\starttext
This is \type{$\blackdiamond$} $\blackdiamond$

This is \type{$\diamond$} $\diamond$
\stoptext
% end code

And the compilation:

 context symbols.tex

mtx-context | run 1: luatex 
--fmt=/usr/local/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en
 --jobname=symbols 
--lua=/usr/local/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui
 --no-parse-first-line --c:currentrun=1 --c:fulljobname=./symbols.tex 
--c:input=./symbols.tex --c:kindofrun=1 --c:maxnofruns=8 cont-yes.mkiv
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/dev) (rev 5195)
 \write18 enabled.
(/usr/local/context/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2014.01.03 00:40 MKIV current  fmt: 2015.3.31  int: 
english/english

system   'cont-new.mkiv' loaded
(/usr/local/context/tex/texmf-context/tex/context/base/cont-new.mkiv)
system   files  jobname 'symbols', input './symbols', result 'symbols'
fontslatin modern fonts are not preloaded
languageslanguage 'en' is active
(/symbols.tex{/usr/local/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fontspreloading latin modern fonts (second stage)
fontstypescripts  unknown library 'loc'
{/usr/local/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/usr/local/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts'fallback modern rm 12pt' is loaded
fontstreatment  fixing some wrong widths
! Undefined control sequence

system   tex  error on line 4 in file .../symbols.tex: Undefined 
control sequence ...

1
2
3 \starttext
4   This is \type{$\blackdiamond$} $\blackdiamond$
5
6 This is \type{$\diamond$} $\diamond$
7 \stoptext
8
9


?
backend  xmp  using file 
'/usr/local/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pagesflushing realpage 1, userpage 1
))/usr/local/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf/usr/local/context/tex/texmf/fonts/opentype/public/lm/lmmono12-regular.otf/usr/local/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf

mkiv lua stats   used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats   used cache path: readable: 
'/usr/local/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e'
 | readable+writable: 
'/tmp/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e'
mkiv lua stats   resource resolver: loadtime 0.019 seconds, 1 scans with 
scantime 0.002 seconds, 5 shared scans, 14 found files, scanned paths: 
/texmf
mkiv lua stats   stored bytecode data: 338 modules (0.450 sec), 69 tables 
(0.010 sec), 407 chunks (0.460 sec)
mkiv lua stats   cleaned up reserved nodes: 42 nodes, 9 lists of 442
mkiv lua stats   node memory usage: 2 glue, 2 penalty, 9 attribute, 28 
glue_spec, 3 attribute_list
mkiv lua stats   node list callback tasks: 6 unique task lists, 6 instances 
(re)created, 45 calls
mkiv lua stats   used backend: pdf (backend for directly generating pdf output)
mkiv lua stats   loaded patterns: en::2, load time: 0.000
mkiv lua stats   jobdata time: 0.000 seconds saving, 0.000 seconds loading
mkiv lua stats   callbacks: 145 direct, 174 indirect, 319 total
mkiv lua stats   result saved in file: symbols.pdf, compresslevel 3, 
objectcompreslevel 3
mkiv lua stats   loaded fonts: 3 files: latinmodern-math.otf, 
lmmono12-regular.otf, lmroman12-regular.otf
mkiv lua stats   fonts load time: 0.653 seconds for 5 fonts, 2 shared in 
backend, 2 common vectors, 0 common hashes
mkiv lua stats   used platform: linux-64, type: unix, binary subtree: 
texmf-linux-64
mkiv lua stats   luatex banner: this is luatex, version beta-0.80.0 (tex live 
2015/dev) (rev 5195)
mkiv lua stats   control sequences: 38352 of 65536 

Re: [NTG-context] how to insert symbols into document?

2015-04-13 Thread Otared Kavian
Hi,

There is no \blackdiamond defined beforehand, but there is \diamondsuit (as 
well as \heartsuit, \spadesuit, \clubsuit):

If you want a filled black diamond, you may use \blacklozenge, or find its 
corresponding UTF code and then insert it with a special command:

 begin diamond.tex
\define\blackdiamond{\utfchar{2666}}
\starttext
This is \type{$\diamondsuit$} $\diamondsuit$

This is \type{$\diamond$} $\diamond$

This is \type{$\blackdiamond$} $\blackdiamond$
\stoptext
 end diamond.tex

Best regards: OK

 On 13 Apr 2015, at 13:14, Csikos Bela bcsikos...@freemail.hu wrote:
 
 Otared Kavian  írta:
 
 On 13 Apr 2015, at 01:29, Csikos Bela  wrote:
 
 Hello context users:
 
 I would like to insert symbols into my document, especially black-diamond 
 and losenge
 symbols. I read symbols page at contextgarden but still don't know how to 
 do it.
 
 I also tried \showsymbolset[was] etc but the symbols but I did not find 
 these (and many
 other symbols either) in the output pages.
 
 I found that symb-imp-mis.mkiv file defines this symbol (line 49) but I 
 don't know how to
 make it show. Do I have to load specific symbol fonts? If yes how can I 
 find out which font has the given symbols? 
 
 What I tried so far included:
 
 % begin code
 \usesymbols[imp-mis]
 \starttext
 
 ◆
 
 \blackdiamond
 
 \symbol [blackdiamond]
 % end code
 
 None of these show anything.
 
 Hi,
 
 You can use the mathmode to access those characters, as in the following 
 example:
 
 \starttext
 This is \type{$\blacklozenge$} $\blacklozenge$
 
 This is \type{$\lozenge$} $\lozenge$
 \stoptext
 
 Hi,
 
 The above example works.
 But if I try it with \blackdiamond, I get error and context stops:
 
 This is the tex file:
 
 % begin code
 \starttext
 This is \type{$\blackdiamond$} $\blackdiamond$
 
 This is \type{$\diamond$} $\diamond$
 \stoptext
 % end code
 
 And the compilation:
 
 context symbols.tex
 
 mtx-context | run 1: luatex 
 --fmt=/usr/local/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en
  --jobname=symbols 
 --lua=/usr/local/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui
  --no-parse-first-line --c:currentrun=1 --c:fulljobname=./symbols.tex 
 --c:input=./symbols.tex --c:kindofrun=1 --c:maxnofruns=8 cont-yes.mkiv
 This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/dev) (rev 5195)
 \write18 enabled.
 (/usr/local/context/tex/texmf-context/tex/context/base/cont-yes.mkiv
 
 ConTeXt  ver: 2014.01.03 00:40 MKIV current  fmt: 2015.3.31  int: 
 english/english
 
 system   'cont-new.mkiv' loaded
 (/usr/local/context/tex/texmf-context/tex/context/base/cont-new.mkiv)
 system   files  jobname 'symbols', input './symbols', result 
 'symbols'
 fontslatin modern fonts are not preloaded
 languageslanguage 'en' is active
 (/symbols.tex{/usr/local/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
 fontspreloading latin modern fonts (second stage)
 fontstypescripts  unknown library 'loc'
 {/usr/local/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/usr/local/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
 fonts'fallback modern rm 12pt' is loaded
 fontstreatment  fixing some wrong widths
 ! Undefined control sequence
 
 system   tex  error on line 4 in file .../symbols.tex: 
 Undefined control sequence ...
 
 1
 2
 3 \starttext
 4   This is \type{$\blackdiamond$} $\blackdiamond$
 5
 6 This is \type{$\diamond$} $\diamond$
 7 \stoptext
 8
 9
 
 
 ?
 backend  xmp  using file 
 '/usr/local/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
 pagesflushing realpage 1, userpage 1
 ))/usr/local/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf/usr/local/context/tex/texmf/fonts/opentype/public/lm/lmmono12-regular.otf/usr/local/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf
 
 mkiv lua stats   used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
 mkiv lua stats   used cache path: readable: 
 '/usr/local/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e'
  | readable+writable: 
 '/tmp/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e'
 mkiv lua stats   resource resolver: loadtime 0.019 seconds, 1 scans with 
 scantime 0.002 seconds, 5 shared scans, 14 found files, scanned paths: 
 /texmf
 mkiv lua stats   stored bytecode data: 338 modules (0.450 sec), 69 tables 
 (0.010 sec), 407 chunks (0.460 sec)
 mkiv lua stats   cleaned up reserved nodes: 42 nodes, 9 lists of 442
 mkiv lua stats   node memory usage: 2 glue, 2 penalty, 9 attribute, 28 
 glue_spec, 3 attribute_list
 mkiv lua stats   node list callback tasks: 6 unique task lists, 6 instances 
 (re)created, 45 calls
 mkiv lua stats   used backend: pdf (backend for directly generating pdf 
 output)
 mkiv lua stats   loaded patterns: en::2, load time: 0.000
 

[NTG-context] Evaluating a Lua expression at the end

2015-04-13 Thread Kumar Appaiah
Hi.

I am trying to set up a system where I can use Lua to find a total
that I can display at the end. For example, if I set a question paper,
after each question, I do a \directlua{total = total + 4}, assuming
this question has 4 points. At the top of my document, I now want to
say Total points: and display the value of total.

Now, naturally, using \directlua gives me 0, since total is 0 at the
beginning. But \latelua didn't seem to be what I am looking for. Could
someone please guide me in the right direction?

Thanks.

Kumar
___
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] Evaluating a Lua expression at the end

2015-04-13 Thread Norbert Melzer
Sorry, wrong recipient...
Am 13.04.2015 14:05 schrieb Norbert Melzer timmel...@gmail.com:

 If it is possible I'd like to wait for the idris book and get that one. If
 that's not possible I'm interested in http://www.manning.com/blackheath/
 Am 13.04.2015 13:54 schrieb Kumar Appaiah a.ku...@alumni.iitm.ac.in:

 Hi.

 I am trying to set up a system where I can use Lua to find a total
 that I can display at the end. For example, if I set a question paper,
 after each question, I do a \directlua{total = total + 4}, assuming
 this question has 4 points. At the top of my document, I now want to
 say Total points: and display the value of total.

 Now, naturally, using \directlua gives me 0, since total is 0 at the
 beginning. But \latelua didn't seem to be what I am looking for. Could
 someone please guide me in the right direction?

 Thanks.

 Kumar

 ___
 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

 ___


___
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] Evaluating a Lua expression at the end

2015-04-13 Thread Norbert Melzer
If it is possible I'd like to wait for the idris book and get that one. If
that's not possible I'm interested in http://www.manning.com/blackheath/
Am 13.04.2015 13:54 schrieb Kumar Appaiah a.ku...@alumni.iitm.ac.in:

 Hi.

 I am trying to set up a system where I can use Lua to find a total
 that I can display at the end. For example, if I set a question paper,
 after each question, I do a \directlua{total = total + 4}, assuming
 this question has 4 points. At the top of my document, I now want to
 say Total points: and display the value of total.

 Now, naturally, using \directlua gives me 0, since total is 0 at the
 beginning. But \latelua didn't seem to be what I am looking for. Could
 someone please guide me in the right direction?

 Thanks.

 Kumar

 ___
 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

 ___
___
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] Evaluating a Lua expression at the end

2015-04-13 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

another single-pass approach, which uses the fact that you know the questions and their 
point weights in advance is to form questions into a Lua table and evaluate 
the total first:


local C = context

local tab =
{ {Question 1, 10, },
  {Question 2, 20, },
  {Question 3, 30, },
}

local n = 0

for _, v in ipairs(tab) do local q, n1 = unpack(v); n = n + n1 end

-- Or: for _, v in ipairs(tab) do n = n + v[2] end

local f = function(it)
  local q, n1 = unpack(it)

  n = n + n1

  C(q .. :  .. n)
  C.par()
end

C.starttext()
  C(Total score:  .. n)
  C.par()

  n = 0 -- Reset

  f(tab[1])
  f(tab[2])
  f(tab[3])

  -- Or: for _, v in ipairs(tab) do f(v) end
C.stoptext()


Best regards,

Lukas



Thanks for the response. I am looking at something like this:

==
\starttext
\directlua{total = 0}
\title{Homework 1}

Total score: \directlua{tex.print(total);}

Question 1 (3 points)
\directlua{total = total + 3}

Question 2 (4 points)
\directlua{total = total + 4}

Question 3 (5 points)
\directlua{total = total + 5}

\stoptext
==

I expect the “Total score” to be followed by “12”, but I don't know
how to get that (or whether that is even possible).

Thanks.

Kumar



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

Count2.cld
Description: Binary data


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

Re: [NTG-context] Evaluating a Lua expression at the end

2015-04-13 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello Kumar,

could you provide a (non-working) minimal example?

I tried this:


local C = context

local n = 0

C.starttext()

  C(A)
  n = n + 1
  C(B)
  n = n + 1
  C(C)
  n = n + 1

print(***, n)

C.stoptext()

print(, n)


and I got 3 (twice) - what I expected:


...
ConTeXt  ver: 2015.04.08 21:31 MKIV beta  fmt: 2015.4.9  int: english/english
...
\\Count.cld', result 'Count'
...
sandbox  call  processing as cld: 
d://Lukas/Jobs/Podebrady-Sachta.RDS/Deska.SO/Statics/t/Count.cld
*** 3

3

...


... And similar result for Count.mkiv.

On Mon, 13 Apr 2015 13:53:28 +0200, Kumar Appaiah a.ku...@alumni.iitm.ac.in 
wrote:


Hi.

I am trying to set up a system where I can use Lua to find a total
that I can display at the end. For example, if I set a question paper,
after each question, I do a \directlua{total = total + 4}, assuming
this question has 4 points. At the top of my document, I now want to
say Total points: and display the value of total.

Now, naturally, using \directlua gives me 0, since total is 0 at the
beginning. But \latelua didn't seem to be what I am looking for. Could


Where could I learn more about \latelua (I'm hearing first time now about that 
command)...

Best regards,

Lukas



someone please guide me in the right direction?

Thanks.

Kumar



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

Count.cld
Description: Binary data


Count.pdf
Description: Adobe PDF document


Count.mkiv
Description: Binary data
___
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] Evaluating a Lua expression at the end

2015-04-13 Thread Kumar Appaiah
On Mon, Apr 13, 2015 at 03:32:04PM +0200, Hans Hagen wrote:
 On 4/13/2015 1:53 PM, Kumar Appaiah wrote:
 Hi.
 
 I am trying to set up a system where I can use Lua to find a total
 that I can display at the end. For example, if I set a question paper,
 after each question, I do a \directlua{total = total + 4}, assuming
 this question has 4 points. At the top of my document, I now want to
 say Total points: and display the value of total.
 
 Now, naturally, using \directlua gives me 0, since total is 0 at the
 beginning. But \latelua didn't seem to be what I am looking for. Could
 someone please guide me in the right direction?
 
 forget about latelua ... by the time that kicks in typesetting is done
 already .. you need to go multipass:
 
 \starttext
 
 \startluacode
 local name = nil
 local temp = 0
 
 function document.startwhatever(s)
 name = s
 temp = 0
 end
 function document.addwhatever(n)
 temp = temp + n
 context(n)
 end
 function document.stopwhatever()
 job.variables.save(document:temp:..name,temp)
 end
 function document.getwhatever(s)
 context(job.variables.collected[document:temp:..s])
 end
 \stopluacode
 
 \def\startwhatever[#1]{\ctxlua{document.startwhatever(#1)}}
 \def\stopwhatever {\ctxlua{document.stopwhatever()}}
 \def\addwhatever#1{\ctxlua{document.addwhatever(#1)}}
 \def\getwhatever#1{\ctxlua{document.getwhatever(#1)}}
 
 total: \getwhatever{foo}
 
 \startwhatever[foo]
 
 test 1: \addwhatever{10}\par
 test 2: \addwhatever{20}\par
 test 3: \addwhatever{30}\par
 
 \stopwhatever
 
 \stoptext

Thanks Hans. This is what I needed!

Kumar
-- 
Kumar Appaiah
___
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] Evaluating a Lua expression at the end

2015-04-13 Thread Kumar Appaiah
Dear Lukáš,

On Mon, Apr 13, 2015 at 02:26:38PM +0200, Procházka Lukáš Ing. - Pontex s. r. 
o. wrote:
 Hello Kumar,
 
 could you provide a (non-working) minimal example?
 
 I tried this:
 
 
 local C = context
 
 local n = 0
 
 C.starttext()
 
   C(A)
   n = n + 1
   C(B)
   n = n + 1
   C(C)
   n = n + 1
 
 print(***, n)
 
 C.stoptext()
 
 print(, n)
 
 
 and I got 3 (twice) - what I expected:

Thanks for the response. I am looking at something like this:

==
\starttext
\directlua{total = 0}
\title{Homework 1}

Total score: \directlua{tex.print(total);}

Question 1 (3 points)
\directlua{total = total + 3}

Question 2 (4 points)
\directlua{total = total + 4}

Question 3 (5 points)
\directlua{total = total + 5}

\stoptext
==

I expect the “Total score” to be followed by “12”, but I don't know
how to get that (or whether that is even possible).

Thanks.

Kumar
-- 
Kumar Appaiah
___
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] Evaluating a Lua expression at the end

2015-04-13 Thread Hans Hagen

On 4/13/2015 1:53 PM, Kumar Appaiah wrote:

Hi.

I am trying to set up a system where I can use Lua to find a total
that I can display at the end. For example, if I set a question paper,
after each question, I do a \directlua{total = total + 4}, assuming
this question has 4 points. At the top of my document, I now want to
say Total points: and display the value of total.

Now, naturally, using \directlua gives me 0, since total is 0 at the
beginning. But \latelua didn't seem to be what I am looking for. Could
someone please guide me in the right direction?


forget about latelua ... by the time that kicks in typesetting is done 
already .. you need to go multipass:


\starttext

\startluacode
local name = nil
local temp = 0

function document.startwhatever(s)
name = s
temp = 0
end
function document.addwhatever(n)
temp = temp + n
context(n)
end
function document.stopwhatever()
job.variables.save(document:temp:..name,temp)
end
function document.getwhatever(s)
context(job.variables.collected[document:temp:..s])
end
\stopluacode

\def\startwhatever[#1]{\ctxlua{document.startwhatever(#1)}}
\def\stopwhatever {\ctxlua{document.stopwhatever()}}
\def\addwhatever#1{\ctxlua{document.addwhatever(#1)}}
\def\getwhatever#1{\ctxlua{document.getwhatever(#1)}}

total: \getwhatever{foo}

\startwhatever[foo]

test 1: \addwhatever{10}\par
test 2: \addwhatever{20}\par
test 3: \addwhatever{30}\par

\stopwhatever

\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] epub-mkiv-demo.epub

2015-04-13 Thread Piotr Kopszak
Thanks Hans!

That did the trick, just a README mentioning mudraw as dependency in
the source directory would do, however the file which is generated
contains errors, at least according to epubcheck and kindlegen, which
prevents conversion of resulting epub file to mobi format, what I
would ultimately like to do.

epubcheck output

Validating against EPUB version 3.0 - custom validation
Validating using EPUB version 3.0 rules.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(26,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(27,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(27,79):
Error while parsing file 'duplicate resource: OEBPS/images/cow.svg'.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(38,120): MathML
should either have an alt text attribute or annotation-xml child
element.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(42,120): MathML
should either have an alt text attribute or annotation-xml child
element.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(54,198): MathML
should either have an alt text attribute or annotation-xml child
element.

Check finished with errors

epubcheck completed
---

kindlegen output
--
*
 Amazon kindlegen(Windows) V2.9 build 1029-0897292
 A command line e-book compiler
 Copyright Amazon.com and its Affiliates 2014
*

Info:I9026:option: (hidden) amazon creator tool or pipeline

Info:I9014:option: -verbose: Verbose output

Info(prcgen):I1048: Unpacking ePub file

Error(xmlmake):E27012: Item or process id already used: cow-svg
-

Any chance these might be fixed?

Best

Piotr


2015-04-11 12:52 GMT+02:00 Hans Hagen pra...@wxs.nl:
 On 4/11/2015 9:12 AM, Piotr Kopszak wrote:

 Hello list,

 I am trying to compile example epub file epub-mkiv-demo.tex which is
 provided with the recent beta, however I'm getting following errors
 when I run:mtxrun --script epub --make epub-mkiv-demo

 resolvers   | trees | analyzing 'home:texmf'
 mtx-epub| using specification file
 'epub-mkiv-demo-export/epub-mkiv-demo-pub.lua'
 mtx-epub| the 'mudraw' binary is not present


 install mudraw

 mtx-epub| cover page image 'cover.xhtml' is not present
 mtx-epub| saving dummy coverpage to

 'epub-mkiv-demo-export/cover.xhtml'...42015/tex/texmf-context/scripts/context/lua/mtx-epub.lua:606:
 bad argument #1 to 'gsub' (string expected, got nil)

 No epub file is generated.

 Any help would be greatly appreciated


 i'll add a check

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



-- 
http://okle.pl


epub-mkiv-demo.epub
Description: application/epub
___
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] epub-mkiv-demo.epub

2015-04-13 Thread Hans Hagen

On 4/13/2015 3:37 PM, Piotr Kopszak wrote:

Thanks Hans!

That did the trick, just a README mentioning mudraw as dependency in
the source directory would do, however the file which is generated
contains errors, at least according to epubcheck and kindlegen, which
prevents conversion of resulting epub file to mobi format, what I
would ultimately like to do.

epubcheck output

Validating against EPUB version 3.0 - custom validation
Validating using EPUB version 3.0 rules.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(26,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(27,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(27,79):
Error while parsing file 'duplicate resource: OEBPS/images/cow.svg'.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(38,120): MathML
should either have an alt text attribute or annotation-xml child
element.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(42,120): MathML
should either have an alt text attribute or annotation-xml child
element.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(54,198): MathML
should either have an alt text attribute or annotation-xml child
element.

Check finished with errors


hm, last time i checked it was ok .. epub is such a mess (to put it 
mildly) ... one manages to satisfy one checker/viewer and in the end it 
breaks another (which is probably why there are so many converters ... 
vendors don't care as they love to lock you in)


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] Writing between lines

2015-04-13 Thread Hans Hagen

On 4/13/2015 10:00 AM, Otared Kavian wrote:

Hi all,

How can one write in small print something between lines, in an efficient 
manner?
I have come up with the following:
\define[1]\betweenlines{${\rlap{{\mbox{\darkgray{\infofont 
#1}}}\atop{}}\atop{}}$}
in order to make visible certain informations just above a cited reference. But 
the use of \atop which a macro for mathmode, together with \mbos, doesn’t seem 
a wise idea.

has any one a better idea how to obtain the same result?


pushing stuff in between will probably mess up spacing etc etc so if you 
follow that route just accept that your proof is not what you will 
eventually get


anyway, i added some ref tracing to the upcoming beta

(1) \showreferences : just shows labels of references as well as 
destinations
(2) \usemodule[references-show] : does the same but also shows a list 
per page


both work ok with

\enabletrackers[nodes.references,nodes.destinations]


A minimal example of its use follows
Best regards: OK

 begin write-between-lines.tex
\define[1]\betweenlines{${\rlap{{\mbox{\darkgray{\infofont 
#1}}}\atop{}}\atop{}}$}

\def\placeformularef[#1]{\doifmode{proofreading}%
{\inrightmargin{\infofont #1}}%
\placeformula[#1]}

\definereferenceformat[Eqref][left=(,right=)]
\def\eqref[#1]{\betweenlines{#1}\Eqref[#1]}

\setupformulas[location=right]

\enablemode[proofreading]

\starttext
We have
\placeformularef[eq:Square]
\startformula
a^2 + 2ab + b^2 = (a + b)^2,
\stopformula
for $a,b\in {\Bbb C}$. Also,
\placeformularef[eq:Identity]
\startformula
\alpha^2 -2\alpha\beta + \beta^2 \NC = (\alpha - \beta)^2.
\stopformula
Note that \eqref[eq:Square] is true whenever we have $ab = ba$ for $b,a \in 
{\Bbb A}$. This is not the case when ${\Bbb A}$ is the ring of the matrices.
It is clear that \eqref[eq:Identity] is a consequence of \eqref[eq:Square].

\stoptext
 begin write-between-lines.tex
___
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
___