Re: [NTG-context] setuplayout vs Indesign!

2020-08-27 Thread jbf

That is very helpful, and just what I needed. Thank you

Julian

On 27/8/20 9:16 pm, Wolfgang Schuster wrote:

Pablo Rodriguez schrieb am 26.08.2020 um 19:39:

On 8/26/20 12:13 PM, jbf wrote:

[...]
Maybe, one of these days, someone with experience in both ConTeXt and
InDesign (since InDesign is used by very many commercial publishers, 
but
I am trying to convince one of them of the value of ConTeXt) could 
offer

a comparison of the layout terminology/measurements/requirements for
both. I for one would find that very helpful.

Hi Julian,

https://wiki.contextgarden.net/Layout#Typesetting_areas contains a
graphical description of the areas and


I don't think the graphic is very useful to recreate a layout because 
there are

too many areas which are unimportant for the margins on each side.

A simpler step by step introduction where you can see leftmargin
doesn't matter for the layout is the better way (see attachment).

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
___
___
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] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Pablo Rodriguez
On 8/27/20 7:35 PM, Wolfgang Schuster wrote:
> [...]
> You have to replace %% with \letterpercent\letterpercent because you're
> still playing with TeX rules.
>
> \startxmlsetups xml:special
>      \startitem
> \cldcontext{string.gsub("\xmlraw{#1}{.}","\letterpercent\letterpercent","\\letterpercent{}")}
>      \stopitem
> \stopxmlsetups

Many thanks for your reply, Wolfgang.

Now I understand what was going on.

> To avoid these limitations create a new Lua function and call only this
> function in the setup:
>
> \startluacode
>
> moduledata = moduledata or { }
>
> function moduledata.special(str)
>      return string.gsub(str,"%%","\\letterpercent{}")
> end
>
> \stopluacode
>
> \startxmlsetups xml:special
>      \startitem
>      \cldcontext{moduledata.special([[\xmlraw{#1}{.}]])}
>      \stopitem
> \stopxmlsetups

Now I see that I have a lot to learn.

Many thanks again for your help,

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] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 27.08.2020 um 19:16:

On 8/27/20 6:16 PM, Wolfgang Schuster wrote:

Pablo Rodriguez schrieb am 27.08.2020 um 17:56:

[...]
\startxmlsetups xml:special
  \startitem
  \cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%",
 "\\letterpercent")}
  \stopitem
\stopxmlsetups

[...]
and to escape special characters you can use context.escape()

Many thanks for your reply, Wolfgang.

I’m afraid that I need to keep $ in order to get some formulas:

\cldcontext{(string.gsub([[\xmlraw{#1}{.}]],
   '', '$'):gsub("",
   "\\ifmmode $\\fi"))}}

Actually this is way more complex, but I need to catch % and have to
substitution above.


You have to replace %% with \letterpercent\letterpercent because you're 
still playing with TeX rules.


\startxmlsetups xml:special
    \startitem
\cldcontext{string.gsub("\xmlraw{#1}{.}","\letterpercent\letterpercent","\\letterpercent{}")}
    \stopitem
\stopxmlsetups

To avoid these limitations create a new Lua function and call only this 
function in the setup:


\startluacode

moduledata = moduledata or { }

function moduledata.special(str)
    return string.gsub(str,"%%","\\letterpercent{}")
end

\stopluacode

\startxmlsetups xml:special
    \startitem
    \cldcontext{moduledata.special([[\xmlraw{#1}{.}]])}
    \stopitem
\stopxmlsetups

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] wrong 2TOPSIDE?

2020-08-27 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\startmode[*first]
\startbuffer[abcde]
  \setuppapersize[A5, landscape]
  \setupbodyfont[100pt]
\starttext
  \dorecurse{158}{%
\startmakeup[page][style=\bf\ss, align=center, pagestatus=start]
\recurselevel
\stopmakeup}
\stoptext
\stopbuffer
 \savebuffer[abcde][singular.tex]

 \executesystemcommand{context --purgeall
--result=\jobname-singular.pdf  \jobname-singular.tex}

 \ctxlua{os.remove(tex.jobname.."-singular.tex")}
\stopmode

\startnotmode[*first]
  \setuppapersize[A5, landscape][A4]
  \setuparranging[2TOPSIDE]
  \setuplayout[page]
  \setupinteractionscreen[option={portrait,paper}]
  \starttext
  \insertpages[\jobname-singular.pdf][width=0pt]
\stopnotmode

\stoptext

I would say that last page (number 158 on #81) is misplaced. I think it
should be on #80.

Could anyone confirm this?

I’m also experiencing issues (I don’t get the first 11 imposed pages),
because I have to use:

 \executesystemcommand{context --purgeall
--result=\jobname-singular.pdf  --environment=\jobname-singular.tex
\jobname-singular.xml}

Is there a fix for this?

I’m reporting this right now, but I won’t be reaching a computer until
next Wednesday. (I know I’m going to forget, if I don’t write this now.)

Many thanks for your help,

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] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Pablo Rodriguez
On 8/27/20 6:16 PM, Wolfgang Schuster wrote:
> Pablo Rodriguez schrieb am 27.08.2020 um 17:56:
>> [...]
>>\startxmlsetups xml:special
>>  \startitem
>>  \cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%",
>> "\\letterpercent")}
>>  \stopitem
>>\stopxmlsetups
> [...]
> and to escape special characters you can use context.escape()

Many thanks for your reply, Wolfgang.

I’m afraid that I need to keep $ in order to get some formulas:

\cldcontext{(string.gsub([[\xmlraw{#1}{.}]],
  '', '$'):gsub("",
  "\\ifmmode $\\fi"))}}

Actually this is way more complex, but I need to catch % and have to
substitution above.

Many thanks for your help,

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] Tagged PDFs from Context

2020-08-27 Thread Karl Pettersson
Hi

See this discussion.
https://github.com/jgm/pandoc/issues/5409#issuecomment-678781349

Would it be possible to generate PDFs with headings tagged like H1, H2,
H3, H4..., instead of using the H tag for all levels, which seems to be
required for proper rendering with some screenreaders? It seems to me
that it would require modfications to the Context source code.
https://source.contextgarden.net/tex/context/base/mkiv/strc-tag.lua

Any ideas?

Best regards 
Karl Pettersson
___
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] Wiki New Extension: ConTeXtXML

2020-08-27 Thread Taco Hoekwater
Hi again,

Just now, I installed and update of the extension that replaces the default 
edit form  for Command pages by a dedicated form. This should make editing a 
lot easier, since there is no longer any visible XML code to confuse you.

Best wishes,
Taco

> On 20 Aug 2020, at 14:04, Taco Hoekwater  wrote:
> 
> Hi,
> 
> As announced last week, I have been working on a wiki extension to control 
> the editing of /Command pages. That extension is now installed on the main 
> wiki.
> 
> In short, we will switch to XML as the page model for newly created /Command 
> pages. This makes editing a bit harder, but it allows much better quality 
> control and (fairly) easy export and import.
> 
> The goal is to eventually be able to easily export all of the reference 
> documentation in the wiki to a separate system (for instance, Paul Mazaitis 
> plans to create a full-blown reference manual). In the current situation, 
> this is nearly impossible because there is so much variation in the content 
> and quality of the wiki /Command pages (not to mention that many are 
> missing). We also want it to be possible to merge improvements to the 
> interface xml definitions by Wolfgang without loosing any existing 
> documentation work.
> 
> The documentation pages are here:
> 
>   https://wiki.contextgarden.net/Command
>   https://wiki.contextgarden.net/Help:Command
>   https://wiki.contextgarden.net/Extension:ConTeXtXML
> 
> After reading those, have a look at the three ‘work pages’:
> 
>   https://wiki.contextgarden.net/Document_level_commands_work_page
>   https://wiki.contextgarden.net/Style_level_commands_work_page
>   https://wiki.contextgarden.net/System_level_commands_work_page 
> 
> All the bright red links are currently undocumented commands. Clicking on one 
> should bring you to the edit screen automatically, with a blob of XML 
> preloaded, ready for you to start writing.
> 
> All the dark red links are existing /Command pages. All of those are 
> traditional wiki text pages. Following those links will bring you to a normal 
> /Command page just like on the main wiki. If you want to see how one of those 
> pages would look like in the new system, you’ll have to rename the existing 
> page first (as explained in 
> https://wiki.contextgarden.net/Command#Pre-existing_pages ) 
> 
> If you do some work, please update those work pages!
> 
> 
> Comments, suggestions and bug reports are more than welcome. 
> 
> Please direct those to me personally or (better) to the wiki mailing list:
> 
>   https://lists.contextgarden.net/mailman/listinfo/wiki
> 
> Have fun!
> 
> Taco
> 
> 
> ___
> 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
> ___

Taco Hoekwater
Elvenkind BV




___
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] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 27.08.2020 um 17:56:

On 8/27/20 5:30 PM, Taco Hoekwater wrote:

[...]
Using Lua gsub(), I need to replace something like:

  string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")


Double it: %%

See also https://www.lua.org/manual/5.3/manual.html#6.4.1 , but the
mention of %% is a bit hidden.


Many thanks for your replies, Taco and Hans.

I’m afraid this doesn’t work (and I need \xmlraw there):

   \startbuffer[demo]
   

  
  The % best paragraph.
  

   
   \stopbuffer

   \startxmlsetups xml:initialize
 \xmlsetsetup{#1}{html}{xml:gen}
   \stopxmlsetups

   \xmlregistersetup{xml:initialize}

   \startxmlsetups xml:gen
 \startitemize
 \xmlfilter{#1}{/**/span[@class='special']/command(xml:special)}
 \stopitemize
   \stopxmlsetups

   \startxmlsetups xml:special
 \startitem
 \cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%",
"\\letterpercent")}
 \stopitem
   \stopxmlsetups



This works fine with your example

\startxmlsetups xml:special
\startitem
\xmlflush{#1}
\stopitem
\stopxmlsetups

and to escape special characters you can use context.escape()

\startxmlsetups xml:special
\startitem
\cldcontext{context.escape([[\xmlraw{#1}{.}]])}
\stopitem
\stopxmlsetups

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
___


Re: [NTG-context] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Pablo Rodriguez
On 8/27/20 5:30 PM, Taco Hoekwater wrote:
>> [...]
>> Using Lua gsub(), I need to replace something like:
>>
>>  string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")
>
> Double it: %%
>
> See also https://www.lua.org/manual/5.3/manual.html#6.4.1 , but the
> mention of %% is a bit hidden.

Many thanks for your replies, Taco and Hans.

I’m afraid this doesn’t work (and I need \xmlraw there):

  \startbuffer[demo]
  
   
 
 The % best paragraph.
 
   
  
  \stopbuffer

  \startxmlsetups xml:initialize
\xmlsetsetup{#1}{html}{xml:gen}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

  \startxmlsetups xml:gen
\startitemize
\xmlfilter{#1}{/**/span[@class='special']/command(xml:special)}
\stopitemize
  \stopxmlsetups

  \startxmlsetups xml:special
\startitem
\cldcontext{string.gsub([[\xmlraw{#1}{.}]], "%%",
   "\\letterpercent")}
\stopitem
  \stopxmlsetups

  \starttext
\xmlprocessbuffer{main}{demo}{}
  \stoptext

What am I missing or doing wrong there?

Many thanks for your help,

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] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Hans van der Meer
In Lua patterns % is a socalled magic character like ^$ etc. These are esacped 
with a %. Thus %% is what you need in the first string.
dr. Hans van der Meer


> On 27 Aug 2020, at 17:11, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> I have and \xmlraw command that gives some text with percent signs.
> ConTeXt parses them as comments (so no output).
> 
> Using Lua gsub(), I need to replace something like:
> 
>  string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")
> 
> How do I need to invoke % to get the character found?
> 
> Many thanks for your help,
> 
> 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
> ___

___
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] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Taco Hoekwater
Hi,

> On 27 Aug 2020, at 17:11, Pablo Rodriguez  wrote:
> 
> Dear list,
> 
> I have and \xmlraw command that gives some text with percent signs.
> ConTeXt parses them as comments (so no output).
> 
> Using Lua gsub(), I need to replace something like:
> 
>  string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")

Double it: %%

See also https://www.lua.org/manual/5.3/manual.html#6.4.1 , but the mention of 
%% is a bit hidden.

Best wishes,
Taco___
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] catch % in gsub("%", "\\letterpercent")

2020-08-27 Thread Pablo Rodriguez
Dear list,

I have and \xmlraw command that gives some text with percent signs.
ConTeXt parses them as comments (so no output).

Using Lua gsub(), I need to replace something like:

  string.gsub([[\xmlraw{#1}{.}]], "%", "\\letterpercent")

How do I need to invoke % to get the character found?

Many thanks for your help,

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] setuplayout vs Indesign!

2020-08-27 Thread Wolfgang Schuster

Pablo Rodriguez schrieb am 26.08.2020 um 19:39:

On 8/26/20 12:13 PM, jbf wrote:

[...]
Maybe, one of these days, someone with experience in both ConTeXt and
InDesign (since InDesign is used by very many commercial publishers, but
I am trying to convince one of them of the value of ConTeXt) could offer
a comparison of the layout terminology/measurements/requirements for
both. I for one would find that very helpful.

Hi Julian,

https://wiki.contextgarden.net/Layout#Typesetting_areas contains a
graphical description of the areas and


I don't think the graphic is very useful to recreate a layout because 
there are

too many areas which are unimportant for the margins on each side.

A simpler step by step introduction where you can see leftmargin
doesn't matter for the layout is the better way (see attachment).

Wolfgang



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


Re: [NTG-context] setuplayout vs Indesign!

2020-08-27 Thread Henning Hraban Ramm

> Am 26.08.2020 um 12:13 schrieb jbf :
> 
> Thank you. Let's see if the Quality Control person is convinced by what she 
> gets with the suggested measurements. 
> 
> I usually set things up 'as if' they would be on A4, in this case, 
> \setuppapersize[ACN][A4] (ACN being the name I give to the 140x216mm book in 
> question).
> 
> And yes, I have looked carefully at the 'Layout' section of Contextgarden, 
> but the difficulty always is marrying its terminology with what someone wants 
> who deals only with InDesign. And that causes confusion (for me, at least). 
> But it certainly helps me to know that 'your left margin is backspace', since 
> I had been presuming that 'leftmargin' meant left margin!
> 
> Maybe, one of these days, someone with experience in both ConTeXt and 
> InDesign (since InDesign is used by very many commercial publishers, but I am 
> trying to convince one of them of the value of ConTeXt) could offer a 
> comparison of the layout terminology/measurements/requirements for both. I 
> for one would find that very helpful.

While I was a long time user of InDesign (2.0 to CS 5.5), and QuarkXPress 
before, I don’t use it any more, my old copy doesn’t run any more on my current 
MacOS. Nowadays I use Serif’s Affinity Publisher/Designer for graphical layout 
jobs (also not free and not a full replacement, but good enough if you know how 
to work around the quirks, and much cheaper).

The terms and measures of graphical layout programs aren’t directly 
translatable to TeX since the concepts are just too different. Even the pt is 
different.

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
___