Re: [NTG-context] ntg-context Digest, Vol 164, Issue 29

2018-02-11 Thread Jeong Dal
Dear Wolfgang,

“\setupmathematics[integral=nolimits]” did what I want.
If I knew this two weeks ago, I saved my time to edit formulas.
I should ask for this feature two weeks ago.

There are so many things  in ConTeXt that I don’t know.

Thank you.

Best regards,

Dalyoung




> \starttext
> 
> \startformula
> \int_{0}^{1} g(x)\,\diff x = 1
> \stopformula
> 
> \setupmathematics[integral=nolimits]
> 
> \startformula
> \int_{0}^{1} g(x)\,\diff x = 1
> \stopformula
> 
> \setupmathematics[integral=limits]
> 
> \startformula
> \int_{0}^{1} g(x)\,\diff x = 1
> \stopformula
> 
> \stoptext
> 
> 
> Wolfgang

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

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

Re: [NTG-context] Typesetting an interview

2018-02-11 Thread Wolfgang Schuster

\definemeasure[interview][3em]

\define[1]\InterviewHeadCommand
  {\offset[x=-\measure{interview}]{#1}}

\definedescription
  [interview]
  [alternative=top,
   headcommand=\InterviewHeadCommand,
   margin=\measure{interview}]

\showframe[text][text]

\starttext

\startinterview{Weisman}
\input weisman
\stopinterview

\startinterview{Ward}
\input ward
\stopinterview

\stoptext

Wolfgang

Henning Hraban Ramm 
7. Februar 2018 um 17:16
Ahoi,
I’m trying to typeset an interview and thought, a "description" might 
be the best setup. But I can’t find the right parameters for the 
layout I want...

Every contribution should look like:

"""
HHR
Here’s the text, question or answer.

OTR
And here’s the next one.
Might have several lines.
"""

Working example:


\definedescription[Interview][
headstyle=italic,
style=normal,
align=flushleft,
alternative=hanging,
]

\def\dostartInterview[#1][#2]%
{\doifsomethingelse{#2}%
{\startInterview[reference={#1},title={#2}]}%
{\startInterview[title={#1}]}%
}
\def\startInt{\dodoubleempty\dostartInterview}
\def\stopInt{\stopInterview}


\starttext

\chapter{An Interview}

\startInt[{Hennning Hraban Ramm (HR)}]
This might be a short question or a long response.
Name or initials of the person should stand in their own line (without 
breaking), while the answer should be indented, without additional 
paragraph indent.

\stopInt

\startInt[{Hans Hagen (HH)}]
And I’m sure the author has something to say.
\input tufte
\stopInt

\startInt[HR]
\input knuth
\stopInt

\startInt[HH]
\input zapf
\stopInt

\startInt[thankyou][HR]
This might also have a reference.
\stopInt

\stoptext



Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


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

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

Re: [NTG-context] Problem with a macro

2018-02-11 Thread Wolfgang Schuster



Jeong Dal 
12. Februar 2018 um 00:31
Dear Otared,

All of your examples yield the same output in which the numbers locate 
at the top and at the bottom of the integral sign.

Is it what you expected?
I am looking for a way to place numbers at the right of the integral 
sign under the \startformula … \stopformula environment as the output 
of $\displaystyle\int_1^4 …$.


\starttext

\startformula
\int_{0}^{1} g(x)\,\diff x = 1
\stopformula

\setupmathematics[integral=nolimits]

\startformula
\int_{0}^{1} g(x)\,\diff x = 1
\stopformula

\setupmathematics[integral=limits]

\startformula
\int_{0}^{1} g(x)\,\diff x = 1
\stopformula

\stoptext


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

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

Re: [NTG-context] Problem with a macro

2018-02-11 Thread Jeong Dal
Dear Otared,

All of your examples yield the same output in which the numbers locate at the 
top and at the bottom of the integral sign.
Is it what you expected? 
I am looking for a way to place numbers at the right of the integral sign under 
the \startformula … \stopformula environment as the output of 
$\displaystyle\int_1^4 …$.

I am using the latest beta.

mtx-context | run 1: luatex 
--fmt="/Users/graph/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
 --jobname="test" 
--lua="/Users/graph/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
 --no-parse-first-line --c:currentrun=1 --c:fulljobname="./test.tex" 
--c:input="./test.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:purgeall 
"cont-yes.mkiv"
This is LuaTeX, Version 1.05.0 (TeX Live 2017) 
 system commands enabled.
open source > level 1, order 1, name 
'/Users/graph/ConTeXt/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2018.02.09 00:04 MKIV beta  fmt: 2018.2.11  
int: english/english
system  > 

Thank you.

Best regards,

Dalyoung

 

> 2018. 2. 12. 오전 2:18, ntg-context-requ...@ntg.nl 작성:
> 
> You are right regarding the unnatural way of using \autointegral. An easy way 
> to use the \autointegral command in a more natural way is to define one’s own 
> macro, as in the following:
> 
> \setupmathdelimiter[integral][rightoffset=-3mu,exact=yes,factor=2]
> 
> \unexpanded\def\myint#1#2#3#4{\autointegral{#2}{#1}{#3(#4)}\,\diff #4}
> 
> \starttext
> $\myint{1}{4}{f}{x}$
> 
> \startformula
> \myint{0}{2\pi}{\cos(t)^2\sin}{t} = 0
> \stopformula
> And here is the classical \type{\int} command:
> \startformula
> \int_{0}^{1} g(x)\,\diff x = 1.
> \stopformula
> \stoptext
> 
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] avoiding space on top of a page

2018-02-11 Thread Wolfgang Schuster



Henning Hraban Ramm 
11. Februar 2018 um 16:00
Ahoi,
I configured my section titles to have a line of space (\blank[big]) 
before and after the title.
But if the section starts on a new page, the title should start in the 
first line.

I couldn’t find the right combination of \blank options...

\setuplayout[grid=yes]
\setuphead[section][
page=no,
style={\bf},
before={\testpage[4]\startlinecorrection\blank[medium,back]},
after={\blank[small,max]\stoplinecorrection},
]


\setuphead
  [...]
  [before={\testpage[5]\blank[...]\startlinecorrection},
   after={\stoplinecorrection\blank[...]}]

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

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

Re: [NTG-context] Midsentence alias

2018-02-11 Thread Idris Samawi Hamid ادريس سماوي حامد

On Sun, 11 Feb 2018 09:56:40 -0700, Hans Hagen  wrote:


On 2/11/2018 5:20 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

Is there an analogous symbol for a midsentence, which requires a mark  
only at its beginning?

|=|


Excellent!
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] Midsentence alias

2018-02-11 Thread Hans Hagen

On 2/11/2018 5:20 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

Is there an analogous symbol for a midsentence, which requires a mark 
only at its beginning?

|=|

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] To \getbuffer or to \input: which one is it better?

2018-02-11 Thread Hans Hagen

On 2/11/2018 2:17 PM, Aditya Mahajan wrote:

On Sun, 11 Feb 2018, Hans Hagen wrote:


Think different ... see end.

\startluacode

    document.speakerdata = {
    {
    speakername = "Gauss",
    title   = "Remarks on Number Theory",
    time    = "8am",
    room    = "B",
    day = "Monday",
    },
    {
    speakername = "Ampère",
    title   = "What is Magnetism",
    time    = "10am",
    room    = "A",
    day = "Monday",
    },
    {
    speakername = "Dirac",
    title   = "Quaternions and the wave equation",
    time    = "11am",
    room    = "B",
    day = "Tuesday",
    },
    }

\stopluacode


I prefer starting with XML and converting it to a lua table using helper 
functions. The advantage of XML is that you can verify the data using an 
RNC schema.
i must admit that i never validate xml .. probably also because most xml 
we get is invalid or has element abuse anyway so one has to look into 
what one gets and act upon interferences


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] Problem with a macro

2018-02-11 Thread Otared Kavian
Hi Dalyoung,

You are right regarding the unnatural way of using \autointegral. An easy way 
to use the \autointegral command in a more natural way is to define one’s own 
macro, as in the following:

\setupmathdelimiter[integral][rightoffset=-3mu,exact=yes,factor=2]

\unexpanded\def\myint#1#2#3#4{\autointegral{#2}{#1}{#3(#4)}\,\diff #4}

\starttext
$\myint{1}{4}{f}{x}$

\startformula
\myint{0}{2\pi}{\cos(t)^2\sin}{t} = 0
\stopformula
And here is the classical \type{\int} command:
\startformula
\int_{0}^{1} g(x)\,\diff x = 1.
\stopformula
\stoptext

Best regards: OK

> On 11 Feb 2018, at 15:20, Jeong Dal  wrote:
> 
> Dear Otared,
> 
> As you said, it is working well.
> 
> However, the numbers 1, 4 located at the top and the bottom of the integral 
> sign which is not usual in math. 
> I have seen a discussion about such an output, but I may not see the result 
> which I want.
> 
> As you see in the following example, only the 1st and the 2nd  gave the 
> output which is usual in math.
> Is still there no way to make nice output  using “\startformula”?
> 
> Thank you.
> 
> Best regards,
> 
> Dalyoung
> 
> %%
> \unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}
> 
> \starttext
> \math{\int_1^4 f(x) \diff x}
> 
> \math{\displaystyle \int_1^4 f(x) \diff x}
> 
> \startformula
> \int_1^4 f(x) \diff x
> \stopformula
> 
> \integ{4}{1}{f(x)}
> \stoptext
> 
> 
>> If you remove the line
>>  \setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]  
>> then your example typesets well with the last beta version 2018.02.09 00:04.
>> 
>> Best regards: OK
>> 
>>> On 11 Feb 2018, at 09:35, Fabrice Couvreur  
>>> wrote:
>>> 
>>> Hi Hans,
>>> The macro that you proposed me worked very well but since my update of 
>>> context standalone, it does not work any more.
>>> Thank you.
>>> Fabrice
>>> 
>>> \setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]  
>>> 
>>> \unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}
>>> 
>>> \starttext
>>> \integ{4}{1}{f(x)}
>>> \stoptext
>>> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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

[NTG-context] Midsentence alias

2018-02-11 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

Midsentences in the ConTeXt sense are quite common. Consider the following:

===
\setuplanguage[en]
[leftsentence={{} \endash\nobreakspace},
 rightsentence={{} \endash\nobreakspace},
 leftsubsentence={{} \textbar\nobreakspace},
 rightsubsentence={{} \textbar\nobreakspace},
 midsentence={{} \endash\nobreakspace}]

\starttext
This is a sentence|<|this is a subsentence|>|that includes a subsentence.
\blank
This is a sentence|<|this is a subsentence|<|this is a nested  
subsentence|>|that includes a nested subsentence|>|that includes a  
subsentence.

\blank
This is a sentence that ends in a midsentence\midsentence Here is the  
midsentence.

\stoptext
===

A primary subsentence or nested subsentence is marked off by |<| and |>|  
respectively.


Is there an analogous symbol for a midsentence, which requires a mark only  
at its beginning?


If not, how can I make a private one? For example:

This is a sentence that ends in a midsentence|<>|Here is the midsentence.

How can I properly define |<>| to be an alias for \midsentence, in a way  
consistent with the rest of the subsentence mechanism?


Note: Could only find one reference to midsentence in the sources:  
lang-ini.mkiv, line 354


If this is not already supported, would like to propose that |<>| be added  
to ConTeXt as an alias for \midsentence.


BTW: It may appear that one can just use |<| to mark a midsentence, but  
then the next subsentence in the document will be treated as a nested  
subsentence.


Thank you in advance!

Best wishes
Idris
--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80512

scratch.pdf
Description: Adobe PDF document


scratch.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] placing a wide float at the bottom

2018-02-11 Thread Rik Kabel

On 2018-02-11 06:50, Henning Hraban Ramm wrote:

Am 2018-02-10 um 18:03 schrieb Rik Kabel :


On 2018-02-10 10:00, Henning Hraban Ramm wrote:

\placefigure[bottom]{}{\externalfigure[hacker][width=\textwidth]}
works just fine,
I get "top" placement with
\placefigure[bottom]{}{\externalfigure[hacker][width=\paperwidth]}


Works here with the code below. The same result with and without adding 
"force". Result attached.

Do you have an MWE?

\showframe
\starttext
  some text
\placefigure[top]{top textwidth}{\externalfigure[hacker][width=\textwidth]}
  some text
\page
  some text
\placefigure[here]{here textwidth}{\externalfigure[hacker][width=\textwidth]}
  some text
\page
  some text
\placefigure[bottom]{bottom 
textwidth}{\externalfigure[hacker][width=\textwidth]}
  some text
\page
  some text
\placefigure[top,force]{top force 
paperwidth}{\externalfigure[hacker][width=\paperwidth]}
  some text
\page
  some text
\placefigure[here,force]{here force 
paperwidth}{\externalfigure[hacker][width=\paperwidth]}
  some text
\page
  some text
\placefigure[bottom,force]{bottom force 
paperwidth}{\externalfigure[hacker][width=\paperwidth]}\stopmode
  some text
\page
  some text
\placefigure[top]{top paperwidth}{\externalfigure[hacker][width=\paperwidth]}
  some text
\page
  some text
\placefigure[here]{here paperwidth}{\externalfigure[hacker][width=\paperwidth]}
  some text
\page
  some text
\placefigure[bottom]{bottom 
paperwidth}{\externalfigure[hacker][width=\paperwidth]}
  some text
\stoptext

Hi Rik,
thank you for looking into this.
Even your example shows a problem: The first "bottom" figure is lower than 
"top", but not at the bottom.

In the following example only the first image is placed at the bottom, the 
others at top:

\showframe
\starttext
\input tufte
\placefigure[bottom]{bottom 
textwidth}{\externalfigure[hacker][width=\textwidth]}
\input knuth
\input zapf
\input tufte
\placefigure[bottom,force]{bottom force 
paperwidth}{\externalfigure[hacker][width=\paperwidth]}\stopmode
\input knuth
\input zapf
\placefigure[bottom]{bottom 
paperwidth}{\externalfigure[hacker][width=\paperwidth]}
\input lorem
\stoptext




You are, unfortunately, right about the problem. Alan Braslau brought up 
the same issue a while back ([NTG-context] \startplacefloat 
[location=bottom], 2015-10-16 
) and it 
was not dealt with at that point. Perhaps he devised a work-around for 
his use that he has not shared yet.


(Sorry for the errant \stopmode in the example. It did nothing, but does 
not belong there in any case.)


--
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] avoiding space on top of a page

2018-02-11 Thread Henning Hraban Ramm
Ahoi,
I configured my section titles to have a line of space (\blank[big]) before and 
after the title.
But if the section starts on a new page, the title should start in the first 
line.
I couldn’t find the right combination of \blank options...

\setuplayout[grid=yes]
\setuphead[section][
page=no,
style={\bf},
before={\testpage[4]\startlinecorrection\blank[medium,back]},
after={\blank[small,max]\stoplinecorrection},
]

(Please find working example attached.)

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD


sectiontest.tex
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with a macro

2018-02-11 Thread Wolfgang Schuster



Fabrice Couvreur 
11. Februar 2018 um 09:35
Hi Hans,
The macro that you proposed me worked very well but since my update of 
context standalone, it does not work any more.

Thank you.
Fabrice

\setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]


\setupmathdelimiter[integral][rightoffset=-3mu,exact=yes,factor=2]

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

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

Re: [NTG-context] Problem with a macro

2018-02-11 Thread Jeong Dal
Dear Otared,

As you said, it is working well.

However, the numbers 1, 4 located at the top and the bottom of the integral 
sign which is not usual in math. 
I have seen a discussion about such an output, but I may not see the result 
which I want.

As you see in the following example, only the 1st and the 2nd  gave the output 
which is usual in math.
Is still there no way to make nice output  using “\startformula”?

Thank you.

Best regards,

Dalyoung

%%
\unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}

\starttext
\math{\int_1^4 f(x) \diff x}

\math{\displaystyle \int_1^4 f(x) \diff x}

\startformula
\int_1^4 f(x) \diff x
\stopformula

\integ{4}{1}{f(x)}
\stoptext


> If you remove the line
>   \setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]  
> then your example typesets well with the last beta version 2018.02.09 00:04.
> 
> Best regards: OK
> 
>> On 11 Feb 2018, at 09:35, Fabrice Couvreur  
>> wrote:
>> 
>> Hi Hans,
>> The macro that you proposed me worked very well but since my update of 
>> context standalone, it does not work any more.
>> Thank you.
>> Fabrice
>> 
>> \setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]  
>> 
>> \unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}
>> 
>> \starttext
>> \integ{4}{1}{f(x)}
>> \stoptext
>> 
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] To \getbuffer or to \input: which one is it better?

2018-02-11 Thread Aditya Mahajan

On Sun, 11 Feb 2018, Hans Hagen wrote:


Think different ... see end.

\startluacode

document.speakerdata = {
{
speakername = "Gauss",
title   = "Remarks on Number Theory",
time= "8am",
room= "B",
day = "Monday",
},
{
speakername = "Ampère",
title   = "What is Magnetism",
time= "10am",
room= "A",
day = "Monday",
},
{
speakername = "Dirac",
title   = "Quaternions and the wave equation",
time= "11am",
room= "B",
day = "Tuesday",
},
}

\stopluacode


I prefer starting with XML and converting it to a lua table using helper 
functions. The advantage of XML is that you can verify the data using an 
RNC schema.


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Typesetting an interview

2018-02-11 Thread Henning Hraban Ramm
I’d loved to use some clean code, but since I didn’t manage on my own, I 
resolved to this somewhat ugly setup:

\def\doStartInt[#1]{\testpage[2]%
\noindent\emph{#1}\par\gobblespacetokens%
\startnarrower[left]\noindent\gobblespacetokens}
\def\startInt{\dosingleempty\doStartInt}
\def\stopInt{\stopnarrower\blank[big]}


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

Am 2018-02-07 um 17:16 schrieb Henning Hraban Ramm :

> Ahoi,
> I’m trying to typeset an interview and thought, a "description" might be the 
> best setup. But I can’t find the right parameters for the layout I want...
> Every contribution should look like:
> 
> """
> HHR
>   Here’s the text, question or answer.
> 
> OTR
>   And here’s the next one.
>   Might have several lines.
> """
> 
> Working example:
> 
> 
> \definedescription[Interview][
>  headstyle=italic,
>  style=normal,
>  align=flushleft,
>  alternative=hanging,
> ]
> 
> \def\dostartInterview[#1][#2]%
>  {\doifsomethingelse{#2}%
>{\startInterview[reference={#1},title={#2}]}%
>{\startInterview[title={#1}]}%
> }
> \def\startInt{\dodoubleempty\dostartInterview}
> \def\stopInt{\stopInterview}
> 
> 
> \starttext
> 
> \chapter{An Interview}
> 
> \startInt[{Hennning Hraban Ramm (HR)}]
> This might be a short question or a long response.
> Name or initials of the person should stand in their own line (without 
> breaking), while the answer should be indented, without additional paragraph 
> indent.
> \stopInt
> 
> \startInt[{Hans Hagen (HH)}]
> And I’m sure the author has something to say.
> \input tufte
> \stopInt
> 
> \startInt[HR]
> \input knuth
> \stopInt
> 
> \startInt[HH]
> \input zapf
> \stopInt
> 
> \startInt[thankyou][HR]
> This might also have a reference.
> \stopInt
> 
> \stoptext
> 
> 
> 
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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

[NTG-context] Bug with module pgfplots ?

2018-02-11 Thread Fabrice Couvreur
Hello,
Following a standalone context update, all files that use the pgfplots
module produce the following error message :

tex error   > tex error on line 85 in file /home/fab/ntg77.tex: ! You
can't use `the character 7' after \the

 7

\pdflastobj ->\pdffeedback lastobj

 /pgfpat4\space \the \pdflastobj
\space 0 R
\pgf@sys@pdf@pdfbackendset@one ...o \noexpand #1#2
  \relax }
 ...pattern@instantiate@north west lines\endcsname
  \expandafter \global
\expa...
\pgfutil@secondoftwo #1#2->#2

...
l.85 \stopaxis

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

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

Re: [NTG-context] To \getbuffer or to \input: which one is it better?

2018-02-11 Thread Hans Hagen

On 2/11/2018 8:49 AM, Otared Kavian wrote:

On 10 Feb 2018, at 17:56, Hans Hagen  wrote:


On 2/10/2018 4:10 PM, Otared Kavian wrote:

[…]

buffers are quite efficient as they never see the file system while input reads 
the file each time .. both are fresh reads so they obey catcode changes 
(different interpretations of characters)

there might be more efficient ways for your case but without an example that's 
guessing


Hi Hans,

Thank you very much for your attention and your explanations about buffers.

I send below a working example showing what I wish to do: to extract from a 
data buffer some informations to be typeset separately according to some 
criteria. Maybe I am using the buffer where the data is stored inappropriately, 
but I can obtain what I want.

However if a sorting were necessary, then my approach would not work…. Is it 
possible to sort the buffer containing the data according to some key?


Think different ... see end.


Best regards: OK

%% begin setvariable-getbuffer.tex
\startbuffer[talkdata]
%%
\setvariables[talk]%
[speakername={Gauss},
title={Remarks on Number Theory},
time={8am},
room={B},
day={Monday},
]
%%

%%
\setvariables[talk]%
[speakername={Ampère},
title={What is Magnetism},
time={10am},
room={A},
day={Monday},
]
%%

%%
\setvariables[talk]%
[speakername={Dirac},
title={Quaternions and the wave equation},
time={11am},
room={B},
day={Tuesday},
]
%%
\stopbuffer

% we define what is to be typeset for each day
\define[1]\talksofday{%
\expdoif{\getvariable{talk}{day}}{#1}{%
\starttabulate[|f{\bi}l|p|][before=]%
\NC Speaker \EQ \getvariable{talk}{speakername} \NC\NR
\NC Title   \EQ \getvariable{talk}{title} \NC\NR
\NC Location and Time\EQ Room 
\getvariable{talk}{room},
at \getvariable{talk}{time} \NC\NR
\HL
\stoptabulate
}
}

% we define what is to be typeset for each room
\define[1]\talksofroom{%
\expdoif{\getvariable{talk}{room}}{#1}{
\starttabulate[|f{\bi}l|p|][before=]%
\NC Speaker \EQ \getvariable{talk}{speakername} \NC\NR
\NC Title   \EQ \getvariable{talk}{title} \NC\NR
\NC Day and Time\EQ \getvariable{talk}{day}, at 
\getvariable{talk}{time} \NC\NR
\HL
\stoptabulate
}
}

\starttext

\starttitle[title={Monday talks}]
\setvariable{talk}{set}{\talksofday{Monday}}
\getbuffer[talkdata]
\stoptitle
\page

\starttitle[title={Tuesday talks}]
\setvariable{talk}{set}{\talksofday{Tuesday}}
\getbuffer[talkdata]
\stoptitle
\page

\starttitle[title={Talks in room B}]
\setvariable{talk}{set}{\talksofroom{B}}
\getbuffer[talkdata]
\stoptitle

\stoptext
%% end setvariable-getbuffer.tex

\startluacode

 -- document.speakerdata = table.load("somefile.lua")
 --
 -- with somefile.lue: return { ... }

document.speakerdata = {
{
speakername = "Gauss",
title   = "Remarks on Number Theory",
time= "8am",
room= "B",
day = "Monday",
},
{
speakername = "Ampère",
title   = "What is Magnetism",
time= "10am",
room= "A",
day = "Monday",
},
{
speakername = "Dirac",
title   = "Quaternions and the wave equation",
time= "11am",
room= "B",
day = "Tuesday",
},
}

\stopluacode

\startluacode
document.talksofday = function(how)
local data = document.speakerdata
if how == "speakername" then
local sort = { } for i=1,#data do sort[i] = data[i] end
table.sort(sort,function(a,b) return a.speakername < 
b.speakername end)

data = sort
end
context.starttabulate { "|f{\\bi}l|p|" }
context.HL()
for i=1,#data do
local d = data[i]
context.NC()
context("Speaker")
context.EQ()
context(d.speakername)
context.NC()
context.NR()
context.NC()
context("Title")
context.EQ()
context(d.title)
context.NC()
context.NR()
context.NC()
context("Location and Time")
context.EQ()
  

Re: [NTG-context] placing a wide float at the bottom

2018-02-11 Thread Henning Hraban Ramm
Am 2018-02-10 um 18:03 schrieb Rik Kabel :

> On 2018-02-10 10:00, Henning Hraban Ramm wrote:
>> \placefigure[bottom]{}{\externalfigure[hacker][width=\textwidth]}
>> works just fine,
>> I get "top" placement with
>> \placefigure[bottom]{}{\externalfigure[hacker][width=\paperwidth]}
>> 
> Works here with the code below. The same result with and without adding 
> "force". Result attached.
> 
> Do you have an MWE?
> 
> \showframe
> \starttext
>  some text
> \placefigure[top]{top textwidth}{\externalfigure[hacker][width=\textwidth]}
>  some text
> \page
>  some text
> \placefigure[here]{here textwidth}{\externalfigure[hacker][width=\textwidth]}
>  some text
> \page
>  some text
> \placefigure[bottom]{bottom 
> textwidth}{\externalfigure[hacker][width=\textwidth]}
>  some text
> \page
>  some text
> \placefigure[top,force]{top force 
> paperwidth}{\externalfigure[hacker][width=\paperwidth]}
>  some text
> \page
>  some text
> \placefigure[here,force]{here force 
> paperwidth}{\externalfigure[hacker][width=\paperwidth]}
>  some text
> \page
>  some text
> \placefigure[bottom,force]{bottom force 
> paperwidth}{\externalfigure[hacker][width=\paperwidth]}\stopmode
>  some text
> \page
>  some text
> \placefigure[top]{top paperwidth}{\externalfigure[hacker][width=\paperwidth]}
>  some text
> \page
>  some text
> \placefigure[here]{here 
> paperwidth}{\externalfigure[hacker][width=\paperwidth]}
>  some text
> \page
>  some text
> \placefigure[bottom]{bottom 
> paperwidth}{\externalfigure[hacker][width=\paperwidth]}
>  some text
> \stoptext

Hi Rik,
thank you for looking into this.
Even your example shows a problem: The first "bottom" figure is lower than 
"top", but not at the bottom.

In the following example only the first image is placed at the bottom, the 
others at top:

\showframe
\starttext
\input tufte
\placefigure[bottom]{bottom 
textwidth}{\externalfigure[hacker][width=\textwidth]}
\input knuth
\input zapf
\input tufte
\placefigure[bottom,force]{bottom force 
paperwidth}{\externalfigure[hacker][width=\paperwidth]}\stopmode
\input knuth
\input zapf
\placefigure[bottom]{bottom 
paperwidth}{\externalfigure[hacker][width=\paperwidth]}
\input lorem
\stoptext


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with a macro

2018-02-11 Thread Fabrice Couvreur
Hi Otared,
I also found that by removing this line, it worked. However, if Hans
proposed this macro, this line should have utility no ?
Fabrice

2018-02-11 10:01 GMT+01:00 Otared Kavian :

> Hi Fabrice,
>
> If you remove the line
> \setupmathextensible[integral][rightoffset=-3mu,exact=yes,
> factor=2]
> then your example typesets well with the last beta version 2018.02.09 00
> :04.
>
> Best regards: OK
>
> > On 11 Feb 2018, at 09:35, Fabrice Couvreur 
> wrote:
> >
> > Hi Hans,
> > The macro that you proposed me worked very well but since my update of
> context standalone, it does not work any more.
> > Thank you.
> > Fabrice
> >
> > \setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]
> >
> > \unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}
> >
> > \starttext
> > \integ{4}{1}{f(x)}
> > \stoptext
> > 
> ___
> > If your question is of interest to others as well, please add an entry
> to the Wiki!
> >
> > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/
> listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > wiki : http://contextgarden.net
> > 
> ___
>
> 
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/
> listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> 
> ___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] Problem with a macro

2018-02-11 Thread Otared Kavian
Hi Fabrice,

If you remove the line
\setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]  
then your example typesets well with the last beta version 2018.02.09 00:04.

Best regards: OK

> On 11 Feb 2018, at 09:35, Fabrice Couvreur  
> wrote:
> 
> Hi Hans,
> The macro that you proposed me worked very well but since my update of 
> context standalone, it does not work any more.
> Thank you.
> Fabrice
> 
> \setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]  
> 
> \unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}
> 
> \starttext
> \integ{4}{1}{f(x)}
> \stoptext
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

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

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

[NTG-context] Problem with a macro

2018-02-11 Thread Fabrice Couvreur
Hi Hans,
The macro that you proposed me worked very well but since my update of
context standalone, it does not work any more.
Thank you.
Fabrice

\setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]

\unexpanded\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}

\starttext
\integ{4}{1}{f(x)}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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