Re: [NTG-context] getting metafun positions within (displayed) math mode

2017-11-16 Thread Nigel King
Wow. I learnt about Maxwell's Equation 48 years ago. I never understood it then 
nor on the intervening time despite sometimes helping design antennas. The 
picture and its annotation definitely helps creating clarity. For my twopenneth 
the effort is very worthwhile.

Thanks

---
Nigel King
Mob: +44 7917 803879
Work:+44 1364 655516


> On 16 Nov 2017, at 21:10, Sanjoy Mahajan  wrote:
> 
> Dear ConTeXters,
> 
> For my sins, and to make students unhappy all over the world, I am
> writing another book: _A Student's Guide to Newton's Laws of Motion_
> (for Cambridge University Press, aka CUP).  As partial compensation, I
> convinced CUP that I may typeset it in ConTeXt and deliver them PDF.
> 
> Being hopefully a guide actually useful to students, it will annotate
> every symbol in important equations, a feature cribbed from the first
> book of the _Student's Guide_ series, Dan Fleisch's _A Student's Guide
> to Maxwell's Equations_.
> 
> I've attached an image of what such an annotated equation looks like
> (from page 2 of Fleisch's book).  It's like a labeled part diagram (say,
> for a laptop), where each part (here, each symbol) is connected with an
> line to its explanation.
> 
> I'm trying to do so with a combination of ConTeXt, MetaPost/MetaFun,
> TikZ, and whatever else might work.  But I am a bit stuck at the
> following spot.
> 
> My plan is to use MetaFun to get the coordinates of each symbol in a
> (displayed) equation and then, with MetaFun, connect those symbols to
> mini-paragraphs of explanation that surround the equation.
> 
> But I am stuck on how to use \hpos in math mode. I'd like to do
> something like:
> 
> \startformula
> \hpos{n1}{\sum}_{\hpos{n2}{0}}^{\hpos{n3}{1}}
> \stopformula
> 
> to get the locations of the nodes n1, n2, and n3 without interfering
> with the math typesetting -- e.g., the engine should still know that
> \sum is in display-math mode, so it should be large and have its sub-
> and super-scripts below and above it, rather than next to it.
> 
> However, the \hpos hides its argument in an \hbox, and thus hides it
> from the math layout.  Thus, I have to do something like this minimal
> example:
> 
> \starttext
> \startformula
>  \sum_0^1  % what it should look like
>  \quad
>  \hpos{n1}{$\displaystyle\sum$}_{\hpos{n2}{$0$}}^{\hpos{n3}{$1$}}
> \stopformula
> \stoptext
> 
> The hpos'ed version after the \quad looks different, even after the
> \displaystyle hack.
> 
> Is there a version of \hpos for math mode?  That would be the cleanest
> solution, because who knows what else would be needed for other cases,
> even if the limits can be placed correctly.
> 
> Or is there a better way to annotate equations?
> 
> (TikZ seems to have the same issue, in that it cannot see into equations.)
> 
> Regards,
> -- 
> -Sanjoy
> 
> 
> Save Long Wharf Park in Boston Harbor!
> 
> 
> Six reasoning tools to make hard problems easy.
> 
> 
> ___
> 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] Setting the footnote symbol

2017-11-16 Thread Idris Samawi Hamid ادريس سماوي حامد

On Thu, 16 Nov 2017 11:40:40 -0700, Pablo Rodriguez  wrote:


On 11/16/2017 07:18 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
Yes, but the point of this scenario is to do everything with  
\definefont.

pagella is just for purposes of a MWE: otherwise the scenario calls for
using a font that has no associated typescript.

Put another way: We want to set up full control over font-style of each
element of a footnote using only \definefont. If that's impossible, it
would be good to know that as well as why.


I must confess that this is far beyond my knowledge. I never used
\definefont.


Mainly useful for testing for bugs in other macros etc..


If you don’t mind using \definefontfamily, this works fine:

  \definefontfamily[lareba][rm][Larabiefont]

  \setupnote[footnote][textstyle={\setupbodyfont[lareba, 12pt]\high}

No previous typescript is required (Larabiefont doesn’t have one).


Yes, SimpleFonts work, but then might as well set the whole document that  
way -)



But for explanations, I’m afraid I’m only an average user :-(.


Pablo, you are anything but an average user :-) Many thanks for your time  
and help.


Best wishes
Idris
--
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
___

[NTG-context] getting metafun positions within (displayed) math mode

2017-11-16 Thread Sanjoy Mahajan
Dear ConTeXters,

For my sins, and to make students unhappy all over the world, I am
writing another book: _A Student's Guide to Newton's Laws of Motion_
(for Cambridge University Press, aka CUP).  As partial compensation, I
convinced CUP that I may typeset it in ConTeXt and deliver them PDF.

Being hopefully a guide actually useful to students, it will annotate
every symbol in important equations, a feature cribbed from the first
book of the _Student's Guide_ series, Dan Fleisch's _A Student's Guide
to Maxwell's Equations_.

I've attached an image of what such an annotated equation looks like
(from page 2 of Fleisch's book).  It's like a labeled part diagram (say,
for a laptop), where each part (here, each symbol) is connected with an
line to its explanation.

I'm trying to do so with a combination of ConTeXt, MetaPost/MetaFun,
TikZ, and whatever else might work.  But I am a bit stuck at the
following spot.

My plan is to use MetaFun to get the coordinates of each symbol in a
(displayed) equation and then, with MetaFun, connect those symbols to
mini-paragraphs of explanation that surround the equation.

But I am stuck on how to use \hpos in math mode. I'd like to do
something like:

\startformula
\hpos{n1}{\sum}_{\hpos{n2}{0}}^{\hpos{n3}{1}}
\stopformula

to get the locations of the nodes n1, n2, and n3 without interfering
with the math typesetting -- e.g., the engine should still know that
\sum is in display-math mode, so it should be large and have its sub-
and super-scripts below and above it, rather than next to it.

However, the \hpos hides its argument in an \hbox, and thus hides it
from the math layout.  Thus, I have to do something like this minimal
example:

\starttext
\startformula
  \sum_0^1  % what it should look like
  \quad
  \hpos{n1}{$\displaystyle\sum$}_{\hpos{n2}{$0$}}^{\hpos{n3}{$1$}}
\stopformula
\stoptext

The hpos'ed version after the \quad looks different, even after the
\displaystyle hack.

Is there a version of \hpos for math mode?  That would be the cleanest
solution, because who knows what else would be needed for other cases,
even if the limits can be placed correctly.

Or is there a better way to annotate equations?

(TikZ seems to have the same issue, in that it cannot see into equations.)

Regards,
-- 
-Sanjoy


Save Long Wharf Park in Boston Harbor!


Six reasoning tools to make hard problems easy.

___
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] org-mode & ConTeXt

2017-11-16 Thread Jörg Hagmann
Hi Gour,

I'm using org-mode for almost everything. If I need a pdf-file of, e.g., a
subtree, I do the following:

1. Export the subtree as an org-file (the directory, title etc. of the
exported file are specified as :PROPERTIES:)

2. I process the exported file with a ruby-script I wrote myself. It does
what I need, i.e. very basic things. More complicated stuff can be included
in the original org-file, as context-commands, provided they don't bother
you. The result is a .tex file.

3. process the tex file with context.

I tried Pandoc, but concluded it was easier to concoct something myself.

Cheers, Jörg

- 
Prof. Jörg Hagmann-Zanolari MD
Luftmattstrasse 25
CH-4052 Basel
Switzerland
Phone (private) +41 (061) 312 6031
www.repetitorium-biochemie.ch

> Date: Tue, 14 Nov 2017 08:49:53 +
> From: Gour 
> To: "ntg-context@ntg.nl" 
> Subject: [NTG-context] org-mode & ConTeXt
>
>
> Hello,
>
> I plan to start working on series lectures/presentations for educational
> purposes and I'm going to use ConTeXt for typesetting the whole
> material.
>
> Considering that for smaller articles (e.g. blog posts) I use Emacs'
> org-mode (with Hugo static-site-generator) and spend fair amount of
> time with org-mode, I wonder whether you in general can recommend using
> org-mode for collecting notes and then export to ConTeXt (via Pandoc)?
>
> Another concern - disclaimer: still haven't go through excellent
> Bibliographies manual - is whether it is possible to e.g. use org-ref
> (https://github.com/jkitchin/org-ref) - orgmode's support for RefTeX
> (https://www.gnu.org/software/auctex/reftex.html) which is mentioned in
> the wiki (http://wiki.contextgarden.net/Reftex) or is is better to
> excusively work within the scope of ConTeXt?
>
> I've also noticed that Bibliogrpahies manual does mention JabRef and
> Zotero for managing databases, so I'd appreciate if ConTeXt users can
> share their experience in regard?
>
>
> Sincerely,
> Gour
>
> -- 
> An intelligent person does not take part in the sources of misery,
> which are due to contact with the material senses. O son of Kuntī,
> such pleasures have a beginning and an end, and so the wise man does
> not delight in them.
>
>
> ___
> 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] Setting the footnote symbol

2017-11-16 Thread Pablo Rodriguez
On 11/16/2017 07:18 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> Yes, but the point of this scenario is to do everything with \definefont.  
> pagella is just for purposes of a MWE: otherwise the scenario calls for  
> using a font that has no associated typescript.
> 
> Put another way: We want to set up full control over font-style of each  
> element of a footnote using only \definefont. If that's impossible, it  
> would be good to know that as well as why.

I must confess that this is far beyond my knowledge. I never used
\definefont.

If you don’t mind using \definefontfamily, this works fine:

  \definefontfamily[lareba][rm][Larabiefont]

  \setupnote[footnote][textstyle={\setupbodyfont[lareba, 12pt]\high}

No previous typescript is required (Larabiefont doesn’t have one).

But for explanations, I’m afraid I’m only an average user :-(.

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

Re: [NTG-context] Setting the footnote symbol

2017-11-16 Thread Idris Samawi Hamid ادريس سماوي حامد

On Thu, 16 Nov 2017 11:11:50 -0700, Pablo Rodriguez  wrote:


On 11/16/2017 06:57 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
On Thu, 16 Nov 2017 10:47:13 -0700, Pablo Rodriguez   
wrote:

[...]
You should rewrite your \setupnote command in the following way:

  \setupnote[footnote][textcommand={\PagellaRegularSmall\high}]


Many thanks. This fixes the height, but we lose the styling of the
reference symbol in the main text - see attached.


I see. One of these commands should work:

\setupnote[footnote][textcommand={\switchtobodyfont[pagella, 12pt]\high}

\setupnote[footnote][textcommand={\setupbodyfont[pagella, 12pt]\high}


Yes, but the point of this scenario is to do everything with \definefont.  
pagella is just for purposes of a MWE: otherwise the scenario calls for  
using a font that has no associated typescript.


Put another way: We want to set up full control over font-style of each  
element of a footnote using only \definefont. If that's impossible, it  
would be good to know that as well as why.


Idris
--
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] Setting the footnote symbol

2017-11-16 Thread Pablo Rodriguez
On 11/16/2017 06:57 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> On Thu, 16 Nov 2017 10:47:13 -0700, Pablo Rodriguez  wrote:
>> [...]
>> You should rewrite your \setupnote command in the following way:
>>
>>   \setupnote[footnote][textcommand={\PagellaRegularSmall\high}]
> 
> Many thanks. This fixes the height, but we lose the styling of the  
> reference symbol in the main text - see attached.

I see. One of these commands should work:

\setupnote[footnote][textcommand={\switchtobodyfont[pagella, 12pt]\high}

\setupnote[footnote][textcommand={\setupbodyfont[pagella, 12pt]\high}

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

Re: [NTG-context] Setting the footnote symbol

2017-11-16 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear Pablo,

On Thu, 16 Nov 2017 10:47:13 -0700, Pablo Rodriguez  wrote:


On 11/16/2017 06:11 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

What do we need to do to get a raised footnote symbol in the main text
(line 6 of the pdf)? Thanks in advance.


BTW, I mixed the number which had to be raised.

By default, the textcommand option has a value of \high in \setupnote.

You should rewrite your \setupnote command in the following way:

  \setupnote[footnote][textcommand={\PagellaRegularSmall\high}]


Many thanks. This fixes the height, but we lose the styling of the  
reference symbol in the main text - see attached.


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

test-note.pdf
Description: Adobe PDF document


test-note.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] Setting the footnote symbol

2017-11-16 Thread Pablo Rodriguez
On 11/16/2017 06:11 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> What do we need to do to get a raised footnote symbol in the main text  
> (line 6 of the pdf)? Thanks in advance.

BTW, I mixed the number which had to be raised.

By default, the textcommand option has a value of \high in \setupnote.

You should rewrite your \setupnote command in the following way:

  \setupnote[footnote][textcommand={\PagellaRegularSmall\high}]

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

Re: [NTG-context] Setting the footnote symbol

2017-11-16 Thread Pablo Rodriguez
On 11/16/2017 06:11 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> Der gang,
> 
> For the following \definefont scenario, the footnote symbol in the main  
> text is not raised:
> 
> ===
> \setuppapersize[letter][letter]

Dear Idris,

which is the difference between your command above and the next one?

  \setuppapersize[letter]

> \setupnotation[footnote][style={\PagellaRegularSmall},
> titlestyle={\PagellaRegularSmall}]  % Why is this necessary?

For what is this required? Or what do you want to achieve with the
titlestyle option?

> What do we need to do to get a raised footnote symbol in the main text  
> (line 6 of the pdf)?

The default value for the numbercommand option in \setupnotation is \high.

If you redefine it, it should read:

   numbercommand={\PagellaRegularSmall\high},

Otherwise you are removing the raising command.

I hope it helps,

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

[NTG-context] Setting the footnote symbol

2017-11-16 Thread Idris Samawi Hamid ادريس سماوي حامد

Der gang,

For the following \definefont scenario, the footnote symbol in the main  
text is not raised:


===
\setuppapersize[letter][letter]

% \setupbodyfont[schola,12pt]
\definefont[PagellaRegular] [texgyrepagella-regular.otf at 14pt]
\definefont[PagellaRegularSmall][texgyrepagella-regular.otf at 12pt]

\setupwhitespace[big]
\setuplayout[width=4.5in,height=5.5in,backspace=2in]

\setupnotation[footnote][style={\PagellaRegularSmall},   % text style  
of the footnote text
 numbercommand=\PagellaRegularSmall, % symbol-font  
style in the footnote
 titlestyle={\PagellaRegularSmall}]  % Why is this  
necessary?
\setupnote[footnote][textcommand={\PagellaRegularSmall}] % symbol-font  
style in the main text


\noheaderandfooterlines

\starttext \PagellaRegular
\startframedtext[width=4.5in,offset=0pt]
\startlocalfootnotes
Hence in Met VII, where Aristotle debates with masterly penetration how to  
meet the claim of substance to be at once universal, intelligible, and  
definable, and at the same time unique and individual, the singular is at  
length superseded on the throne of substance by the infima species.

\startfootnote
Or \quotation{materiate form,} as Aristotle also calls it because it  
attains existence in a material embodiment and cannot be defined without  
reference to matter, though matter is itself indefinable. The discussion  
is interspersed with criticism of the forms. Aristotle attacks the theory  
as a purely arbitrary individualisation of universals, and the detail of  
the polemic, as well as the context, suggest that he is attacking Plato  
not for divorcing infimae species from singulars, but for separating and  
reifying genera taken apart from species. [\textellipsis]

\stopfootnote\
That is to say the genus is taken to be fully actualised in its infimae  
species, and its further differentiation into singulars is treated as  
irrelevant.


\placelocalfootnotes
\stoplocalfootnotes
\stopframedtext
\stoptext
===

What do we need to do to get a raised footnote symbol in the main text  
(line 6 of the pdf)? Thanks in advance.


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

test-note.pdf
Description: Adobe PDF document


test-note.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
___