Re: [NTG-context] filter module's inline command and supressed spacing

2015-01-01 Thread Mark Szepieniec
Hi Piotr,

maybe you can try opening an issue in the code's repository:
https://github.com/adityam/filter/issues

On Tue, Dec 30, 2014 at 10:28 AM, Piotr Kopszak kops...@gmail.com wrote:

 P.S.

 Silly of me not to check ConTeXt version first. Anyway, the problem
 persists with most recent ConTeXt although different errors are
 produced. The space is supressed
 in 'Januszkiewicza)Notatki' and html entities are not interpreted
 properly when using \inlinepandoc.

 2014-12-30 10:00 GMT+01:00 Piotr Kopszak kops...@gmail.com:
  Hello list,
 
  It looks like a bug in the filter module, but maybe I'm doing
  something wrong. Any help will be greatly appreciated. When using the
  \inlinepandoc command in the first paragraph below the space at the
  end of the paragraph in życiaA. Mickiewicza is supressed when it
  should be życia A. Mickiewicza. This does not happen when using
  pandoc environment. If you want to run the minimal example you have to
  make sure you got the recent pandoc which supports twiki input format
  and create the output subdirectory in your working directory.
 
  Best
 
  Piotr
 
 
  \usemodule[filter]
  \defineexternalfilter
[pandoc]
[
  filter={pandoc -f \externalfilterparameter{format} -t context
 -o \externalfilteroutputfile},
  format=twiki,
  directory=output,
]
  \starttext
  Inne tyt.: Wizyta pana Franciszka Grzymały, Exegi monumentum aere
  perennius  Powst. Paryż, na autografie podpis: Paryż, 12 marca
  1833. Wiersze natchnione wizytą Fr. Grzymały.   Pdr: {\it Czas} 1859
  nr nr 118 s. 2.  (\inlinepandoc{w artykule L#42;#42;#42; (E.
  Januszkiewicza)  Notatki wspomnień z życia A. Mickiewicza}).
 
  \startpandoc
  Inne tyt.: Wizyta pana Franciszka Grzymały, Exegi monumentum aere
  perennius  Powst. Paryż, na autografie podpis: Paryż, 12 marca
  1833. Wiersze natchnione wizytą Fr. Grzymały.   Pdr: {\it Czas} 1859
  nr nr 118 s. 2.  (w artykule L#42;#42;#42; (E. Januszkiewicza)
  Notatki wspomnień z życia A. Mickiewicza).
  \stoppandoc
  \stoptext
 
 -
 
  --
  http://okle.pl



 --
 http://okle.pl

 ___
 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

 ___

___
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] vertical alignment of table of contents in makeup

2014-12-21 Thread Mark Szepieniec
Hi Pablo,

thanks for your clarifications. My thinking was that I didn't want my table
of contents page to have a page number, but I didn't realize that the ToC
head acts as a chapter head, so you can just get rid of the page number in
the way you suggest.

So just leaving out the makeup works fine, thanks!

On Sat, Dec 20, 2014 at 11:41 PM, Pablo Rodriguez oi...@gmx.es wrote:

 On 12/20/2014 03:13 AM, Mark Szepieniec wrote:
  There is a trick mentioned on the wiki for top-aligning the contents of
  a makeup page, namely adding top=,, which cancels the default value of
  \vss, which is infinitely strechable space.
 
  However, that doesn't seem to work when the first element in the makeup
  page is \completecontent:

 Hi Mark,

 this is what it happens when you start a makeup page with a \chapter
 command. \chapter inserts a page break before the heading.

  [...]
  Here, the table of contents and the section are both placed on the
  makeup page, but they are centered vertically. If the \completecontent
  line is commented out, the correct vertical alignment of the section
  header is obtained. Is there a way to get top-alignment when a makeup
  page starts with \completecontent? Is this a bug?

 As far as I know, this isn’t a bug.

 You can disable the page break before chapter with:

 \setuphead[chapter][page=]

 This way it works as you intend.

  Or should I even be using makeup pages in my table of contents?

 I wonder whether this makes sense at all.

 Why do you want or why do you think you need the table of contents
 wrapped in a makeup page?

 A makeup page is fine for contents such as title pages, colophons or
 similar ones. Their contents should fit in a single page, because the
 contents won’t be split across pages.

 Here you have a sample that shows why makeup pages shouldn’t be used for
 table of contents:

 \starttext
 \startmakeup[standard][top=,]
 \chapter{Contents}
 \dorecurse{50}{\section{testsection}}
 \stopmakeup
 \stoptext

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

Re: [NTG-context] setting margins in makeup

2014-12-21 Thread Mark Szepieniec
On Sun, Dec 21, 2014 at 12:02 PM, Hans Hagen pra...@wxs.nl wrote:

 On 12/20/2014 11:55 PM, Pablo Rodriguez wrote:

 On 12/19/2014 04:38 PM, Mark Szepieniec wrote:

 [...]
 Incidentally, what threw me off was the phrasing in the manual:

 4.19
 Makeup
 A document may have a titlepage, a colofon and some pages that are
 not directly related to the main part of the document. Mostly these
 pages are not numbered and can do without headers and footers.
 Because their layout needs extra attention we prefer the word makeup
 for defining their specific layout.

 Since my makeup pages indeed don't have page numbers, I presumed they
 wouldn't have headers either. I may have read too much into that, but
 perhaps that passage can be improved?


 Hi Mark,

 makeups don’t have either headers or footers, but have the document
 layout unless otherwise specified.

 You are right: makeups don’t have header or footer /texts/, although
 they don’t have the space for headers and footers removed.


 they have them but their state is empty (headerstate etc parameters)

 Hans


Thanks for the clarification both of you, that was exactly what I was
getting wrong.

Best,

Mark


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

___
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] vertical alignment of table of contents in makeup

2014-12-21 Thread Mark Szepieniec
On Sun, Dec 21, 2014 at 10:12 PM, Pablo Rodriguez oi...@gmx.es wrote:

 On 12/21/2014 09:01 PM, Mark Szepieniec wrote:
  Hi Pablo,
 
  thanks for your clarifications. My thinking was that I didn't want my
  table of contents page to have a page number, but I didn't realize that
  the ToC head acts as a chapter head, so you can just get rid of the page
  number in the way you suggest.
 
  So just leaving out the makeup works fine, thanks!

 Hi Mark,

 to get rid of page numbers in the table of contents,

 http://wiki.contextgarden.net/Table_of_Contents#Suppressing_page_numbering_for_the_ToC_pages
 may help you.

 Just in case it helps,

 Pablo



  On Sat, Dec 20, 2014 at 11:41 PM, Pablo Rodriguez wrote:
 
  On 12/20/2014 03:13 AM, Mark Szepieniec wrote:
   There is a trick mentioned on the wiki for top-aligning the
 contents of
   a makeup page, namely adding top=,, which cancels the default
 value of
   \vss, which is infinitely strechable space.
  
   However, that doesn't seem to work when the first element in the
 makeup
   page is \completecontent:
 
  Hi Mark,
 
  this is what it happens when you start a makeup page with a \chapter
  command. \chapter inserts a page break before the heading.
 
   [...]
   Here, the table of contents and the section are both placed on the
   makeup page, but they are centered vertically. If the
 \completecontent
   line is commented out, the correct vertical alignment of the
 section
   header is obtained. Is there a way to get top-alignment when a
 makeup
   page starts with \completecontent? Is this a bug?
 
  As far as I know, this isn’t a bug.
 
  You can disable the page break before chapter with:
 
  \setuphead[chapter][page=]
 
  This way it works as you intend.
 
   Or should I even be using makeup pages in my table of contents?
 
  I wonder whether this makes sense at all.
 
  Why do you want or why do you think you need the table of contents
  wrapped in a makeup page?
 
  A makeup page is fine for contents such as title pages, colophons or
  similar ones. Their contents should fit in a single page, because the
  contents won’t be split across pages.
 
  Here you have a sample that shows why makeup pages shouldn’t be used
 for
  table of contents:
 
  \starttext
  \startmakeup[standard][top=,]
  \chapter{Contents}
  \dorecurse{50}{\section{testsection}}
  \stopmakeup
  \stoptext
 
  I hope it helps,
 
 
  Pablo


Interesting, thanks!
___
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] setting margins in makeup

2014-12-19 Thread Mark Szepieniec
I'm having trouble resetting my margins in makeup pages. I want the makeup
pages to have equal topspace, bottomspace, backspace and cutspace,
regardless of the standard layout of the rest of the document.

Following Wolfgang's recommendation (
http://www.ntg.nl/pipermail/ntg-context/2014/079409.html), I tried the
following:

\setuppapersize [A4][A4]

% Standard page layout
\setuplayout[width=middle,  backspace=1.5in, cutspace=1.5in,
 height=middle, topspace=0.75in, bottomspace=0.75in]

% Title page layout
% \definemakeup defines a layout with the same name, which we alter.
\definemakeup[titlepage]
\setuplayout  [titlepage][width=middle, backspace=20mm, height=middle,
topspace=20mm]

\starttext

\startmakeup[titlepage][top=,]
bla
\stopmakeup

But, on my system, this puts the bla too far from the top of the page,
and it looks as though the topspace has not been set properly. (Backspace
seems ok), Am I doing something wrong or is there a better way to achieve
this?

Also, the manual says I can use the command \showframe to display frames to
help in debugging, but that doesn't seem to do anything for me?

Thanks in advance,

Mark
___
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] setting margins in makeup

2014-12-19 Thread Mark Szepieniec
Sorry for the noise, I've solved it, turns out makeup pages still have
headers which you need to set to zero if you want uniform margins:

% Title page layout
% \definemakeup defines a layout with the same name, which we alter.
\definemakeup[titlepage]
\setuplayout  [titlepage][width=middle, backspace=20mm,
  height=middle, topspace=20mm,
  header=0mm]

did the trick for me.

Incidentally, what threw me off was the phrasing in the manual:

4.19
Makeup
A document may have a titlepage, a colofon and some pages that are not
directly related to the
main part of the document. Mostly these pages are not numbered and can do
without headers
and footers. Because their layout needs extra attention we prefer the word
makeup for defining
their specific layout.

Since my makeup pages indeed don't have page numbers, I presumed they
wouldn't have headers either. I may have read too much into that, but
perhaps that passage can be improved?

On Fri, Dec 19, 2014 at 3:33 PM, Mark Szepieniec mszep...@gmail.com wrote:

 I'm having trouble resetting my margins in makeup pages. I want the makeup
 pages to have equal topspace, bottomspace, backspace and cutspace,
 regardless of the standard layout of the rest of the document.

 Following Wolfgang's recommendation (
 http://www.ntg.nl/pipermail/ntg-context/2014/079409.html), I tried the
 following:

 \setuppapersize [A4][A4]

 % Standard page layout
 \setuplayout[width=middle,  backspace=1.5in, cutspace=1.5in,
  height=middle, topspace=0.75in, bottomspace=0.75in]

 % Title page layout
 % \definemakeup defines a layout with the same name, which we alter.
 \definemakeup[titlepage]
 \setuplayout  [titlepage][width=middle, backspace=20mm, height=middle,
 topspace=20mm]

 \starttext

 \startmakeup[titlepage][top=,]
 bla
 \stopmakeup

 But, on my system, this puts the bla too far from the top of the page,
 and it looks as though the topspace has not been set properly. (Backspace
 seems ok), Am I doing something wrong or is there a better way to achieve
 this?

 Also, the manual says I can use the command \showframe to display frames
 to help in debugging, but that doesn't seem to do anything for me?

 Thanks in advance,

 Mark

___
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] vertical alignment of table of contents in makeup

2014-12-19 Thread Mark Szepieniec
There is a trick mentioned on the wiki for top-aligning the contents of a
makeup page, namely adding top=,, which cancels the default value of
\vss, which is infinitely strechable space.

However, that doesn't seem to work when the first element in the makeup
page is \completecontent:

\starttext

% top= here doesn't seem to be working...
\startmakeup[standard][top=,]
\completecontent
\section{testsection}
\stopmakeup
\stoptext

Here, the table of contents and the section are both placed on the makeup
page, but they are centered vertically. If the \completecontent line is
commented out, the correct vertical alignment of the section header is
obtained. Is there a way to get top-alignment when a makeup page starts
with \completecontent? Is this a bug?

Or should I even be using makeup pages in my table of contents?

Mark
___
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] How does \setupfloat work?

2014-11-29 Thread Mark Szepieniec
I'm trying to set a default width for figures with \setupfloat. However,
the command doesn't seem to be picking up the width specification, even
though the manual indicates it accepts a width= argument:

\setupfloat[figure][width=2cm]

\starttext

\placefigure{}{\externalfigure[picture.png]}


\stoptext


picture.png just gets inserted at its native size, rather than scaled to
have the specified width. What am I doing wrong? (setting minwidth and/or
maxwidth doesn't seem to work either)

Thanks in advance for any assistance.

Mark
___
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] How does \setupfloat work?

2014-11-29 Thread Mark Szepieniec
On Sat, Nov 29, 2014 at 11:03 AM, Hans Hagen pra...@wxs.nl wrote:

 On 11/29/2014 10:49 AM, Mark Szepieniec wrote:

 I'm trying to set a default width for figures with \setupfloat. However,
 the command doesn't seem to be picking up the width specification, even
 though the manual indicates it accepts a width= argument:

 \setupfloat[figure][width=2cm]

 \starttext

 \placefigure{}{\externalfigure[picture.png]}


 \stoptext


 just

 \placefigure{}{\externalfigure[picture.png][width=2cm]}



 picture.png just gets inserted at its native size, rather than scaled to
 have the specified width. What am I doing wrong? (setting minwidth
 and/or maxwidth doesn't seem to work either)

 Thanks in advance for any assistance.

 Mark


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



 --

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


Sorry, I should have mentioned I was able to work around it by doing
exactly that, but I'd rather not have to edit all the \placefigure
instances if I decide to change the width.

Also I'd like to use a different default width for graphics, so
\setupexternalfigures[width=XXXcm] wouldn't work well either.

I realize I could define my own macros or something to solve this, but I'm
just puzzled that setting width in \setupfloat[figure] doesn't work. Am I
reading the manual wrong, or is is just not implemented yet or something?
(honest question)

Thanks for your response,

Mark
___
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] How does \setupfloat work?

2014-11-29 Thread Mark Szepieniec
On Sat, Nov 29, 2014 at 8:22 PM, Christoph Reller 
christoph.rel...@gmail.com wrote:

 On Sat, Nov 29, 2014 at 11:03 AM, Hans Hagen pra...@wxs.nl wrote:

  On 11/29/2014 10:49 AM, Mark Szepieniec wrote:
 
  I'm trying to set a default width for figures with \setupfloat.
 However,
  the command doesn't seem to be picking up the width specification, even
  though the manual indicates it accepts a width= argument:
 
  \setupfloat[figure][width=2cm]
 
  \starttext
 
  \placefigure{}{\externalfigure[picture.png]}
 
 
  \stoptext
 
 
  just
 
  \placefigure{}{\externalfigure[picture.png][width=2cm]}
 
 
 
  picture.png just gets inserted at its native size, rather than scaled
 to
  have the specified width. What am I doing wrong? (setting minwidth
  and/or maxwidth doesn't seem to work either)
 
  Thanks in advance for any assistance.
 
  Mark

 Sorry, I should have mentioned I was able to work around it by doing
 exactly that, but I'd rather not have to edit all the \placefigure
 instances if I decide to change the width.

 Also I'd like to use a different default width for graphics, so
 \setupexternalfigures[width=XXXcm] wouldn't work well either.

 I realize I could define my own macros or something to solve this, but I'm
 just puzzled that setting width in \setupfloat[figure] doesn't work. Am I
 reading the manual wrong, or is is just not implemented yet or something?
 (honest question)

 Thanks for your response,

 Mark


 Hi Mark,
 You can use \defineexternalfigure as in the following example.

 \defineexternalfigure[whatever][width=2cm]
 \starttext
 \placefigure{}{\externalfigure[picture.png][whatever]}
 \stoptext

 See also http://wiki.contextgarden.net/Floating_Objects

 Christoph


Thanks all for your responses.

\defineexternalfigure looks like it does something very close to what I
wanted. Googling it brought me to a mailing list thread where a question
similar to mine was asked, so for future reference:
http://www.ntg.nl/pipermail/ntg-context/2012/069446.html.

So I guess my problem is resolved, but I'd still like to understand better
why my earlier solution of doing

\setupfloat[figure][width=2cm]

didn't set a default for later instances of \placefigure. I feel like I
might be missing some aspect of the ConTeXt philosophy, or I'm misreading
the manual, or it's just a bug...?
___
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] How does \setupfloat work?

2014-11-29 Thread Mark Szepieniec
On Sun, Nov 30, 2014 at 12:48 AM, Aditya Mahajan adit...@umich.edu wrote:

 On Sat, 29 Nov 2014, Mark Szepieniec wrote:

  So I guess my problem is resolved, but I'd still like to understand better
 why my earlier solution of doing

 \setupfloat[figure][width=2cm]

 didn't set a default for later instances of \placefigure. I feel like I
 might be missing some aspect of the ConTeXt philosophy, or I'm misreading
 the manual, or it's just a bug...?


 \setupfloat[figure] sets the values of \startplacefigure (and
 \placefigure), and not for \externalfigure. The width value for
 startplacefigure is not used anywhere.

 The default value of \setupfloats[width=...] is used when the float box is
 empty. So, the only scenario where the value of \setupfloats[width=...]
 will matter is the following:

 \starttext
 \setupfloats[width=2cm]
 \placefloat{}{}

 \setupfloats[width=10cm]
 \placefloat{}{}
 \stoptext

 Aditya


Thanks Aditya, that's very helpful and things make more sense now. Is this
stuff documented somewhere or did you consult the source code?
___
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] Permissible characters in ConTeXt reference labels

2014-09-18 Thread Mark Szepieniec
OK, thanks both of you, its looks like I need to sanitize all mentioned
characters, since the reference strings will generally originate from
formats other than ConTeXt, and we don't want ConTeXt to do any processing
on them, aside from comparisons to resolve references.

As for Aditya's examples, the first results in a compilation error on my
test file, while the second compiles without error, and gives the expected
result.

On Thu, Sep 18, 2014 at 4:26 AM, Aditya Mahajan adit...@umich.edu wrote:

 On Thu, 18 Sep 2014, Hans Hagen wrote:

  On 9/18/2014 12:06 AM, Mark Szepieniec wrote:

 Bump...

 If it's not too much trouble, I would greatly appreciate some feedback
 on this before I propose it to be merged into pandoc; even a looks good
 to me from one of the ConTeXt gurus would be very helpful.

 Thanks in advance,

 Mark

 On Tue, Sep 9, 2014 at 12:20 AM, Mark Szepieniec mszep...@gmail.com
 mailto:mszep...@gmail.com wrote:

 I'm trying to fix a problem in pandoc (see
 https://github.com/jgm/pandoc/pull/1589) where it doesn't properly
 sanitize the reference labels in ConTeXt output, causing errors
 during compilation when a label contains '#' for example. Note that
 this sanitizing is needed in addition to the regular backslash
 escaping used for control characters: '\#' is still illegal in a
 label for example.


 (LaTeX label) = (ConTeXt reference). What Mark mean was references such as

 \section[...]{...} or \startplacefigure[reference={...}].

  In the sanitizer function I'm writing, I'd like to properly escape
 all illegal characters, but I couldn't find an explicit list of
 allowed or illegal characters. Based on some testing I've conducted
 (see attached file), I've arrived at the following set:

 \#[],{}%()|=


 it depends on where these characters end up in

 #  : always tricky as it denotes an argument, so escape
 [] : depends if it gets fed into a macro that uses [] as delimiters
 {} : only an issue when not balanced
 %  : escaping needed as it's comment otherwise
 () : depends on where it ends up, like []
 |  : is special in context so needs escaping
 \  : of course that one needs escaping

  1) Does this look like a reasonable set? Are there other characters
 or sequences that should be included, or are worth testing?


 keep in mind that escapes should end up unescaped at some point

  2) I was told (see
 https://groups.google.com/forum/#!topic/pandoc-discuss/tYpXMUkmbEY)
 that if the characters  and , didn't work, it would count as a
 ConTeXt bug, is there any truth to that? Please let me know if any
 further info is needed on my part.


 well, define bug ... one can say the same of  and  in xml -)


 Since I made that comment on the pandoc mailing list, let me explain.

 Consider:

 \section[some reference]{Title}

 Given how  behaves elsewhere in ConTeXt, a user would expect the above to
 be a valid input. If it is not, then it is bug (or atleast, surprising).

 The same goes for

 \section[some, reference]{Title}

  if the result ends up in a comma separated list then , can be an issue
 but one can always wrap an argument in {} to hide that

  3) Does anyone see issues with this general approach? I'm relatively
 new to ConTeXt, so I might be missing either a huge problem, or an
 obviously easier way to do this.


 i don't know ... i never used pandoc input


 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
 
 ___

___
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] Permissible characters in ConTeXt reference labels

2014-09-17 Thread Mark Szepieniec
Bump...

If it's not too much trouble, I would greatly appreciate some feedback on
this before I propose it to be merged into pandoc; even a looks good to
me from one of the ConTeXt gurus would be very helpful.

Thanks in advance,

Mark

On Tue, Sep 9, 2014 at 12:20 AM, Mark Szepieniec mszep...@gmail.com wrote:

 I'm trying to fix a problem in pandoc (see
 https://github.com/jgm/pandoc/pull/1589) where it doesn't properly
 sanitize the reference labels in ConTeXt output, causing errors during
 compilation when a label contains '#' for example. Note that this
 sanitizing is needed in addition to the regular backslash escaping used for
 control characters: '\#' is still illegal in a label for example.

 In the sanitizer function I'm writing, I'd like to properly escape all
 illegal characters, but I couldn't find an explicit list of allowed or
 illegal characters. Based on some testing I've conducted (see attached
 file), I've arrived at the following set:

 \#[],{}%()|=

 1) Does this look like a reasonable set? Are there other characters or
 sequences that should be included, or are worth testing?

 2) I was told (see
 https://groups.google.com/forum/#!topic/pandoc-discuss/tYpXMUkmbEY) that
 if the characters  and , didn't work, it would count as a ConTeXt bug, is
 there any truth to that? Please let me know if any further info is needed
 on my part.

 3) Does anyone see issues with this general approach? I'm relatively new
 to ConTeXt, so I might be missing either a huge problem, or an obviously
 easier way to do this.

 Thanks,

 Mark

___
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] Permissible characters in ConTeXt reference labels

2014-09-08 Thread Mark Szepieniec
I'm trying to fix a problem in pandoc (see
https://github.com/jgm/pandoc/pull/1589) where it doesn't properly sanitize
the reference labels in ConTeXt output, causing errors during compilation
when a label contains '#' for example. Note that this sanitizing is needed
in addition to the regular backslash escaping used for control characters:
'\#' is still illegal in a label for example.

In the sanitizer function I'm writing, I'd like to properly escape all
illegal characters, but I couldn't find an explicit list of allowed or
illegal characters. Based on some testing I've conducted (see attached
file), I've arrived at the following set:

\#[],{}%()|=

1) Does this look like a reasonable set? Are there other characters or
sequences that should be included, or are worth testing?

2) I was told (see
https://groups.google.com/forum/#!topic/pandoc-discuss/tYpXMUkmbEY) that if
the characters  and , didn't work, it would count as a ConTeXt bug, is
there any truth to that? Please let me know if any further info is needed
on my part.

3) Does anyone see issues with this general approach? I'm relatively new to
ConTeXt, so I might be missing either a huge problem, or an obviously
easier way to do this.

Thanks,

Mark


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