Re: [NTG-context] A problem with autopunctuation
Hi, all, Hans has done some work on autopunctuation which made it into yesterday's beta (2012.12.03 11:33). This includes a 'set it like I type it' mode people have been asking for. There are now three options to \setupmathematics[autopunctuation=...]: * autopunctuation=no — default TeX behaviour. Commas get a thin space, periods get nothing. * autopunctuation=yes — manual control for commas. Commas followed by a space get a thin space; periods, and commas followed by something else, do not. * autopunctuation=all — like `yes`; and periods, too, get a thin space unless suppressed Example code below, example output attached, and the behaviour is documented at http://wiki.contextgarden.net/Command/setupmathematics Cheers, Sietse \defineparagraphs[asdf][n=3] \startTEXpage[offset=2mm] \startasdf \setupmathematics[autopunctuation=no] autopunctuation=no \starttabulate[] \NC input \NC desired \NC output \NC \NR \NC 2,5 \NC 2, 5 \NC $2,5$ \NC \NR \NC 2, 5 \NC 2, 5 \NC $2, 5$ \NC \NR \NC 2.5 \NC 2.5 \NC $2.5$ \NC \NR \NC 2. 5 \NC 2.5 \NC $2. 5$ \NC \NR \stoptabulate \asdf \setupmathematics[autopunctuation=yes] autopunctuation=yes \starttabulate[] \NC input \NC desired \NC output \NC \NR \NC 2,5 \NC 2,5 \NC $2,5$ \NC \NR \NC 2, 5 \NC 2, 5 \NC $2, 5$ \NC \NR \NC 2.5 \NC 2.5 \NC $2.5$ \NC \NR \NC 2. 5 \NC 2.5 \NC $2.5$ \NC \NR \stoptabulate \asdf \setupmathematics[autopunctuation=all] autopunctuation=all \starttabulate[] \NC input \NC desired \NC output \NC \NR \NC 2,5 \NC 2,5 \NC $2,5$ \NC \NR \NC 2, 5 \NC 2, 5 \NC $2, 5$ \NC \NR \NC 2.5 \NC 2.5 \NC $2.5$ \NC \NR \NC 2. 5 \NC 2. 5 \NC $2. 5$ \NC \NR \stoptabulate \stopasdf \stopTEXpage punctuation-001.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A problem with autopunctuation
Am 03.11.2012 um 21:15 schrieb Marcin Borkowski mb...@wmi.amu.edu.pl: Dnia 2012-11-03, o godz. 14:04:30 Andres Conrado ela...@chiquitico.org napisał(a): In dont't really know why you think it should render differently. Everything TeX is supposed to ignore white spaces in math, AFAIK. Yep, but that's no TeX! Take a look at math-ini.mkiv, lines 873nn. And what do you think the example will tell us? \starttext \enablemathpunctuation $(1,2) (1, 2) (1{,}2) \hbox{foo, not bar}$ \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A problem with autopunctuation
Dnia 2012-11-04, o godz. 11:04:52 Wolfgang Schuster wolfgang.schus...@gmail.com napisał(a): Am 03.11.2012 um 21:15 schrieb Marcin Borkowski mb...@wmi.amu.edu.pl: Dnia 2012-11-03, o godz. 14:04:30 Andres Conrado ela...@chiquitico.org napisał(a): In dont't really know why you think it should render differently. Everything TeX is supposed to ignore white spaces in math, AFAIK. Yep, but that's no TeX! Take a look at math-ini.mkiv, lines 873nn. And what do you think the example will tell us? \starttext \enablemathpunctuation $(1,2) (1, 2) (1{,}2) \hbox{foo, not bar}$ \stoptext Wolfgang Well, I *would* expect (1,2) to produce no space after the comma, and (1, 2) to produce a thin space. But I may be wrong; in any case, they seem to do exactly the same, which doesn't make much sense to me. Also, I wrote about this some time ago on TeX.SE (http://tex.stackexchange.com/questions/52524/autopunctuation-not-working-properly), and Aditya suggested posting here - which I (finally) did. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ 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] A problem with autopunctuation
Am 03.11.2012 um 01:45 schrieb Marcin Borkowski mb...@wmi.amu.edu.pl: If I get it correctly, the following two formulae should render differently - and they don't. What is going on? \setupmathematics[autopunctuation=yes] \starttext $(2,5)$ versus $(2, 5)$ \stoptext Spaces in math mode are ignored because the spacing is controlled by different rules. \starttext \m{1.2}\par \m{1. 2}\par \m{1 .2}\par \m{1 . 2}\par \blank \m{1,2} \blank \setupmathematics[autopunctuation=yes]\m{1,2} \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A problem with autopunctuation
On Sun, 4 Nov 2012, Wolfgang Schuster wrote: Am 03.11.2012 um 01:45 schrieb Marcin Borkowski mb...@wmi.amu.edu.pl: If I get it correctly, the following two formulae should render differently - and they don't. What is going on? \setupmathematics[autopunctuation=yes] \starttext $(2,5)$ versus $(2, 5)$ \stoptext Spaces in math mode are ignored because the spacing is controlled by different rules. \starttext \m{1.2}\par \m{1. 2}\par \m{1 .2}\par \m{1 . 2}\par \blank \m{1,2} \blank \setupmathematics[autopunctuation=yes]\m{1,2} \stoptext I always thought that autopunctuation was targetted towards the European tradition of using comma as a decimal separator. That behavior can be achieved by changing a comma to be an ord from a punctuation. However, changing the comma to an ord has the drawback that you have to explicitly add spaces when comma is needed as a punctuation, for example in sets: \m{A = \{a,\, b,\, c\}} Autopunctuation is supposed to get around this: if comma is followed by a non-space, the comma should behave like an ord; if it is followed by a space, it should behave like a punctuation. Clearly that is not happening. 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] A problem with autopunctuation
Dnia 2012-11-04, o godz. 16:38:53 Aditya Mahajan adit...@umich.edu napisał(a): On Sun, 4 Nov 2012, Wolfgang Schuster wrote: Am 03.11.2012 um 01:45 schrieb Marcin Borkowski mb...@wmi.amu.edu.pl: If I get it correctly, the following two formulae should render differently - and they don't. What is going on? \setupmathematics[autopunctuation=yes] \starttext $(2,5)$ versus $(2, 5)$ \stoptext Spaces in math mode are ignored because the spacing is controlled by different rules. \starttext \m{1.2}\par \m{1. 2}\par \m{1 .2}\par \m{1 . 2}\par \blank \m{1,2} \blank \setupmathematics[autopunctuation=yes]\m{1,2} \stoptext I always thought that autopunctuation was targetted towards the European tradition of using comma as a decimal separator. That behavior can be achieved by changing a comma to be an ord from a punctuation. However, changing the comma to an ord has the drawback that you have to explicitly add spaces when comma is needed as a punctuation, for example in sets: \m{A = \{a,\, b,\, c\}} Autopunctuation is supposed to get around this: if comma is followed by a non-space, the comma should behave like an ord; if it is followed by a space, it should behave like a punctuation. Clearly that is not happening. +1 This was exactly what I was expecting. (In LaTeX, there's even a package, called icomma AFAIR, which does more or less this.) As I often write mathematical texts in Polish, such a feature would be *very* useful for me. I could use \digits or \unit, but this has its drawbacks, too. Aditya Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ 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] A problem with autopunctuation
In dont't really know why you think it should render differently. Everything TeX is supposed to ignore white spaces in math, AFAIK. If you want a space in math, you need to force it, like this: \setupmathematics[autopunctuation=yes] \starttext $(2,\ 5)$ versus $(2,\ 5)$ \stoptext Best, Andrés Conrado Montoya El Andi andresconr...@gmail.com http://chiquitico.org Los fines no justifican los medios, porque la medida verdadera de nuestro carácter está dada por los medios que estamos dispuestos a utilizar, no por los fines que proclamamos. Por favor, evite enviarme documentos adjuntos en formato Word o PowerPoint. Lea http://www.gnu.org/philosophy/no-word-attachments.es.html Naturalmente, la gente normal no desea la guerra, pero al final son los líderes de una nación quienes determinan su política, y resulta muy sencillo doblegar a la gente, sea una democracia, una dictadura fascista, un parlamento o una dictadura comunista. Con voz o sin voz, la gente siempre podrá entregarse a la voluntad de sus líderes. Es fácil. Lo único que hay que hacer es decirles que están siendo atacados, y denunciar a los pacifistas por su falta de patriotismo y exponer el país al peligro. Funciona igual en todos los países. ---Hermann Goering, en los juicios de Nuremberg. 2012/11/3 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 http://www.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: RFC: path relative to current file. (Andre Caldas) 2. A problem with autopunctuation (Marcin Borkowski) 3. Re: Weird print(\n...) error (Peter M?nster) 4. Re: RFC: path relative to current file. (Sietse Brouwer) -- Message: 1 Date: Fri, 2 Nov 2012 22:35:29 -0200 From: Andre Caldas andre.em.cal...@gmail.com To: Hans Hagen pra...@wxs.nl Cc: mailing list for ConTeXt users ntg-context@ntg.nl Subject: Re: [NTG-context] RFC: path relative to current file. Message-ID: CADVh14X0wb-2f7uRzb8Jo5jDE9n3ha0iyTLYBPB=vRf= dwn...@mail.gmail.com Content-Type: text/plain; charset=UTF-8 Hello! It would be REALLY NICE if the functionality of pathrelativetome was provided by ConTeXt. in file-job.lua add around the function 'process': local function toppath() [...] \component toppath:/subpath/somefile.tex Works like a charm, Hans! Sorry I took so long to test... I copied file-job.lua from the GIT repository, and changed my tex files to use toppath:/path/to/file. For example: https://bitbucket.org/andrecaldas/math-video-classes/src/b743f22e4f567662ac55c1ac7dc1b6d13362e11d/src/products/assorted.tex?at=default Really nice! Thanks!! :-) Cheers, Andr? Caldas. -- Message: 2 Date: Sat, 3 Nov 2012 01:45:45 +0100 From: Marcin Borkowski mb...@wmi.amu.edu.pl To: ConTeXt mailing list ntg-context@ntg.nl Subject: [NTG-context] A problem with autopunctuation Message-ID: 20121103014545.02b8dd5f@aga-netbook Content-Type: text/plain; charset=US-ASCII If I get it correctly, the following two formulae should render differently - and they don't. What is going on? \setupmathematics[autopunctuation=yes] \starttext $(2,5)$ versus $(2, 5)$ \stoptext Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University -- Message: 3 Date: Sat, 03 Nov 2012 08:47:33 +0100 From: Peter M?nster pmli...@free.fr To: mailing list for ConTeXt users ntg-context@ntg.nl Subject: Re: [NTG-context] Weird print(\n...) error Message-ID: 877gq33z6y@micropit.couberia.selfip.net Content-Type: text/plain; charset=utf-8 On Fri, Nov 02 2012, Proch?zka Luk?? wrote: print(\nT) print(\n .. T) Any explanation? \nT is an unknown command. -- Peter -- Message: 4 Date: Sat, 3 Nov 2012 11:13:35 +0100 From: Sietse Brouwer sbbrou...@gmail.com To: mailing list for ConTeXt users ntg-context@ntg.nl Cc: Hans Hagen pra...@wxs.nl Subject: Re: [NTG-context] RFC: path relative to current file. Message-ID: CAF= dkzy9s5uuxfqv5quq1pybtcgglam9rwk-rtd3iaxekp6...@mail.gmail.com Content-Type: text/plain; charset=UTF-8 Andreas wrote: It would be REALLY NICE if the functionality of pathrelativetome was provided by ConTeXt. Hans wrote: in file-job.lua add around the function 'process': local function toppath() [...]
Re: [NTG-context] A problem with autopunctuation
Dnia 2012-11-03, o godz. 14:04:30 Andres Conrado ela...@chiquitico.org napisał(a): In dont't really know why you think it should render differently. Everything TeX is supposed to ignore white spaces in math, AFAIK. Yep, but that's no TeX! Take a look at math-ini.mkiv, lines 873nn. Best, Andrés Conrado Montoya El Andi andresconr...@gmail.com http://chiquitico.org Best, -- Marcin ___ 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 ___