Re: [NTG-context] how to setup path of ConTeXtLMTX for MacVim?

2021-12-14 Thread Jan-Erik Hägglöf via ntg-context
agen)
>>  3. Re: TeXWorks and synctex SOLVED (Bruce Horrocks)
>> 
>> 
>> --
>> 
>> Message: 1
>> Date: Tue, 14 Dec 2021 00:48:25 +0100
>> From: Jan-Erik Hägglöf 
>> To: mailing list for ConTeXt users 
>> Subject: Re: [NTG-context] how to setup path of ConTeXtLMTX for
>>  MacVim?
>> Message-ID: <32566c08-2359-48df-b24c-2aa2e3d02...@gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>> 
>> let g:context_mtxrun = 
>> 'PATH=$HOME/context/context-osx-64/tex/texmf-osx-64/bin:$PATH mtxrun'
>> 
>> nnoremap å :ConTeXt
>> nnoremap  ö :call tex#preview()
>> nnoremap  ä
>>   \ :call tex#goto_texshop(expand("%:p"), line('.'), col('.'), 1, 1)
>> 
>> Here is my snippet from my personal context.vim file
>> 
>> I see that you have :! and that means that you instruct vim to execute a 
>> shell command.
>> 
>> Just write :ConTeXt and it should work fine
>> 
>>> 13 dec. 2021 kl. 14:30 skrev Jeong Dal via ntg-context :
>>> 
>>> Dear John, Nicola,
>>> 
>>> I created a file context.vim under the folder ~/.vim/after/ftplugin/ which 
>>> contains
>>> 
>>> map > :w:!ConTeXt
>>> let g:context_mtxrun = 'PATH=$HOME/ConTeXtLM/tex/texmf-osx-64/bin:$PATH 
>>> mtxrun'
>>> let g:tex_flavor = "context"
>>> 
>>> The result is
>>> 1. using “:ConTeXt”   issued an error message:  “E492: not an editor 
>>> command: ConTeXt
>>> 2. using “make” issued an error message: "No targets specified and no 
>>> makefile found. …" 
>>> Pressing C-h, compiling started and succesfully ended. However, it use 
>>> /usr/local/texlive/… not LMTX tex folder.
>>> 
>>> Without context.vim, “:ConTeXt" and “:make" worked fine.
>>> 
>>> I’ll do more test. 
>>> 
>>> Thank you.
>>> Best regards,
>>> 
>>> Dalyoung
>>> 
>>> ___
>>> 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
>>> ___
>> 
>> -- next part --
>> An HTML attachment was scrubbed...
>> URL: 
>> <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20211214/d4e3531d/attachment-0001.htm>
>> 
>> --
>> 
>> Message: 2
>> Date: Tue, 14 Dec 2021 00:54:44 +0100
>> From: Hans Hagen 
>> To: mailing list for ConTeXt users , Aditya
>>  Mahajan 
>> Subject: Re: [NTG-context] circuitikz module seems broken
>> Message-ID: <41f06234-caab-6576-aa5e-8396c8ee3...@xs4all.nl>
>> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>> 
>> Hi,
>> 
>> This works here:
>> 
>> \usemodule[circuitikz]
>> 
>> \starttext
>>\startcircuitikz
>>\draw (0,2) to[I] (2,2);
>>\stopcircuitikz
>>\startcircuitikz
>>\draw (0,2) to[I] (2,2);
>>\stopcircuitikz
>> \stoptext
>> 
>> with the attached. Make sure to put it in the regular context base path 
>> and run mtxrun --generate.
>> 
>> Aditya: can you check if we load enough? We really need to get rid of 
>> all these (kind of strange) t-* modules that somehow ended up in tikz 
>> and it's way easier and robust to occasionally add something needed to 
>> m-tikz than to try to catch hard-to-locate-and-fix stuff in the tikz 
>> distribution. If needed we can apply runtime patches too.
>> 
>> (nyw, it looks like tikz creates empty pfg files during a run but that's 
>> probbably has a reason)
>> 
>> 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
>> -
>> -- next part -

Re: [NTG-context] Title for tabulate

2021-12-14 Thread Hans Hagen via ntg-context

On 12/14/2021 6:16 PM, Benjamin Buchmuller via ntg-context wrote:

Hi!

I'd like to follow up on a problem that Denis came across recently with the titles 
argument in tabulate. (It's more a solution than a question, but any hints to improve the 
answer are welcome.) I wanted to use this argument for an easy specification of, well, a 
title for a "recipe". The advantage is that all information is held together 
and it's easy to use for people who are not (too) familiar with ConTeXt.

So, in one file I can define all styles (which the end-user would not need to 
see):

\definetabulate[recipe][|l|l|p|l|]

\setuptabulate
[recipe]
[
bodyfont=small,
distance=medium,
before={\blank[back, small]},
header=text,
headstyle=\bi, % this formats the "\BC" cells
headcolor=red, % this formats the "\BC" cells
]


\starttext

And then use:

\startrecipe[title={Whatever mixture 1}]
\FL
\NC Absolute \BC Stock \NC Ingredient \NC Final \NR
\HL
\NC 1 \NR
\LL
\stoprecipe

\startrecipe[title={Whatever mixture 2}]
\FL
\BC Absolute \BC Stock \BC Ingredient \BC Final \NR
\HL
\NC 1 \NR
\LL
\stoprecipe

\stoptext

etc.

However, I cannot change the way the title is styled (or spaced from the table) unless I 
do "title={\bi Some text.}". However, blank commands are also stripped off at 
this place. (I also don't get a clue from the source if there is any argument to spike-in 
some formatting.)

So, if there is no easy way to access this one, we can work around:

\definetabulate[recipetab][|l|l|p|l|]

\setuptabulate
[recipetab]
[
bodyfont=small,
distance=medium,
before={\blank[back, small]},
% header=text, % THIS MUST NOT BE "text"
headstyle=bold,
headcolor=red,
]

\define\startrecipe{\dodoubleempty\dostartrecipe}

\long\def\dostartrecipe[#1][#2]#3\stoprecipe{%
\iffirstargument
{\bi #1}\blank[medium]
\fi
\ifsecondargument
\startrecipetab[#2]
#3
\stoprecipetab
\else
\startrecipetab
#3
\stoprecipetab
\fi
}

\startrecipe[Head 1]
\FL
\BC Absolute \BC Stock \BC Ingredient \BC Final \NR
\HL
\NC 1 \NR
\LL
\stoprecipe

\startrecipe[Head 2][headcolor=blue] % pass on arguments to tabulate
\FL
\BC Absolute \BC Stock \BC Ingredient \BC Final \NR
\HL
\NC 1 \NR
\LL
\stoprecipe

Small question though: Is there a ConTeXt way to "\long\def" or a simple way ("user 
interface") to filter a list of arguments for a specific key=val pair, e.g. to make a single 
optional argument with headertitle={Some header.}?
context has no (need for) \long ... all is long (i mever saw a reason 
for using it)


(1) use a proper head:

\definehead[RecipeHead][subsubsubsubsubsubject]
\setuphead [RecipeHead][style=bolditalic,after={\blank[medium]}]

\definetabulate[recipetab][|l|l|p|l|]

\setuptabulate
  [recipetab]
  [bodyfont=small,
   distance=medium,
   before={\blank[back, small]},
   headstyle=bold,
   headcolor=red]

here's a one-step lmtx solution:

\let\stoprecipe\relax

\tolerant\protected\def\startrecipe[#1]#*[#2]#3\stoprecipe
  {\ifcstok{#1}\emptytoks\else
 \RecipeHead{#1}
   \fi
   \ifcstok{#2}\emptytoks
 \startrecipetab#3\stoprecipetab
   \else
 \startrecipetab[#2]#3\stoprecipetab
   \fi}

or just

\tolerant\protected\def\startrecipe[#1]#*[#2]#3\stoprecipe
  {\ifempty{#1}\else
 \RecipeHead{#1}
   \fi
   \ifempty{#2}%
 \startrecipetab#3\stoprecipetab
   \else
 \startrecipetab[#2]#3\stoprecipetab
   \fi}


and here's one that does what you ask (in the core i'd try to avoid 
grabbing too much arguments and if real core we'd make sure dummy 
parameters don;t interfere):


\tolerant\protected\def\startrecipe[#1]#2\stoprecipe
  {\ifempty{#1}%
 \startrecipetab#2\stoprecipetab
   \orelse\ifhastok={#1}%
 \getdummyparameters[headtitle=,#1]
 \ifempty{\dummyparameter{headtitle}}\else
   \normalexpanded{\RecipeHead{\dummyparameter{headtitle}}}
 \fi
 \startrecipetab[#1]#2\stoprecipetab
   \else
 \RecipeHead{#1}
 \startrecipetab#2\stoprecipetab
   \fi}

\startrecipe[headtitle={Head 3},headcolor=blue] % pass on arguments to 
tabulate

\FL
\BC Absolute \BC Stock \BC Ingredient \BC Final \NR
\HL
\NC 1 \NR
\LL
\stoprecipe

Here's a variant:

\def\theparameter#1#2%
  {\beginlocalcontrol
   \begingroup
   \getdummyparameters[#1=,#2]%
   \normalexpanded{\endgroup\endlocalcontrol\dummyparameter{#1}}}

\tolerant\protected\def\startrecipe[#1]#2\stoprecipe
  {\ifempty{#1}%
 \startrecipetab#2\stoprecipetab
   \orelse\ifhastok={#1}%
 \edef\MyHeadTitle{\theparameter{headtitle}{#1}}%
 \ifempty\MyHeadTitle\else
   \normalexpanded{\RecipeHead{\MyHeadTitle}}
 \fi
 \startrecipetab[#1]#2\stoprecipetab
   \else
 \RecipeHead{#1}
 \startrecipetab#2\stoprecipetab
   \fi}

or just


[NTG-context] curved

2021-12-14 Thread Hans Hagen via ntg-context

Hi Hraban,

follow up on chat ...

\starttext

\startMPcode % {doublefun}

mfun_bend_tolerance := 0.002; % double : 131/65536
mfun_bend_tolerance := 0.02 ; % scaled

vardef iscurved(expr p, i, tolerance) =
save d, b, r ; boolean r ; r := true ;
d := (xpart precontrol   iof p) - (xpart postcontrol (i-1) 
of p) ;
b := abs((xpart postcontrol (i-1) of p) - (xpart point   (i-1) 
of p) - d);

if b <= tolerance :
b := abs((xpart point i of p) - (xpart precontrol i of p) - d) ;
if b <= tolerance :
d := (ypart precontrol   iof p) - (ypart 
postcontrol (i-1) of p) ;
b := abs((ypart postcontrol (i-1) of p) - (ypart point 
  (i-1) of p) - d) ;

if b <= tolerance :
b := abs((ypart point i of p) - (ypart precontrol i of 
p) - d) ;

if b <= tolerance :
r := false ;
fi ;
fi ;
fi ;
fi ;
r
enddef ;

path p ; p := fullcircle scaled 10cm ;
path q ; q := fullsquare scaled 10cm ;
path r ; r := fullsquare scaled 10cm randomized 1cm ;

draw p ; draw q ; draw r ;

message(iscurved(p,2,0.02));
message(iscurved(q,2,0.02));
message(iscurved(r,2,0.02));

\stopMPcode

\stoptext


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] Title for tabulate

2021-12-14 Thread Benjamin Buchmuller via ntg-context
Hi!

I'd like to follow up on a problem that Denis came across recently with the 
titles argument in tabulate. (It's more a solution than a question, but any 
hints to improve the answer are welcome.) I wanted to use this argument for an 
easy specification of, well, a title for a "recipe". The advantage is that all 
information is held together and it's easy to use for people who are not (too) 
familiar with ConTeXt.

So, in one file I can define all styles (which the end-user would not need to 
see):

\definetabulate[recipe][|l|l|p|l|]

\setuptabulate
[recipe]
[
bodyfont=small,
distance=medium,
before={\blank[back, small]},
header=text,
headstyle=\bi, % this formats the "\BC" cells
headcolor=red, % this formats the "\BC" cells
]


\starttext

And then use:

\startrecipe[title={Whatever mixture 1}]
\FL 
\NC Absolute \BC Stock \NC Ingredient \NC Final \NR 
\HL
\NC 1 \NR
\LL
\stoprecipe

\startrecipe[title={Whatever mixture 2}]
\FL 
\BC Absolute \BC Stock \BC Ingredient \BC Final \NR 
\HL
\NC 1 \NR
\LL
\stoprecipe

\stoptext

etc.

However, I cannot change the way the title is styled (or spaced from the table) 
unless I do "title={\bi Some text.}". However, blank commands are also stripped 
off at this place. (I also don't get a clue from the source if there is any 
argument to spike-in some formatting.) 

So, if there is no easy way to access this one, we can work around:

\definetabulate[recipetab][|l|l|p|l|]

\setuptabulate
[recipetab]
[
bodyfont=small,
distance=medium,
before={\blank[back, small]},
% header=text, % THIS MUST NOT BE "text"
headstyle=bold,
headcolor=red,
]

\define\startrecipe{\dodoubleempty\dostartrecipe}

\long\def\dostartrecipe[#1][#2]#3\stoprecipe{%
\iffirstargument
{\bi #1}\blank[medium]
\fi
\ifsecondargument
\startrecipetab[#2]
#3
\stoprecipetab
\else
\startrecipetab
#3
\stoprecipetab
\fi
}

\startrecipe[Head 1]
\FL
\BC Absolute \BC Stock \BC Ingredient \BC Final \NR 
\HL
\NC 1 \NR
\LL
\stoprecipe

\startrecipe[Head 2][headcolor=blue] % pass on arguments to tabulate
\FL
\BC Absolute \BC Stock \BC Ingredient \BC Final \NR 
\HL
\NC 1 \NR
\LL
\stoprecipe

Small question though: Is there a ConTeXt way to "\long\def" or a simple way 
("user interface") to filter a list of arguments for a specific key=val pair, 
e.g. to make a single optional argument with headertitle={Some header.}?

Best


Benjamin

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

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


Re: [NTG-context] About margin notes

2021-12-14 Thread Hans Hagen via ntg-context

On 12/14/2021 11:58 AM, MANUEL GONZALEZ SUAREZ via ntg-context wrote:

Hi all:
I send this minimal example:

\mainlanguage [es]
\definefontfamily [mainface] [serif] [Gentium]
\setupbodyfont[mainface]
\setuppagenumbering[alternative=doublesided, location={footer,right}]

\setuplayout[textwidth=12cm,margin=2.5cm]
\setupmargindata[inmargin][style={\tfx\em}, location=outer,align=flushouter]


just use \inouter or define a new margindata class (see typo-mar.mkxl 
line 360 etc to see what is defined in what way)




\starttext

\chapter{Introduction}
\input{tufte}
\input{tufte}\inmargin{This is the first margin note}
\input{tufte}
\input{tufte}
\section{Whe start here}
\input{knuth}\inmargin{This is another margin note}
\input{tufte}\inmargin{This is another note in margin}
\input tufte
\chapter{Second chapter}
\section{First section}
\input{tufte}

\stoptext

Notes that appear in the right margin are justified, aligned with the 
text, but not the note in the left margin.How could I do this?

Thanks.
M. González.

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



--

-
  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] descriptions -- symbol between head and text

2021-12-14 Thread Wolfgang Schuster via ntg-context

Denis Maier via ntg-context schrieb am 14.12.2021 um 16:44:


Hi,

is there a way to get some text between the head and the text of a 
description. Enumerations have stoppers, but I couldn’t find an 
equivalent setting for descriptions:




\definedescription
  [deflist]
  [alternative=hanging,
   width=fit,
   headcommand=\groupedcommand{[BEFORE] }{ [AFTER]}]

\starttext

\startdeflist{Knuth}
\input knuth
\stopdeflist

\stoptext

Wolfgang

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

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


[NTG-context] descriptions -- symbol between head and text

2021-12-14 Thread Denis Maier via ntg-context
Hi,

is there a way to get some text between the head and the text of a description. 
Enumerations have stoppers, but I couldn't find an equivalent setting for 
descriptions:

The output should look roughly like this:

ABC: asdfasdfasdf jklöjklööjklö
CDE: asdfasdfasdf jklöjklöjklöö

Denis

%
\definedescription[deflist][
  headstyle=normal,
  style=normal,
  alternative=hanging,
  width=fit,
  margin=1cm,
  distance=0em,
  ]

\starttext
\startdeflist{ABC}
\input knuth
\stopdeflist

\startdeflist{CDE}
\input knuth
\stopdeflist

\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] how to setup path of ConTeXtLMTX for MacVim?

2021-12-14 Thread Jeong Dal via ntg-context
Dear Nicola, Jan-Erik, and John,

Although you have explained about the way out of my problem, 
I am still in the problem.

I need to learn more about vim.
I’ll do more try following your advice and  the explanation in wiki.

Thank you again for your help.

Best regards,

Dalyoung

> 2021. 12. 14. 오전 8:56, ntg-context-requ...@ntg.nl 작성:
> 
> Send ntg-context mailing list submissions to
>   ntg-context@ntg.nl
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   https://mailman.ntg.nl/mailman/listinfo/ntg-context
> or, via email, send a message with subject or body 'help' to
>   ntg-context-requ...@ntg.nl
> 
> You can reach the person managing the list at
>   ntg-context-ow...@ntg.nl
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ntg-context digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: how to setup path of ConTeXtLMTX for MacVim?
>  (Jan-Erik Hägglöf)
>   2. Re: circuitikz module seems broken (Hans Hagen)
>   3. Re: TeXWorks and synctex SOLVED (Bruce Horrocks)
> 
> 
> --
> 
> Message: 1
> Date: Tue, 14 Dec 2021 00:48:25 +0100
> From: Jan-Erik Hägglöf 
> To: mailing list for ConTeXt users 
> Subject: Re: [NTG-context] how to setup path of ConTeXtLMTX for
>   MacVim?
> Message-ID: <32566c08-2359-48df-b24c-2aa2e3d02...@gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> let g:context_mtxrun = 
> 'PATH=$HOME/context/context-osx-64/tex/texmf-osx-64/bin:$PATH mtxrun'
> 
> nnoremap å :ConTeXt
> nnoremap  ö :call tex#preview()
> nnoremap  ä
>\ :call tex#goto_texshop(expand("%:p"), line('.'), col('.'), 1, 1)
> 
> Here is my snippet from my personal context.vim file
> 
> I see that you have :! and that means that you instruct vim to execute a 
> shell command.
> 
> Just write :ConTeXt and it should work fine
> 
>> 13 dec. 2021 kl. 14:30 skrev Jeong Dal via ntg-context :
>> 
>> Dear John, Nicola,
>> 
>> I created a file context.vim under the folder ~/.vim/after/ftplugin/ which 
>> contains
>> 
>> map > :w:!ConTeXt
>> let g:context_mtxrun = 'PATH=$HOME/ConTeXtLM/tex/texmf-osx-64/bin:$PATH 
>> mtxrun'
>> let g:tex_flavor = "context"
>> 
>> The result is
>> 1. using “:ConTeXt”   issued an error message:  “E492: not an editor 
>> command: ConTeXt
>> 2. using “make” issued an error message: "No targets specified and no 
>> makefile found. …" 
>> Pressing C-h, compiling started and succesfully ended. However, it use 
>> /usr/local/texlive/… not LMTX tex folder.
>> 
>> Without context.vim, “:ConTeXt" and “:make" worked fine.
>> 
>> I’ll do more test. 
>> 
>> Thank you.
>> Best regards,
>> 
>> Dalyoung
>> 
>> ___
>> 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
>> ___
> 
> -- next part --
> An HTML attachment was scrubbed...
> URL: 
> <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20211214/d4e3531d/attachment-0001.htm>
> 
> --
> 
> Message: 2
> Date: Tue, 14 Dec 2021 00:54:44 +0100
> From: Hans Hagen 
> To: mailing list for ConTeXt users , Aditya
>   Mahajan 
> Subject: Re: [NTG-context] circuitikz module seems broken
> Message-ID: <41f06234-caab-6576-aa5e-8396c8ee3...@xs4all.nl>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
> 
> Hi,
> 
> This works here:
> 
> \usemodule[circuitikz]
> 
> \starttext
> \startcircuitikz
> \draw (0,2) to[I] (2,2);
> \stopcircuitikz
> \startcircuitikz
> \draw (0,2) to[I] (2,2);
> \stopcircuitikz
> \stoptext
> 
> with the attached. Make sure to put it in the regular context base path 
> and run mtxrun --generate.
> 
> Aditya: can you check if we load enough? We really need to get rid of 
> all these (kind of strange) t-* modules that somehow ended up in tikz 
> and it's way easier and robust to occasionally add something needed to 
> m-tikz than to try to catch hard-to-l

Re: [NTG-context] Regular online meet-up

2021-12-14 Thread Henning Hraban Ramm via ntg-context

We’re online NOW! You can still join us. ;)

Hraban

Am 07.12.21 um 15:29 schrieb Henning Hraban Ramm via ntg-context:

You’re invited to join next Tuesday, December 14th, 15:00 CET (UTC+1)

at https://lecture.senfcall.de/hen-rbr-rku-oke

ConTeXt users of all levels are welcome!

Hans offered to give a Q session again – please announce subjects 
you’d like to discuss ASAP, so that he can prepare.



I’d suggest to have a look at the recent changes to learn how they might 
affect us: math font settings, bars, some outdated modules, low-level 
stuff...



[Howto]
* No special software installation required; most modern browsers should 
work (WebRTC required).

* Open the above URL, accept the privacy statement,
* enter your name,
* click "join" (or "start" if you’re the first),
* click "with microphone", allow your browser to access it, check the 
audio.
(Some strings might be different, I see the German interface, you should 
get the main language of your browser.)
* Your microphone is muted if you join. Activate microphone and/or 
camera with the buttons at the bottom.

* Minimize the default presentation with the "screen" button, bottom right.

* If you’d like to share your screen or upload a file, you can make 
yourself the presenter: Click on your user name, change the setting, 
then you’ll see the "screen sharing" button beside the camera button; 
also there’s now "manage presentations" behind the "plus" button. Beware 
there is only one presenter, so don’t kill someone else’s presentation.


[Technical hints]
* Sound is usually better if you use a headset (less noise for everyone).

* Connection problems are mostly due to low bandwidth or high latency on 
your side, e.g. with mobile connections.

* If audio/video doesn’t work for you, you can still use the text chat.
* Screen sharing needs a lot of bandwidth.

* You can also join with a regular telephone (audio only, of course), 
call +49-6151-86275-22 (German landline); then you must enter a PIN that 
changes every time – if you need it, ask me for it via email. 
Mute/unmute your microphone with "0".


[Netiquette]
* Please use a name that we recognize from here. Some feel uncomfortable 
with anonymous lurkers.

* Mute your microphone while you’re not talking.
* It’s nice to show your face at least when you join.
* If there are connection problems, stop camera sharing.
* The room is set to “everyone’s a moderator“, I trust you...

Next time will be January 11th.

See you, Hraban

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

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


Re: [NTG-context] tikzplot displacement result [solved]

2021-12-14 Thread Jan-Erik Hägglöf via ntg-context
HI!

Thank you for your help.

The code was generated by Geogebra Classic 5 "export to pgf/tikz" function and 
it seems to have errors that needs to be solved in that application.

Now I have a good template to do this on my own.

Regards 

Jan-Erik

> 12 dec. 2021 kl. 15:53 skrev Gavin :
> 
> Hi Jan-Erik,
> 
> Use the \addplot command when you use pgfplots. The manual, pgfplots.pdf, is 
> quite good.
> 
> \setupbodyfont[10pt]
> \enableregime[utf]
> \usemodule[tikz]
> \usemodule[pgfplots]
> \usetikzlibrary[arrows]
> \setuppagenumbering[location=]
> \starttext
> \definecolor[ffvvqq][r=1.,g=0.,b=0.]
> \startTEXpage
> \starttikzpicture[line cap=round,line join=round,>=triangle 
> 45,x=1.0cm,y=1.0cm]
> \startaxis
> [
> x=1.0cm,y=1.0cm,
> axis lines=middle,
> ymajorgrids=true,
> xmajorgrids=true,
> xmin=-3.2488079448294145,
> xmax=34.87398305791419,
> ymin=-7.496155590728956,
> ymax=11.53265632858922,
> xtick={-3.0,-2.0,...,34.0},
> ytick={-7.0,-6.0,...,11.0},]
> %\clip(-3.2488079448294145,-7.496155590728956) rectangle 
> (34.87398305791419,11.53265632858922);
> \addplot[line 
> width=2.pt,color=ffvvqq,smooth,samples=100,domain=-3.2488079448294145:34.87398305791419]{x+3}
>  node[below right, pos= 0.1]{$h$};
> \stopaxis
> \stoptikzpicture
> \stopTEXpage
> \stoptext
> 
> I removed the clip command because it is causing a problem and is 
> unnecessary. I don’t know what you are trying to do with the node{$h$}, but I 
> made it a label on the plot.
> 
> The metafun graph module would also work for this plot, but it pgfplots is 
> more mature. I recommend using pgfplots unless you are already skilled with 
> metapost.
> 
> Hope that gets you going in the right direction.
> 
> Gavin
> 
> 
> 
>> On Dec 12, 2021, at 3:13 AM, Jan-Erik Hägglöf via ntg-context 
>>  wrote:
>> 
>> HI!
>> 
>> I’m trying to fit the funktion in the right place in this plot but it seems 
>> to get displaced.
>> 
>> What is wrong with the code?
>> 
>> Is there a way to do this in Metafun?
>> 
>> Thanks in advance
>> 
>> Sincerely 
>> 
>> Jan-Erik
>> 
>> 
>> 
>> \setupbodyfont[10pt]
>> \enableregime[utf]
>> \usemodule[tikz]
>> \usemodule[pgfplots]
>> \usetikzlibrary[arrows]
>> \setuppagenumbering[location=]
>> \starttext
>> \definecolor[ffvvqq][r=1.,g=0.,b=0.]
>> \startTEXpage
>> \starttikzpicture[line cap=round,line join=round,>=triangle 
>> 45,x=1.0cm,y=1.0cm]
>> \startaxis
>> [
>> x=1.0cm,y=1.0cm,
>> axis lines=middle,
>> ymajorgrids=true,
>> xmajorgrids=true,
>> xmin=-3.2488079448294145,
>> xmax=34.87398305791419,
>> ymin=-7.496155590728956,
>> ymax=11.53265632858922,
>> xtick={-3.0,-2.0,...,34.0},
>> ytick={-7.0,-6.0,...,11.0},]
>> \clip(-3.2488079448294145,-7.496155590728956) rectangle 
>> (34.87398305791419,11.53265632858922);
>> \draw[line 
>> width=2.pt,color=ffvvqq,smooth,samples=100,domain=-3.2488079448294145:34.87398305791419]
>>  plot(\x,{(\x)+3});
>> \draw[color=ffvvqq] (-3.5583519743388714,-0.7831230981304516) node {$h$};
>> \stopaxis
>> \stoptikzpicture
>> \stopTEXpage
>> \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
___


Re: [NTG-context] circuitikz module seems broken

2021-12-14 Thread Jan-Erik Hägglöf via ntg-context
HI ALL!

Finally it worked after complete reinstall

Tikz circuitikz pgfplots from ctan, updated LMTX to latest 2021.12.10

And replaced m-tikz.mkxl and m-circuitikz.mkxl with the attached files from 
Hans.

test2.log
Description: Binary data


Fingers crossed and praying and impressive help from Hans and Aditya

Many thanks

Sincerely

Jan-Erik

> 14 dec. 2021 kl. 04:57 skrev Aditya Mahajan via ntg-context 
> :
> 
> I tested with my course assignments (simple tikz block diagrams, lots of 
> pgdplots code) and everything works correctly. I haven't tested circuitikz; 
> the simple example fails and I am trying to understand why that is happening.
> 
>> Aditya: can you check if we load enough? 
> 
> I believe so. This is what my notes say (it is no fun to trace down these 
> files):
> 
> % Order in which files are loaded
> % 1. t-tikz
> % 1.1 t-pgf
> % 1.1.1 t-pgfcor
> % 1.1.1.1 t-pgfsys
> % 1.1.1.1.1 t-pgfrcs
> % 1.1.1.1.1.1 t-pgfmod  % Ignore
> % 1.1.1.1.1.2 pgfutil-common.tex(1)
> % 1.1.1.1.1.3 pgfutil-context.def   (2)
> % 1.1.1.1.1.4 pgfrcs.code.tex   (3)
> % 1.1.1.1.2 pgfsys.code.tex (4)
> % 1.1.1.1.3 pgfsyssoftpath.code.tex (5)
> % 1.1.1.1.4 pgfsysprotocol.code.tex (6)
> % 1.1.1.2 pgfcore.code.tex  (7)
> % 1.1.2 \usepgfmodule[shapes,plot]  (8)
> % 1.2 t-pgffor
> % 1.2.1 t-pgfrcs (already loaded)
> % 1.2.2 t-pgfkey
> % 1.2.2.1 pgfkeys.code.tex  (9)
> % 1.2.3 pgffor.code.tex(10)
> % 1.3 tikz.code.tex(11)
> 
> You also have pgfmoduleplot.code.tex, which I had missed.
> 
>> We really need to get rid of all
>> these (kind of strange) t-* modules that somehow ended up in tikz and it's 
>> way
>> easier and robust to occasionally add something needed to m-tikz than to try
>> to catch hard-to-locate-and-fix stuff in the tikz distribution. If needed we
>> can apply runtime patches too.
> 
> Agreed. I believe that the pgf module provides so many modules as a means to 
> be modular. For example, it possible to use `pgffor` module to get the for 
> loop syntax; or load `pgfkey` to get the key-value arguments, etc. But each 
> of these t-* files has so much boilerplate code, so I like your method 
> better. 
> 
>> (nyw, it looks like tikz creates empty pfg files during a run but that's
>> probbably has a reason)
> 
> tikz's ChangeLog has the following entries:
> 
> 2007-01-18:
>- Fixed .aux problems in plain and ConTeXt mode. Using .pgf as
>  extension now.
> 
> Grepping the source for `.pgf` gives:
> 
> tex/generic/pgf/utilities/pgfutil-context.def:  
> \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
> tex/generic/pgf/utilities/pgfutil-context.def:  \immediate\csname 
> openout\endcsname\pgfutil@auxout\jobname.pgf\relax
> tex/generic/pgf/utilities/pgfutil-plain.def:  
> \pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
> tex/generic/pgf/utilities/pgfutil-plain.def:  \immediate\csname 
> openout\endcsname\pgfutil@auxout\jobname.pgf
> 
> The file handle \pgfutil@auxout is used in the macro \pgfutil@writetoaux 
> which gets used in the driver files to write absolute positioning stuff to 
> file. For example, pgfsys-luatex.def has:
> 
> \def\pgfsys@markposition#1{%
>  \savepos%
>  \edef\pgf@temp{#1}%
>  \expandafter\pgfutil@writetoaux\expandafter{%
>
> \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\lastxpos}{\the\lastypos}}%
> }
> 
> This can easily be stored in the tuc file using two-pass data, but I don't 
> use this feature of tikz, so don't have examples to test this. 
> 
> @HenriMenke: Do you know if it is save to not create the `.pgf` file and 
> rewrite the above macro to read store the \pgfsyspdfmark table in the `.tuc` 
> file?
> 
> 
> 
> ___
> 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] Switching to righttoleft without changing margins of delimited text

2021-12-14 Thread Denis Maier via ntg-context
Great. So another thing to wikify. I was already wondering why there was no 
align parameter.

Denis

> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Dienstag, 14. Dezember 2021 14:09
> An: Maier, Denis Christian (UB) ; ntg-context@ntg.nl
> Betreff: Re: AW: [NTG-context] Switching to righttoleft without changing
> margins of delimited text
> 
> On 12/14/2021 10:57 AM, denis.ma...@unibe.ch wrote:
> > Hi Hans,
> >
> >  > -Ursprüngliche Nachricht-
> >
> >  > Von: Hans Hagen 
> >
> >  > Gesendet: Montag, 13. Dezember 2021 17:43
> >
> >  > An: mailing list for ConTeXt users 
> >
> >  > Cc: Maier, Denis Christian (UB) 
> >
> >  > Betreff: Re: [NTG-context] Switching to righttoleft without
> > changing margins
> >
> >  > of delimited text
> >
> >  >
> >
> >  > On 12/13/2021 5:25 PM, Denis Maier via ntg-context wrote:
> >
> >  > > Hi,
> >
> >  > >
> >
> > [... ]
> >
> >  > > %
> >
> >  > >
> >
> >  > > \righttext seems to change the locations of the margins, i.e.
> >
> >  > > leftmargin becomes rightmargin and vice-versa. That may be nice
> > in
> >
> >  > > some situations, but I need to keep the margins where they are.
> > Is
> >
> >  > > there a way to do this? (Maybe \righttoleft is the wrong
> > command?) I
> >
> >  > > thought I could define a new rtlblockquote with appropriate
> > settings, like
> >
> >  > so:
> >
> >  > >
> >
> >  > > \definedelimitedtext[rtlblockquote]
> >
> >  > >
> >
> >  > > \setupdelimitedtext[rtlblockquote]
> >
> >  > >
> >
> >  > >
> >
> >  > > [leftmargin=0em,rightmargin=1.5em,before={\righttoleft}]
> >
> >  > >
> >
> >  > > But maybe there’s a better way. Any hints?
> >
> >  > You switch directions when we're still in vertical mode, so you need:
> >
> >  >
> >
> >  > \startblockquote
> >
> >  >  \dontleavehmode\righttoleft\ignorespaces
> >
> >  >  \input knuth
> >
> >  > \stopblockquote
> >
> > I'm afraid this doesn't give the desired result. While this fixes the
> > inverted margins issue, this keeps the whole paragraph in LTR-mode.
> >
> > The expected result (created with rtlblockquote) would be this:
> >
> > So, the question remains: is a dedicated startstop-pair to achieve
> > this (what’s the proper name of those anyway? In latex these are
> > environments, but that feels odd in context)? Or are there easier solutions?
> i'll add support for the align parameter
> 
> \usealignparameter\delimitedtextparameter
> 
> but you need to adapth left/right margins to your taste as in the bidi concept
> (being part of a line) left and rightskip swap
> 
> \definedelimitedtext
>[mine]
>[align={flushleft,r2l},leftmargin=3cm,rightmargin=0cm]
> 
> \starttext
>  \input tufte
>  \startmine
>  \input tufte
>  \stopmine
>  \input tufte
> \stoptext
> 
> 
> 
> -
>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] Switching to righttoleft without changing margins of delimited text

2021-12-14 Thread Hans Hagen via ntg-context

On 12/14/2021 10:57 AM, denis.ma...@unibe.ch wrote:

Hi Hans,

 > -Ursprüngliche Nachricht-

 > Von: Hans Hagen 

 > Gesendet: Montag, 13. Dezember 2021 17:43

 > An: mailing list for ConTeXt users 

 > Cc: Maier, Denis Christian (UB) 

 > Betreff: Re: [NTG-context] Switching to righttoleft without changing 
margins


 > of delimited text

 >

 > On 12/13/2021 5:25 PM, Denis Maier via ntg-context wrote:

 > > Hi,

 > >

[... ]

 > > %

 > >

 > > \righttext seems to change the locations of the margins, i.e.

 > > leftmargin becomes rightmargin and vice-versa. That may be nice in

 > > some situations, but I need to keep the margins where they are. Is

 > > there a way to do this? (Maybe \righttoleft is the wrong command?) I

 > > thought I could define a new rtlblockquote with appropriate 
settings, like


 > so:

 > >

 > > \definedelimitedtext[rtlblockquote]

 > >

 > > \setupdelimitedtext[rtlblockquote]

 > >

 > >

 > > [leftmargin=0em,rightmargin=1.5em,before={\righttoleft}]

 > >

 > > But maybe there’s a better way. Any hints?

 > You switch directions when we're still in vertical mode, so you need:

 >

 > \startblockquote

 >  \dontleavehmode\righttoleft\ignorespaces

 >  \input knuth

 > \stopblockquote

I'm afraid this doesn't give the desired result. While this fixes the 
inverted margins issue, this keeps the whole paragraph in LTR-mode.


The expected result (created with rtlblockquote) would be this:

So, the question remains: is a dedicated startstop-pair to achieve this 
(what’s the proper name of those anyway? In latex these are 
environments, but that feels odd in context)? Or are there easier solutions?

i'll add support for the align parameter

   \usealignparameter\delimitedtextparameter

but you need to adapth left/right margins to your taste as in the bidi 
concept (being part of a line) left and rightskip swap


\definedelimitedtext
  [mine]
  [align={flushleft,r2l},leftmargin=3cm,rightmargin=0cm]

\starttext
\input tufte
\startmine
\input tufte
\stopmine
\input tufte
\stoptext



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


[NTG-context] About margin notes

2021-12-14 Thread MANUEL GONZALEZ SUAREZ via ntg-context
Hi all:
I send this minimal example:

\mainlanguage [es]
\definefontfamily [mainface] [serif] [Gentium]
\setupbodyfont[mainface]
\setuppagenumbering[alternative=doublesided, location={footer,right}]

\setuplayout[textwidth=12cm,margin=2.5cm]
\setupmargindata[inmargin][style={\tfx\em}, location=outer,align=flushouter]


\starttext

\chapter{Introduction}
\input{tufte}
\input{tufte}\inmargin{This is the first margin note}
\input{tufte}
\input{tufte}
\section{Whe start here}
\input{knuth}\inmargin{This is another margin note}
\input{tufte}\inmargin{This is another note in margin}
\input tufte
\chapter{Second chapter}
\section{First section}
\input{tufte}

\stoptext

Notes that appear in the right margin are justified, aligned with the text, but 
not the note in the left margin. How could I do this?
Thanks.
M. González.
___
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] Switching to righttoleft without changing margins of delimited text

2021-12-14 Thread Denis Maier via ntg-context
Hi Hans,



> -Ursprüngliche Nachricht-

> Von: Hans Hagen 

> Gesendet: Montag, 13. Dezember 2021 17:43

> An: mailing list for ConTeXt users 

> Cc: Maier, Denis Christian (UB) 

> Betreff: Re: [NTG-context] Switching to righttoleft without changing margins

> of delimited text

>

> On 12/13/2021 5:25 PM, Denis Maier via ntg-context wrote:

> > Hi,

> >

[... ]

> > %

> >

> > \righttext seems to change the locations of the margins, i.e.

> > leftmargin becomes rightmargin and vice-versa. That may be nice in

> > some situations, but I need to keep the margins where they are. Is

> > there a way to do this? (Maybe \righttoleft is the wrong command?) I

> > thought I could define a new rtlblockquote with appropriate settings, like

> so:

> >

> > \definedelimitedtext[rtlblockquote]

> >

> > \setupdelimitedtext[rtlblockquote]

> >

> >

> > [leftmargin=0em,rightmargin=1.5em,before={\righttoleft}]

> >

> > But maybe there’s a better way. Any hints?

> You switch directions when we're still in vertical mode, so you need:

>

> \startblockquote

>  \dontleavehmode\righttoleft\ignorespaces

>  \input knuth

> \stopblockquote



I'm afraid this doesn't give the desired result. While this fixes the inverted 
margins issue, this keeps the whole paragraph in LTR-mode.



[cid:image002.jpg@01D7F0D9.6EFC58C0]



The expected result (created with rtlblockquote) would be this:



[cid:image004.jpg@01D7F0D9.6EFC58C0]

So, the question remains: is a dedicated startstop-pair to achieve this (what’s 
the proper name of those anyway? In latex these are environments, but that 
feels odd in context)? Or are there easier solutions?

Denis


___
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] how to setup path of ConTeXtLMTX for MacVim?

2021-12-14 Thread Nicola via ntg-context
On 2021-12-13, Jeong Dal via ntg-context  wrote:
> Dear John, Nicola,
>
> I created a file context.vim under the folder ~/.vim/after/ftplugin/ which 
> contains
>
> map > :w:!ConTeXt
> let g:context_mtxrun = 'PATH=$HOME/ConTeXtLM/tex/texmf-osx-64/bin:$PATH 
> mtxrun'
> let g:tex_flavor = "context"
>
> The result is
> 1. using “:ConTeXt”   issued an error message:  “E492: not an editor command: 
> ConTeXt

:ConTeXt is a buffer-local command, which means that it is available
only when the active buffer has filetype `context`. Make sure that this
is the case before trying to typeset.

> 2. using “make” issued an error message: "No targets specified and no 
> makefile found. …"

Again, I believe that you are typing those commands with an active
buffer whose filetype is not `context`.

> Pressing C-h, compiling started and succesfully ended. However, it use
> /usr/local/texlive/… not LMTX tex folder.

As already pointed out, ! invokes a shell command. Remove the
exclamation mark.

Nicola


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