[NTG-context] mapping seeregister command to xml

2019-07-04 Thread Thomas A. Schmitz

Hi,

I'm having trouble mapping the seeregister command to an xml setup. 
Example (looks somewhat messy, but explains why I need it):


\startbuffer[test]

  This is a test. IGRR 4, 988sort="IGRR4+988" target="TAM 2 677">IGRR 
4+988 = TAM 2, 677sort="TAM2+677">TAM 2+677


\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{#1}{*}{-}

\xmlsetsetup{#1}{document|p|inscription|seeinscription|emph|index}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
\xmlflush{#1} \par
\stopxmlsetups

\startxmlsetups xml:emph
{\em \xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:inscription
\expanded{\inscription[\xmlatt{#1}{sort}]{\xmlflush{#1}}}
\stopxmlsetups

\startxmlsetups xml:seeinscription

\expanded{\seeinscription[\xmlatt{#1}{sort}]{\xmlflush{#1}}{\xmlatt{#1}{target}}}
\stopxmlsetups

\defineregister[inscription][inscriptions]

\setupregister[inscription][pagestyle=,
textstyle=,
location=right,
prefix=none,
indicator=no]

\starttext
\xmlprocessbuffer{main}{test}{}
\blank [line]
\placeregister[inscription]
\stoptext

Maybe my problem is with expansion in index entries? I must admit that I 
haven't really grasped why the \expanded was necessary and what it does...


All best

Thomas
___
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] two (2) questions about footnotes

2019-05-27 Thread Thomas A. Schmitz

On 05/27/2019 09:35 AM, Hans Hagen wrote:


   Test1: \index{Adam}Adam.
\footnote{Test2: \index{Eve}Eve.}
\footnote[note:abel]{Test3: \index[Abel]{Abel in 
\in{note}[note:abel]}Abel.}


\page

\placeregister [index]
\stoptext


Ah excellent, thanks a lot, that makes everything clear!

All best

Thomas
___
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] two (2) questions about footnotes

2019-05-27 Thread Thomas A. Schmitz

Hi all,

I have two questions/problems about footnotes. Here is a minimal 
example, which does not compile in this form:


\unexpanded\def\MyRule{\blackrule[width=\textwidth,height=3pt]}
\setupfootnotes[rule=\MyRule]

\starttext
Test1: \index{Adam}Adam.\footnote{Test2: \index{Eve}Eve.}
\page
\placeregister [index]
\stoptext

(1) In my current project, the publisher wants the rule separating text 
and notes to extend across the entire text width. I found the \blackrule 
command and its use in the setup on the mailing list, many years ago, 
proposed by Steffen Wolfrum, but it doesn't work (anymore?); I get "tex 
error on line 3 in file /tmp/test.tex: ! Missing \endcsname inserted." 
Any hints?


(2) Again, something that has been asked on the mailing list, but not 
received any replies: would it be possible to have the index report that 
"Eve" occurs inside a footnote? So it says "Eve 1 n. 1" or something 
like that?


Thanks a lot, and all best

Thomas
___
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] Remove italics from bibliography list

2019-05-17 Thread Thomas A. Schmitz

On 5/17/19 12:41 PM, Dmitry Starostin wrote:

I tried several variants, but I cannot find where exactly the switch
happens.

\definebtx[apa:list:title:incollection][apa:list:title][style=]
\definebtx[apa:list:title:book][apa:list:title][style=]

\definebtx[apa:list:journal][apa:list][style=]


Since a number of questions about custom bibliographic styles came up 
during the past few days, I have created a section on the wiki that 
explains how one can get started with creating their own custom setups 
from scratch; it's at 
https://wiki.contextgarden.net/Bibliography_mkiv#Custom_bibliographical_styles


For further questions, please remember that it is considered polite to 
create complete minimal working examples, not just send code snippets 
that leave everybody guessing what it is you want to achieve.


All best

Thomas
___
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] PDF output routine in lmtx

2019-04-30 Thread Thomas A. Schmitz
> On 29. Apr 2019, at 11:46, Christian Prim  wrote:
> 
> Hi
> 
> in lmtx the pdf output routine has changed afaik. I just wanted to report, 
> that in lmtx our printer/copier (Ricoh 8200S or Ricoh 8110S) doesn't print 
> any character. A standard document as the MWE prints well under mkiv. Under 
> lmtx, there is no output (blank sheet). In a document with a tikz-figure, the 
> tikz-figure (without labels, as they are text) is printed. Something with 
> text output must have changed, that makes it incompatible with the copier at 
> our school. I tried to print with different drivers and also used the 
> printers interface (direct print via usb-stick). No success. Are they some 
> flags I can play with (like other pdf-version or so) to find a solution to 
> this problem? This "bug" prevents me to use lmtx at out school.
> 
> MWE:
> 
> \starttext
> That is a test.
> \stoptext
> 
> Of course there is no problem with the preview and the output works on a 
> HP-Printer.

I have no solution, unfortunately, but I can add that I see similar problems. 
In my case, the printer is a HP LaserJet 1320. The page looks perfectly fine on 
screen; when I print it out, several Greek letters are replaced by questions 
marks in a small rectangular box. When I compile the same file with regular 
context mkiv, everything is printed as intended. So I’m at a loss…

Thomas
___
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] index "compress" option / collapsing of page numbers

2019-04-03 Thread Thomas A. Schmitz


> On 3. Apr 2019, at 10:56, Henning Hraban Ramm  wrote:
> 
> Thank you – it’s not only a German habit, even if we pronounce it “folgende”, 
> “f.” stems from Latin “folio”, and “ff.” is a duplicated abbreviation, as was 
> usual in mediaeval Latin.
> So, this is at least used in English, German, Norwegian and Swedish, as far 
> as I could find. In French they seem to use “sq.” and “sqq.” (sequens).

I’m not sure the abbreviation for “folio” has anything to do with our German 
“folgende”; if you have a link for this, I would like to know. And for the 
record: “ff.” for page ranges is now discouraged in most scholarly 
publications; journals and publishers now say f. for x - x+1, or exact page 
numbers.

Thomas
___
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] Welcome to LMTX

2019-04-02 Thread Thomas A. Schmitz

On 02.04.19 11:34, Rudolf Bahr wrote:

whereis mtxrun gives:
mtxrun: /home/sam/context/tex/texmf-linux-64/bin/mtxrun

whereis context gives:
context: /usr/local/context /home/sam/context/tex/texmf-linux-64/bin/context


Hmm - you're still using your old context, it should say 
/home/sam/context-lmtx/tex/texmf-linux-64/bin/mtxrun


Which shell are you running?
___
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] environment variable for runtime

2019-02-27 Thread Thomas A. Schmitz

Hi,

I would like to typeset the runtime information that context displays at 
the end of typesetting:


mkiv lua stats  > runtime: 174.639 seconds, 913 processed pages, 913 
shipped pages, 5.228 pages/second

system  | total runtime: 526.583 seconds

Is this stored in any environment key? How could I access it?

Thanks

Thomas
___
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] New logo proposal

2019-01-30 Thread Thomas A. Schmitz

On 1/30/19 1:50 PM, Willi Egger wrote:

I would say, that the multicolor version is dissecting the word ConTeXT to 
unidentifiable crumbles. It is to my taste to less connected to typesetting, 
herewith agreeing partly with Clyde.


It is useless to argue about taste, but it may be of interest to see how 
users react. I would agree with Willi. The colors look too random to me. 
A fine-tuned palet with  a smaller range of colors that are visually and 
intuitively related would be preferable, IMHO. But again: de gustibus 
non est disputandum; if Paul likes this look, he should by all means use 
it in his presentations and documents.  And of course, thanks for 
sharing your design with us!


Thomas
___
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] Sorting registers method for "uppercase like lowercase, diacritics ignored"

2019-01-20 Thread Thomas A. Schmitz

On 20.01.19 21:59, Marcus Vinicius Mesquita wrote:

Well, I tried all possible permutations thereof, and also the predefined
methods, and none gives what my editor wants, which is just "uppercase like
lowercase, diacritics ignored".
See MWE attached.
Please, would somebody help me achieve the desired result?


Your example doesn't contain any uppercase letters. Which makes it a bit 
difficult to test what you're looking for. I must admit that I'm not 
very familiar with register "methods," I assume that Wolfgang or Hans 
will be able to tell you how to use them. For your case, if you merely 
want to get rid of all distinctions between upper- and lowercase, 
accents, etc., you could use

Lua (slightly modified example):

\mainlanguage[pt]
\defineregister [nome]
\setupregister  [nome] [
  language=pt,
  n=1,
]

\startluacode
  userdata = userdata or { }
  function userdata.indexing(s)
t = characters.lower(characters.shaped(s))
context.nome( { t }, s)
  end
\stopluacode

\def\mynome#1%
  {\ctxlua{userdata.indexing([==[#1]==])}}

\starttext

\mynome{árvore}árvore \mynome{Äard}Äard \mynome{água}água 
\mynome{Água}Água  \mynome{abnegação}abnegação \mynome{alegria}alegria 
\mynome{agrilhoado}agrilhoado \mynome{anjo}anjo \mynome{ódio}ódio 
\mynome{orgulho}orgulho \mynome{Åz}Åz \mynome{Åaaa}Åaaa \mynome{Özz}Özz 
\mynome{Öaa}Öaa


\page[yes]

\placeregister [nome]

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

[NTG-context] final thoughts on experiments with lua

2019-01-09 Thread Thomas A. Schmitz
I've finished testing my lua script, and it does exactly what I need. I 
think I'll write a small article about it for one of the next context 
group proceedings, but wanted to just give a very brief summary that 
might be of interest to some:


Pure Lua is wonderful, but as the language is deliberately kept very 
small, one sometimes has to find rather cumbersome workarounds. If you 
run Lua under ConTeXt (with mtxrun --script), you get a version with 
batteries included, which is perfect for manipulating and analyzing 
text. Some areas that I found particularly impressive:


1. I've tried several times to make use of lpegs. Hans' code is full of 
it, and I know that it's fast and extremely versatile, but I found it 
difficult to wrap my head around its functioning and write useful code 
with lpegs. The ConTeXt wrapper makes this extremely easy; this is lpeg 
for the rest of us. It's really a delight to build patterns and see them 
work immediately!


2. The utf library and string manipulation with characters.(...) is 
absolutely necessary if you want to handle non-ASCII text because pure 
Lua gives very unexpected results in this area. These operations work 
wonderfully with the context libraries.


3. Lua's handling of tables is very efficient and fast. For analyzing my 
Greek texts, I have to use huge tables for morphological parsing, with 
more than 900,000 entries. Looking up words in these tables is around 3x 
faster in Lua than in python!


One final thought: one limitation that I still find cumbersome to work 
around is the fact that associative arrays ("pairs" in Lua speak) do not 
have an order. When I analyze my texts, I want book numbers, chapters, 
paragraphs preserved in the order in which they are read (entered into 
the table). In many cases, it is not possible (or extremely awkward) to 
sort these numbers, since chapters may be numbered something like 2, 2a, 
3, 3α, 3β etc. python has the OrderedDict() in its collections module. 
In Lua, the best I could find was entering the chapter numbers into an 
array (ipair) and then retrieve it from there. Maybe there is a better way?


All of this just to say how grateful I am for the way Hans, Taco, 
Wolfgang, Luigi, and the other developers have enhanced Lua. Thanks 
guys, you make my work much more pleasant and efficient!


Thomas
___
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] further experiments with lua

2019-01-09 Thread Thomas A. Schmitz

On 1/9/19 9:47 AM, Hans Hagen wrote:
mtxrun has al the basic modules in it but not the character ones 
(thinking of it, i can add an autoload for that, maybe i should do that)


so you need:

require "char-ini"


Hans, Luigi,

thanks a lot, that solves it! Maybe autoload or at least a small hint in 
cld-mkiv.pdf?


Thomas
___
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] further experiments with lua

2019-01-08 Thread Thomas A. Schmitz

Hi Hans,

I'm doing some further experiments with the utf and lpeg libraries. This 
code fails, and I don't understand why:


local s = "Ä"

print(characters.uccode(s))

mtxrun --script test.lua


./test.lua:3: attempt to index global 'characters' (a nil value)

Thomas
___
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] papersize problem with latest beta

2019-01-07 Thread Thomas A. Schmitz


> On 7. Jan 2019, at 17:07, Hans Hagen  wrote:
> 
> i uploaded a fix

Sorry, didn’t see the new upload. Thanks, issue is fixed!

Thomas
___
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] papersize problem with latest beta

2019-01-07 Thread Thomas A. Schmitz
Hi Hans,

the latest and greatest (2019.01.07 10:07) has a problem with papersizes. MWE:

\setuppapersize[A6]

\showframe

\starttext

Hello world

\stoptext

All best

Thomas
___
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] lua lpeg + utf8

2019-01-06 Thread Thomas A. Schmitz

On 06.01.19 23:08, Hans Hagen wrote:

what do you mean with "running luatex alone" ; you can run scripts with

mtxrun --script yourscript foo.txt

(or do you mean something different)


Hi Hans,

thanks, this is what I meant! I guess I was trying to reinvent the wheel 
and doing things in pure Lua, but processing utf8 is indeed much easier 
with all the context functions. So thanks, I hope I can take it from here!


Thomas
___
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] lua lpeg + utf8

2019-01-06 Thread Thomas A. Schmitz

On 06.01.19 19:20, Wolfgang Schuster wrote:

\starttext

\startluacode

print("abcdeφὴὰabcde")

local remap = utf.remapper { a = "y", c = "z", ὴ = "ή", ὰ = "ά" }

print(remap("abcdeφὴὰabcde"))

\stopluacode

\stoptext


Wolfgang, thank you, I should have looked into this manual! Is there an 
easy way to load the necessary additional libraries if I'm running 
luatex alone, outside of mtxrun?


Thomas
___
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] lua lpeg + utf8

2019-01-06 Thread Thomas A. Schmitz

Hi everybody,

best wishes for (the still new) 2019! My question is not strictly a 
ConTeXt problem, but about the way luatex (and pure Lua) can handle utf8 
in lpeg. Here is my Lua example:


mystring = "abcdeφὴὰabcde"

local replace_table = {
  a = "y",
  c = "z",
  ὴ = "ή",
  ὰ = "ά",
}

function replace(s)
local patt = (lpeg.Cs(1)) / replace_table
local parser = lpeg.Cs((patt + 1)^0)
t = parser:match(s)
return t
end

newstring = replace(mystring)

print(newstring)

This will successfully replace "a" and "c," but not "ὴ" or "ὰ" because 
lpeg.Cs(1) sees only the first byte of these multibyte characters. Pure 
Lua complains with an error message; luatex runs, but does not do the 
replacement. What would be a good way to work around this limitation?


All best

Thomas
___
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] book

2018-12-20 Thread Thomas A. Schmitz

On 12/16/18 2:45 PM, Andrea Valle wrote:

sorry
https://www.logos-verlag.de/cgi-bin/engbuchmid?isbn=4466  



This looks very interesting, from a typographical point of view. How did 
you create the music notation examples? Would it be possible to showcase 
a few pages that are particularly complex, on the wiki, for example?


Thomas
___
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] Issues using publications subsystem for non-bibliographic database

2018-12-08 Thread Thomas A. Schmitz

On 08.12.18 20:50, Alan Braslau wrote:

In my incremental development, I place a bibliography at the end of a chapter, 
part, or even section - there is no need for this to be backmatter. Using 
modes, these then can remain or not be rendered as design advances.


I've been following this thread somewhat distractedly... From a 
systematic point of view, Alan is of course right: a reference should 
refer to something, which is normally a list. However, I find myself in 
situations where I want a reference, but this list should not be 
included in the document. Example: you distribute a bibliographical list 
on your handout and want your slides to display the numeric reference, 
but not the list itself. So I wonder if one possible solution would be 
to provide the possibility to have the list calculated but not typeset 
(hidden). In a naive way, I tried something like


\hbox to width 0cm{\placelistofpublications}

but that doesn't work. But I'm sure this should be easily doable? As for 
something like full citation information in the footnote, with 
crossreference (something like "above, n. XXX"): the format seems 
obsolete, I agree, but at least in the humanities, it is still often 
used and would be very handy to have.


All best

Thomas
___
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] regression in bib system

2018-12-05 Thread Thomas A. Schmitz

Hans, Alan,

I'm experiencing a regression with bibliographies in the latest beta 
(2018.12.01 13:20). I haven't been able to reduce it to a MWE yet, but 
here's what I get from my bibliographic files: compilation hangs with 
this message:


close source> level 2, order 8, name 
'/mnt/shared/Documents/excerpts.tex'
close source> level 1, order 8, name 
'/mnt/shared/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'

backend > info > no date/time but fake id information will be added

? ^\/mnt/shared/context/tex/texmf-linux-64/bin/context: line 2: 18125

When I hit enter, I get

mtx-context | fatal error: return code: 1

but the produced pdf appears to be correct. The same file compiles fine 
with version 2018.10.02 23:17. I don't have any version in between. I'll 
see if I can produce a MWE, but I wanted to give you a heads up in advance.


All best

Thomas
___
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] ConTeXt source from XML

2018-10-23 Thread Thomas A. Schmitz

> On 23. Oct 2018, at 10:43, Hans Hagen  wrote:
> 
> examples ... i thought that there is a kind of error message on the console 
> (at least in a tex run)

Yes, I often get errors like “can’t close tag  with  on line .” 
But I don’t know in which situations these messages pop up and when context 
simply bails out.

Thomas
___
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] wrong hyphenation in ancient Greek?

2018-10-13 Thread Thomas A. Schmitz

On 13.10.2018 10:05, Pablo Rodriguez wrote:

As far as I know, two consonants in ancient Greek aren’t hyphenated,
when they may begin a word.

Γν may be the beginning of word in Greek (such as γνῶσις), but even LSJ
has no word that begins with γμ.

Am I missing something or should this be improved in the hyphenation
patterns?


You're right, this shouldn't happen. I tried in vain to find the culprit 
in lang-agr.lua and to see more with


\enabletrackers[hyphenator.visualize,hyphenator.steps,languages.patterns]

but failed. Arthur is the guru here, so maybe he has a suggestion?

Thomas
___
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] tex-gyre fonts missing in 2018.07.02 14:39

2018-07-04 Thread Thomas A. Schmitz
Hi Hans,

is it possible that you forgot to include the texgyre fonts in the latest beta? 
I just realized that the directory 
experimental/tex/texmf/fonts/opentype/public/tex-gyre is missing… (and my 
documents are in latin modern)

All best

Thomas
___
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] xml, language, btx problems

2018-06-18 Thread Thomas A. Schmitz



sometimes you need to do

\starttexcode
   ...
\stoptexcode

when inside some special caocode regime (which happens in xml)

Hans


Hans, thank you - that was the golden hint! It works now as I've always 
wanted! And I realize once again that I know far less about ConTeXt than 
I wished and thought...


Wolfgang: thanks for your suggestions, too! I had thought about loading 
the xml document twice, the first time just for extracting the 
"language" information, but felt it was less than elegant and maybe not 
quite efficient (my lecture course xmls tend to have more thah 25,000 
lines). But I didn't provide enough information for you to see the 
easiest solution.


Thanks, I'm a happy camper again (I have to prepare the handout for a 
talk I'm giving next week in Israel...)


Thomas
___
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] xml, language, btx problems

2018-06-18 Thread Thomas A. Schmitz

Hi Alan,

thanks for joining the discussion! Just to answer your two queries about 
my setup:


On 06/18/2018 12:58 AM, Alan Braslau wrote:

Thomas,

Why would the definitions need to be loaded before \starttext?
The bibliographic data can be loaded independent of any rendering or
use definitions.


That's what I deduced from my experiments. When I load the definitions 
in the xml setup of the root element, they are not loaded, but printed 
verbatim to the pdf file. My deduction may be wrong - this is a pretty 
complex setup, in which I produce slides, manuscript (in different 
formats), handout, and bibliography all from the same xml source. So it 
may be some interference/interaction of these complex parts that I don't 
quite understand. I'll continue experimenting...


Also, why don't you write your custom definitions to

handle languages, rather than writing new definition sets based on
language?

There is one stumbling block that made me think I had to have two 
separate setups (in addition to the fact that it makes the source 
cleaner and easier to maintain): I copied publ-imp-apa.* and modified it 
to suit my needs. Now for apa, editors and authors are included in one 
set, e.g., in line 169-171:


categories.book = {
sets = {
author = { "author", "editor", "publisher", "title" },
}

In my German bibliography file, I distinguish between authored volumes 
and edited volumes both for the presentation and for the sorting:


Author, Firstname: Title ...

as opposed to

Edited Volume, hrsg. von Firstname Editor ...

and I found that as long as I had this "set" line in my 
publ-imp-style.lua file, I would always get


Editor, Firstname: Edited Volume, hrsg. von Firstname Editor ...

When I deleted the line, I could get what I wanted. So my inference was 
that for my German bibliography, I needed a different lua and a 
different publ-imp-.tex file. But maybe I was wrong and you have an 
easier approach?


All best and thanks!

Thomas


___
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] xml, language, btx problems

2018-06-17 Thread Thomas A. Schmitz

On 06/17/2018 09:37 PM, Pablo Rodriguez wrote:

Hi Thomas,

this may work in your case:

  \startxmlsetups xml:document
  \mainlanguage[\xmlatt{#1}{language}]
  \doifmodeelse{**en}
{\usebtxdefinitions [english]}
{\usebtxdefinitions [deutsch]}
  \stopxmlsetups

I have just checked in with another document and it worked as expected.


Thank you for your suggestion, Pablo, but this is just a slightly 
different syntax to express the same test, this doesn't change anything. 
Maybe this document is clearer in explaining my problem (and results are 
identical with the \doifmodeelse syntax):


\startbuffer[test]

   test

\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{\xmldocument}{document}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document
\mainlanguage[\xmlatt{#1}{language}]
Language settings work correctly here:

\doifelse {\currentmainlanguage} {de}
{\color [blue] {Deutsch}}
{\color [red]  {English}}\par
\xmlflush{#1}
\stopxmlsetups

\starttext
This is where the btx set has to be loaded, and language settings do not 
work as needed:


\doifelse {\currentmainlanguage} {de}
{\color [blue] {Deutsch}}
{\color [red]  {English}}\par

\xmlprocessbuffer{main}{test}{}

\stoptext

Is there any way to set the language before the  element is 
processed? I experimented with this


\startxmlsetups xml:language:initiate
\mainlanguage[\xmlattribute{\xmldocument}{root::/document}{language}]
\stopxmlsetups

\xmlbeforedocumentsetup{\xmldocument}{xml:language:initiate}{xml:testsetups}

but this doesn't work, and I'm not sure I'm using it the right way.

All best

Thomas
___
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] xml, language, btx problems

2018-06-17 Thread Thomas A. Schmitz

Hi,

I have a conceptual problem integrating btx into my xml workflow. There 
are too many files involved, so no minimal example, but a minimal 
description. Root of my xml document:



...


I have two files with btx definitions:

publ-imp-deutsch.mkvi

publ-imp-english.mkvi

Loading one of these two should depend on the main language:

\doifelse {\currentlanguage} {en}
{\usebtxdefinitions [english]}
{\usebtxdefinitions [deutsch]}

My problem: the main language is set within the processing rules for the 
root of my xml document:


\startxmlsetups xml:document
   \mainlanguage[\xmlatt{#1}{language}]
\stopxmlsetups

However, this implies a \starttext. And the btxdefinitions need to be 
loaded before \starttext, or so it seems. Which means: the processing 
rules for \usebtxdefinitions need to be set outside of the xml setups. 
But at this moment, the main language is not set yet, and the \doifelse 
fails. Any hints how to get out of this conundrum?


Thanks, and all best

Thomas
___
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] Build for Alpine Linux

2018-04-17 Thread Thomas A. Schmitz

On 04/17/2018 05:25 PM, Arthur Reutenauer wrote:

   I can’t test musl support, but the new code should avoid the problem
Thomas experienced.

Best,

Arthur


I haven't had any trouble so far but need to test with another computer, 
tonight.


Thomas
___
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] linux binaries split?

2018-03-24 Thread Thomas A. Schmitz

On 03/24/2018 05:51 PM, Mojca Miklavec wrote:

I reverted the change for now until someone can come up with a working command.



Arthur's

if command -v ldd >/dev/null && ldd --version 2>&1 | fgrep -q '^musl'

works for me, but again, there may be other corner cases that we don't 
see now. I would suggest reversing the logic of this test: default to 
linux unless you clearly find the string "musl" in the output; don't 
rely on a zero result, which may be prevented by a number f reasons...


Thomas
___
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] linux binaries split?

2018-03-24 Thread Thomas A. Schmitz

On 24.03.2018 14:06, Arthur Reutenauer wrote:

   Quite possibly the shell makes a difference, but the expression being
grepped for really should be protected by quotes.  Can you try

ldd --version 2>&1 | fgrep -q '^musl'

?

Best,

Arthur


Arthur, with your command, I get an empty line as return. My question 
still stands: what is the expected result for this test? If I run the 
command


ldd --version 2>&1 | grep -q ^musl

from inside my system, grep will report all the subdirectories with a line

grep: XXX: Is a directory

So: if the test defaults to "musl" when the return is non-empty, that 
would explain a lot. And it should be adapted since it puts a lot of 
confidence into the return of this command.


Thomas
___
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] linux binaries split?

2018-03-24 Thread Thomas A. Schmitz

On 24.03.2018 13:32, Mojca Miklavec wrote:

The binaries were requested (and provided) by Henri Menke:
https://mailman.ntg.nl/pipermail/ntg-context/2018/090611.html

 From what I understood (maybe I misunderstood) the regular linux
binaries would not even work on machines with musl, but maybe you have
both libc and musl installed?

It was not meant to be a short-term thing (unless/until we figure out
that there are too many problems with it and nobody uses it), but it
was probably never even tested properly and Hans did not yet implement
support in mtxrun, so maybe installing out-of-the-box would not yet
work, I don't have a machine to test it.


I was just writing this message when more replies arrived.  I have never 
heard of musl and have never installed it; pretty sure all my linux 
installations are regular ones with libc. So: the problem appears to be 
with the test in


if command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl
then
libc=musl
else
libc=glibc
fi

which appears to default to musl even if it is not present. But I don't 
know enough about shell scripting to debug it - could it also be a 
problem with the shell used? (Mine is zsh.)


Thomas
___
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] linux binaries split?

2018-03-24 Thread Thomas A. Schmitz

On 03/24/2018 12:14 PM, luigi scarso wrote:


hm, what does
command -v ldd >/dev/null && ldd --version 2>&1
say ?


ldd (GNU libc) 2.26
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.


it's a "long term", ie until  it's in texlive .
If not in texlive, it can be dropped, but not necessarily.


Sorry, I don't understand, this sounds contradictory to me.

On 03/24/2018 12:15 PM, Hans Hagen wrote:
> i have no clue what drives this but i suppose than a specific linux only
> has one of these two libs
>
> (no sign of musl in my scripts here)

I see this tex/setuptex:

if command -v ldd >/dev/null && ldd --version 2>&1 | grep -q 
^musl
then
libc=musl
else
libc=glibc
fi


rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh .

it looks like that one has changed 


Even with the new first-setup.sh: when I run it, there are no new 
binaries in context/tex/texmf-linuxmusl-64/bin, so for the time being, 
context minimals are broken on arch linux (and its derivatives, I guess).


Thomas
___
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] linux binaries split?

2018-03-24 Thread Thomas A. Schmitz

Hi,

I wanted to use my minimal installation on arch linux this morning and 
received this error:


Binaries for platform 'linuxmusl-64' are missing.
(There is no folder "/mnt/shared/context/tex/texmf-linuxmusl-64/bin")
provide a proper tex root (like '. setuptex /something/tex')

Looking into setuptex, I see indeed a test for "libc=musl" or 
"libc=glibc," so it appears that we now have two sets of binaries for 
linux-64? Is this supposed to be a long-term thing or just in the 
preparation for texlive 2018? (I share my minimal directory between 
several linux installations, so I assume I would need both sets?)


Thank you, and all best

Thomas
___
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] natural tables to extreme tables

2018-02-28 Thread Thomas A. Schmitz

On 02/28/2018 11:35 PM, Hans Hagen wrote:
page 26 of the xtable manual ... you define tagged settings and can use 
these tag for cells and rows


OK Hans, I see that, thanks a lot! But it still means I have to tag the 
cells/rows? As always, I'm playing with xml and Lua and am trying to 
write some universal code that allows me to try out different table 
mechanisms. Just to explain (don't spend time on this, I'm just playing 
around): I collect my table settings like this:


\startsetups section_table
\setupframedtablecolumn [1] [width=0.7cm,align=left]
\setupTABLE [column] [1] [width=0.7cm,align=left]
\stopsetups

In my Lua file, I start tables like this:

starttable()
startrow()
startcell() etc.

and can switch from one mechanism to another by having these aliases:

starttable = context.startframedtable
starttable = context.bTABLE
starttable  = context.startembeddedxtable

and commenting out the mechanisms that I don't need. But it looks like 
the xtable needs additional arguments to work...


Thanks, and all best

Thomas
___
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] natural tables to extreme tables

2018-02-28 Thread Thomas A. Schmitz

Hi,

for my experimenting with tables: is there a way to set up individual 
columns in xtables? Maybe I'm thick tonight, but I couldn't find 
anything in the manual or the source. If I have this setup


\setupTABLE [frame=on,split=repeat]
\setupTABLE [column] [1] [width=0.7cm,align=left]
\setupTABLE [column] [2] [width=0.5cm,align=left]
\setupTABLE [column] [3] [width=6cm,align={normal,verytolerant,stretch}]
\setupTABLE [column] [4] [width=8cm,align={normal,verytolerant,stretch}]
\setupTABLE [column] [5] [width=1cm,align={normal,verytolerant,stretch}]

how would this translate into \setupxtable?

Thomas
___
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] How to do an inline itemization?

2018-02-28 Thread Thomas A. Schmitz

On 02/28/2018 11:33 AM, Dr. Thomas Möbius wrote:

How to do an in-line / in-text itemization?

I would like to (i) enumerate something (ii) in the text (iii) but I 
don't know how.


Thank you!
Thomas


\starttext

\startitemize[n,text]
\startitem
One
\stopitem
\startitem
Two
\stopitem
\stopitemize

\stoptext

I think this isn't documented in the wiki and should be added.

Thomas
___
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] Learning how to use \setupbtxrendering

2018-02-20 Thread Thomas A. Schmitz
Hi Otared,


> 
> So my first question is: how can one define one's own « specification », when 
> modifying built-in specifications is not satisfactory for one's needs, or 
> does not give the expected result? 

I work with lots of bibliographies and want my very own styles, and I have 
indeed found that it is easier to define my own styles rather than modify the 
existing ones. So what you want to do:

1. you define your own style, let’s call it otared. So in your main tex file, 
you would have this line:

\usebtxdefinitions [otared]

This means you have to create two files, one for the lua definitions, one for 
tex. 

2. For the lua file, just take publ-imp-apa.lua and cpy it as 
publ-imp-otared.lua. Chances are you won’t have to make any changes right away. 
The content is pretty straightforward lua code.

3. The tex file publ-imp-otared.mkvi will then contain your definitions in a 
block 

\startbtxrenderingdefinitions[otared]

...

\stopbtxrenderingdefinitions

You define two different sets of definitions: one for the citations in the text 
(in the form \startsetups btx:cite:XXX), one for the list of references (in the 
form \startsetups btx:list:XXX). Here you can make all the formatting you want: 
article name in red, author name for articles in small caps, journal name in 
3D, whatever. Again, just look at publ-imp-apa.mkvi and try to understand how 
it works; it’s not that difficult.

> The second question is: how can one write a file containing only the 
> references which are used in a document, so that that file can be in some way 
> included into the main document (this is somewhat analogous to the .bbl file 
> created by BibTeX, which allows to include a series of \bibitem into an 
> article written with LaTeX: this is necessary to do when one submits a paper 
> to a mathematical journal).
> 
> Thanks again for your help: OK

The list of references is included in the .tuc file that a context run 
produces. If you need to massage it into any other form, 5 minutes of lua 
coding can extract the salient information for you.

HTH

Thomas
___
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] Learning how to use \setupbtxrendering

2018-02-18 Thread Thomas A. Schmitz

On 02/18/2018 06:07 PM, Alan Braslau wrote:

title={The Cambridge Companion to {\em Ulysses}},


Alan, I think this was Rik Kabel's point: for some scenarios, you cannot 
avoid to have some sort of context commands in your bibtex file. For a 
while, I also used biblatex from time to time, so I tried to have a 
bibtex file that would be as clean as possible and work with both 
systems, but your example shows that this is not always possible. Well, 
nothing that some well-written perl couldn't get rid of...


All best

Thomas
___
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] xits-math font problem

2018-02-18 Thread Thomas A. Schmitz

On 02/16/2018 11:57 AM, Hans Hagen wrote:
you can look into the cache and see what names.tma mentions (and save 
the xits bit for later comparison when it fails)


as i can't replicate it here i need that info

Hans,

I have compared the two files names.tma from my laptop (has the error) 
and my desktop (works); both run some form of x86_64 linux and have 
context minimals 2018.02.12. The only difference I could spot relating 
to xits was this: the working computer has these entries in the table


["otf"] = {
   ["xits"]=752,
   ["xitsbold"]=749,
   ["xitsbolditalic"]=750,
   ["xitsitalic"]=751,
   ["xitsmath"]=754,
   ["xitsmathbold"]=753,
   ["xitsmathregular"]=754,
   ["xitsregular"]=752,
  },

the not-working one only has:

["otf"] = {
   ["xits"]=749,
   ["xitsbold"]=744,
   ["xitsbolditalic"]=745,
   ["xitsitalic"]=746,
   ["xitsmath"]=747,
   ["xitsmathbold"]=748,
  },

so the entry for xitsmathregular is missing. But I have no idea if this 
is helpful for you. If you want, I can zip the two files and send them 
to you.


All best

Thomas
___
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] xits-math font problem

2018-02-16 Thread Thomas A. Schmitz

On 16.02.2018 08:37, Hans Hagen wrote:



can you try mtxrun --script font --reload --force


Hans, it's the same problem I reported about a week ago, and in my 
experience, it recurs intermittently. A reload of the font cache fixes 
it for a while, but it comes back, and it concerns only XITS math, so 
something is fishy about this font or about the way context treats it... 
One thing that could help: is there a tracer that could show more 
information once the cache gets into this state, so we can see what 
actually goes wrong?


Thomas
___
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] Sending data from lua to context and back to lua

2018-02-08 Thread Thomas A. Schmitz

On 08.02.2018 15:34, Rudolf Bahr wrote:

With the use of "\immediate\write" and "\read" in context and the read and write
functions in lua I know exactly from where to where the data goes. How to do
the same with "context()"?


This question is impossible to answer - what is "the same"? Please make 
a minimal example to show what you have tried and where you had trouble 
- the manual I referred to provides good starting points.


Thomas
___
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] Sending data from lua to context and back to lua

2018-02-08 Thread Thomas A. Schmitz

On 02/07/2018 06:39 PM, Rudolf Bahr wrote:

Sometimes the necessity could arise to send data from lua to context
and answers back to lua. I tried this by using "read" and
"immediate\write" commands in context. These commands are described
in chapter 21 and 22 of Donald E. Knuth's "The TeXbook".

My question is: Do there exist better and more simple solutions?


You can print (typeset) information from inside lua code with the 
"context" function. Have you seen the manual cld-mkiv.pdf? It's in the 
minimals.


Thomas
___
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] Metapost: How to get total number of pages?

2017-11-17 Thread Thomas A. Schmitz

On 17.11.2017 14:02, Procházka Lukáš Ing. wrote:
it seems that there is 'PageNumber' variable (macro) available within MP 
code, maybe introduced by 'StartPage', within MP.


How do I get total number of pages or last page number within MP (in 
Ctx: \totalnumberofpages, \lastpage)?


NOfPages

If you had grepped the source for PageNumber, you would have discovered 
that all of this is defined in meta-pag.mkiv.


Thomas
___
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] ASCII input - non ASCII output

2017-11-08 Thread Thomas A. Schmitz

On 11/08/2017 11:34 AM, Mojca Miklavec wrote:

I'm still not arguing that this is the most brilliant idea, but I can
totally imagine a Serbian professor wanting to "auto-generate" a
Cyrillic version of his book on top of the Latin edition with
close-to-zero extra effort.


Ok, I can see that this may be a convenient way of producing different 
output from the same source; I wasn't aware of this (and I was somewhat 
provocative about Latex, of course :-) From a conceptional point of 
view, it still feels a bit hackish to do these things on the font level, 
because they are not/should not be tied to specific fonts - you'd have 
to rewrite your features or goodies or whatever they are called now for 
every font you want to use (and you may run into a number of funny 
inconsistencies in character names or even unicode slots).


Thomas
___
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] ASCII input - non ASCII output

2017-11-07 Thread Thomas A. Schmitz

On 11/07/2017 01:48 PM, Sava Maksimović wrote:

Is there a way in context, that for some*text*  ascii input (in source .tex
file) define mapping in internal tex system ?

For example, if i put two ascii characters "dj" in .tex file, can i  get
cyrillic character "ђ" in .pdf ?
And so on, for input b, v, g, d, ... to get output б, в, г, д, ...

Or more general, for every letter/string in unicode to define the way that
it should be read.

It's benefit for non ascii language users, because in that case they don't
need to switch keyboard layout all the time between command, math input and
text input.

When mkiv was in its infancy, Hans helped me in writing something like 
this for my Greek module. It basically applies a Lua string.gsub to the 
input to produce and typeset utf8 output. But I pretty soon gave up 
using it. We're in the twenty-first century, and this sort of trickery 
really is not needed any more. And, as Mojca has said, you would have to 
have your text delimited, you don't want your ConTeXt commands to be 
transliterated as well. I can send you the relevant code if you want, 
and you could adapt it to your case. But I would advise against it. In 
the long run, changing keyboards is less hassle than this sort of 
semi-solution to an obsolete problem.



In Latex, package fontenc(precisely OT2 encoding) do that things.


Yes, LaTeX stays firmly in the 1970s. But the world has moved on.

Thomas
___
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] ligature exceptions

2017-09-27 Thread Thomas A. Schmitz

On 09/27/2017 10:25 PM, Henning Hraban Ramm wrote:

Thank you for the suggestion.
I tried

\replaceword[eka][Auflage][Au{fl}age]
\setreplacements[eka]

and even converted the german wordlist from the selnolig package, but it 
doesn’t help.



Works here. You'll have to make a real example.

Thomas
___
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] ligature exceptions

2017-09-27 Thread Thomas A. Schmitz

On 09/27/2017 02:16 PM, Thomas Widmann wrote:

That's a nice idea.  If something like that existed, it could be used
to change 's' to 'ſ' in relevant places, too.



This exists, see here: 
https://www.mail-archive.com/ntg-context@ntg.nl/msg79381.html

___
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] Troubleshooting pdf bookmarks

2017-09-26 Thread Thomas A. Schmitz

On 09/26/2017 12:19 PM, Henning Hraban Ramm wrote:

There was \tracebookmarks only in MkII.



Isn't that what \enabledirectives[references.bookmarks.preroll] does 
nowadays?


Thomas
___
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] abbreviations: \infull always in small caps

2017-09-23 Thread Thomas A. Schmitz

On 23.09.2017 12:40, Henning Hraban Ramm wrote:

Ahoi,
I’m trying to employ the synonyms mechanism for abbreviations, as documented:

\setupsynonyms
   [style=italic,
   headstyle=bold,
   titlestyle=normal,
   synonymstyle=normal]

\abbreviation{Abt.}{Abteilung}
\abbreviation{ADN}{Allgemeiner Deutscher Nachrichtendienst}
\abbreviation{AFL}{American Federation of Labor}
\abbreviation{ANC}{African National Congress}
\abbreviation{AV}{Auslandsvertretung}
\abbreviation{BArch}{Bundesarchiv}

\starttext
\placelistofabbreviations[criterium=all]

\infull{AV}
\infull{AFL}

\stoptext

The result of \infull is always in small caps, and I don’t like that. I 
couldn’t find its definition in the source* nor a setup command.


It's defined in strc-syn.mkiv, lines 655-8. If you add

\setupsynonyms [abbreviation] [textstyle=normal]

to your file, you'll get the result as normal text.

All best

Thomas
___
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] Hyphenation with dashes in natural table

2017-09-11 Thread Thomas A. Schmitz

On 09/11/2017 10:23 PM, Rik Kabel wrote:

See http://wiki.contextgarden.net/Compound_words.


But this page also contains the solution to the original problem:

\setbreakpoints [compound]

Thomas
___
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] typesetting serial letters in Context

2017-06-13 Thread Thomas A. Schmitz

> On 13. Jun 2017, at 09:53, luigi scarso  wrote:
> 
>> Yet there is no x-corres.mkiv. Who can help me out?
>> 
> I don't remember x-corres.mkiv, but
> mkiv has a guide
> tex/texmf-context/doc/context/documents/general/manuals/xml-mkiv.pdf

Yes, typesetting xml in mkiv is a completely different beast from mkii. It is 
vastly superior and very powerful, but you will have to relearn and recode. 
There is the manual Luigi mentioned, there are also some pages on the wiki to 
facilitate the transition.

Thomas
___
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] framedtable frame

2017-05-21 Thread Thomas A. Schmitz

Hi all,

I am hitting a slight imperfection in the new framedtable mechanism. 
Example included; question: is it possible to have the same behavior in 
cell frames as in the natural table in the third part of my example?


Thanks, and best wishes

Thomas

\starttext

\start
\setupframedtablecolumn [1] [width=3cm,align=normal]
\setupframedtablecolumn [2] [width=3cm,align={normal,verytolerant,stretch}]
\setupframedtablecolumn [3] [width=3cm,align=normal]
\setupframedtablecolumn [4] [width=3cm,align=normal]

\startframedtable
\startframedrow
\startframedcell
One
\stopframedcell
\startframedcell
Cell Two has a slightly longer text
\stopframedcell
\startframedcell
Three
\stopframedcell
\startframedcell
Four
\stopframedcell
\stopframedrow
\stopframedtable
\stop

\blank [line]

\start
\setupframedtablecolumn [1] [width=3cm,bottomframe=off,align=normal]
\setupframedtablecolumn [2] 
[width=3cm,bottomframe=off,align={normal,verytolerant,stretch}]

\setupframedtablecolumn [3] [width=3cm,bottomframe=off,align=normal]
\setupframedtablecolumn [4] [width=3cm,bottomframe=off,align=normal]

\startframedtable
\startframedrow
\startframedcell
One
\stopframedcell
\startframedcell
Cell Two has a slightly longer text
\stopframedcell
\startframedcell
Three
\stopframedcell
\startframedcell
Four
\stopframedcell
\stopframedrow
\stopframedtable
\stop

\blank [line]

\start

\setupTABLE [frame=on]
\setupTABLE [column] [1] [width=3cm,align=normal]
\setupTABLE [column] [2] [width=3cm,align={normal,vertolerant,stretch}]
\setupTABLE [column] [3] [width=3cm,align=normal]
\setupTABLE [column] [4] [width=3cm,align=normal]

\bTABLE
\bTR
\bTD
One
\eTD
\bTD
Cell Two has a slightly longer text
\eTD
\bTD
Three
\eTD
\bTD
Four
\eTD
\eTR
\eTABLE

\stop

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

[NTG-context] another question about markings

2017-05-08 Thread Thomas A. Schmitz
Aaaand here's another question about markings: how could I compare the 
value of the top/bottom (or first/last) markings and have the header 
change accordingly? Example attached, it doesn't do what I (naively) 
expected it to do.


All best

Thomas

\setuppapersize [A5]

\definemarking[Head]

\startsetups Headersetup

\doifelse{\expanded{\getmarking[Head][top]}}{\expanded{\getmarking[Head][bottom]}}{\getmarking[Head][top]}{\getmarking[Head][top] 
– \getmarking[Head][bottom]}

\stopsetups

\setupheadertexts[\texsetup{Headersetup}]

\starttext

\dorecurse{6}{\marking[Head]{Tufte}\input tufte\par}

\dorecurse{6}{\marking[Head]{Knuth}\input knuth\par}

\dorecurse{6}{\marking[Head]{Tufte}\input tufte\par}

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

[NTG-context] linenumbers in marking

2017-05-08 Thread Thomas A. Schmitz

Hi all,

5 years ago, on the mailing list, there was a thread started by Pablo 
Rodríguez (http://www.mail-archive.com/ntg-context@ntg.nl/msg62140.html) 
about line numbers in headers. Wolfgang Schuster replied that in 
principle, it's possible to have line numbers in headers, "but it’s not 
usable because the numbers are always shown on the next page." He made 
the following example (which I have slightly adapted):


\definemarking[linenumber]

\define\LinenumberCommand
  {\normalexpanded{\setmarking[linenumber]{\linenumber}}}

\setuplinenumbering[command=\LinenumberCommand]

\startsetups linenumber

\doiftext {
\getmarking[linenumber]
}
{
\getmarking[linenumber][top] – 
\getmarking[linenumber][bottom]

}

\stopsetups

\setupheadertexts[\texsetup{linenumber}]

\starttext

\dorecurse{6}{\input tufte\par}

\startlinenumbering
\dorecurse{20}{\input knuth\par}
\stoplinenumbering

\resetmarking[linenumber]

\dorecurse{6}{\input tufte\par}

\stoptext

Hans wrote: "currently it's not possible but it's no big deal to add 
that feature at some point." I have now a similar problem with markings 
in a header. Is there a solution to this? Could it be implemented now?


Thanks, and best wishes

Thomas
___
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] (again) index sorting of accented characters

2017-04-27 Thread Thomas A. Schmitz

On 04/27/2017 10:26 PM, Pablo Rodriguez wrote:

Could you please confirm the issue?

Many thanks for your help,



Two remarks:

1. I'm not sure what you're looking for. Do you really want an index 
that sorts every form of every word as an entry? So that ἐμήν and ἐμοῖς 
are different words and not occurrences of the same entry? If that's 
really what you're looking for, you may want to look into a very handy 
luatex function: characters.shaped() returns the unaccented characters 
of a unicode string, see chapter 11.2 of cld-mkiv.pdf. Define your own 
command that uses this lua function to index the unaccented word; that's 
not too hard.


2. If, on the other hand, you want to build a real index that will sort 
morphological forms under their head words, you will have to give the 
sort term explicitly, and then you don't have to rely on ConTeXt's 
abilities to sort accented Greek because you will have something like 
ἐμήν\index{εμοσ} in your text. For the time being, there's no software 
that can reliably parse ancient Greek, I'm afraid.


Thomas
___
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] (again) index sorting of accented characters

2017-04-27 Thread Thomas A. Schmitz

On 04/27/2017 07:21 PM, Pablo Rodriguez wrote:

I mean, if this is the way, I have other two patches for other two
languages in which I have indices.

And if I’m wrong, I would like to know how to get right word sorting in
registers.


Have you played with the different "methods" defined in sort-ini.lua, 
lines 96-103?


Thomas
___
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] MP & text transparency

2017-04-24 Thread Thomas A. Schmitz

On 24.04.2017 15:11, Procházka Lukáš Ing. wrote:

The rectangle drawn is transparent, which is OK.

But the text "Test" is not, is it fully red; why?

How to specify text to be partially transparent, too?

TIA.

Best regards,

Lukas


Wouldn't it be better to define the transparency in ConTeXt and use it 
for both text and drawing? Like this:


\definecolor [tred] [r=1,g=0,b=0,t=.2,a=1]

\startuseMPgraphic{T}
  newpath rc; rc := fullsquare xyscaled (50mm, 50mm);
  color col; col := (1.,.1,.1);
  drawoptions(withcolor \MPcolor{tred}) ;
  draw rc withpen pencircle scaled (2.5mm) ;
  label(textext("\setupbodyfont[sans,35mm] \color[tred]{Test}"), (80mm, 
50mm)) ;

\stopuseMPgraphic

\defineoverlay[T][\useMPgraphic{T}]

\setupbackgrounds[page][background={foreground,T}]

\startTEXpage[width=200mm,height=200mm]
\stopTEXpage

See ch. 8.2 of the metafun manual.

HTH

Thomas
___
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] processing very big tables

2017-04-11 Thread Thomas A. Schmitz

On 11.04.2017 11:53, Thomas A. Schmitz wrote:


Hans, just in case it's useful: I have a small test file that shows my
problem with linetables. The data comes from xml (of course...), but I
have simply captured it in a lua table (in alphabet.lua). Look at p. 4,
10, 11, etc.

All best

Thomas


Oops, sorry, this was meant for Hans personally, not for the list... We 
apologize for the inconvenience...


Thomas
___
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] processing very big tables

2017-04-11 Thread Thomas A. Schmitz

On 10.04.2017 17:07, Hans Hagen wrote:

don't set it then (line tables are actually able to span pages
horizontally)


Hans, just in case it's useful: I have a small test file that shows my 
problem with linetables. The data comes from xml (of course...), but I 
have simply captured it in a lua table (in alphabet.lua). Look at p. 4, 
10, 11, etc.


All best

Thomas


test.7z
Description: application/7z-compressed
___
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] processing very big tables

2017-04-10 Thread Thomas A. Schmitz

On 10.04.2017 17:07, Hans Hagen wrote:


don't set it then (line tables are actually able to span pages
horizontally)


nope, when I don't set it, I don't get a table typeset...


hm, currently not, but i can probably add some features


would be awesome, if you have the time!

Thomas
___
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] processing very big tables

2017-04-10 Thread Thomas A. Schmitz

On 09.04.2017 15:57, Hans Hagen wrote:


\starttext

\setuplinetable[n=2,lines=25]
\setuplinetable[c][1][width=6cm] %
,background=color,backgroundcolor=red,color=white]
\setuplinetable[c][1][width=6cm] %
,background=color,backgroundcolor=red,color=white]
\setuplinetable[1][all][background=color,backgroundcolor=white]

\dontcomplain

\startlinetable
\dorecurse{100}{
\dorecurse{100}{
\NC aaa \NC test test test  test \NC \NR
}
}
\stoplinetable

\page


Alright, I experimented a bit and am back with questions I couldn't 
solve by looking at the source:


1. How does the parameter lines=NUMBER work? If I set it, I get very 
weird page breaks in some locations and lines that are printed above 
each other in other places. When I leave it out, the table isn't typeset 
at all. I can't find the right parameter to have the table fill the 
entire page.


2. Is it possible to get horizontal and vertical lines?

Thomas
___
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] processing very big tables

2017-04-09 Thread Thomas A. Schmitz

On 04/09/2017 03:57 PM, Hans Hagen wrote:

\starttext

\setuplinetable[n=2,lines=25]
\setuplinetable[c][1][width=6cm] %
,background=color,backgroundcolor=red,color=white]
\setuplinetable[c][1][width=6cm] %
,background=color,backgroundcolor=red,color=white]
\setuplinetable[1][all][background=color,backgroundcolor=white]

\dontcomplain


Alright, so the answer is: "use linetables!" Thanks, Hans: I will play 
with them and report back!


Thomas
___
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] processing very big tables

2017-04-09 Thread Thomas A. Schmitz

Hi all,

I need some fundamental advice from experienced users: I'm processing 
xml and collecting the data in lua tables, which I want to typeset in 
some sort of table or tabular format. Typesetting requirements are 
fairly low, just a couple of columns that need to be nicely aligned, 
with the occasional horizontal overflow that should be handled 
gracefully (i.e. longer lines should be broken), and of course, the 
table has to break across pages. However, the lua tables have several 
thousands of entries, and I expect the final document to have around 
3,000 pages. When I tried Natural Tables, I got a "TeX capacity 
exceeded" error, which disappeared when I tried with a smaller part of 
my document. So my question is: what is the most "inexpensive" way of 
typesetting this sort of material? One of the table environments? Which 
one (would xtables be better?)? Or low-level vboxes within hboxes etc.? 
Or just \framed within \framed? What would you suggest for this sort of 
material?


Thanks for your insights!

Thomas
___
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] How to use tex.print in ctxlua

2017-03-19 Thread Thomas A. Schmitz

On 19.03.2017 16:56, Pablo Rodriguez wrote:

is there any reason not to use the following instead of your way below?

  for i = 1,n do
tex.print("(" .. vecteurX[i] .. ", " .. vecteurY[i] .. ")\\par")
  end


I don't think that this is a good approach. Refer to chapter 11.6 of 
"Programming in Lua" to see why string concatenation is computationally 
expensive. (It wouldn't matter in this simple case, but it's not a good 
habit to develop.)


All best

Thomas
___
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] How to use tex.print in ctxlua

2017-03-19 Thread Thomas A. Schmitz

On 19.03.2017 16:30, Otared Kavian wrote:

I would like to print in a text the values of a array computed in a  
\startluacode …. \stopluacode combination.
How can I do it properly? Please have a look at the example below and its 
output, which is not satisfactory because the right parenthesis is separated 
from the number by a space. How can I suppress this unwanted space?
For instance I get (1, 103 ) instead of (1, 103).


Otared,

is there a reason why you don't use context(vecteurY[i]) and 
context(vecteurX[i])? This gets rid of the spurious space for me (and 
makes your code more consistent). But I assume you must have tried it 
because you use the "context" command in other places of your lua code.


Thomas
___
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] hunting a lua stack error

2017-03-13 Thread Thomas A. Schmitz

On 13.03.2017 21:22, Alan Bowen wrote:

The file processes but does not show the  “A, B, and C” when interaction
is activated.

Alan


Alan,

you had a similar problem a while ago, and I meant to write, but forgot. 
bibtex disallows some characters in cite keys: "a bibtex key is a 
sequence of any characters except " # % ' ( ) , = { } plus space." As 
you can see, you simply should not put a comma into a bibtex key. And I 
think the best course for ConTeXt would be to adhere to these standards.


Thomas
___
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] TOC in presentations

2017-03-08 Thread Thomas A. Schmitz

On 03/09/2017 06:57 AM, Jose Luis Arellano wrote:

Dear list,

After learning ConTeXt for a while, I have decided to try to make my own
slides, but I will like to use a list of contents in every page.

Can anybody post an example or link to start?



Have a look at the code in s-present-original.mkiv, that's where Topic 
macros are defined to have a list on every slide (if that's what you 
mean by "list of contents").


Thomas
___
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] Bug in Natural Tables

2017-03-08 Thread Thomas A. Schmitz

On 03/08/2017 03:47 PM, Henri Menke wrote:

No, this is Natural Tables.  The macros I am using are defined in tabl-nte.mkiv 
and the header there states


You're right, I was too fast with my response.



Nevertheless, as you requested, here the same bug with the traditional Natural 
Table macros:


I didn't request anything, but there seems to be a real bug. Here's my code:

\setuppapersize [A4,landscape]

\starttext

\setupTABLE [row] [each] [align={lohi,middle}]
\setupTABLE [column] [1] [width=5cm]
\setupTABLE [column] [2] [width=2cm]
\setupTABLE [column] [3] [width=2cm]
\setupTABLE [column] [4] [width=2cm]
\setupTABLE [column] [5] [width=2cm]
\setupTABLE [column] [6] [width=2cm]
\setupTABLE [column] [7] [width=2cm]

\bTABLE
\bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \bTD 5 \eTD \bTD 6 
\eTD \bTD 7 \eTD \eTR

\bTR \bTD OSI-Schicht  \eTD \bTD[nc=6] Umsetzung \eTD \eTR
\bTR \bTD Anwendungsschicht\eTD \bTD[nc=2,nr=3] SOME/I\eTD 
\bTD[nc=2,nr=3] AVB/TSN\eTD \bTD[nc=2,nr=3] DoIP \eTD \eTR

\bTR \bTD  Darstellungsschicht   \eTD  \eTR
\bTR \bTD  Sitzungsschicht   \eTD  \eTR
\bTR \bTD Transportschicht \eTD \bTD[nc=3] TCP\eTD \bTD[nc=3] UDP 
\eTD \eTR
\bTR \bTD Vermittlungsschicht  \eTD \bTD[nc=3] IPv4\eTD \bTD[nc=3] IPv6 
\eTD \eTR

\bTR \bTD Sicherungsschicht\eTD \bTD[nc=6] Ethernet \eTD \eTR
\bTR \bTD Bitübertragungsschicht \eTD \bTD[nc=2] 100BASE-TX\eTD 
\bTD[nc=2] 100BASE-T\eTD \bTD[nc=2] 1000BASE-T \eTD \eTR

\eTABLE

\stoptext

If I comment out the first table row, the table is out of whack. Same if 
I do not define the width of columns explicitly. So something is not 
quite right here.


Thomas
___
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] Bug in Natural Tables

2017-03-08 Thread Thomas A. Schmitz

On 03/08/2017 10:28 AM, Henri Menke wrote:

\starttext

\startTABLE[align={lohi,middle}]
  \NC OSI-Schicht\NC[nx=6] Umsetzung \NC\NR
  \NC Anwendungsschicht  \NC[nx=2,ny=3] SOME/I \NC[nx=2,ny=3] AVB/TSN 
\NC[nx=2,ny=3] DoIP \NC\NR
  \NC Darstellungsschicht\NC\NR
  \NC Sitzungsschicht\NC\NR
  \NC Transportschicht   \NC[nx=3] TCP \NC[nx=3] UDP \NC\NR
  \NC Vermittlungsschicht\NC[nx=3] IPv4 \NC[nx=3] IPv6 \NC\NR
  \NC Sicherungsschicht  \NC[nx=6] Ethernet \NC\NR
  \NC Bitübertragungsschicht \NC[nx=2] 100BASE-TX \NC[nx=2] 100BASE-T \NC[nx=2] 
1000BASE-T \NC\NR
\stopTABLE

\stoptext


Because that's not a natural table. You're confusing the old TABLE 
environment (\startTABLE) with natural tables (\bTABLE; \NC[nx=3] should 
be \bTD[nx=e]). And it's inconsistent. If you want six columns, you have 
to tell ConTeXt what it should do in rows 3 and 4, where you  define 
only one column.


Thomas
___
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] xml in lua: how to say "ancestor"?

2017-03-03 Thread Thomas A. Schmitz

On 25.02.2017 21:49, Hans Hagen wrote:

xml.attribute(e,"..[tag()='section' or tag()='chapter']","title")

with an optional default

(there is also p = xml.parent(e) and then you can access p.at.title ..
so there are several ways(

Hans


I am sorry it took me so long to play with this... But it still doesn't 
do what I need. My problem is still: from a given element, I need to 
grab the content of an attribute that may be two or three or four levels 
up in the xml tree. The code below (adapted from Hans) still only works 
for a parent, but I need access to an "ancestor."


Thomas

\starttext

\startbuffer[test]

  

  
  Subsection Text
  

  
  

  Subsection Text

  

\stopbuffer

\startluacode

function xml.functions.xml_subsection(e)
chaptertitle = xml.attribute(e, "..[tag()='chapter']", "title")
context("Title of chapter is: ")
context(chaptertitle)
context.par()
lxml.flush(e)
context.blank( { "2*line" })
end

\stopluacode

\startxmlsetups xml:test:setups
\xmlsetsetup{\xmldocument}{*}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test:setups}

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:chapter
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:section
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:subsection
\xmlfunction{#1}{xml_subsection}
\stopxmlsetups

\xmlprocessbuffer{main}{test}{}

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

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Thomas A. Schmitz

On 02/25/2017 09:49 PM, Hans Hagen wrote:

xml.attribute(e,"..[tag()='section' or tag()='chapter']","title")

with an optional default

(there is also p = xml.parent(e) and then you can access p.at.title ..
so there are several ways(


Excellent, I can work with that!

Thanks a lot

Thomas
___
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] xml in lua: how to say "ancestor"?

2017-02-25 Thread Thomas A. Schmitz

On 02/25/2017 09:10 PM, Hans Hagen wrote:

then you can just use

xml.attribute (or lxml.attribute)



Yes, exactly: how does something like

\xmlattribute{#1}{..[tag()='section' or tag()='chapter']}{title}

translate into lua? such as

xml.attribute(e, "../../chapter", "title", "")?

Thomas
___
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] xml in lua: how to say "ancestor"?

2017-02-25 Thread Thomas A. Schmitz

Hans,

thanks for your efforts and your help - but I need a lua solution 
because I have to process my document in lua tables.


Thanks

Thomas

On 02/25/2017 07:30 PM, Hans Hagen wrote:


\startbuffer[test]

  

  
Text
  

  
  

  Text

  

\stopbuffer

\startxmlsetups xml:test:setups
\xmlsetsetup{\xmldocument}{*}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test:setups}

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:chapter
\blank[2*big] CHAPTER: \xmlattribute{#1}{.}{title}\blank
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:section
\blank SECTION: \xmlattribute{#1}{.}{title} \blank\relax
(previous:\xmlattribute{#1}{..[tag()='chapter']}{title})
\blank
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:subsection
\blank SUBSECTION: \xmlattribute{#1}{.}{title} \blank\relax
\blank
(previous:\xmlattribute{#1}{..[tag()='section' or
tag()='chapter']}{title})
\blank
\xmlflush{#1}
\stopxmlsetups

\xmlprocessbuffer{main}{test}{}

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

[NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Thomas A. Schmitz

Hi all,

no real example, just snippets, sorry: I need to process xml documents 
in lua (because I want to collect information in tables). The structure 
is a bit irregular:



  

  
Text
  

  
  

  Text

  


So chapters may or may not have sections. If, on the level of my 
subscetions, I want to extract the information of the chapter title, in 
a ConTeXt environment, I could say 
\xmlattribute{#1}{ancestor::chapter}{title}. How could I do the same in 
lua? I have something like

xml.attribute(e, "../../chapter", "title", "")
but that only works for the first case, not the second one. I tried to 
understand the lpegs in lxml-lpt.lua, but didn't succeed.


Thanks, and best wishes

Thomas
___
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] How to use \setupitemgroup?

2017-02-04 Thread Thomas A. Schmitz

On 02/04/2017 11:55 PM, Csikos Bela wrote:



I haven't intended to define my own itemize command. I wanted to change
the default settings of \startitemize.  Is this not the proper way to redefine
\startitemize default options? (I wanted to use \setupitemize but
the wiki site directs to \setupitemgroup page.)  The wiki page says that
"\setupitemgroup[.1.][.2.][.3.][.4.]
1: name of the itemgroup to change (e.g. itemize for \startitemize)".
And if I wanted to setup my own itemize command, should not I define it
first using \defineitemgroup?



Ah, I see, I misunderstood your intention. If all you want to do is 
setup the default itemize, you can simply have


\setupitemize[each][packed,joinedup,n][stopper=!]

This is explained on the setupitemgroup page:

"\setupitemgroup[.1.][.2.][.3.][.4.]

1: name of the itemgroup to change (e.g. itemize for \startitemize). You

  get the same effect when using \setupitemize[.2.][.3.][.4.]"

Thomas



___
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] How to use \setupitemgroup?

2017-02-04 Thread Thomas A. Schmitz

On 02/04/2017 10:41 PM, Csikos Bela wrote:

Dear context users:

I have troubles using \setupitemgroup. I tried to use it based on the
contextgarden wiki page (http://wiki.contextgarden.net/Command/setupitemgroup),
 description, but either my understanding how to use it is not correct or the
command doesn't behave as described on the wiki page.

In the following example I want the items to be in a numbered, packed list, 
where the
item numbers are followed by ), like 1) 2) etc. If I don't add stopper=) 
option, I get
a numbered list, but it's not packed. If I add stopper=), the list becomes an 
unnumbered
list, but packed. I use context standalone ConTeXt  ver: 2016.09.24 12:40 MKIV 
beta.
I attach the resulted pdfs.

What do I do wrong?

Thanks,

bcsikos


example code:


Most importantly: do not mix keywords and assignments. There are dozens 
of messages on the list with your exact problem; maybe we need some sort 
of very explicit, scary warning on the wiki. So


\setupitemgroup[itemize][each][packed,joinedup][n,stopper=)]

should be

\setupitemgroup[itemize][each][packed,joinedup,n][stopper=)]

Then a couple of smaller things: bonus points for providing an example, 
but please remove stuff that has nothing to do with your question. For 
your private names, use uppercase or mixed-case so you don't clash with 
system macros, so please do not define an itemgroup "itemize," but 
"Itemize," or better still give it a more expressive name. And lastly: I 
couldn't test with the old standalone you use.


Hope that helps.

Thomas
___
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] \itemize unpacked?

2016-12-19 Thread Thomas A. Schmitz

On 12/19/2016 02:26 PM, Procházka Lukáš Ing. wrote:

Also, in my case, there are more \itemize to be packed; and some of them
(in the middle of the document) should be "unpacked"; so grouping
itemize setting is not very comfortable here.


Then the cleanest (and most ConTeXt-like) solution would be to define 
several instances of itemize in the preamble and use those instead of 
applying the settings on the fly. 
(http://wiki.contextgarden.net/Command/defineitemgroup , but I guess you 
know about that.)


Thomas
___
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] Gidole font problem

2016-12-02 Thread Thomas A. Schmitz

On 02.12.2016 19:36, Mikoláš Štrajt wrote:

Hi,


I am triying to use custom font in my Context documents.


However, it doesnt work without any obvious trace.



Your ConTeXt is WAYY too old. You'll have to install a more current version.

Thomas
___
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] avoid newline after definestartstop

2016-10-24 Thread Thomas A. Schmitz

On 10/24/2016 05:08 PM, Otared Kavian wrote:

Hi Michael,

Maybe what Wolfgang meant by « putting the marks by hand » is something like: 
you define \StartCitation and \StopCitation in the following way:

% begin quotation-note.tex

\define\StartCitation{\startnarrower[left,right]«~}
\define[1]\StopCitation{~»\footnote{#1}\stopnarrower}

\starttext
\input tufte
\StartCitation
 \input knuth
\StopCitation{This is a Quote of Donald Knuth}
\stoptext
% end quotation-note.tex

Indeed instead of the quotation marks « and » you can put whatever you wish.
If you have quotations without footnotes, then you may define another 
start-stop.


Here would be my suggestion, which gives a syntax that is a bit more 
ConTeXt-like, I feel (but the coding can probably be improved):


\def\startQuote%
  {\dosingleempty\dostartQuote}

\def\dostartQuote[#1]%
  {\blank [line]
   \iffirstargument
\getparameters[QQ][note=oops,#1]
\def\stopQuote{\footnote{\QQnote}\stopnarrower\blank [line]}%
  \else
\def\stopQuote{\stopnarrower\blank [line]}
  \fi
  \setupnarrower [left=1cm,right=2cm]
  \startnarrower}

\starttext

\input zapf

\startQuote
\input tufte
\stopQuote

\startQuote[note=Knuth]
\input knuth
\stopQuote

\stoptext

Thomas
___
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] xml: spurious empty spaces

2016-10-19 Thread Thomas A. Schmitz

On 10/19/2016 01:47 PM, Hans Hagen wrote:


\startxmlsetups xml:a
\ignorespaces
\xmlflush{#1}
\removeunwantedspaces
\stopxmlsetups

\startxmlsetups xml:b
\ignorespaces
\xmlfunction{#1}{b}
\removeunwantedspaces
\stopxmlsetups



Ah OK, I had tried applying these within the lua code, but this didn't 
work. Thanks a lot Hans, that's cleaner!


Thomas
___
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] xml: spurious empty spaces

2016-10-19 Thread Thomas A. Schmitz
Hi all,

below is a slightly silly example that demonstrates a problem I’m having: I 
want to process (in Lua) the xml element “b” only when it has an attribute 
“display” set. This works, but elements without the attribute leave spurious 
spaces in the pdf output. The workaround I’m currently using is

if xml.attribute(e, "./", "display", "") ~= "yes" then
  context.unskip()
else
  …

but that seems like a kludge. Is this expected behavior, or should this be 
fixed?

Thanks

Thomas

\startbuffer[test]

  test
  test
  test
  test
  test
  test
  test

\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{\xmldocument}{a|b}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startluacode
  function xml.functions.b(e)
  xml.strip(e, "/", nolines, anywhere)
  if xml.attribute(e, "./", "display", "") == "yes" then
  context.space()
  context("/")
  context.space()
  lxml.flush(e)
end
  end
\stopluacode

\startxmlsetups xml:a
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:b
 \xmlfunction{#1}{b} 
\stopxmlsetups

\starttext
\xmlprocessbuffer{main}{test}{}

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

Re: [NTG-context] font size switching

2016-10-17 Thread Thomas A. Schmitz

On 10/17/2016 07:31 PM, Csikos Bela wrote:

Do you mean it's better to use e.g. {\bf some text} then \bf{some text}?


The latter is not valid syntax. You want to read the wiki section on 
font switching: http://wiki.contextgarden.net/Font_Switching





>x and xx are different font sizes, not x repeated (it could have been
>named y or w instead). Here you have the difference:
>
>\starttext
>default, {\tfx smaller (x) {\tfx not smaller (x again)}}
>
>default, {\tfx smaller (x) {\tfxx smaller (xx now)}}
>\stoptext

I know this. What I don't understand is that if I have the code:

\starttext
Default {\tfa Larger} {\tfx Smaller1} \\
Default \tfa Larger \tfx Smaller2
\stoptext

then I have Smaller1 in (x) size and Smaller2 in default size. Why?
I would expect Smaller2 to be in (x) size too (as the manual implies).

I'm not sure where you found the sentence you copied in your first mail. 
My copy of contextref.pdf says p. 107: "The various commands will adapt 
themselves to the actual setup of font and size." Which is exactly what 
you see.



Thomas




___
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] position of linenumbering

2016-10-12 Thread Thomas A. Schmitz

On 12.10.2016 16:38, Pablo Rodriguez wrote:

Wolfgang,

your approach is right, but hasn’t Thomas hit a bug?

According to the description from page 301 in i-context.pdf,
\startlinenumbering ... \stoplinenumbering inherit from \setuplinenumbering.



Thanks Wolfgang, this solution works (I must admit I wasn't aware of 
\definelinenumbering). Nevertheless, I think Pablo is right because this 
means one must define every setup in advance. In some situations, it 
might be useful to change on the fly, and I think this "bleeding" of 
setups into preceding blocks is unexpected.


All best

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

Re: [NTG-context] position of linenumbering

2016-10-12 Thread Thomas A. Schmitz

On 12.10.2016 15:48, Otared Kavian wrote:

Hi Thomas,

It seems that if you use \setuplinenumbering the issue is fixed: please have a 
look here:

\setuppapersize [A6]
\setuplinenumbering[location=text,distance=0.5cm]
\starttext

\startlinenumbering

\dorecurse{2}{\input tufte}

\stoplinenumbering

dummy

\stoptext

Best regards: OK



Hi Otared,

thanks for your suggestion, but it only shifts the problem elsewhere 
without solving it. New example (I need several different linenumbering 
setups in my real word document so I can't put a general setup before 
the \starttext):


\setuppapersize [A6]

\starttext

\start
\setuplinenumbering  [location=text,distance=0.5cm]
\startlinenumbering

\dorecurse{2}{\input tufte}

\stoplinenumbering
\stop

\start
\setuplinenumbering [location=text,distance=1.5cm]
\startlinenumbering
\dorecurse{2}{\input knuth}

\stoplinenumbering
\stop

dummy

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

[NTG-context] position of linenumbering

2016-10-12 Thread Thomas A. Schmitz

Hi all,

consider this example:

\setuppapersize [A6]

\starttext

\startlinenumbering [location=text,distance=0.5cm]

\dorecurse{2}{\input tufte}

\stoplinenumbering

dummy

\stoptext

on the second page, the position of the linenumbering changes and does 
not follow the "distance" setting. Can this be fixed? And if yes, how?


Thanks and best wishes

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

Re: [NTG-context] Paranormal bug in TL 2016

2016-10-10 Thread Thomas A. Schmitz

On 10/10/2016 01:49 PM, Henri Menke wrote:

Dear Thomas,

does it also compile on latest beta when there is a hyphen in the filename?  
BTW, the example can be simplified a little by just using 
\setbreakpoints[compound] instead of my complicated hyphen thing (Updated 
example is below.).  Also I'm very sure that it is mainly related to the 
breakpoints thing.

As I mentioned in the original post, I currently cannot update because of 
critical documents being composed with the TL 2016 version and I cannot afford 
any regressions.

Cheers, Henri


Yes, I had saved your file as test-test.tex, and it compiles with 
2016.10.08 00:11


Thomas
___
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] frames for left/right pages

2016-10-10 Thread Thomas A. Schmitz

On 10/10/2016 12:47 PM, Wolfgang Schuster wrote:

Are you looking for streams, the mechanism Hans added for you years ago?


I'll have to look into Hans's rewrite of streams. As far as I remember, 
they were much more complex (offering synchronization etc.). Also, 
streams seem to be bound to full pages and don't offer backgrounds. So I 
think I'm looking for something simpler, yet more versatile.


Thomas
___
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] Paranormal bug in TL 2016

2016-10-10 Thread Thomas A. Schmitz

On 10/10/2016 12:14 PM, Henri Menke wrote:

Dear list,

at some point my document started throwing an error

! error:  (nodes): trying to delete an attribute reference of a non attribute 
node

I managed to extract a minimal example which shows the error (below).  However, 
the error only occurs when the filename of the document contains a hyphen!  
When I save the document as `test-error.tex' the error comes up, when I save it 
as `testerror.tex' it typesets smoothly.

Unfortunately, I currently cannot update to latest beta because I have an 
important document where I cannot afford any regressions.

Cheers, Henri


Hi Henri,

I can confirm that running context tl 2016 (2016.05.17 19:20) on your 
example triggers this error; the same file compiles cleanly with the 
current beta. Not sure if this is good news or bad news for you...


Thomas
___
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] frames for left/right pages

2016-10-10 Thread Thomas A. Schmitz

Hi,

I have a wish list for independent frames and would like to know if this 
is possible in ConTeXt:


1. left and right pages in a doublesided document have frames with 
independent text flow, i.e. the text from p. 2 continues on p. 4, from 
p. 3 on p. 5, etc. The frames are regular frames and can have 
backgrounds, borders, etc.


2. After a couple of pages, these frames end. Below them, the text flows 
normally, i.e. begins below frame on p. 6 and continues below frame on p. 7.


3. Since I want to take my data from xml, the content of the frames will 
be taken from buffers.


So this would give, in pseudo-code:

\starttext

\startleftrightbuffers
\leftframe{\getbuffer[left]}

\rightframe{\getbuffer[right}
\stopleftrightbuffers

Here, the normal text begins, it will flow below the frames...

\stoptext

Is this possible? How would I code that?

Thanks for any pointers

Thomas
___
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] Ideas for improving documentation of ConTeXt

2016-10-10 Thread Thomas A. Schmitz

On 10/10/2016 07:43 AM, Jonas Baggett wrote:


Thanks for your encouragement ! Yes that looks like an interesting
challenge for me, but it is not something I am wanting to do alone
because of my lack of experience, at least I would need someone to coach
me. Actually I don't have really experience with web developpment and I
would at least need help for the technological choices. Having someone
that tells me that if I use technology X, there are module Y and Z that
will be a good fit is a good start.


Just two small remarks:

1. there are not that many modules in ConTeXt because most of the 
functionality is in the core. If you come from the LaTeX world, you may 
expect several hundred packages, each with their own idiosyncracies and 
documentation. That's not the case here.


2. As for your documentation project, let me be honest: unless someone 
very dedicated and very knowledgeable makes a long-term commitment and 
looks after these examples, they are worse than useless. Unless there is 
very tight control, they may contain bad and/or outdated code and lead 
newcomers in the wrong direction. The context way has always been to 
avoid boilerplate templates and let users roll their own styles. Which 
makes sense since in context almost every detail can be changed easily 
via dedicated setup commands. (This is again quite unlike LaTeX and its 
document classes that predefine many details.) I have problems imagining 
a collection of sample documents that will be more than a haphazard 
bunch of fortuitous designs.


Thomas
___
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] Simpleslides presentation: list of topics

2016-09-15 Thread Thomas A. Schmitz

On 15.09.2016 12:11, Otared Kavian wrote:

Hi Thomas,

Thanks for your quick answer. Actually, mistakenly, I thought you had gave up 
the simplesildes module, not Aditya… And I included Wolfgang because he follows 
everything and has insight for everything…

Anyhow, thank you for sharing this nice module. Actually sometimes it is useful 
to have the interaction and some links working in a presentation, at least in 
maths. Imagine a case in which you introduce an equation and later on you refer 
to it and someone asks to show it again.
Also it is handy to have a list of topics because this way one can go back 
easily to the page where the list is and go quickly to such and such topic. 
Moreover it happens that one can prepare a topic but not show it unless there 
is a specific demand.

Now, from an esthetic point of view for the swoosh, it is not obvious where to 
put the list, but when there are only a few topics (as is usually the case) 
then one can find an appropriate setting of the list.
Another solution would be to have the nice visual counter to be interactive and 
so clicking on a certain number would go to the wanted topic.

In any case thanks again!
Best regards: OK


Hi Otared,

I think you're best off following Aditya's suggestion. Excuse me for 
saying that I still don't find your use case quite compelling and would 
be very reluctant to introduce a change in design which rests on so many 
ifs (if there are only few topics and if interaction is desired...). 
Moreover, I'm not quite certain what you're looking for: a special slide 
that will hold some sort of TOC? Or a list of topics that will be 
displayed on every slide (as in s-pre-19, provided in the distribution)? 
What is a "topic": every slide title? Or a sort of section that will 
encompass several slides?


As for the counter: that may be possible, but is far beyond my coding 
ability. There is an interactionmenu which is part of the distribution 
(see scrn-but.mkvi); maybe it would be easier if you used this rather 
than the counters provided by simpleslides.


All best

Thomas
___
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] Simpleslides presentation: list of topics

2016-09-15 Thread Thomas A. Schmitz

On 15.09.2016 11:35, Otared Kavian wrote:

Is it possible to have a list of topics on a page when one uses the 
simpleslides module?
For instance when using the swoosh model, as in the following example, and then 
navigate to each topic with a link?


Hi Otared,

I'm neither Wolfgang nor Aditya, but the one who is currently in charge 
of the module (Aditya did not have time to do more work on it). The 
answer is: there are a few styles that have a topic list integrated, 
(such as FuzzyTopic), but not swoosh (and I don't see where such a list 
would be an esthetically pleasing fit on this design). As for 
interactive links: the simpleslides module doesn't have them since I 
have never understood who would use them (the way I use presentations is 
always linear; if you want to go back to a particular slide, you may 
want to look at a tool such as impressive). If somebody makes a 
convincing case, I might implement it.


Sorry for the negative answer, best wishes

Thomas
___
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] Margin kerning for compounds

2016-09-08 Thread Thomas A. Schmitz

On 08.09.2016 11:08, Henri Menke wrote:

I have constructed a better example (and eliminated a grammar error), see 
below.  I think what »|-|« does is essentially 
»-\penalty\zerocount\hskip\zeropoint«.  When I insert this as is the margin 
kerning is correct.  Still, I have no idea how to fix |-|.


Just add

\setbreakpoints[compound]

to the preamble of your documents, and you get both hyphenation and 
margin kerning, no need for |-|.


Thomas
___
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] space before/after colored framed text

2016-08-17 Thread Thomas A. Schmitz

> On 17 Aug 2016, at 16:36, Jean-Pierre Delange  wrote:
> 
> Dear list,
> 
> I use for one of my own projects some code given by Wolfgang to Fabrice (see 
> below), which is working fine : at the end of each chapter, I've placed a 
> framed text as a summary (25 lines with few footnotes). I have 2 questions :

You’ve been told before: please make minimal compilable examples. Yours is 
neither minimal (contains lots of completely extraneous stuff) nor does it 
compile. This is considered rude because it is taken to mean: I value my time 
so much more than yours. Please don’t do this.

Thomas
___
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] ConteXt and Slackware

2016-08-10 Thread Thomas A. Schmitz

On 08/10/2016 10:49 AM, Jose Luis Arellano wrote:

Yes, as you can see:

~/context$ export | grep PWD
declare -x OLDPWD="/home/pepe"
declare -x PWD="/home/pepe/context"



Just FYI: I fired up a partition into which I had installed Zenwalk, 
which is pure Slackware with some eye candy, and installed context. 
Everything went as expected. So this is not a problem with slackware, 
but with your particular configuration. Is there any other tex 
installation on your system? How is your PATH variable set? Do you run 
any scripts at login?


Thomas
___
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] marking in two pass data

2016-08-08 Thread Thomas A. Schmitz

On 08/08/2016 01:56 PM, Hans Hagen wrote:


I bet you can figure out why this works:

context.bTD()
context.marking( { "Test" }, k[2])
context(k[1])
context.eTD()


Uugh, I thought I was clever in leaving it out of the cell, but of 
course, now I see my error! (In my defense, I made a stupid typo in my 
real-life file that made it harder to spot this). Thanks Hans, 
everything is fine now!


Thomas
___
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] marking in two pass data

2016-08-07 Thread Thomas A. Schmitz

Hi all,

the example is kind of silly but shows my problem: I use Lua to 
manipulate data from xml files, and I want to typeset it as natural 
tables. Is it possible to set a marking within such tables so that it 
works in page headers? I hit a similar problem some time ago, but I'm 
not sure I found any good solution for it...


Thanks

Thomas

Example:

\starttext

\setupTABLE [split=repeat]

\definemarking [Test]

\setupheadertexts [{\getmarking[Test][top]--\getmarking[Test][bottom]}]

\startluacode

samples = {
  { "A", "aesop-de.tex" },
  { "B", "bryson.tex" },
  { "C", "carey.tex" },
  { "D", "cervantes-es.tex" },
  { "E", "darwin.tex" },
  { "F", "davis.tex" },
  { "G", "dawkins.tex" },
  { "H", "douglas.tex" },
  { "I", "hawking.tex" },
 }

 context.bTABLE()
 for _, k in ipairs(samples) do
   context.marking( { "Test" }, k[1])
   context.bTR()
   context.bTD()
   context(k[1])
   context.eTD()
   context.bTD()
   context.input( k[2] )
   context.eTD()
   context.eTR()
end
context.eTABLE()

\stopluacode

\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] Equivalent of extras option in new bibliography system?

2016-07-03 Thread Thomas A. Schmitz

On 07/02/2016 02:07 AM, Alan Braslau wrote:

Yes. Consider:

\cite[righttext={{, p.~24},{, p.~xx}}] [Author:2016,Author2:2015]

The comma gets parsed (as always) to separate multiple right texts,
assigned here to each citation reference.

The solution to your problem is:

\cite[righttext={{, p.~24}}][Author:2016]

Alternately (if you find the {{ }} strange), you can type
\cite[righttext={\btxcomma p.~24}] [Author:2016]

The macro \btxcomma also takes care of spacing.


I know I shouldn't be asking but answering questions on this topic, but 
here comes anyway: what is the magic incantation to have the righttext 
included within the brackets in authornum styles? So for


\cite[righttext={{,\,100}}][Hagen]

I want the result to look like Hagen [1, 100]. I tried

\definebtx
  [default:cite:author:num] % todo
  [default:cite:authornum]
  [left={\btxleftbracket},
   right={\currentbtxrighttext\btxrightbracket}]

but I get Hagen [1], 100. Any pointers what I should try?

Thomas
___
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] trying to delete an attribute reference of a non attribute node

2016-07-03 Thread Thomas A. Schmitz

On 07/03/2016 11:39 AM, Marco Patzer wrote:

has been fixed already

Confirmed, the new beta works. Thanks for the quick fix.



Amazingly, this has also fixed a long-standing bug I had with one of my 
files; I got the same error message. I hadn't been able to find a 
minimal example to reproduce it, so I'm very glad Marco did, thank you 
too! And of course, thanks Hans...


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

  1   2   3   4   5   6   7   8   9   10   >