Re: [NTG-context] Questions about mathfence

2013-07-30 Thread Aditya Mahajan

On 2013-07-29, at 5:34 AM, Hans Hagen pra...@wxs.nl wrote:

 On 7/29/2013 3:24 AM, Aditya Mahajan wrote:
 Hi,
 
 Some questions/remarks about math fences
 
 1. When using
 
 \definemathfence[colorbracket][bar][middle=0x7C,color=red,
 command=yes]
 \starttext
 
 \startformula
   \colorbracket{\frac {a}{b}\fence a = b}^n
 \stopformula
 
 \stoptext
 
 The delimiter is of the wrong color (black instead of red), and the
 clause after \fence is red. I am doing something wrong or is it a bug.
 
 Just not yet done .. coloring such math thingies is somewhat tricky ... added.

Thanks.

 2. For some types of expressions, for example, probability, the middle
 delimiter should have the space similar to mathrel, rather than mathord.
 For example, while typing I often use:
 
 \Pr\left( X = \frac {a}{b} \,\middle|\, Y = \frac{c}{d} \right)
 
 Would it be worthwhile to add these extra spaces by default (not sure
 what is the convention in physics/quantum mechanics for bra and ket
 notation) or as an option.
 
 I'll add \mskip\thinmuskip around the middle ... no clue what key/value to 
 use so we can wait tile someone complaints

Thanks.

 3. Finally, why are the default values of left, middle, and right =
 0x2E. Isn't 0x7C a better default?
 
 Well, the period is (for tex) special in the sense that it is a nop so if you 
 only want
 
 (
 
 and no
 
 )
 
 then explaining to a user that a period is to be used to nil the right symbol 
 is somewhat less troublesome.
 
 One sets up the wanted symbols anyway.

Of course. I use unmatched delimiters so infrequently that I forgot about it. 

Math fences replace most of the functionality of my old mathsets module. The 
only missing feature is the text key, but that is a specialized use case, so 
I'll just update mathsets so that it uses math fences in the background. 

I it really necessary to use Unicode characters to specify left, right, etc? I 
ink that most math users will be more comfortable using literal symbols, 
{,[,(,|, etc or tex names \Vert, \vert, etc. 

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Questions about mathfence

2013-07-30 Thread Hans Hagen

On 7/30/2013 3:28 PM, Aditya Mahajan wrote:


I it really necessary to use Unicode characters to specify left, right, etc? I 
ink that most math users will be more comfortable using literal symbols, 
{,[,(,|, etc or tex names \Vert, \vert, etc.


currently yes ... i hate to introduce all kind of extra tests for what 
value is given and by permitting \commands we also become less robust


keep in mind that one can clone

\definemathfence [fancybracket] [bracket] [command=yes,color=red]

so if there is a properly named base set (i tend to clean expressive 
verbose names, at least as base commands instead of all the weird ones 
that showed up over time (along with entities with slightly different 
names) ... clean math as start and we can always add dirty math as 
instances


Hans

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Questions about mathfence

2013-07-30 Thread Aditya Mahajan

On Tue, 30 Jul 2013, Hans Hagen wrote:


On 7/30/2013 3:28 PM, Aditya Mahajan wrote:

I it really necessary to use Unicode characters to specify left, right, 
etc? I ink that most math users will be more comfortable using literal 
symbols, {,[,(,|, etc or tex names \Vert, \vert, etc.


currently yes ... i hate to introduce all kind of extra tests for what value 
is given and by permitting \commands we also become less robust


In the mathsets module, I assumed that a valid math delimiter is used as 
the value for left, right, and middle keys. In that case, no extra test it 
needed.



keep in mind that one can clone

\definemathfence [fancybracket] [bracket] [command=yes,color=red]

so if there is a properly named base set (i tend to clean expressive verbose 
names, at least as base commands instead of all the weird ones that showed up 
over time (along with entities with slightly different names) ... clean math 
as start and we can always add dirty math as instances


Agreed. Unmatched brackets are not so common, so this the default set is a 
reasonable starting point.


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Math fallback

2013-07-30 Thread Aditya Mahajan
Is it possible to use the fallback mechanism for math fonts? For example, 
I am using Neo Euler for math which has a few missing glyphs. Can I use 
Cambria (or Xits) as a fallback font for missing glyphs.


I am using the simplefonts module, but I am happy to write a typescript 
file if that makes things easier. I do not really want to define a new 
virtual font.


Aditya

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Inserting verbatim text in a figure and framed.

2013-07-30 Thread john Culleton
Here is my code so far. I want to show a file in verbatim form. It
compiles but here is no frame around the text and there is no caption.

\startbuffer[ex1]
\typefile[]{example1.tex}
\stopbuffer

\placefigure[here][fig:ex1]
{Example 1}
{\externalfigure[ex1.buffer][width=.75\textwidth]}
--

I am following the example at the foot of page 303 in the manual.
Any suggestions?

John Culleton

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Inserting verbatim text in a figure and framed.

2013-07-30 Thread Peter Münster
On Tue, Jul 30 2013, john Culleton wrote:

 Here is my code so far. I want to show a file in verbatim form. It
 compiles but here is no frame around the text and there is no caption.

Hi,

this works here:

--8---cut here---start-8---
\starttext
\startbuffer[ex1]
\typefile[]{test.tex}
\stopbuffer
\placefigure[here][fig:ex1]
{Example 1}
{\framed{\externalfigure[ex1.buffer][width=.75\textwidth]}}
\stoptext
--8---cut here---end---8---

ConTeXt version: 2013.05.28 00:36

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Inserting verbatim text in a figure and framed.

2013-07-30 Thread Wolfgang Schuster

Am 30.07.2013 um 21:30 schrieb Peter Münster pmli...@free.fr:

 On Tue, Jul 30 2013, john Culleton wrote:
 
 Here is my code so far. I want to show a file in verbatim form. It
 compiles but here is no frame around the text and there is no caption.
 
 Hi,
 
 this works here:
 
 --8---cut here---start-8---
 \starttext
 \startbuffer[ex1]
 \typefile[]{test.tex}
 \stopbuffer
 \placefigure[here][fig:ex1]
 {Example 1}
 {\framed{\externalfigure[ex1.buffer][width=.75\textwidth]}}
 \stoptext
 --8---cut here---end---8---

Why do you use a buffer?

\starttext
\startplacefigure[reference=fig:ex1,title=Example 1]
  \framed[align=flushleft,width=.75\textwidth]{\typefile{test.tex}}
\stopplacefigure
\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Math accents set too close to capital

2013-07-30 Thread Michael Murphy
Hello all,

I'm trying to typeset 'H' with a circumflex (or hat) in math mode, but the 
result is rather ugly when not using latin-modern. I've tried to redefine the 
\hat macro to move the accent up a bit using \topaccent: is this the best 
approach? Having to nest '$' does not seem right at all. (Also, for some reason 
although I find \mathhat in enco-ini.mkiv, when I try to use it I get undefined 
control sequence.)

Thanks,
Michael

\starttypescript [mathfont]
  \definetypeface [mathfont] [mm] [math]  [palatino]  [default] [rscale=1.0]
\stoptypescript
\usetypescript[mathfont]
\setupbodyfont[mathfont]

\starttext

$\hat{H}$

\def\hat#1{\topaccent{3pt}{0}{90}{\textcircumflex}{$#1$}}

$\hat{H}$

\stoptext

--

Michael Murphy
murphy...@gmail.com



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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Change URL color to match layer

2013-07-30 Thread Michael Ash
I would like to change the color of URL's in parts of a document.

In particular I am using the letter module and would like to have the color
of URL's match the color of text in the letterhead and then change to match
the color in the main body of the letter.

I can set the URL color once with \setupinteraction but I do not see how to
change it thereafter.

Thank you very much for your guidance.

Best,
Michael



\usemodule[letter]

\setupinteraction[state=start,color=black]
%% \setupinteraction[state=start,color=red]

%% Would like this URL to match the color of the return address (location)
\useURL[author-email][mailto:m...@econs.umass.edu][][m...@econs.umass.edu]
%% Would like this URL to match the color of the recipient's address
(address)
\useURL[recipient-email][mailto:addres...@gmail.com][][addres...@gmail.com]
%% Would like this URL to match the color of the main body
\useURL[knuthbio][
http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth
]

\setupletter[
  name={Michael Ash},
  email={\from[author-email]}
  ]

\setupletter[signature={Michael Ash}]

\defineletterelement[layer][location][example]{\correspondenceparameter{name}
\correspondenceparameter{email}\par}
\setupletterlayer[location][alternative=example,color=red]

\defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par}
\setupletterlayer[address][alternative=example,color=blue]

\starttext
\startletter[
  toname={The Addressee\\\from[recipient-email]},
  opening={Dear Addressee:},
  closing={Best regards,}]

  Enjoy \from[knuthbio]

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

Re: [NTG-context] Change URL color to match layer

2013-07-30 Thread Wolfgang Schuster

Am 30.07.2013 um 23:57 schrieb Michael Ash m...@econs.umass.edu:

 I would like to change the color of URL's in parts of a document.
 
 In particular I am using the letter module and would like to have the color 
 of URL's match the color of text in the letterhead and then change to match 
 the color in the main body of the letter.
 
 I can set the URL color once with \setupinteraction but I do not see how to 
 change it thereafter.

You can disable the default style and color with 
\setupinteraction[color=,style=], the links will now use the attributes of the 
surrounding text.

Wolfgang

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Inserting verbatim text in a figure and framed.

2013-07-30 Thread Peter Münster
On Tue, Jul 30 2013, Wolfgang Schuster wrote:

 Am 30.07.2013 um 21:30 schrieb Peter Münster pmli...@free.fr:

 \startbuffer[ex1]
 \typefile[]{test.tex}
 \stopbuffer

 Why do you use a buffer?

Copy + paste ... ;)  (brain was somewhere else... ;)

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Change URL color to match layer

2013-07-30 Thread Michael Ash
I think that I have found an answer:  in the \setupinteraction command that
manages URL's, hyperlinks, PDF properties, etc. include
color=,contrastcolor=,


\usemodule[letter]

%% Would like this URL to match the color of the return address (location)
\useURL[author-email][mailto:aut...@myhome.com][][aut...@myhome.com]
%% Would like this URL to match the color of the recipient's address
(address)
\useURL[recipient-email][mailto:addres...@gmail.com][][addres...@gmail.com]
%% Would like this URL to match the color of the main body
\useURL[knuthbio][
http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth
]

\setupinteraction[state=start,color=,contrastcolor=,style=normal]

\setupletter[
  name={Michael Ash},
  email={\from[author-email]}
  ]

\setupletter[signature={Michael Ash}]

\defineletterelement[layer][location][example]{\correspondenceparameter{name}
\correspondenceparameter{email}\par}
\setupletterlayer[location][alternative=example,color=red]

\defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par}
\setupletterlayer[address][alternative=example,color=blue]

\starttext
\startletter[
  toname={The Addressee\\\from[recipient-email]},
  opening={Dear Addressee:},
  closing={Best regards,}]

  Enjoy \from[knuthbio]

\stopletter
\stoptext



On Tue, Jul 30, 2013 at 5:57 PM, Michael Ash m...@econs.umass.edu wrote:

 I would like to change the color of URL's in parts of a document.

 In particular I am using the letter module and would like to have the
 color of URL's match the color of text in the letterhead and then change to
 match the color in the main body of the letter.

 I can set the URL color once with \setupinteraction but I do not see how
 to change it thereafter.

 Thank you very much for your guidance.

 Best,
 Michael



 \usemodule[letter]

 \setupinteraction[state=start,color=black]
 %% \setupinteraction[state=start,color=red]

 %% Would like this URL to match the color of the return address
 (location)
 \useURL[author-email][mailto:m...@econs.umass.edu][][m...@econs.umass.edu]
 %% Would like this URL to match the color of the recipient's address
 (address)
 \useURL[recipient-email][mailto:addres...@gmail.com][][addres...@gmail.com
 ]
 %% Would like this URL to match the color of the main body
 \useURL[knuthbio][
 http://en.wikipedia.org/wiki/Donald_Knuth][][http://en.wikipedia.org/wiki/Donald_Knuth
 ]

 \setupletter[
   name={Michael Ash},
   email={\from[author-email]}
   ]

 \setupletter[signature={Michael Ash}]

 \defineletterelement[layer][location][example]{\correspondenceparameter{name}
 \correspondenceparameter{email}\par}
 \setupletterlayer[location][alternative=example,color=red]


 \defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par}
 \setupletterlayer[address][alternative=example,color=blue]

 \starttext
 \startletter[
   toname={The Addressee\\\from[recipient-email]},
   opening={Dear Addressee:},
   closing={Best regards,}]

   Enjoy \from[knuthbio]

 \stopletter
 \stoptext




-- 
Michael Ash, Chair, Department of Economics
Professor of Economics and Public Policy
University of Massachusetts Amherst
Amherst, MA 01003
Email m...@econs.umass.edu
Tel +1-413-545-2590 Twitter https://twitter.com/michaelaoash
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Left-justifying the date in the letter module

2013-07-30 Thread Michael Ash
I am still having a problem with left-justifying the date in letters.  The
date is towards the left but is aligned several mm to the right of the
other text.


\usemodule[letter]

%% Omit the word Date, attempt to left-justify date (doesn't align
perfectly)
\setupletterlayer[reference][alternative=c]

\defineletterelement[layer][address][example]{\correspondenceparameter{toname}\par}
\setupletterlayer[address][alternative=example]

\starttext
\startletter[
  toname={The Addressee},
  opening={Dear Addressee:},
  closing={Best regards,},
  signature={I.M. Sender}]

  \input knuth

\stopletter
\stoptext




BTW are the values for the alternative key (example, e, c, etc.)
documented somewhere?

Thank you again.

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___