[NTG-context] suppressing console output

2014-03-19 Thread Lars Huttar
Hello,

I'm running context mkiv, version: 2013.05.28 00:36 (from the 2013 TeX
Live CD).
We're getting floods of output from context, including lots of Underfull
hboxes, and the names of .tex files that are being opened and closed.
This is all within a build script that does several other things besides
running context.
I'd like to suppress non-critical output from context so that other
important output from the script doesn't get so easily lost.
I'm already logging that output to a file, but I'd like to be able to
take advantage of the console as well.

I've tried the following command-line options to context, as suggested
by context --help:
--batchmode
--silent
--silent=typesetting
--noconsole

but none of these seem to have any effect on the output!
I could just have the script discard stdout from context; I'm not sure
how much of the output that would get rid of, but it may be good enough.
However it's not ideal.
(When an error occurs, as sometimes happens, I don't want the error
message and its context to be hidden while the console waits for the
user to respond blindly. I assume that would be on stderr anyway though...)

Can anyone tell me how to suppress non-critical messages from context as
it runs?

Thanks,
Lars

___
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] suppressing console output

2014-03-19 Thread Lars Huttar
On 3/19/2014 11:09 AM, Hans Hagen wrote:
 On 3/19/2014 4:03 PM, Aditya Mahajan wrote:
 On Wed, 19 Mar 2014, Lars Huttar wrote:

 Can anyone tell me how to suppress non-critical messages from
 context as
 it runs?

 There are two types of messages that ConTeXt generates: Messages that
 come from TeX engine and messages that come from ConTeXt macro code. If
 you use

 context --noconsole filename

 the messages from ConTeXt are suppressed.

Thanks, Aditya. I will try adding a filename argument.
This does seem to get rid of a lot of non-critical output, though not
all, as you noted in your followup email.

 I don't know of a way to
 suppress messages that originate from TeX engine.

 \dontcomplain

Is there any documentation about what kinds of complaints this
suppresses? I couldn't find any in the usual places. Apparently it is a
ConTeXt command rather than a primitive TeX one.

Lars

___
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] suppressing console output

2014-03-19 Thread Lars Huttar
On 3/19/2014 11:33 AM, Hans Hagen wrote:
 On 3/19/2014 4:15 PM, Aditya Mahajan wrote:
 On Wed, 19 Mar 2014, Hans Hagen wrote:

 On 3/19/2014 4:03 PM, Aditya Mahajan wrote:
 On Wed, 19 Mar 2014, Lars Huttar wrote:

 Can anyone tell me how to suppress non-critical messages from
 context as
 it runs?

 There are two types of messages that ConTeXt generates: Messages that
 come from TeX engine and messages that come from ConTeXt macro
 code. If
 you use

 context --noconsole filename

 the messages from ConTeXt are suppressed. I don't know of a way to
 suppress messages that originate from TeX engine.

 \dontcomplain

 And what about these messages:

 context --noconsole test

 mtx-context | warning: no (local) file './test', proceeding
 mtx-context | run 1: luatex
 --fmt=/home/adityam/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en

 --jobname=test
 --lua=/home/adityam/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui

 --no-parse-first-line --c:currentrun=1 --c:directives=logs.target=file
 --c:fulljobname=./test --c:input=./test --c:kindofrun=1
 --c:maxnofruns=8 --c:noconsole cont-yes.mkiv
 This is LuaTeX, Version beta-0.76.0-2013040516 (rev 4627)
   \write18 enabled.
 (/home/adityam/media/opt/context-minimals/texmf-context/tex/context/base/cont-yes.mkiv



 ConTeXt  ver: 2013.12.24 17:52 MKIV beta  fmt: 2013.12.24  int:
 english/english

 (/home/adityam/media/opt/context-minimals/texmf-context/tex/context/base/cont-new.mkiv)

 (/tmp/test.tex{/home/adityam/media/opt/context-minimals/texmf-fonts/fonts/map/pdftex/context/mkiv-base.map}{/home/adityam/media/opt/context-minimals/texmf-fonts/fonts/map/dvips/lm/lm-math.map}{/home/adityam/media/opt/context-minimals/texmf-fonts/fonts/map/dvips/lm/lm-rm.map}

 (/home/adityam/media/opt/context-minimals/texmf-context/tex/context/sample/knuth.tex)

 )
 )/home/adityam/media/opt/context-minimals/texmf-fonts/fonts/opentype/public/lm/lmroman12-regular.otf


 currently there is no callback for open/close file message but at some
 point we can also intercept these (low priority, to be done when the
 luatex io is cleaned up)

 Hans


Thanks.
In our case these amount to pages and pages of output, because our
document consists of many many files that reference each other
(including images). So I would vote a big +1 for that change.

Lars

___
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] suppressing console output

2014-03-19 Thread Lars Huttar
On 3/19/2014 11:36 AM, Hans Hagen wrote:
 On 3/19/2014 4:29 PM, Lars Huttar wrote:


 Is there any documentation about what kinds of complaints this
 suppresses? I couldn't find any in the usual places. Apparently it is a
 ConTeXt command rather than a primitive TeX one.

 \show\dontcomplain


system  tex  error on line 2 in file
C:/Users/Huttar/Documents/work/tex/test-dontcomplain.tex: ? ...


1 \starttext

2  \show\dontcomplain

3 \stoptext

4


l.2 \show\dontcomplain


?


 if console output is slowing down a run make sure you have an
 efficient console (i use conemu on windows and on unixes i always make
 sure that i use a proper font); sometimes you can set delays (standard
 cmd on windows is char-by-char but there are variants); when one runs
 from an editor normally the drawbacks are neglectable (at leats in scite)


Thanks, the slowdown is one of our concerns. I will look into
alternative terminals.

Lars

___
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] suppressing console output

2014-03-19 Thread Lars Huttar
On 3/19/2014 11:45 AM, Hans Hagen wrote:
 On 3/19/2014 4:37 PM, Lars Huttar wrote:

 In our case these amount to pages and pages of output, because our
 document consists of many many files that reference each other
 (including images). So I would vote a big +1 for that change.

 doesn't --batchmode help then?

My mistake... --batchmode does seem to get rid of the file open/close
messages. (Until I learned that --noconsole takes an argument, there was
still so much output that it was hard to see a difference in output due
to --batchmode.)

Unfortunately, --batchmode also seems to suppresses printing fatal error
messages and stopping on them (as its --help documentation suggests). So
when the tex code has an error, the compilation continues to the end
(wasting significant time) and then exits with a failure status code,
but no indication of where the error occurred.

So --batchmode doesn't really seem to be an option for us.
Unless we use batchmode most of the time and then rerun without
batchmode after an error occurs.

I tried having the build script discard stdout from the context process
(with --noconsole=tmp.log but without --batchmode). But apparently, the
error output of context goes to stdout instead of stderr: Context stops
on a fatal error but the error message and prompt are lost, and the
process hangs, waiting for the user to respond to a message they can't see.

Lars

___
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] confusion about expansion

2014-03-12 Thread Lars Huttar
Hello,
I've got a running page head like this in my document:

\def\CurrentUser{\cldcontext{os.resultofwhoami}}

\def\Markname { Compiled \date by \CurrentUser  \LUATEX +\ConTeXt\
\contextversion }

and later:

\setlayer[cropmark][preset=lefttop,x=3cm,y=-1.5\lineheight]{\Markname}

But when I run this, I get a UCS error that seems to indicate that the
*result* of \CurrentUser (waxhaw\huttar) is getting parsed as a
command sequence.

Here's the error:

! Undefined control sequence.

 1   % see ConTeXt wiki http://wiki.contextgarden.net/Imposition#Cut_marks
 2
 3 %% TODO: make sure this doesn't reevaluate every time
 4 %% the command sequence is used!
 5 \define\CurrentUser{\cldcontext{os.resultofwhoami}}
 6
 7 \def\Markname { Compiled \date by \CurrentUser  \LUATEX
+\ConTeXt\ \conte
xtversion. SVN  }
...

l.1 waxhaw\huttar

\cldcontext #1x-\directlua {context(#1)}

\Markname #- Compiled \date by \CurrentUser
\LUATEX +\ConTeXt \
\contextvers...
l.24 ...t=lefttop,x=3cm,y=-1.5\lineheight]{\Markname
  }

How can I change the definition of \CurrentUser, or \Markname, to output
the result of \CurrentUser as-is, instead of parsing the result?
I tried (somewhat blindly) changing \def to \define, but it didn't make
any difference.

At the same time, I want to make sure that the processor won't be making
an OS system call to whoami every time \CurrentUser is evaluated: I
want it to happen only once, when \CurrentUser is defined.

Here is my complete working example:

\def\CurrentUser{\cldcontext{os.resultofwhoami}}

\def\Markname { Compiled \date by \CurrentUser \LUATEX +\ConTeXt\
\contextversion. }

\setuplayout[location=middle,marking=on]

\definelayer[cropmark][state=repeat,width=\paperwidth,height=\paperheight]

\setupbackgrounds[page][background=cropmark]

\setlayer[cropmark][preset=lefttop,x=3cm,y=-1.5\lineheight]{\Markname}


\starttext

Foo

\stoptext


Thanks for any help.
Lars


___
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] confusion about expansion

2014-03-12 Thread Lars Huttar
On 3/12/2014 10:05 AM, Wolfgang Schuster wrote:
 Am 12.03.2014 um 15:00 schrieb Lars Huttar lars_hut...@sil.org:

 Hello,
 I've got a running page head like this in my document:

 \def\CurrentUser{\cldcontext{os.resultofwhoami}}

 \def\Markname { Compiled \date by \CurrentUser  \LUATEX +\ConTeXt\
 \contextversion }

 and later:

 \setlayer[cropmark][preset=lefttop,x=3cm,y=-1.5\lineheight]{\Markname}

 But when I run this, I get a UCS error that seems to indicate that the
 *result* of \CurrentUser (waxhaw\huttar) is getting parsed as a
 command sequence.
 When you want to pass a backslash to Lua you have to use \letterbackslash.


Thanks... can you give me an example of what that would look like?
I don't think I want to pass a backslash to Lua, so I'm not sure how to
apply what you're saying. Or are you using Lua here in the sense of
LuaTeX?

A backslash appears in the output of os.resultofwhoami; do I need to
perform some processing on that output in order to escape backslashes?

Lars

___
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] confusion about expansion

2014-03-12 Thread Lars Huttar
On 3/12/2014 10:21 AM, Wolfgang Schuster wrote:

 Am 12.03.2014 um 15:12 schrieb Lars Huttar lars_hut...@sil.org
 mailto:lars_hut...@sil.org:

 On 3/12/2014 10:05 AM, Wolfgang Schuster wrote:
 Am 12.03.2014 um 15:00 schrieb Lars Huttar lars_hut...@sil.org
 mailto:lars_hut...@sil.org:

 Hello,
 I've got a running page head like this in my document:

 \def\CurrentUser{\cldcontext{os.resultofwhoami}}

 \def\Markname { Compiled \date by \CurrentUser  \LUATEX +\ConTeXt\
 \contextversion }

 and later:

 \setlayer[cropmark][preset=lefttop,x=3cm,y=-1.5\lineheight]{\Markname}

 But when I run this, I get a UCS error that seems to indicate that the
 *result* of \CurrentUser (waxhaw\huttar) is getting parsed as a
 command sequence.
 When you want to pass a backslash to Lua you have to use
 \letterbackslash.


 Thanks... can you give me an example of what that would look like?
 I don't think I want to pass a backslash to Lua, so I'm not sure how to
 apply what you're saying. Or are you using Lua here in the sense of
 LuaTeX?

 A backslash appears in the output of os.resultofwhoami; do I need to
 perform some processing on that output in order to escape backslashes?

 Try this:

 \def\CurrentUser{\cldcontext{os.resultofwhoami}}

 \def\Markname{Compiled \date by \detokenize\expandafter{\CurrentUser}
 \LUATEX +\ConTeXt\ \contextversion.}

 \setuplayout[location=middle,marking=on]

 \definelayer[cropmark][state=repeat,width=\paperwidth,height=\paperheight]

 \setupbackgrounds[page][background=cropmark]

 \setlayer[cropmark][preset=lefttop,x=3cm,y=1.5\lineheight]{\Markname}

 \starttext

 Foo

 \stoptext



Thanks again...
This gets rid of the error, but it seems to prevent any expansion of the
content of \CurrentUser, because the page head now literally looks like
this:

 Compiled March 12, 2014 by \cldcontext {os.resultofwhoami}. 
LuaTEX+ConTEXt...

Lars

___
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] confusion about expansion

2014-03-12 Thread Lars Huttar
On 3/12/2014 11:06 AM, Wolfgang Schuster wrote:

 Am 12.03.2014 um 15:51 schrieb Lars Huttar lars_hut...@sil.org
 mailto:lars_hut...@sil.org:

 This gets rid of the error, but it seems to prevent any expansion of the
 content of \CurrentUser, because the page head now literally looks like
 this:

 You can try to print the string in verbatim mode:

  
 \def\CurrentUser{\cldcommand{sprint(tex.vrbcatcodes,os.resultofwhoami)}}

   \def\Markname{Compiled \date by \CurrentUser\ \LUATEX +\ConTeXt\
 \contextversion.}


That did it. Thank you!
Lars

___
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] getting text outside cropmarks to work

2014-02-11 Thread Lars Huttar
On 2/7/2014 10:21 AM, Wolfgang Schuster wrote:
 Am 07.02.2014 um 16:17 schrieb Lars Huttar lars_hut...@sil.org:

 This works for one page, but when I increase the length of the text to
 take multiple pages, the top and bottom text only appears on the first
 page. (Again, using ConTeXt version 2013.05.28 00:36 from the TeX Live CD.)
 How do you make layers, or backgrounds, appear on every page?

 Add “state=repeat” to \definelayer:

   \definelayer[cropmark][state=repeat,width=\paperwidth,height=\paperheight]


It works for me. Thanks again!

Lars

___
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] getting text outside cropmarks to work

2014-02-07 Thread Lars Huttar
On 2/6/2014 10:12 AM, Wolfgang Schuster wrote:

 Am 05.02.2014 um 17:30 schrieb Lars Huttar lars_hut...@sil.org
 mailto:lars_hut...@sil.org:

 ...
 If we need to implement this using layers, does anyone have a recent
 example of using a layer to place a running footer outside the crop
 marks?

 \setuppapersize[A4][A3]

 \setuplayout[location=middle,marking=on]

 \setupbodyfont[modern]

 \definelayer[cropmark][width=\paperwidth,height=\paperheight]

 \setupbackgrounds[page][background=cropmark]

 \setlayer[cropmark][preset=middlebottom,y=-\lineheight]{Bottom Text}
 \setlayer[cropmark][preset=middletop,y=-\lineheight]{Top Text}

 \starttext
 \input knuth
 \stoptext



This works for one page, but when I increase the length of the text to
take multiple pages, the top and bottom text only appears on the first
page. (Again, using ConTeXt version 2013.05.28 00:36 from the TeX Live CD.)
How do you make layers, or backgrounds, appear on every page?

Thanks,
Lars

___
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] getting text outside cropmarks to work

2014-02-06 Thread Lars Huttar
On 2/6/2014 10:12 AM, Wolfgang Schuster wrote:

 Am 05.02.2014 um 17:30 schrieb Lars Huttar lars_hut...@sil.org
 mailto:lars_hut...@sil.org:

 ... If we need to implement this using layers, does anyone have a recent
 example of using a layer to place a running footer outside the crop
 marks?

 \setuppapersize[A4][A3]

 \setuplayout[location=middle,marking=on]

 \setupbodyfont[modern]

 \definelayer[cropmark][width=\paperwidth,height=\paperheight]

 \setupbackgrounds[page][background=cropmark]

 \setlayer[cropmark][preset=middlebottom,y=-\lineheight]{Bottom Text}
 \setlayer[cropmark][preset=middletop,y=-\lineheight]{Top Text}

 \starttext
 \input knuth
 \stoptext

 Wolfgang


Thanks, this looks very helpful. I'll give it a try.
Lars


___
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] getting text outside cropmarks to work

2014-02-05 Thread Lars Huttar
Hello,

Under mkii we used to have a running footer that appeared below the crop
marks. Under mkiv I can't get that to work.

The MWE I'm trying (with ConTeXt mkiv from the TeXLive 2013 CD):

\def\TopText { Top Text }

\def\BottomText { Bottom Text }

\def\pagecutmarksymbol {\the\realpageno}

\def\pagecutmarklength {.5cm}

\let\pagecutmarktoptext \TopText

\let\pagecutmarkbottomtext \BottomText

\setuplayout[marking=text]

%\setuplayout[marking=on]

\starttext

\input knuth

\stoptext


Code like this used to work for us in mkii.


I tried it with both marking=text and marking=on, but in either case, I
get neither crop marks nor the text.
(In our real document, I was able to get crop marks with [marking=on].
But not text. And haven't figured out how to get crop marks in a MWE.)


Relevant guidance I've been trying to follow:
http://wiki.contextgarden.net/Imposition#Cut_marks
http://context.markmail.org/thread/kpayudrtabsti76i

Thanks for any help on how to get text (pagecutmarkbottomtext) to appear
outside the crop marks.

Lars

___
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] getting text outside cropmarks to work

2014-02-05 Thread Lars Huttar
On 2/5/2014 11:03 AM, Wolfgang Schuster wrote:
 Am 05.02.2014 um 16:45 schrieb Lars Huttar lars_hut...@sil.org:

 Hello,

 Under mkii we used to have a running footer that appeared below the crop
 marks. Under mkiv I can't get that to work.

 The MWE I'm trying (with ConTeXt mkiv from the TeXLive 2013 CD):

 \def\TopText { Top Text }

 \def\BottomText { Bottom Text }

 \def\pagecutmarksymbol {\the\realpageno}

 \def\pagecutmarklength {.5cm}

 \let\pagecutmarktoptext \TopText

 \let\pagecutmarkbottomtext \BottomText

 \setuplayout[marking=text]

 %\setuplayout[marking=on]

 \starttext

 \input knuth

 \stoptext

 Code like this used to work for us in mkii.
 Redefining internal commands isn’t a good solution, what you can do is to use 
 a layer to place your texts.


Thanks for your reply.

When you say redefining internal commands, is that referring to
statements like

  \let\pagecutmarktoptext \TopText

?

AFAICT this is the recommended solution, both on the current wiki 
(http://wiki.contextgarden.net/Imposition#Cut_marks) and by Hans 
(http://context.markmail.org/thread/kpayudrtabsti76i) albeit several years ago; 
the current ref man (section 3.4 Page design / page composition) also lists 
marking=TEXT as an option for \setuplayout. If this is correct, how is one 
supposed to specify the text to display?

Am I misunderstanding the documentation, or is it just obsolete?

If we need to implement this using layers, does anyone have a recent
example of using a layer to place a running footer outside the crop marks?

Thanks,
Lars

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

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


Re: [NTG-context] a way to implement \testcolumn in mixedcolumns

2013-12-05 Thread Lars Huttar (SIL gmail)
On 12/3/2013 4:40 PM, Hans Hagen wrote:
 On 12/3/2013 3:10 PM, Lars Huttar wrote:
 ...
 Thanks again for your work on this.
 We're continually reevaluating whether we can use the beta or need to
 stick with the stable version. At the moment, it looks like we'll be
 sticking with the stable version. But we'd like to use the beta, if the
 problems can be ironed out.

 fyi: i'll not patch the stable version

 new beta


Thanks for the fixes.
When I said the stable version, I wasn't very specific, but I was
referring to the one on the TeX Live 2013 CD.

But after you said the above I realized you were talking about this
(http://wiki.contextgarden.net/ConTeXt_Standalone#Single_user_installation):

 By default, the suite installs ConTeXt beta. If you want the stable
 version of ConTeXt, you can use

 sh ./first-setup.sh --context=current

I'm making a note of it here in hope that it will help me remember next
time what the stable version refers to.

Regards,
Lars

___
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] footer page number on first page of section: doesn't appear

2013-12-05 Thread Lars Huttar
On 12/4/2013 4:00 PM, Aditya Mahajan wrote:
 On Wed, 4 Dec 2013, Lars Huttar wrote:

 On Dec 4, 2013 12:16:12 pm Wolfgang Schuster wrote:
 ...
 This works only when your heading forces a page break with the
 “page=yes”
 setting in \setuphead.

 Thanks for this response.
 Actually, we were able to get it to work as follows.

 First, we used
 \definehead[section][chapter]
 to get section to inherit some settings from chapter.
 This included the page=yes setting you mentioned (which we don't want,
 because we handle page breaks with some separate special logic); but it
 also apparently includes some unknown magic that enables page numbers in
 footers.

 Then we add page=no to the \setuphead[section] command, to override
 the inherited page=yes.
 Apparently, it works:

 \definetext[footerpagenumber][footer][pagenumber]

 \definehead[section][chapter]

 \setuphead[section][page=no,header=empty,footer=footerpagenumber,number=no,align={middle,nothyphenated,verytolerant},style=ssbf]


 \starttext

 \section{My Own Section}

 \dorecurse{15}{ \input knuth \par }

 \stoptext


 I would love to know what the default properties of the \chapter head
 are, so we could know what we're inheriting, or how to set up section to
 do what we want without inheriting unknown properties from chapter.

 (Untested): Looking at the code, it looks that any value other than
 page=, (i.e, page=empty) should work. Did you try the above example
 without the \definehead[section][chapter] line?

 Aditya

Uggh... I just tried it without the \definehead[section][chapter] line,
and it works! (I.e. there is a page number in the footer, only on the
first page of the section.) It wasn't working yesterday ... which makes
me wonder what else I changed since then.

Thanks,
Lars

___
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] footer page number on first page of section: doesn't appear

2013-12-04 Thread Lars Huttar
Hi,
Based on our reading of
http://wiki.contextgarden.net/FO_Page_Layout#First_Page
we have the following MWE, which we want to put a page number in the
footer on the first page only:

\definetext[footerpagenumber][footer][pagenumber]

\setuphead[section][header=empty,footer=footerpagenumber,number=no,align={middle,nothyphenated,verytolerant},style=ssbf]

\starttext

\section{My Own Section}

\dorecurse{15}{ \input knuth \par }

\stoptext


Unfortunately, no page number shows up.

If we add
  \setuppagenumbering[location=footer]
before the \starttext, we get the page numbering we want, but it's on
every page, not just the first.


Is there something wrong with our setuphead?


Thanks,
Lars


___
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] footer page number on first page of section: doesn't appear

2013-12-04 Thread Lars Huttar
On Dec 4, 2013 12:16:12 pm Wolfgang Schuster wrote:

 On 12/4/2013 12:37 PM, Lars Huttar wrote:
 Hi,
 Based on our reading of
 http://wiki.contextgarden.net/FO_Page_Layout#First_Page
 we have the following MWE, which we want to put a page number in the
 footer on the first page only:

 \definetext[footerpagenumber][footer][pagenumber]

 \setuphead[section][header=empty,footer=footerpagenumber,number=no,align={middle,nothyphenated,verytolerant},style=ssbf]

 \starttext

 \section{My Own Section}

 \dorecurse{15}{ \input knuth \par }

 \stoptext


 Unfortunately, no page number shows up.

 If we add
   \setuppagenumbering[location=footer]
 before the \starttext, we get the page numbering we want, but it's on
 every page, not just the first.


 Is there something wrong with our setuphead?


 This works only when your heading forces a page break with the “page=yes”
 setting in \setuphead.

Thanks for this response.
Actually, we were able to get it to work as follows.

First, we used
\definehead[section][chapter]
to get section to inherit some settings from chapter.
This included the page=yes setting you mentioned (which we don't want,
because we handle page breaks with some separate special logic); but it
also apparently includes some unknown magic that enables page numbers in
footers.

Then we add page=no to the \setuphead[section] command, to override
the inherited page=yes.
Apparently, it works:

\definetext[footerpagenumber][footer][pagenumber]

\definehead[section][chapter]

\setuphead[section][page=no,header=empty,footer=footerpagenumber,number=no,align={middle,nothyphenated,verytolerant},style=ssbf]

\starttext

\section{My Own Section}

\dorecurse{15}{ \input knuth \par }

\stoptext


I would love to know what the default properties of the \chapter head
are, so we could know what we're inheriting, or how to set up section to
do what we want without inheriting unknown properties from chapter.

Thanks again,
Lars

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

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


Re: [NTG-context] a way to implement \testcolumn in mixedcolumns

2013-12-03 Thread Lars Huttar
On 11/28/2013 1:34 PM, Hans Hagen wrote:

 That macro was never meant for mixed columns. I made a variant that
 works ok in mixed columns which will be in the next beta.

 \setuptolerance[verytolerant]

 \starttext

 \startmixedcolumns

 \dorecurse{4}{\input ward \par}

 \testcolumn[10][-1pt] % 10 lines - 1pt slack

 \dorecurse{2}{\input ward \par}

 \stopmixedcolumns

 \stoptext

Ok. It looks like the second parameter to \testcolumn is now required
(it didn't used to be).
What does this slack value do? Does it mean that the minimum amount of
space left in the column is 10 lines minus 1pt?

Also, in the Dec. 2 beta (current version: 2013.12.02 15:22),  the
\column command now causes an error when we come to the \stopmixedcolumns.
I don't know if it's connected with the above change, or something else.

MWE: change the \testcolumn command above to \column.
I get the following error output:

! LuaTeX error
C:/context/tex/texmf-context/tex/context/base/page-mix.lua:474
: attempt to compare number with nil
stack traceback:
   
C:/context/tex/texmf-context/tex/context/base/page-mix.lua
:474: in function 'process_penalty'
   
C:/context/tex/texmf-context/tex/context/base/page-mix.lua
:572: in function 'setsplit'
   
C:/context/tex/texmf-context/tex/context/base/page-mix.lua
:687: in function 'setsplit'
   
C:/context/tex/texmf-context/tex/context/base/page-mix.lua
:819: in function 'mixsetsplit'
[string \directlua ]:1: in main chunk.

system   tex  error on line 14 in file
C:/Users/Huttar/Documents/work/tex/test-beta-testcolumn.tex:
LuaTeX error  ...

 4
 5 \startmixedcolumns
 6
 7 \dorecurse{4}{\input ward \par}
 8
 9 %\testcolumn[10][-1pt] % 10 lines - 1pt slack
10 \column
11
12 \dorecurse{2}{\input ward \par}
13
14   \stopmixedcolumns
15
16 \stoptext
17


\ctxcommand #1 -\directlua {commands.#1}
   
\page_mix_routine_construct ...\else false\fi , }}
  \deadcycles
\zerocount
\page_mix_routine_continue ...ine_construct \v!no
 
\page_mix_routine_package ...
\page_otr_command_routine ...mix_routine_continue
  \or
\page_mix_routine_bala...
\page_otr_triggered_output_routine ...and_routine
  \fi
output ...eforeoutput \page_otr_triggered_output_routine
  \relax \the
\everyafterout...
...
l.14 \stopmixedcolumns
   
? X


Thanks again for your work on this.
We're continually reevaluating whether we can use the beta or need to
stick with the stable version. At the moment, it looks like we'll be
sticking with the stable version. But we'd like to use the beta, if the
problems can be ironed out.

Lars

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

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


Re: [NTG-context] a way to implement \testcolumn in mixedcolumns

2013-11-29 Thread Lars Huttar (SIL gmail)
On 11/28/2013 1:34 PM, Hans Hagen wrote:

 That macro was never meant for mixed columns. I made a variant that
 works ok in mixed columns which will be in the next beta.


Excellent. I will give it a try.
I see a context-setup-win64 dated 2013-11-28 19:45. Is that beta? I may
wait for the next one anyway just to be sure... today is a holiday for us.

Lars

___
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] bug in beta: \tab results in text overlap

2013-11-27 Thread Lars Huttar
On 11/22/2013 4:34 PM, Hans Hagen wrote:

 The problem, is/was that mixed columns had not yet mark
 synchronization enabled. I uploaded a new beta. In the process I also
 made marks a bit more restrictive but it might have (yet unknown) side
 effects.

Hans, I tried the beta of 2013.11.26, and as mentioned in a previous
email, it fixes the \getmarking problem pretty well. However the same
beta has a fatal problem for us: lists using \tab are now broken.

MWE:
\starttext
\tab{AC}Autonomous Community\par
\tab{\it alt.}alternate name for\par
\stoptext

In the TeX Live 2013 version of mkiv, this gives us a nice table with
the headword separated from the definition.
In the beta, the headword and the definition start at the same
horizontal position, and overlap each other.

We use these lists in the context of mixedcolumns, but the overlap
behavior occurs regardless of mixedcolumns.

Any help would be appreciated. If we can't fix or work around this
problem, we may have to abandon the beta and go back to TeX Live 2013,
which means our page header guide words would be incorrect.

Lars

___
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] bug in beta: \tab results in text overlap

2013-11-27 Thread Lars Huttar
On 11/27/2013 11:08 AM, Lars Huttar wrote:

 I tried the beta of 2013.11.26, and as mentioned in a previous
 email, it fixes the \getmarking problem pretty well. However the same
 beta has a fatal problem for us: lists using \tab are now broken.

 MWE:
 \starttext
 \tab{AC}Autonomous Community\par
 \tab{\it alt.}alternate name for\par
 \stoptext

 In the TeX Live 2013 version of mkiv, this gives us a nice table with
 the headword separated from the definition.
 In the beta, the headword and the definition start at the same
 horizontal position, and overlap each other.

 We use these lists in the context of mixedcolumns, but the overlap
 behavior occurs regardless of mixedcolumns.

 Any help would be appreciated. If we can't fix or work around this
 problem, we may have to abandon the beta and go back to TeX Live 2013,
 which means our page header guide words would be incorrect.


Well, it's probably not quite that fatal for our project, because it
looks like the \definedescription mechanism can be used to replace \tab,
and does not suffer from the same problem in the beta.

Nevertheless I thought someone would like to know that \tab has stopped
working, so it can be fixed (or documented as obsolete, in favor of
\definedescription).

Lars

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

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


Re: [NTG-context] a way to implement \testcolumn in mixedcolumns

2013-11-26 Thread Lars Huttar
On 11/23/2013 6:49 AM, Hans Hagen wrote:
 On 11/22/2013 11:37 PM, Lars Huttar wrote:
 On 11/22/2013 4:59 PM, Hans Hagen wrote:
 On 11/20/2013 11:12 PM, Lars Huttar wrote:
 On 11/20/2013 4:47 PM, Lars Huttar wrote:
 However one thing we do miss from columnsets is the control over
 widows
  orphans in two ways: \testcolumn, and \setupcolumnsetlines.
 \testcolumn[n] allowed us to do a conditional column break, so
 when we
 were about to start a new subsection heading, we could prevent it
 being
 an orphan at the bottom of the column; and when starting a paragraph
 with a hangaround graphic framed flushright and bottom, we could
 similarly use \testcolumn to prevent the graphic from hanging down
 into
 the footer (which is what sometimes happened otherwise).

 So I'm wondering, is there some way to achieve the equivalent of
 \testcolumn in mixedcolumns?

 for the moment add \penalty1


 OK... where? In the same place we used to use \testcolumn?

 just after the (sub)section title

 i need time to figure out this kind of things in the balancer

Hans, here is what I tried (MWE):

\setuppapersize[A4]

\starttext

\section{Introduction}

\startmixedcolumns[distance=5mm, balance=yes]

\dorecurse {25} {

\subsection{Subsection Heading}

\penalty1

If I had not participated fully in all these activities, literally
hundreds of improvements would never have been made, because I would
never have thought of them or perceived their importance. \endgraf

}

\stopmixedcolumns

\stoptext


As you see, I tried \penalty1 after the subsection heading.
But in the resulting PDF, on page 3, in the left column, we see a
subsection heading at the bottom of the column with nothing below it. So
something didn't work.

Am I not doing it the way you meant?


Thanks for your help,
Lars

___
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] bug: \getmarking with mixedcolumns

2013-11-26 Thread Lars Huttar
On 11/22/2013 4:34 PM, Hans Hagen wrote:
 On 11/21/2013 7:01 PM, Lars Huttar wrote:

 I now have a MWE that shows the problem.
 Where top and bottom work fine outside of columns, in mixedcolumns, any
 keyword I use with \getmarking always seem to return the *last* item on
 the page. Here's the MWE:

 I changed the example a bit

 \setupbodyfont[dejavu]

 \definemarking[country]

 \startsetups myheader

 (\getmarking[country][1][top]\enspace\emdash\enspace\getmarking[country][1][bottom])

 \hfill

 (\getmarking[country][2][top]\enspace\emdash\enspace\getmarking[country][2][bottom])

 \stopsetups

 \setupheadertexts
   [\setups{myheader}][]
   [][\setups{myheader}]

 \def\anothersection#1%
   {\par
\dontleavehmode
\marking[country]{#1}%
\start\bf #1 \endgraf\stop
\quad
test
\par}

 \starttext
 \startmixedcolumns[distance=5mm, balance=yes]
 \anothersection{Brazil}
%\anothersection{Suriname}
%\anothersection{Uruguay}
%\anothersection{Bolivia}
%\anothersection{Venezuela}
 \anothersection{Peru}
 \stopmixedcolumns
 \stoptext

 The problem, is/was that mixed columns had not yet mark
 synchronization enabled. I uploaded a new beta.

When I use the new beta (using 2013.11.26), marking works better, with
the following caveats:

1) The column number argument is required; using
\getmarking[country][top] instead of \getmarking[country][1][top] still
returns the wrong value. This is not a problem for us, but it's
important to know, because if you leave out the column number argument,
there is no error given, and AFAIR the documentation doesn't tell you
it's required.

2) Sometimes \getmark[country][n][bottom] returns the country at the top
of column n+1 (or column 1 on the next page). In your example above,
\getmarking[country][1][bottom] shows Peru, which is in column 2,
instead of Brazil. This can be a significant problem for us, unless we
can find a way to fix it.
Did you get a different result?

 In the process I also made marks a bit more restrictive but it might
 have (yet unknown) side effects.

 \enabledirectives[marks.boxestoo]

 can be used to see the effect of this.


I tried this with your example above, but didn't see anything change.
Are we supposed to see some colored boxes around the marks?

Thanks again,
Lars


___
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] bug: \getmarking with mixedcolumns

2013-11-22 Thread Lars Huttar
On 11/22/2013 4:34 PM, Hans Hagen wrote:
 On 11/21/2013 7:01 PM, Lars Huttar wrote:

 I now have a MWE that shows the problem.
 Where top and bottom work fine outside of columns, in mixedcolumns, any
 keyword I use with \getmarking always seem to return the *last* item on
 the page. Here's the MWE:

 I changed the example a bit

 \setupbodyfont[dejavu]

 \definemarking[country]

 \startsetups myheader

 (\getmarking[country][1][top]\enspace\emdash\enspace\getmarking[country][1][bottom])

 \hfill

 (\getmarking[country][2][top]\enspace\emdash\enspace\getmarking[country][2][bottom])

 \stopsetups

 \setupheadertexts
   [\setups{myheader}][]
   [][\setups{myheader}]

 \def\anothersection#1%
   {\par
\dontleavehmode
\marking[country]{#1}%
\start\bf #1 \endgraf\stop
\quad
test
\par}

 \starttext
 \startmixedcolumns[distance=5mm, balance=yes]
 \anothersection{Brazil}
%\anothersection{Suriname}
%\anothersection{Uruguay}
%\anothersection{Bolivia}
%\anothersection{Venezuela}
 \anothersection{Peru}
 \stopmixedcolumns
 \stoptext

 The problem, is/was that mixed columns had not yet mark
 synchronization enabled. I uploaded a new beta. In the process I also
 made marks a bit more restrictive but it might have (yet unknown) side
 effects.

 \enabledirectives[marks.boxestoo]

 can be used to see the effect of this.


Thanks. We will try this out.

Lars

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

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


Re: [NTG-context] a way to implement \testcolumn in mixedcolumns

2013-11-22 Thread Lars Huttar
On 11/22/2013 4:59 PM, Hans Hagen wrote:
 On 11/20/2013 11:12 PM, Lars Huttar wrote:
 On 11/20/2013 4:47 PM, Lars Huttar wrote:
 However one thing we do miss from columnsets is the control over widows
  orphans in two ways: \testcolumn, and \setupcolumnsetlines.
 \testcolumn[n] allowed us to do a conditional column break, so when we
 were about to start a new subsection heading, we could prevent it being
 an orphan at the bottom of the column; and when starting a paragraph
 with a hangaround graphic framed flushright and bottom, we could
 similarly use \testcolumn to prevent the graphic from hanging down into
 the footer (which is what sometimes happened otherwise).

 So I'm wondering, is there some way to achieve the equivalent of
 \testcolumn in mixedcolumns?

 for the moment add \penalty1


OK... where? In the same place we used to use \testcolumn?

According to http://www.tug.org/utilities/plain/cseq.html#penalty-rp,
If number is 10,000 or larger, TeX will never break a line or a page
there. Also, if number is -10,000 or less, it will always break a line
or a page there [97 and 110]. ... Plain TeX has \break and \nobreak
macros which are defined to be: \penalty-1 and \penalty1.

So it sounds like you're recommending the equivalent of a \nobreak. That
wouldn't make sense in the place where we want to conditionally break
the column. So I guess you're talking about using it e.g. right after
the subsection heading, since we don't want it to break right there?

If so, that sounds like it will be helpful for preventing that
particular case.

I don't think it will work for preventing external figures from hanging
down below the bottom of the column though, will it? Because for that to
work, we'd have to prevent breaks anywhere in the flowing-around
paragraph. And I don't see a way to do that.

Thanks,
Lars

___
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] bug: \getmarking with mixedcolumns

2013-11-21 Thread Lars Huttar
On 11/21/2013 11:40 AM, Lars Huttar wrote:
 In a thread from July
 (http://context.markmail.org/thread/6tgzusw45whaqghi), Marco Patzer
 raised some questions that we have too. They were somewhat answered, but
 I'm still not clear on what the meanings of the keywords are.

 On Jul 8, 2013 4:08:33 pm Hans wrote:
 On 7/9/2013 12:30 AM, Marco Patzer wrote:
 / On 2013–07–08 Hans Hagen wrote:
 //
 // I expect the markings on the left and right to be the same and show
 // A–C on the first page and D–E on the second one. Looks like a bug to
 // me.
 //
 // use top and bottom
 //
 // This works. Thanks.
 //
 // -- previous : last before sync
 // -- next : first after sync
 //
 // -- top  : first in sync
 // -- bottom   : last in sync
 //
 // -- first: first not top in sync
 // -- last : last not bottom in sync
 //
 // That is exactly what's in the wiki (Command/getmarking). To my
 // defence: The manual (chapter 12.4) is outdated, it lists:
 //
 //previous - the last of the previous page
 //first- the first of the actual page
 //last - the last of the actual page
 //both - first — last
 //all  - previous — first — last
 //
 // I have no idea what “first not top in sync” means, in contrast to
 // “first of the actual page”, which is quite clear but wrong on a
 // current MkIV.
 /
 old tex terminology ... in mkiv i don't use the build-in-tex marks at 
 all (too much juggling needed to get things right)
 So I'm wondering ... Hans, since the descriptions you posted are old tex
 terminology, what do previous/next/top/bottom/first/last/etc. mean in
 current terminology?
 I agree with Marco that the descriptions in the ref manual are much
 easier to understand, but appear to be wrong; and do not include top/bottom.
 I'll be happy to update the ref manual and the wiki if I can get clear
 and accurate information.

 We have run many examples here, including the ones on the getmarking
 wiki page, trying to understand what these keywords mean.
 top/bottom do appear to do what we need in an MWE, but are not working
 for us in the real document, and knowing the meaning of these keywords
 would be very helpful in troubleshooting the problem.

 Thanks,
 Lars

 
I now have a MWE that shows the problem.
Where top and bottom work fine outside of columns, in mixedcolumns, any
keyword I use with \getmarking always seem to return the *last* item on
the page. Here's the MWE:
\definemarking[country]


%\startsetups myheader

%F1: \getmarking[country][1][first] - L2: \getmarking[country][2][last]

%\hfill

%T1: \getmarking[country][1][top] - B2: \getmarking[country][2][bottom]

%\stopsetups


\startsetups myheader

F: \getmarking[country][first] - L: \getmarking[country][last]

\hfill

T: \getmarking[country][top] - B: \getmarking[country][bottom]

\stopsetups


\setupheadertexts[\setups{myheader}][][][\setups{myheader}]


\def\anothersection#1{

\marking[country]{#1}

{\bfb #1 \endgraf}

\dorecurse{1}{\input knuth \endgraf}

\marking[country]{#1}

}


\starttext

\startmixedcolumns[distance=5mm, balance=yes]

\anothersection{Brazil}

\anothersection{Suriname}

\anothersection{Uruguay}

\anothersection{Bolivia}

\anothersection{Venezuela}

\anothersection{Peru}

\stopmixedcolumns

\stoptext



When you run the MWE, you see that all the fields in the page header
show the same value: whatever country appears last on the page. (Or
even, depending on how you tweak the length of the country text, if the
next page starts with a new country, you'll get that new country for the
old page.)

I also tried using column numbers, in imitation of the columnsets
example on the wiki at http://wiki.contextgarden.net/Command/getmarking

\startsetups myheader

F1: \getmarking[country][1][first] - L2: \getmarking[country][2][last]

\hfill

T1: \getmarking[country][1][top] - B2: \getmarking[country][2][bottom]

\stopsetups


But this didn't appear to make any difference. Maybe it works for
columnsets but not for mixedcolumns. Does anyone know how to get correct
results for \getmarking in mixedcolumns?


Thanks,
Lars

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

2013-11-21 Thread Lars Huttar
In a thread from July
(http://context.markmail.org/thread/6tgzusw45whaqghi), Marco Patzer
raised some questions that we have too. They were somewhat answered, but
I'm still not clear on what the meanings of the keywords are.

On Jul 8, 2013 4:08:33 pm Hans wrote:
 On 7/9/2013 12:30 AM, Marco Patzer wrote:
 / On 2013–07–08 Hans Hagen wrote:
 //
 // I expect the markings on the left and right to be the same and show
 // A–C on the first page and D–E on the second one. Looks like a bug to
 // me.
 //
 // use top and bottom
 //
 // This works. Thanks.
 //
 // -- previous : last before sync
 // -- next : first after sync
 //
 // -- top  : first in sync
 // -- bottom   : last in sync
 //
 // -- first: first not top in sync
 // -- last : last not bottom in sync
 //
 // That is exactly what's in the wiki (Command/getmarking). To my
 // defence: The manual (chapter 12.4) is outdated, it lists:
 //
 //previous - the last of the previous page
 //first- the first of the actual page
 //last - the last of the actual page
 //both - first — last
 //all  - previous — first — last
 //
 // I have no idea what “first not top in sync” means, in contrast to
 // “first of the actual page”, which is quite clear but wrong on a
 // current MkIV.
 /
 old tex terminology ... in mkiv i don't use the build-in-tex marks at 
 all (too much juggling needed to get things right)

So I'm wondering ... Hans, since the descriptions you posted are old tex
terminology, what do previous/next/top/bottom/first/last/etc. mean in
current terminology?
I agree with Marco that the descriptions in the ref manual are much
easier to understand, but appear to be wrong; and do not include top/bottom.
I'll be happy to update the ref manual and the wiki if I can get clear
and accurate information.

We have run many examples here, including the ones on the getmarking
wiki page, trying to understand what these keywords mean.
top/bottom do appear to do what we need in an MWE, but are not working
for us in the real document, and knowing the meaning of these keywords
would be very helpful in troubleshooting the problem.

Thanks,
Lars

___
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] bug: \getmarking with mixedcolumns

2013-11-21 Thread Lars Huttar
On 11/21/2013 1:01 PM, Lars Huttar wrote:
 I now have a MWE that shows the problem. Where top and bottom work
 fine outside of columns, in mixedcolumns, any keyword I use with
 \getmarking always seem to return the *last* item on the page. 

I sometimes forget to include our version info.
MKIV, the Context version from TeX Live 2013.

Lars

___
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] a way to implement \testcolumn in mixedcolumns

2013-11-20 Thread Lars Huttar
Hello,

On this list I've been advised that mixedcolumns is the latest and
greatest implementation of columns; the one to use. We have switched
over from columnsets to mixedcolumns, and have been very pleased with
the column balancing (for some reason we couldn't get column balancing
to work in columnsets).

However one thing we do miss from columnsets is the control over widows
 orphans in two ways: \testcolumn, and \setupcolumnsetlines.
\testcolumn[n] allowed us to do a conditional column break, so when we
were about to start a new subsection heading, we could prevent it being
an orphan at the bottom of the column; and when starting a paragraph
with a hangaround graphic framed flushright and bottom, we could
similarly use \testcolumn to prevent the graphic from hanging down into
the footer (which is what sometimes happened otherwise).

So I'm wondering, is there some way to achieve the equivalent of
\testcolumn in mixedcolumns?

Is it theoretically impossible to implement this in mixedcolumns because
the required information (how many lines are left in the current column)
is not yet known?
Or could that information be gleaned from somewhere?

I see in page-brk.mkiv the following definition for \testcolumn:

\def\testcolumn
  {\dodoubleempty\page_tests_columns_test}

\def\page_tests_columns_test[#1][#2]%
  {\endgraf
   \ifdim\pagegoal\maxdimen
 \ifdim\pagetotal\pagegoal
   \d_page_tests_test\dimexpr
 \pagegoal
-\pagetotal
 \ifdim\lastskip\parskip+\parskip\fi
 \ifsecondargument+#2\fi
   \relax
   \getrawnoflines\d_page_tests_test % (raw)
   \ifnum#1\noflines
 \column
   \fi
 \else
   \penalty-\plustenthousand % (untested)
 \fi
   \fi}


I'm not a low-level TeX programmer, and I don't understand a lot of
this, but it looks like
  \getrawnoflines\d_page_tests_test
puts the number of remaining lines into \noflines

Any suggestions are appreciated.
(And I should have a MWE soon.)

Lars

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

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


Re: [NTG-context] a way to implement \testcolumn in mixedcolumns

2013-11-20 Thread Lars Huttar
On 11/20/2013 4:47 PM, Lars Huttar wrote:
 However one thing we do miss from columnsets is the control over widows
  orphans in two ways: \testcolumn, and \setupcolumnsetlines.
 \testcolumn[n] allowed us to do a conditional column break, so when we
 were about to start a new subsection heading, we could prevent it being
 an orphan at the bottom of the column; and when starting a paragraph
 with a hangaround graphic framed flushright and bottom, we could
 similarly use \testcolumn to prevent the graphic from hanging down into
 the footer (which is what sometimes happened otherwise).

 So I'm wondering, is there some way to achieve the equivalent of
 \testcolumn in mixedcolumns?

Here is a MWE:

\starttext


\startmixedcolumns[distance=5mm, balance=yes]

\dorecurse {20} {

\testcolumn[8]

\subsection{Subsection Heading} \input knuth \endgraf

}

\stopmixedcolumns


\stoptext


You can see that the heading for subsection 6 is an orphan at the bottom
of a column (at least, with the paper size settings I have; otherwise,
I'm sure it happens somewhere else). If \testcolumn worked, the
\testcolumn[8] would have shoved the subsection heading to the next
column, because there was not space for 8 lines left in the column at
that point.

Any thoughts on how to fix this kind of occurrence?

Thanks,
Lars

___
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] simplefonts: defining a fallback for a non-main font

2013-11-15 Thread Lars Huttar
On 11/14/2013 5:06 PM, Wolfgang Schuster wrote:
 Am 14.11.2013 um 22:52 schrieb Lars Huttar lars_hut...@sil.org:

 ... But then I have another font for the title:
 \definesimplefont[titleface][Gentium Basic][size=40pt]


 How do I set a fallback for it?
 ...
 There is no support for this with the old version of the module.


For posterity, here is how I worked around it:

\usemodule[simplefonts]

% The main font for text:
\setmainfont[Gentium Book Basic]

\setmainfontfallback[Gentium Plus][range={ipaextensions}, force=yes,
rscale=auto]

% The font for the title:
\def\titlefont{Gentium Basic}

\starttext

% Temporarily change the main font, while keeping the main font fallback:
{ \setmainfont[\titlefont] \switchtobodyfont[40pt] Title with a fancy
ɠlyph }


% Back to our previously defined main font:

Body text ...

\stoptext


Lars

___
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] simplefonts: defining a fallback for a non-main font

2013-11-15 Thread Lars Huttar
On 11/15/2013 11:50 AM, Aditya Mahajan wrote:
 Just a minor improvement:

 On Fri, 15 Nov 2013, Lars Huttar wrote:

 % Temporarily change the main font, while keeping the main font
 fallback:
 { \setmainfont[\titlefont] \switchtobodyfont[40pt] Title with a fancy
 ɠlyph }

 Make that {\setmainfont[...] ... \endgraf}

 Otherwise, the interline space will not be calculated correctly.

Thanks. It actually didn't seem to make any difference, but I put it in.

Lars

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

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

[NTG-context] how to reduce \lineskiplimit in ConTeXt grid layout

2013-11-15 Thread Lars Huttar
As you know, in plain TeX, \lineskiplimit tunes the vertical glue
algorithm by specifying the minimum amount of space between the bottom
edge of one line and the top edge of the following line.

But in ConTeXt, it appears that \lineskiplimit is set to zero, at least
in grid mode.
We're using grid mode, and we have some occasional high ascenders, e.g.
capital letters with diacritics on top.
We have bodyfont size 8.1pt, and interlinespace = 9.3pt. We realize this
is less than the recommended ratio of 1.2.

Understandably, when those tall characters occur, we sometimes get a
blank line above them. It looks like the \lineskiplimit would be
violated if the 9.3pt interlinespace were enforced, so ConTeXt adds some
space (analogous to \lineskip in TeX?). But since we're on a grid, more
space has to be added in order to conform to the grid.

All that makes sense, but we would like to be able typeset the lines
closer together, and judge for ourselves whether it looks too bad. (When
we used to typeset the same text at 8.1pt/9.3pt using mkii, blank lines
did not occur.) Is there something similar to \lineskiplimit that we can
tweak? I've been reading section 5.5 Line Spacing in the context ref
manual, but I don't see anything there about changing a threshold
analogous to \lineskiplimit.

I tried setting \lineskiplimit=-2pt, but that caused a worse problem: a
blank line across both columns, instead of just one.

Thanks,
Lars
Version: mkiv luatex in Tex Live 2013.

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

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


Re: [NTG-context] how to reduce \lineskiplimit in ConTeXt grid layout

2013-11-15 Thread Lars Huttar
On 11/15/2013 3:54 PM, Hans Hagen wrote:

 you can try to choose a more strict grid snapping method (see
 spac-ver.mkiv line 1375 etc ... some methods have tolerance, some snap
 always ..)

Thanks, I will try that.
In the meantime, here is a MWE:

\usemodule[simplefonts][size=8.1pt]

\setmainfont[Gentium Book Basic]

\setuplayout[grid=yes]


\starttext

\section{Small interlinespace}

\setupinterlinespace[reset,small]

\input knuth {\bf \color[red]{Éwé}} \input knuth


\section{9.3pt interlinespace}

\setupinterlinespace[reset,9.3pt]

% Notice the blank line that appears above Éwé:

\input knuth {\bf \color[red]{Éwé}} \input knuth

\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] how to reduce \lineskiplimit in ConTeXt grid layout

2013-11-15 Thread Lars Huttar
On 11/15/2013 3:54 PM, Hans Hagen wrote:

 you can try to choose a more strict grid snapping method (see
 spac-ver.mkiv line 1375 etc ... some methods have tolerance, some snap
 always ..)

 Hans

\setuplayout[grid=tolerant] did the trick.
There are no blank lines, and the lines on the grid
Awesome!

Lars

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

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


Re: [NTG-context] how to reduce \lineskiplimit in ConTeXt grid layout

2013-11-15 Thread Lars Huttar
On 11/15/2013 5:29 PM, Lars Huttar wrote:
 \setuplayout[grid=tolerant] did the trick.
 There are no blank lines, and the lines on the grid

I meant to say, the lines in the left and right columns align with each
other perfectly.

___
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] syntax for \definesimplefont in TeX Live version of simplefonts

2013-11-14 Thread Lars Huttar
Hello,
We are using simplefonts, the version included with TeX Live 2013. As
mentioned in another email, we don't have the freedom to experiment with
potentially unstable versions.

I've been reading
http://wiki.contextgarden.net/simplefonts
and have it working well so far with the mainfont, sansfont, and
mainfontfallback.

The part I need help with is for using another font.
http://wiki.contextgarden.net/simplefonts#Defining_other_typefaces_and_fonts
says we can use

  * |\definesimplefont|, defines a font for the use in headers or other
style elements.
  * |\simplefont|, defines a font for inline use.

Can anyone tell me the syntax for these commands - and for using them?
I tried
 \definesimplefont[titleface][Gentium Basic]
 ...
 \setupbodyfont[titleface]

There are no complaints and the \definesimplefont line, but I don't know
if it's the right syntax. And the \setupbodyfont line is giving the warning
  fonts  typescripts  unknown library 'titleface'



So I'm guessing that the \definesimplefont line is correct, but I just
don't know how to use the defined font.


Help please?


Thanks,
Lars

___
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] syntax for \definesimplefont in TeX Live version of simplefonts

2013-11-14 Thread Lars Huttar
On 11/14/2013 11:35 AM, Aditya Mahajan wrote:
 On Thu, 14 Nov 2013, Lars Huttar wrote:

 I tried
 \definesimplefont[titleface][Gentium Basic]
 ...
 \setupbodyfont[titleface]

 So I'm guessing that the \definesimplefont line is correct, but I just
 don't know how to use the defined font.

 \titleface

So simple! facepalm

Thanks...

Lars

___
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] syntax for \definesimplefont in TeX Live version of simplefonts

2013-11-14 Thread Lars Huttar
On 11/14/2013 11:31 AM, Wolfgang Schuster wrote:
 Am 14.11.2013 um 16:42 schrieb Lars Huttar lars_hut...@sil.org:

 Hello,
 We are using simplefonts, the version included with TeX Live 2013. As
 mentioned in another email, we don't have the freedom to experiment with
 potentially unstable versions.

 I've been reading
 http://wiki.contextgarden.net/simplefonts
 and have it working well so far with the mainfont, sansfont, and
 mainfontfallback.

 The part I need help with is for using another font.
 http://wiki.contextgarden.net/simplefonts#Defining_other_typefaces_and_fonts
 says we can use

  * |\definesimplefont|, defines a font for the use in headers or other
style elements.
  * |\simplefont|, defines a font for inline use.

 Can anyone tell me the syntax for these commands - and for using them?
 I tried
 \definesimplefont[titleface][Gentium Basic]
 ...
 \setupbodyfont[titleface]

 There are no complaints and the \definesimplefont line, but I don't know
 if it's the right syntax. And the \setupbodyfont line is giving the warning
  fonts  typescripts  unknown library 'titleface'



 So I'm guessing that the \definesimplefont line is correct, but I just
 don't know how to use the defined font.
 The \definesimplefont command can be used when you want a certain font
 for the chapter, section etc. heading, e.g.

   \definesimplefont[ChapterFont][Gentium Basic][size=24pt]

   \setuphead[chapter][style=ChapterFont]

 but I don’t recommend this command anymore (and removed it from the new 
 version)
 because you can get the same result with a custom typeface, e.g.

   \definesimplefonttypeface[chapterfont][Gentium Basic]

   \definefont[ChapterFont][\classfont{chapterfont}{Serif} at 24pt]

   \setuphead[chapter][style=ChapterFont]


 When you want to change only the global font for your document you
 need the \definesimplefonttypeface command, e.g.

   \definesimplefonttypeface[documentfont][Gentium Basic]

   \setupbodyfont[documentfont]


 Wolfgang

Thanks, very helpful.
I will update the wiki page with this.

Lars

___
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] simplefonts: defining a fallback for a non-main font

2013-11-14 Thread Lars Huttar
Hi again,

I'm using simplefonts (TeX Live 2013 version) and I have a main font:

\setmainfont[Gentium Book Basic]

and I can set a fallback for it,

\setmainfontfallback[Gentium Plus][range={ipaextensions}, force=yes,
rscale=auto]

and that works.


But then I have another font for the title:
\definesimplefont[titleface][Gentium Basic][size=40pt]


How do I set a fallback for it?

After looking at the source code for simplefonts, I tried:

% undefined cs: \definesimplefontfallback[titleface][Gentium
Plus][range={ipaextensions}, force=yes, rscale=auto]

% undefined cs: \fontfallback[titleface][Gentium
Plus][range={ipaextensions}, force=yes, rscale=auto]

% undefined cs: \definefallbackfont[titleface][Gentium
Plus][range={ipaextensions}, force=yes, rscale=auto]


But they all gave undefined control sequence errors.


I can work around the problem by setting the main font before the title,
using the main font for the title, and then changing the main font after
the title is done. But that seems kludgy.

Thanks,
Lars

___
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] simplefonts: defining a fallback for a non-main font

2013-11-14 Thread Lars Huttar
On 11/14/2013 5:06 PM, Wolfgang Schuster wrote:
 There is no support for this with the old version of the module.


OK, good to know. Thanks.
Lars

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

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


[NTG-context] how to include sans, bold and size in \setuptab[headstyle=???]

2013-11-11 Thread Lars Huttar
Hello, I have the following MWE:
\starttext

\setuptab[headstyle=ssbfb]

\tab{foo} \input knuth \par

\stoptext


Here, the headstyle specifies a sans font with boldface style, at 1.44
times the current bodyfont size.


However, I want to be able to specify an absolute point size, instead of
a relative size.

I tried variations like

  \setuptab[headstyle=18pt]

but that has no effect: the size remains 12pt, or whatever the default is.

If I use
  \setuptab[headstyle={\switchtobodyfont[18pt]}]

then the size takes effect (for the key only, which is what I want).
I can combine that with sans:
  \setuptab[headstyle={\switchtobodyfont[ss, 18pt]}]

and that works.


But how to mix in boldface?
  \setuptab[headstyle={\switchtobodyfont[ssbf, 18pt]}]

doesn't give sans boldface, but reverts to a serif, non-bold style (at
18pt size).

  \setuptab[headstyle={\switchtobodyfont[ss, bf, 18pt]}]

gives the same results.


I finally tried

  \setuptab[headstyle={\ssbf \switchtobodyfont[18pt]}]

and that works! But it seems clunky: it looks like it requires two font
switches, which I'm told makes things slower.

And I can't help wondering if I'm missing some simpler way.
Is there a more efficient or elegant way to do this?


Thanks,
Lars

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

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


Re: [NTG-context] how to include sans, bold and size in \setuptab[headstyle=???]

2013-11-11 Thread Lars Huttar
On 11/11/2013 12:27 PM, Wolfgang Schuster wrote:
 Lars Huttar mailto:lars_hut...@sil.org
 11. November 2013 18:00
 I finally tried

 \setuptab[headstyle={\ssbf \switchtobodyfont[18pt]}]

 and that works! But it seems clunky: it looks like it requires two font
 switches, which I'm told makes things slower.

 And I can't help wondering if I'm missing some simpler way.
 Is there a more efficient or elegant way to do this?

 \definefont[BigBoldSans][SansBold at 18pt]

 \setuptab[headstyle=BigBoldSans]

OK, but in order to use this systematically, I would have to have a
\definefont for every potential combination of font style (serif/sans),
alternative (bold/italic/etc.), and size that will get used in the
document. In a large, complex book, that extra layer of indirection
seems unattractive. But maybe there's no better way to do it.

Lars


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

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


[NTG-context] setting size for mainfont or sansfont in stable simplefonts

2013-11-06 Thread Lars Huttar
Hello,

I'm using the simplefonts module from TeX Live 2013. (I can't use the
new simplefonts for this production project, due to stability requirements.)

I have the following, which works well for the most part:

\setupbodyfontenvironment[default][em=italic]

\usemodule[simplefonts][size=9.2pt]

\setmainfont[Gentium Book Basic]
\setsansfont[Tex Gyre Heros]


\starttext

Serif typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold
italic} styles.


\ss Sans--serif typeface: regular, {\em italic}, {\bf bold} and {\bf\em
bold italic} styles.

\stoptext



Because the Tex Gyre Heros font is larger than Gentium Book Basic at a
given point size, when I compile this document, there is a size mismatch
between the serif and the sans typefaces. So I looked for a way to give
the sans font a smaller default size. I couldn't find an example of such
at http://wiki.contextgarden.net/simplefonts. I tried this:

\setsansfont[Tex Gyre Heros][size=8pt]

but it didn't seem to have any effect.

Is there a way to do what I'm trying to do? I could use
\switchtobodyfont[8pt] every time I go to sans, but I don't think that's
the intention of simplefonts.

Thanks,
Lars

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

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


Re: [NTG-context] setting size for mainfont or sansfont in stable simplefonts

2013-11-06 Thread Lars Huttar
On 11/6/2013 5:35 PM, Wolfgang Schuster wrote:
 Am 06.11.2013 um 23:27 schrieb Lars Huttar lars_hut...@sil.org:

 \setsansfont[Tex Gyre Heros][size=8pt]

 but it didn't seem to have any effect.
 \setsansfont[…][scale=0.95]

 Wolfgang


Thanks for the quick response!

Lars

___
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] installing a true-type font: can't find ttf2afm

2013-11-05 Thread Lars Huttar
On 11/4/2013 5:32 PM, Wolfgang Schuster wrote:
 Am 04.11.2013 um 22:56 schrieb Mojca Miklavec 
 mojca.miklavec.li...@gmail.com:

 That TTF should work as well. The only difference is that you might
 need slightly different commands to set it up (there were recent
 changes/improvements in that, other users should tell you how exactly
 that can be done). 

 Make your choice:

 \definefontfamily [gentium-basic] [serif] [Gentium Basic]
 \definefontfamily [gentium-book]  [serif] [Gentium Book Basic]
 \definefontfamily [gentium-plus]  [serif] [Gentium Plus]

 \starttext

 {\switchtobodyfont[gentium-basic]Upright \it Italic \bf Bold \bi BoldItalic}

 {\switchtobodyfont[gentium-book]Upright \it Italic \bf Bold \bi BoldItalic}

 {\switchtobodyfont[gentium-plus]Upright \it Italic \bf Bold \bi BoldItalic}

 \stoptext



Thanks for the suggestion.
I don't know if I'm doing something wrong, but when I try to compile the
above with mkiv, I get Undefined control sequence on line 1:

l.1 \definefontfamily

[gentium-basic] [serif] [Gentium Basic]


ConTeXt ver: 2013.05.28 00:36 MKIV current fmt: 2013.10.11 int:
english/english


Nor can I find \definefontfamily in the ref man or on the wiki.


Regards,

Lars

___
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] installing a true-type font: can't find ttf2afm

2013-11-05 Thread Lars Huttar
On 11/5/2013 12:05 PM, Mojca Miklavec wrote:
 On Tue, Nov 5, 2013 at 5:08 PM, Lars Huttar  wrote:
 On 11/4/2013 5:32 PM, Wolfgang Schuster wrote:

 Make your choice:

 \definefontfamily [gentium-basic] [serif] [Gentium Basic]
 \definefontfamily [gentium-book]  [serif] [Gentium Book Basic]
 \definefontfamily [gentium-plus]  [serif] [Gentium Plus]

 \starttext

 {\switchtobodyfont[gentium-basic]Upright \it Italic \bf Bold \bi BoldItalic}

 {\switchtobodyfont[gentium-book]Upright \it Italic \bf Bold \bi BoldItalic}

 {\switchtobodyfont[gentium-plus]Upright \it Italic \bf Bold \bi BoldItalic}

 \stoptext
 Thanks for the suggestion.
 I don't know if I'm doing something wrong, but when I try to compile the
 above with mkiv, I get Undefined control sequence on line 1:

 l.1 \definefontfamily
 As I told you: there were recent changes/improvements in that.

 http://www.ntg.nl/pipermail/ntg-context/2013/075428.html

 You would need the ConTeXt distribution for that, TeX Live 2013 is too
 old. (You can probably still load the simplefonts module explicitly or
 write the typescripts yourself - again different syntax.)

 Mojca


Thanks again for your responses.

I did try loading the simplefonts module explicitly, but
definefontfamily is still undefined.

I'm working on a large, production project, and the deadline is too
close to risk using unstable releases. Is there a context release since
Wolfgang's new version of simplefonts, that has been declared stable?
Given that his new version came out less than a month ago, it seems
unlikely.

Maybe I can get TTFs working using mtxrun, as Hans suggested. It seems
to be working on Windows; I need to try the same on Linux with our
custom font.

Lars

___
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] installing a true-type font: can't find ttf2afm

2013-11-05 Thread Lars Huttar
On 11/4/2013 4:56 PM, Mojca Miklavec wrote:
 On Mon, Nov 4, 2013 at 10:46 PM, Lars Huttar wrote:
 On 11/4/2013 3:34 PM, Mojca Miklavec wrote:
 - you can find Gentium at http://www.ctan.org/pkg/gentium-tug (also in
 TeX Live and in the ConTeXt distribution)
 Thank you ... that was key information I didn't have.
 I was instead downloading the TTF files from sil.org.
 That TTF should work as well. The only difference is that you might
 need slightly different commands to set it up (there were recent
 changes/improvements in that, other users should tell you how exactly
 that can be done).

I will look for that, because it turns out that I still need to use a
TTF font. Gentium Plus does not include bold and bold-italic weights,
and Gentium Basic doesn't include all the characters ranges I need. We
have a customized version of Gentium Basic with bold weight, with an
extra character added, and it's a TTF. We had it working with mkii but
not yet with mkiv.

 When you say out of the box, I think you're referring to the
 gentium-tug package box, not the ConTeXt box... in other words, I should
 not expect Gentium to work just because I installed ConTeXt; I have to
 also install gentium-tug, right?
 The font is installed by default when installing the ConTeXt
 distribution. I thought it was also installed by default with the
 ConTeXt scheme in TeX Live, but apparently I was wrong. I can fix
 this. The scheme already contains a bunch of nice fonts and Gentium
 could/probably should be among them.


Just to confirm the above: After installing TeX Live context scheme on
Linux, Gentium was not in my names.tma. And when I tried to use
\setmainfont[Gentium], I got errors, 'simplefonts  font ''gentium'' not
found'. After installing the gentium-tug package (sudo
/usr/local/bin/tlmgr install gentium-tug), and compiling a .tex file
using \setmainfont[Gentium], the errors went away, and my names.tma now
includes several variants of Gentium. At no point did I run mtxrun
(knowingly).

On the other hand, on Windows, I had installed TeX Live context scheme
as well, and have not installed gentium-tug. But I did install Gentium
as an OS font (using TTF files). I then ran mtxrun --generate (as
suggested by Hans), and after that, gentium* showed up in names.tma, and
I was then able to successfully compile a .tex file using
\setmainfont[Gentium] with mkiv context. (But that didn't work before I
ran mtxrun --generate.)

Just a couple of data points in case they're relevant.

Lars

___
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] installing a true-type font: can't find ttf2afm

2013-11-04 Thread Lars Huttar
Hi all,
I'm following the instructions at
http://wiki.contextgarden.net/Installing_a_TrueType_font,_step_by_step
because I want to install a TTF (Gentium in fact) for ConTeXt to use.
There is a warning that these instructions may be out of date, but I
haven't found anything newer.

This is under TeX Live 2013, the context scheme, and I've been using
ConTeXt mkiv.

I found texfont.pl, though it wasn't in the path, and managed to run it
in the directory where I have my .ttf files:
$ sudo PATH=$PATH
/usr/local/texlive/2013/texmf-dist/scripts/context/perl/texfont.pl
--ve=sil --co=gentium --makepath --install

But then I get errors about ttf2afm:

TeXFont 2.2.1 - ConTeXt / PRAGMA ADE 2000-2004

mktexlsr: Updating /usr/local/texlive/2013/../texmf-local/ls-R...
mktexlsr: Done.
   encoding vector : texnansi
   vendor name : sil
   source path : .
   font collection : gentium
   texmf font root : /usr/local/texlive/2013/../texmf-local
 map file name : texnansi-sil-gentium.map
   source path : .
  processing files : all on afm path
locating afm files : using pattern ./*.afm
locating afm files : using ttf files
   generating afm file : ./GentiumPlus-I.afm
sh: ttf2afm: command not found
   generating afm file : ./GentiumPlus-R.afm
sh: ttf2afm: command not found
 copying files : afm
 copying files : pfb
 copying files : ttf
   copying : GentiumPlus-I.ttf
   copying : GentiumPlus-R.ttf
processing aborted : no afm files found

--help : show some more info


I can't find ttf2afm anywhere. Is it part of pdfTex? Do I have to have
the pdftex scheme installed in order to install True-type fonts?

Thanks,
Lars



___
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] installing a true-type font: can't find ttf2afm

2013-11-04 Thread Lars Huttar
On 11/4/2013 3:34 PM, Mojca Miklavec wrote:
 - you can find Gentium at http://www.ctan.org/pkg/gentium-tug (also in
 TeX Live and in the ConTeXt distribution)

Thank you ... that was key information I didn't have.
I was instead downloading the TTF files from sil.org.

 - Gentium works out-of-the-box in ConTeXt (see the documentation of
 gentium-tug) 

When you say out of the box, I think you're referring to the
gentium-tug package box, not the ConTeXt box... in other words, I should
not expect Gentium to work just because I installed ConTeXt; I have to
also install gentium-tug, right?
If not, I must be doing something wrong because I can't find Gentium in
the luatex-cache font database.

 This is under TeX Live 2013, the context scheme, and I've been using
 ConTeXt mkiv.
 So why bother about pdfTeX?

Only because the latest instructions I could find said to use texfont,
which uses ttf2afm, which was missing and I thought it might come from
pdfTeX. I'm glad to know I don't have to, and I'll update that wiki page
accordingly.

Thanks again,
Lars

___
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] ConTeXt standalone - in what situations is it better?

2013-10-24 Thread Lars Huttar
Hello,
I was looking into simplefonts
(http://wiki.contextgarden.net/simplefonts) and noticed the clause

 if you’re running ConTeXt Standalone
 http://wiki.contextgarden.net/ConTeXt_Standalone (which is a better
 option)

Well I'm using TeXLive, but am happy to take good advice, so I looked at
http://wiki.contextgarden.net/ConTeXt_Standalone to see why it would be
a better option.
The basic reason I can see is that Standalone is updated more frequently.

So if you're using bleeding-edge features of ConTeXt (including recent
fixes to simplefonts?), I can see wanting to use Standalone and have
access to the latest features and fixes.

On the other hand, if you're working on a large production project that
has to be careful of stability, is there any advantage to Standalone
over TeXLive? Sure, you can keep a standalone version frozen in place,
but then that seems equivalent to staying with an existing version of
TeXLive.

The other issue for me with Standalone is that the only version listed
for Windows is W32TeX. When I go to the web page for that platform, I
don't see any information about what W32TeX is; just how to install it.
It sounds like it's specific to 32-bit systems, and mine is 64-bit. But
I suppose in that regard it's no different from TeXLive -- the
executables are 32-bit but they run fine on 64-bit systems.

Does anybody have advice for me on other reasons for switching from
TeXLive to ConTeXt Standalone, or reasons not to?

Thanks,
Lars

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

2013-10-14 Thread Lars Huttar
Hi Wolfgang,

I'm doing an overhaul of font handling in our large project, and
wondering whether I should switch to simplefonts at this point.

Can you tell me, how mature is simplefonts? Is it ready for heavy-duty,
complex production use?

Also, is it superceding the standard ConTeXt font handling? That is,
should I expect to find better help available from this list for issues
with simplefonts? Will new development be focused more on simplefonts?

Thanks,
Lars


On 10/10/2013 2:02 PM, Wolfgang Schuster wrote:
 Hi all,

 I’m happy to announce a new version of the simplefonts code. Thew new version 
 of the code
 is a complete rewrite and brings many changes.

___
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] Feedback wanted on a ConTeXt tutorial

2013-09-30 Thread Lars Huttar
On 9/29/2013 1:05 PM, Marco Patzer wrote:
 Some thoughts:

   1.1.1
   Unfortunately there’s no really easy way to install ConTEXt on Windows.

 I never installed ConTeXt on Windows, but if this is true this
 should definitely be fixed. According to

   http://wiki.contextgarden.net/ConTeXt_Standalone#Command_line_method
 ...

For my part ... I recently installed TeXLive 2012 and 2013 on Windows 7,
and it was easy.

I told it to install only the ConTeXt scheme, instead of installing
everything.
Also I had to configure the TeXWorks editor options to use ConTeXt
(LuaTeX) by default instead of pdfLaTeX.
But other than that, unless I'm forgetting something, it worked fine,
out-of-the-box.

Lars

___
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] What do \start and \stop mean?

2013-09-30 Thread Lars Huttar
I found \start and \stop referenced in the context reference manual
(e.g. section 5.5).
While \startXYZ - \stopXYZ pairs are discussed earlier, I can't find any
place that \start and \stop (with no suffix) are described.
They seem to be used like \bgroup and \egroup. Is that right?
They are defined in core-sys.mkiv, but I can't figure out from there
what they actually do.

I'll contribute documentation for them if someone can tell me what they
mean.

Thanks,
Lars


___
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] What do \start and \stop mean?

2013-09-30 Thread Lars Huttar
On 9/30/2013 11:44 AM, Aditya Mahajan wrote:
 On Mon, 30 Sep 2013, Lars Huttar wrote:

 I found \start and \stop referenced in the context reference manual
 (e.g. section 5.5).
 While \startXYZ - \stopXYZ pairs are discussed earlier, I can't find any
 place that \start and \stop (with no suffix) are described.
 They seem to be used like \bgroup and \egroup. Is that right?
 They are defined in core-sys.mkiv, but I can't figure out from there
 what they actually do.

 (Untested, based on what I remember):

 \start = \bgroup
 \stop  = \egroup

 but \start scans the next argument, so there are situations when
 \start may fail but \bgroup works.

 \start[whatever] ... \stop = \startwhatever ... \stopwhatever


Ouch, that sounds like two very different behaviors, depending on
whether an argument is present.


I think I'll document \start at
http://wiki.contextgarden.net/Command/start
but take the usage of it out of the ref man's examples, replacing it
with { and }, as long as the examples still work. It's not important to
any of the examples.

Thanks, Aditya and Luigi, for the quick assist.

Lars



 Aditya
 ___

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

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


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

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


Re: [NTG-context] question about linespace adjustment

2013-09-30 Thread Lars Huttar
On 9/26/2013 3:47 PM, Wolfgang Schuster wrote:
 You can use \switchtobodyfont to change the size for certain parts of a text
 but it’s best to keep this to a minimum because \tfa etc. are a  lot faster.

 The reason why you don’t need \setupinterlinespace when you use
 \switchtobodyfont is that \setupinterlinespace is already called by
 \switchtobodyfont.

 Another thing which shouldn’t be forgotten is that \switchtobodyfont
 controls and changes the sizes for \tfa etc.

 Wolfgang

To summarize this, and what I've learned from others on this list over
the last week or two, I've updated the wiki page
http://wiki.contextgarden.net/Font_Switching
It's a pretty substantial change, so I hope someone knowledgeable will
look at it and make sure it's right.

I'm trying to find ways to express the fact that, as I understand it,
there are two distinct concepts of current font in effect at any given
time:
1) the bodyfont, which is set by \setupbodyfont or \switchtobodyfont
2) the effective font (is there a more standard term for this?) which
is changed by \tfa, \ss, etc.

\tfa etc. change the effective font based on what the bodyfont is.
Anything that changes the bodyfont, such as \switchtobodyfont, also
affects the linespacing.
Just changing the effective font does not affect the linespacing.
Changing the bodyfont changes the effective font.

Does that give an accurate picture?

Thanks,
Lars




___
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] git or svn

2013-09-27 Thread Lars Huttar
On 9/27/2013 3:38 AM, Taco Hoekwater wrote:
 On Sep 27, 2013, at 9:01 AM, Peter Münster pmli...@free.fr wrote:

 On Fri, Sep 27 2013, Aditya Mahajan wrote:

 The last time I tried, merging multiple version in svn is a huge pain. One 
 of
 the advantages of DVCS is that branching and merging are easy.
 I understand. Please go ahead if you need git. My preference for svn is
 just my personal opinion, coming from my personal experience: people
 wanted to change a well running system, using the latest and greatest
 tools. In the end, after quite some efforts, there was no benefit, it
 was just a bit more complicated.
 +1 from me: I have exactly the same experience personally.


I'm with Taco and Peter on this one. SVN is part of my everyday
workflow; Git requires a lot more reading and fumbling. However I know
the need to be fluent with Git is becoming more and more prevalent, and
for many people it's already the easiest thing. So I wouldn't argue
against moving to Git. I'm just reporting my preference.

BTW I committed several changes to the manual yesterday, and plan to do
a fair bit more in the coming week or two. I would appreciate if someone
knowledgeable could check and make sure that I haven't said things that
are misleading or incorrect.

Lars

___
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] git or svn

2013-09-27 Thread Lars Huttar
On 9/26/2013 9:10 PM, Aditya Mahajan wrote:
 Github seems to be the most popular DVCS hosting site at the moment.
 For manuals, I think that Github is particularly useful because you
 can click on edit and make the change. Github automatically creates a
 fork, a new branch, and pull request for you. So the technical barrier
 to participation is low.

I would question the perception that the technical barrier to
participation on Github is low. Not long ago I tried to submit a patch
to a project on Github, improving documentation and adding features. It
took several hours (distributed over a couple of weeks) to learn how to
do all that was required. It was *not* automatic. It strongly
discouraged me from making more contributions to that project.

Maybe some major things have changed on Github since then. In any case,
I have no doubt that once you know the system, and have the
infrastructure set up, it's easy to participate. And I'm not saying that
SVN makes it easy for non-SVN users to participate. All I'm saying is
that for non-Git users, the technical barrier to participation was
substantial, last time I tried it.

Again, I'm not arguing against a move to Git. I would just like to
contribute my recent experience toward a well-informed decision process.

Lars

___
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] question about linespace adjustment

2013-09-27 Thread Lars Huttar
On 9/26/2013 3:47 PM, Wolfgang Schuster wrote:
 Am 25.09.2013 um 23:45 schrieb Lars Huttar lars_hut...@sil.org:

 Wolfgang, thanks for your response.

 On 9/25/2013 5:02 PM, Wolfgang Schuster wrote:
 You can’t expect from \tfa etc. to change the interlinespace because these
 commands can be used in your paragraphs to change the size of certain
 words only and in this case you don’t want a forced change of the 
 interlinespace.
 Well... \switchtobodyfont[20pt] can also be used in paragraphs to change
 the size of just a few words.
 But the above suggests that \switchtobodyfont shouldn't be used for that
 purpose, and commands like \tfc should?
 You can use \switchtobodyfont to change the size for certain parts of a text
 but it’s best to keep this to a minimum because \tfa etc. are a  lot faster.

 The reason why you don’t need \setupinterlinespace when you use
 \switchtobodyfont is that \setupinterlinespace is already called by
 \switchtobodyfont.

OK, good to know.

 Another thing which shouldn’t be forgotten is that \switchtobodyfont
 controls and changes the sizes for \tfa etc.

Can you elaborate on that?
A few days ago, Luigi wrote,

 \tfc augment the fontsize of a factor of 1.728
 It's relative to the default font size not to the current fontsize

So when he says relative to the default font size, does that mean the
same thing as relative to the current body font size? I think so. The
following example shows that the function of \tfc is relative to the
size set by \switchtobodyfont:

{\tfc tfc \tfc tfc}


{\switchtobodyfont[20pt] 20pt \tfc tfc}


{\switchtobodyfont[6pt] 6pt \tfc tfc}


Here the text after \tfc appears in three different sizes, proportional
to (and larger than) the \switchtobodyfont setting in effect. However,
the first line shows us that \tfc is *not* affected by previous effects
of \tfc. So as Luigi said, there is a distinction between the current
font size (which is affected by \tfc), and the default font size -- or
maybe it should be described as the current body font size -- which is
not affected by \tfc.
Is that correct?

So does \tfc mean set the current font size to be three steps up from
the current body font size?

Thanks. I'm contributing clarifications into the manual as I come to
understand how things are designed to work.

Lars

___
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] question about linespace adjustment

2013-09-25 Thread Lars Huttar
On 9/24/2013 5:25 PM, Aditya Mahajan wrote:
 On Tue, 24 Sep 2013, Lars Huttar wrote:

 environment), and the second category only affects the font (and I'm
 still not clear on how the body font differs from the current font).

 (Sorry for the terse replies...)

 {\switchtobodyfont[14pt] Text $math$ \sans{Sans} \endgraf}

 {\tfc Text $math$ \sans{Sans} \endgraf}

 Aditya

I don't know how this answers the above question. Can anybody explain?

Clearly you're drawing a comparison between \switchtobodyfont[14pt] and
\tfc.
I've run the sample, and I see that, as in other samples earlier in this
thread, \switchtobodyfont causes the interlinespace to be adjusted
accordingly, and \tfc doesn't.

Is that intended to be an answer to 'how the body font differs from
the current font'? And is the answer that the bodyfont is a conglomerate
of more properties than just the font, including interlinespace?

Thanks,
Lars

___
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] question about linespace adjustment

2013-09-25 Thread Lars Huttar
Wolfgang, thanks for your response.

On 9/25/2013 5:02 PM, Wolfgang Schuster wrote:
 You can’t expect from \tfa etc. to change the interlinespace because these
 commands can be used in your paragraphs to change the size of certain
 words only and in this case you don’t want a forced change of the 
 interlinespace.

Well... \switchtobodyfont[20pt] can also be used in paragraphs to change
the size of just a few words.
But the above suggests that \switchtobodyfont shouldn't be used for that
purpose, and commands like \tfc should?

 To adapt the interlinespace when you now use \tfa etc. you have to add
 \setupinterlinespace to your code (arguments aren’t needed) to tell context
 to recalculate it.


Thank you. What I'm trying to learn now is *why* that's true. Or more
precisely, where is the boundary between the font-changing commands that
automatically adjust interlinespace, and those commands that don't? and
what is the conceptual model that motivates the boundary, and helps
users remember and predict where the boundary lies?

What I think I'm hearing is that \switchtobodyfont is intended for
changes of longer duration, say, at least a paragraph. Whereas \tfa and
so on are intended for brief changes, to set off a phrase, for example.

As an example of where's the boundary, experimentation shows that
\setsmallbodyfont is in the same category as \switchtobodyfont: it
automatically affects the interlinespace. Nevertheless I can't find
anywhere in the manual or on the wiki that tells me that
\setsmallbodyfont differs from \tx in this way (let alone *why* it
differs). Maybe I should expect that any command that has bodyfont in
its name is intended for long-term changes, and other commands aren't?

Sorry if I'm being slow on the uptake.
Documentation like
http://wiki.contextgarden.net/Command/switchtobodyfont just doesn't seem
to explain this difference in intention.

Thanks again. I do hope to use this experience to contribute
clarifications to the manual. I've already done that some on the wiki
(hoping that if I get it wrong, someone will correct my mistakes!)

Lars

___
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] question about linespace adjustment

2013-09-24 Thread Lars Huttar
Hello,
I'm working through the reference manual trying to understand how things
work in regard to fonts. I'll be submitting clarifications and
elaborations to the manual in an attempt to help other non-experts to
grasp the design of ConTeXt.

There's a point that's confusing to me in section 5.5, Line spacing. On
page 108 of the manual it says
Linespacing alters when a new bodyfont is used or when linespacing is
defined explicitly by \setupinterlinespace (which is explained later)

But on the next page it says,
When you make a font switch the linespacing is adapted when you give
the command \setupinterlinespace without any setup parameters and also
when you add the key reset, for example...

So here's why I'm confused. When you change fonts, (a) does linespacing
get changed automatically, or (b) do you have to say
\setupinterlinespace? If (a), then why does the second quote above seem
to say you need \setupinterlinespace to make it happen? If (b), then
isn't the first quote above inaccurate?

Is there a distinction being drawn here between when a new bodyfont is
used and when you make a font switch, or are those just variant
phrasings for what is intended to mean the same thing?

Thanks for your help,
Lars

___
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] question about linespace adjustment

2013-09-24 Thread Lars Huttar
Aditya wrote,
 Contrast

 {\switchtobodyfont[14pt] \input ward \endgraf}

 with

 {\tfc \input ward \endgraf}


Thanks for your help. You've left me to draw my own conclusions from
this example, so I'll say what I think this implies, and please correct
me if I'm wrong.

(Note to other non-TeXnichians: \endgraf is a TeX synonym for \par: end
of paragraph.)

I think the principle that you're trying to demonstrate is that the
answer to my last paragraph is yes: there is an important distinction
between making a font switch, e.g. \tfc, and using a new body font,
of which \switchtobodyfont is apparently an example.
Namely, that the latter causes the interlinespace to be automatically
adjusted, whereas the former doesn't unless you explicitly use
\setupinterlinespace.

Can you explain how/why the two ways of increasing the font size should
have such different effects? (I have read section 5.8 and 5.9 about
selecting bodyfonts and interlinespace but still don't get it.)
\tfc is described as a font selector command (5.3.2). It seems to me
that both \tfc and \switchtobodyfont[20pt] simply attempt to switch to a
different size of whatever bodyfont is currently in effect. But there
must be something I'm missing. (Or else it's just an arbitrary
distinction, but that seems unlikely.)

Lars

___
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] question about linespace adjustment

2013-09-24 Thread Lars Huttar
On 9/24/2013 12:01 PM, Lars Huttar wrote:

 Can you explain how/why the two ways of increasing the font size should
 have such different effects? (I have read section 5.8 and 5.9 about
 selecting bodyfonts and interlinespace but still don't get it.)
 \tfc is described as a font selector command (5.3.2). It seems to me
 that both \tfc and \switchtobodyfont[20pt] simply attempt to switch to a
 different size of whatever bodyfont is currently in effect. But there
 must be something I'm missing. (Or else it's just an arbitrary
 distinction, but that seems unlikely.)



Is it that \switchdobodyfont changes the *body* font, which engages the
associated bodyfont environment...
whereas \tfc changes the *font*, not the *body* font?

Lars

___
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] question about linespace adjustment

2013-09-24 Thread Lars Huttar
Luigi,
Thanks for your reply.

On 9/24/2013 2:18 PM, luigi scarso wrote:

 On Tue, Sep 24, 2013 at 7:45 PM, Lars Huttar lars_hut...@sil.org
 mailto:lars_hut...@sil.org wrote:


 Is it that \switchdobodyfont changes the *body* font, which
 engages the
 associated bodyfont environment...
 whereas \tfc changes the *font*, not the *body* font?

 Lars

 You can look into
  font-pre.mkiv

OK. I'm looking at it,
http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/font-pre.mkiv
Is there anything in particular you had in mind that I can learn from it?
I found some aliases, e.g. \smaller, which are handy to know. But I
don't know how much I can rely on the undocumented ones to continue to
do what they do now.

 \tfc augment the fontsize of a factor of 1.728
 It's relative to the default fount size not to the current fontsize:
 {\tfc foo {\tfc foo}} both foo have the same size

Thank you, this is an important nugget that I didn't understand when
reading the documentation. \setsmallbodyfont and \setbigbodyfont, in
contrast, change the font size relative to the current size.


 But interlinespace is not modified, so we need to reset
 \starttext
 OK: \input knuth\blank{\tfx WRONG: \input knuth\blank \tfc WRONG:
 \input knuth\relax} \page
 OK: \input knuth\blank{\tfx\setupinterlinespace OK: \input knuth\blank
 \tfc WRONG: \input knuth\blank} \page
 OK: \input knuth\blank{\tfx\setupinterlinespace OK: \input knuth\blank
 \tfc\setupinterlinespace OK: \input knuth\blank}
 \stoptext

Ok. This confirms what Aditya said, and what the manual says: that you
have to use \setupinterlinespace after \tfx or \tfc if you want the
interlinespace to be adjusted.

But I would really like to understand the categories involved here.
So we have one category of font size selector commands, which includes
\setsmallbodyfont and \setbigbodyfont, that cause interlinespace to be
adjusted automatically.
Then we have another category, including \tfc, \tfx, \ita, and others,
that do not cause interlinespace to be adjusted.

What is the rhyme or reason behind these categories? And that would help
me know, which other commands belong to which category? E.g. would
\serif cause interlinespace to be adjusted? An experiment would reveal
the answer, at least in the circumstances that I think of testing, but
I'd like to understand the conceptual model.
Maybe the concept is that the first category affects the body font
(and therefore interacts with the properties of the body font
environment), and the second category only affects the font (and I'm
still not clear on how the body font differs from the current font).

Thanks for your help,
Lars

___
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] bug? gap appears in columnset

2013-09-19 Thread Lars Huttar
Hans wrote,
 Columnsets are rather special and mostly meant for magazine like 
 documents, where content can span columns, images are explicitly placed 
 on the grid, etc. For that reason columnset soperate on a rather strict 
 grid that gets setup based in the lineheight and although content can be 
 larger, the grid dictates what happens. Balancing is semi automatic and 
 nearly always demands some tweaks.

In our use of columnsets, we do have content that can span columns (but
we keep it outside of columnsets). We also have images within columns
that are placed in the flow of text via hangarounds. We manually tweak
our column lengths on each page (e.g.
\setupcolumnsetlines[columnset10][1][1][42]), in order to avoid the
worst of the widows and orphans. As you say, balancing requires manual
tweaks too, but it's not that big a burden, since we're already doing
\setupcolumnsetlines for many pages.

 Using columnsets for a large document that has to flow automatically is 
 therefore debatable. Regular multi columns or in mkiv mixed-columns are 
 a better choice then.

We have tried to port our code to mkiv, but have so far found been
unsuccessful. (But are trying again now, having found new success with
TL2013 mkii.)
Also, we've been unable to find any statement that mkiv is out of beta
status. Moreover, much of the documentation still seems to be oriented
toward mkii. So it's hard to justify much of a time investment in
porting production work to mkiv yet. Can you comment on the official
status of mkiv?

Regarding mixed-columns: I understand it's a rewrite of the old
columns model. My impression is that columns didn't support manual
tweaking of column lengths (like \setupcolumnsetlines). Does
mixed-columns support such a thing? That would be a critical question
for us, as it wouldn't be an option for us to spend time porting to mkiv
and using mixed-columns, if it doesn't allow us to tweak the height of
each column on each page.

Thanks again for your help and advice.
Lars

___
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] bug? gap appears in columnset

2013-09-18 Thread Lars Huttar
Regarding sane interlinespace,
Hans wrote,
 ok, but then, an interlinespace is normally around 1.2 times the 
 bodyfontsize

OK. That's helpful.

But notice that in the following example, the interline space that
causes the problem is in the *first* section (where htdp is 12pt and
baselineskip is also 12pt!), while the gap shows up in the *second*
section, whose interlinespace is 2.8ex:

\def\printHtdp{\setbox0\hbox{()} \the\htdp0,\the\baselineskip}


\definecolumnset[columnset1][n=2]

\setupcolumnset[columnset1][distance=5mm,balance=yes]


\starttext


\section{Introduction}


\setupinterlinespace[line=12pt]

\startcolumnset[columnset1]

\printHtdp

\dorecurse {7} { \input knuth }

\stopcolumnset


\section{Bibliography}


\tfxx

\setupinterlinespace[line=2.8ex] %or use 11pt

\startcolumnset[columnset1]

\printHtdp

\dorecurse {10} { \input knuth }

\stopcolumnset


\stoptext


Since the problem can appear a ways after the cause, that makes it an
especially hard problem to track down, especially for someone who is
unaware of the nature of the problem. But even now that we're aware of
what the problem (hopefully) is, we've not been able to fix it in our
real-life document.


We sprinkled in many places the code to show htdp and baselineskip
(\printHtdp). E.g. in the early sections that would putatively cause the
problem, our htdp/baselineskip in 8.60252pt,10.5pt. That's a ratio of
more than 1.2. We have eliminated all the places we could find where the
htdp/baselineskip ratio was less than 1.2, even where there was no text.
But the gap persists.

We have a large and complex document, so there might conceivably be
places where a larger htdp than expected is hiding. Are there any tools
for automatically going through a document and reporting places where
not-sane interlinespace occurs?

Thanks,
Lars

___
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] bug? gap appears in columnset

2013-09-17 Thread Lars Huttar
Aditya wrote:
 Any particular reason you are using columnsets rather than \startcolumns 
 or \startmixedcolumns. Columnsets are for specialized layout requirements, 
 and in my experience, mixing columnsets with text that is not in 
 columnsets is a bit tricky.


Thanks for suggesting a potential workaround.

We do have pretty specialized layout requirements, including figures
(some of which are hangarounds within columns, and some are outside of
columnsets but on the same page) and page-width-centered section
headings that are outside of columnsets.
I suspect that we tried \startcolumns and couldn't get it to work, but I
will definitely try again

I can't find \startmixedcolumns on the contextgarden wiki nor in the
ConTeXt manual. There are references to it on this mailing list, as a
rewrite of the old columns mechanism. I'm reluctant to entrust a big
production project to undocumented features, but at this point, if it
works, we'll probably go with it. I wonder if it's available in mkii as
well as in mkiv?

 \startsetups normal
 \setupinterlinespace[line=12pt]
 \stopsetups

 \startsetups tight
 \setupinterlinespace[line=9.3pt]
 \stopsetups
 \setupmixedcolumns[distance=5mm, balance=yes]

 \starttext
 \section{Introduction}
 \startmixedcolumns[setups=normal]
 \dorecurse {7} { \input knuth }
 \stopmixedcolumns

 \section{Bibliography}

 \startmixedcolumns[setups=tight]
 \dorecurse {10} { \input knuth }
 \stopmixedcolumns


 Aditya (not sure why the interlinespacing is not working)

At
http://tex.stackexchange.com/questions/133586/bug-unwanted-gap-in-2nd-columnset#comment301754_133586,
phg wrote If you want lines to adhere to a tighter line spacing you
will have to set a smaller font size, (the default one is 12pt I think)
e.g. |\setupbodyfont [7pt]| gets you the desired baseline skip and
decent leading. Doesn’t make the gap disappear, though.
I had left font settings out of the minimal example, since they aren't
necessary to exercise the bug.

Thanks again,
Lars


___
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] bug? gap appears in columnset

2013-09-17 Thread Lars Huttar
Hans wrote,
 Just wondering ... do you think that the first pages look ok?

Thanks for your response.
By look ok, are you referring to the closeness of the lines of text?
It does seem kind of close, but within acceptable limits, depending on
other constraints; however I'm not really the one to make aesthetic
decisions about the document. I'm just trying to implement what the
customer wants.

Also, the minimal example is stripped down to minimally exercise the
unexplained behavior, so it doesn't reflect the fact that in our actual
document, we reduce the font size in places where we reduce the
interlinespace. In that sense, maybe a less minimal example would serve
the purpose better. I'll work on that, now that I know the font size may
be an integral part of the problem.

 You mess 
 with the interlinespace in a way that will make the outcome never look 
 okay.

I'd like to know more what that means, but I think it's elaborated on
below when you talk about baselineskip.

 Also, columnsets assume that the interlinespace is sane.

Can you point me to documentation on the constraints that define what
kind of interlinespace is sane?

Also, given the goal that For using ConTeXt, no TeX programming skills
and no technical background are needed. Some basic knowledge of
typography and document design will enable you to use the full power of
ConTeXt (http://wiki.contextgarden.net/What_is_ConTeXt), does/could
ConTeXt issue an error when its assumptions are violated?

 \setbox0\hbox{Tg}\the\htdp0,\the\baselineskip

 gives

 10.59601pt,9.3pt

 so, any line that has a character with ascender and descender will 
 enforce a larger than 9.3pt distance + lineskip and mess up any 
 prediction cq. heuristics

I can't find any reference defining \htdp0, but I'm guessing it means
the height+depth (where depth means how far descenders extend below the
baseline) of the Tg box.
I'm also confused as to why you're adding 9.3pt + lineskip, when in my
limited understanding of TeX, I understood lineskip to be *part* of the
distance between baselines, rather than an additional distance. But
maybe that's not important to the main issue.

I'm trying to formulate a rule for knowing whether interlinespace is sane.
Is it that interlinespace needs to be more than or equal to the maximum
of (height + depth + lineskip) of any line in the text?

Thanks again for your help.

Lars

___
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] bug? gap appears in columnset

2013-09-16 Thread Lars Huttar
FYI, I have posted this question on
http://tex.stackexchange.com/questions/133586/bug-unwanted-gap-in-2nd-columnset
Marco and phg were able to reproduce the problem, including in the
latest versions.
I don't plan to keep posting in both places, but wanted to leave a
pointer from this thread to the other one.

Regards,
Lars

On 9/13/2013 4:07 PM, Lars Huttar wrote:
 Hello,
 We have a document where a gap occurs in a columnset under certain
 conditions.


___
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] bug? gap appears in columnset

2013-09-16 Thread Lars Huttar
I was advised to report the bug back to this list, with an even more
minimized example.
Here it is below.
This bug occurs in both mkiv and mkii, in the latest versions (current
beta).

|\setupinterlinespace[line=12pt]

\definecolumnset[columnset1][n=2]
\setupcolumnset[columnset1][distance=5mm,balance=yes]

\starttext

\section{Introduction}
\startcolumnset[columnset1]
\dorecurse {7} { \input knuth } 
\stopcolumnset

\section{Bibliography}
\setupinterlinespace[line=9.3pt]
\startcolumnset[columnset1]
\dorecurse {10} { \input knuth }
\stopcolumnset

\stoptext


Note the gap across both columns on p. 3, about 3/4 of the way down.
Any suggestions for a workaround would be appreciated.

Lars

|

On 9/16/2013 2:29 PM, Lars Huttar wrote:
 FYI, I have posted this question on
 http://tex.stackexchange.com/questions/133586/bug-unwanted-gap-in-2nd-columnset
 Marco and phg were able to reproduce the problem, including in the
 latest versions.
 I don't plan to keep posting in both places, but wanted to leave a
 pointer from this thread to the other one.

 Regards,
 Lars



___
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] bug? gap appears in columnset

2013-09-13 Thread Lars Huttar
Hello,
We have a document where a gap occurs in a columnset under certain
conditions.
It seems to be a confluence of:

- 2 sections, each with 2-column columnsets
- \page[empty] between them
- the 2nd section has a tighter interline space

The problem is that on the first page of the second section, a two-line
gap appears where gridlines 50 and 51 are.

It may be a coincidence, but 50 is also the number of lines per page in
the first section. We've found that coincidence to be true even with
different page and font sizes.

Can anyone tell us a way to get rid of the gap? We've tried things like
  \setupcolumnsetlines[columnsetbibliography][1][1][-1]
  \setupcolumnsetlines[columnsetbibliography][1][2][-1]
with various values for the last parameter, but nothing helps.

Below is a small, self-contained sample.

Thanks for any help you can give.
Lars

Version information:
This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012)
(format=cont-en 2012.11.14)  13 SEP 2013 11:38
ConTeXt  ver: 2012.05.30 11:26 MKII  fmt: 2012.11.14  int: english/english


\showgrid
\setupinterlinespace[line=12pt]
\setuplayout[grid=yes]

\definecolumnset[columnsetIntroduction0][n=2]
\setupcolumnset[columnsetIntroduction0][distance=5mm,balance=yes]

\definecolumnset[columnsetbibliography][n=2]
\setupcolumnset[columnsetbibliography][distance=5mm,balance=yes]

\starttext

\section{Introduction}

\startcolumnset[columnsetIntroduction0]
% The important thing here is how many columns of text we have.
\dorecurse {7} { \input knuth }
\stopcolumnset

\page[yes] % Always finish the current page
% If we haven't ended up on an odd page, generate an empty one.
\ifodd \pageno \else \page[empty] \fi

\section{Bibliography}
\setupinterlinespace[line=9.3pt]

\startcolumnset[columnsetbibliography]
\dorecurse {140} { \input knuth\par }
\stopcolumnset

\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] bug? gap appears in columnset

2013-09-13 Thread Lars Huttar
It should also be mentioned that we need the second section to have a
tighter line spacing than the first, but despite the

\setupinterlinespace[line=9.3pt]

command, and despite the red grid lines being tighter, the text itself
seems to have the same interline spacing as in the first section. How do
we actually change the interline spacing?

Thanks again.

Lars

On 9/13/2013 4:07 PM, Lars Huttar wrote:
 Hello,
 We have a document where a gap occurs in a columnset under certain
 conditions.
 It seems to be a confluence of:

 - 2 sections, each with 2-column columnsets
 - \page[empty] between them
 - the 2nd section has a tighter interline space

 The problem is that on the first page of the second section, a two-line
 gap appears where gridlines 50 and 51 are.

 It may be a coincidence, but 50 is also the number of lines per page in
 the first section. We've found that coincidence to be true even with
 different page and font sizes.

 Can anyone tell us a way to get rid of the gap? We've tried things like
   \setupcolumnsetlines[columnsetbibliography][1][1][-1]
   \setupcolumnsetlines[columnsetbibliography][1][2][-1]
 with various values for the last parameter, but nothing helps.

 Below is a small, self-contained sample.

 Thanks for any help you can give.
 Lars

 Version information:
 This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012)
 (format=cont-en 2012.11.14)  13 SEP 2013 11:38
 ConTeXt  ver: 2012.05.30 11:26 MKII  fmt: 2012.11.14  int: english/english


 \showgrid
 \setupinterlinespace[line=12pt]
 \setuplayout[grid=yes]

 \definecolumnset[columnsetIntroduction0][n=2]
 \setupcolumnset[columnsetIntroduction0][distance=5mm,balance=yes]

 \definecolumnset[columnsetbibliography][n=2]
 \setupcolumnset[columnsetbibliography][distance=5mm,balance=yes]

 \starttext

 \section{Introduction}

 \startcolumnset[columnsetIntroduction0]
 % The important thing here is how many columns of text we have.
 \dorecurse {7} { \input knuth }
 \stopcolumnset

 \page[yes] % Always finish the current page
 % If we haven't ended up on an odd page, generate an empty one.
 \ifodd \pageno \else \page[empty] \fi

 \section{Bibliography}
 \setupinterlinespace[line=9.3pt]

 \startcolumnset[columnsetbibliography]
 \dorecurse {140} { \input knuth\par }
 \stopcolumnset

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


[NTG-context] flow text around graphic: lower right

2013-08-26 Thread Lars Huttar
Hi all,
We have the small self-contained example below, in which text flows
around a graphic.
The graphic is aligned with the upper-left corner of the text paragraph
(despite \setuphanging[location=right]). We would very much like to have
the graphic align with the lower right corner of the paragraph.
Is there any way to do that?

\definecolumnset[TwoColumns][n=2]

\setupexternalfigures[location={local,default}]

\setuphanging[location=right]


\starttext

\startcolumnset[TwoColumns]


\dorecurse{3}{

\starthangaround{\externalfigure[cow][width=2cm]}

I want this cow to be in the lower right corner of the paragraph.

\input knuth

\stophangaround

}


\stopcolumnset

\stoptext



Versions: We're using mkii. But we get the same results for mkii and
mkiv on the example above.


Thanks,
Lars

___
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] section headings on a grid: less space above?

2013-08-24 Thread Lars Huttar
Marco wrote,
 On 2013–08–23 Lars Huttar wrote:

 / \setuphead[subsection][number=no,style=it,grid=top]
 /
 Add

   before={\blank[line]}

 Marco

Thank you very much, that worked!
Can you explain how it works?
Does before= override the setting of grid=? Is before= at a lower
level?
Yet before= must be at a high enough level that the grid-setting code
is able to adjust for it and still preserve the grid alignment...

Regards,
Lars

___
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] section headings on a grid: less space above?

2013-08-23 Thread Lars Huttar
Hello,

I'm using mkii to typeset a document with grid layout. I'm trying to
configure the formatting of the subsection headings.

I have the following setuphead:
\setuphead[subsection][number=no,style={\switchtobodyfont[SansB,\subheadersize]},grid=top]

This works successfully in that the lines below the heading are aligned
to the grid.

But what I'm trying to change is the fact that 4 grid lines are taken up
by the heading: approximately two blank lines above, and one below. The
requirement is to use 3 grid lines.

I know how to move the heading text down within the space:
grid=3pt
does that.

But I can't figure out how to reduce the number of lines above the
heading text.

The document at http://www.pragma-ade.com/general/manuals/details.pdf
says that the top option (as in grid=top) means add/remove an extra
line to the top. But in my experimenting, the presence or absence of
top seems to make no difference.
I also tried:
grid={broad,low}
grid={fit,low}
grid={line,3pt}
grid=standard
no grid setting at all

but none of these seems to reduce the total amount of vertical space
taken up by the heading.

Can somebody tell me how to do this? E.g. how to make the top option
remove an extra line on top?

Thanks,
Lars

P.S. version:
ConTeXt  ver: 2008.05.21 15:21 MKII  fmt: 2009.1.20
but I'm hoping the oldness of the version isn't a factor here.
___
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] section headings on a grid: less space above?

2013-08-23 Thread Lars Huttar
On 8/23/2013 11:26 AM, Lars Huttar wrote:
 Hello,

 I'm using mkii to typeset a document with grid layout. I'm trying to
 configure the formatting of the subsection headings.


Here is a small, self-contained example showing what I'm talking about:

\definecolumnset [twocol] [n=2,balancing=yes]


\setuphead[subsection][number=no,style=it,grid=top]


\starttext


\startcolumnset[twocol]

\dorecurse {5}{

\subsection{Subsection Heading}

\input knuth

}

\stopcolumnset


\stoptext


When I run this in mkiv, each subsection heading takes up 4 grid lines
of space.
How can I make it take up 3 lines?


(I would also like to lower the placement of the heading text within
that space; grid=3pt or grid={line,3pt} did that in mkii, but doesn't
seem to work in mkiv.)


Thanks,
Lars

___
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] error: terminal: NOfTextColumns-1, ! Improper final value has been replaced by 0

2013-04-29 Thread Lars Huttar
On 4/26/2013, Hans Hagen wrote:
 
 On 4/24/2013 5:30 PM, Lars Huttar wrote:
 / ...
 /
 It took me a while to figure it out as NOfTextColumns is only used in 
 very special cases and long gone from context (it dates from a previous 
 background implementation). Normally the obsolete code is never seen but 
 in your case consulting the variable might be triggered by the fact that

 multi_column_first_page_hack

 is set to true (looks like a quick hack i made for Jelle long ago).

 I commented it in the mkii source now, hopefully no error message any 
 longer.

Thank you. How can I make this change in our ConTeXt installations?
As noted previously, the only place I could find a mention of/
 for i=1 upto NOfTextColumns-1/
was in some code that was already commented out. So I don't know how I
would comment it out any more effectively than that.


 Hans

 ps. sometimes there is some specific test code that then depends on 
 other experimental code being present

 ps. in mkiv it's all redone anyway and i will redo columnsets one of 
 these days too;

Jut to make sure it's clear, I'm running ConTeXt with mkiv.
(ConTeXt ver: 2012.05.30 11:26 MKIV fmt: 2013.3.11)

I mention that because I'm not sure if your statement about mkiv implies
that this error shouldn't be happening if I'm already using mkiv.

Lars

___
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] Missing number error, related to setupcolumnsetlines

2013-04-24 Thread Lars Huttar
On /Mon Apr 22 18:59:07 CEST 2013, Hans Hagen wrote:
/
 On 4/22/2013 4:24 PM, Lars Huttar wrote:
 / On /Fri Apr 19 21:36:41 CEST 2013 /Hans Hagen wrote:
 // On 4/18/2013 11:13 PM, Lars Huttar wrote:
 // / \definecolumnset [abbcolumn] [n=2,distance=5mm,balancing=yes]
 // //
 // //  \setupcolumnsetlines[abbcolumn][1][1][60]
 // //  \setupcolumnsetlines[abbcolumn][1][2][60]
 // /
 // the 60 exceeds the number of lines
 //
 // Hans, thanks for responding.
 //
 // I don't understand the above statement. What number of lines does 60
 // exceed? Is there a hard-coded limit? (We didn't seem to have a problem
 // with this code before we migrated from XeTeX / mkii to LuaTeX / mkiv,
 // but I couldn't guarantee what else is different.)
 /
 Column sets allocates a box for each line but does that dynamically 
 (i.e. at the start of a columnset) but the min/max settings in the above 
 command don't check for that so if you have a 55 line layout you get an 
 overflow.

OK, I think I understand now.

 / Is there a workaround for us now?
 /
 I've added a check.

I'm not sure what this means. I guess it will prevent the error message
from occurring.
Is it something I would get from a nightly development snapshot?
If so, where do I find it?

But it also sounds like there's no point in our having a setting of 60
lines when there are only 42 lines in our layout (that's the number
above which this error occurs). So I need to either tweak our layout, or
reduce the number of lines I'm asking for in a columnset.

Thanks,
Lars


 / I could leave out the \setupcolumnsetlines commands for the moment, and
 // hope we don't overflow the page. Actually I'm not sure what will happen
 // if we leave the number of lines at the default (which is apparently 
 zero?).
 /
 no, more like 55 or so (depends on the layout settings)

 / Regards,
 // Lars
 //
 //
 // /  \starttext
 // //  \startcolumnset[abbcolumn]
 // //  foo
 // //  \stopcolumnset
 // //  \stoptext
 // /
 // i'll add a check
 //
 // (i will redo columnsets at some point in a more mkiv-ish way)
 //
 // Hans
 /



___
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] error: terminal: NOfTextColumns-1, ! Improper final value has been replaced by 0

2013-04-24 Thread Lars Huttar
Hello,

I'm encountering the following error, under ConTeXt  ver: 2012.05.30
11:26 MKIV  fmt: 2013.3.11  int: english/english:

system  tex  error on line 27 in file
data/three-volume-book-book-1.tex: terminal:  NOfTextColumns-1
! Improper final value has been replaced by 0.
to be read again
   :
* for i=1 upto NOfTextColumns-1:
draw (rightboundary TextColumns[i])
shif...


 ...

17 \safeinput ./data/statistics-for-area-area-africa.tex
18 \safeinput ./data/statistics-for-area-area-europe.tex
19
20
21
22 \input ./macros/E16pagenohead.tex
23 \ifodd \pageno \else \noheaderandfooterlines \null \page[yes]\fi
\noheade
randfooterlines
24
25 \startptp{
26 \pagereference[Languages]\pnum{Part II}\ptitle{Language Listings}
27  }\stopptp


This error is very odd because:

a) The only place I can find code mentioning NOfTextColumns-1 is in
mp-core.mpii, where it's commented out!
  % \startuseMPgraphic{whatever}
  % for i=1 upto NOfTextColumns-1 :
  % draw (rightboundary TextColumns[i]) shifted ...

But maybe I just haven't been looking in the right places.

b) The place in my .tex document where the error occurs, line 27, is at
a \stopptp. Yet there is an essentially identical start/stopptp earlier
in the document, where no such error is thrown:

  \startptp{
  \pagereference[Summaries]\pnum{Part I}\ptitle{Statistical Summaries}
  }\stopptp

So I guess there's some content in between the two starts/stop ptp's
that's laying the stage for the error to occur.
I'll be working on a minimal example, but that's time-consuming; and I
thought in the meantime, there may be some clues in the above
information that could help clarify the nature of the problem, to
someone who understands the inner workings of ConTeXt.

Thanks for any help,
Lars

___
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] Missing number error, related to setupcolumnsetlines

2013-04-22 Thread Lars Huttar
On /Fri Apr 19 21:36:41 CEST 2013 /Hans Hagen wrote:
 On 4/18/2013 11:13 PM, Lars Huttar wrote:
 / \definecolumnset [abbcolumn] [n=2,distance=5mm,balancing=yes]
 //
 //  \setupcolumnsetlines[abbcolumn][1][1][60]
 //  \setupcolumnsetlines[abbcolumn][1][2][60]
 /
 the 60 exceeds the number of lines

Hans, thanks for responding.

I don't understand the above statement. What number of lines does 60
exceed? Is there a hard-coded limit? (We didn't seem to have a problem
with this code before we migrated from XeTeX / mkii to LuaTeX / mkiv,
but I couldn't guarantee what else is different.)

Is there a workaround for us now?
I could leave out the \setupcolumnsetlines commands for the moment, and
hope we don't overflow the page. Actually I'm not sure what will happen
if we leave the number of lines at the default (which is apparently zero?).

Regards,
Lars


 /  \starttext
 //  \startcolumnset[abbcolumn]
 //  foo
 //  \stopcolumnset
 //  \stoptext
 /
 i'll add a check

 (i will redo columnsets at some point in a more mkiv-ish way)

 Hans

___
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] Missing number error, related to setupcolumnsetlines

2013-04-18 Thread Lars Huttar
Hello,
I've got a Missing number error, treated as zero. I've whittled the
problem code down to this minimal example:

\definecolumnset [abbcolumn] [n=2,distance=5mm,balancing=yes]

\setupcolumnsetlines[abbcolumn][1][1][60]
\setupcolumnsetlines[abbcolumn][1][2][60]

\starttext
\startcolumnset[abbcolumn]
foo
\stopcolumnset
\stoptext


By contrast, if I remove the \setupcolumnsetlines commands, the error
goes away. (But I think I need those commands, in case the text has more
than 60 lines.)

Also, if I run the example shown on this page
http://wiki.contextgarden.net/Command/setupcolumnsetlines
which seems very similar to mine, it works fine; no errors.

Based on the latter working example, I tried adding the following to my
minimal example that fails:

\switchtobodyfont[small]
or
\setupcolumnsetstart[abbcolumn][1][1][1]
\setupcolumnsetstart[abbcolumn][1][2][1]


but neither one solved the problem.

Here is more of the error output I received when running TeX on the
minimal example shown at the start of this email:

! Missing number, treated as zero.

system   tex  error on line 8 in file minimalex-133.tex:
Missing number, treated as zero ...

 1 \definecolumnset [abbcolumn] [n=2,distance=5mm,balancing=yes]
 2
 3 \setupcolumnsetlines[abbcolumn][1][1][60]
 4 \setupcolumnsetlines[abbcolumn][1][2][60]
 5
 6 \starttext
 7 \startcolumnset[abbcolumn]
 8   foo
 9 \stopcolumnset
10 \stoptext
11

to be read again
   \otr:1:43
\OTRSETdoifcellelse ...er #1:\number #2\endcsname
  \@EA
\secondoftwoarguments...
\@@ar@@1 ...ellelse {\mofcolumns }\columnlastcell
  {\global \advance
\columnl...
\redoloop -\expandrecursecontent
  \endofloop
to be read again
   {
inserted text
44
...
l.8 f
 oo
?



Here is some of the earlier output, include the version info:

 context --mode=windows,report,border --nomapfiles --verbose 
minimalex-133.tex

resolvers   | resolving | creating instance
resolvers   | resolving | variable 'SELFAUTOLOC' set to
'c:/texlive/2012/bin/win32'
...
resolvers   | resolving |
resolvers   | resolving | unknown configuration file
'C:/Users/huttarl/texmf/web2c/texmfcnf.lua'
resolvers   | resolving | unknown configuration file
'c:/texlive/2012/bin/win32/texmfcnf.lua'
...
This is LuaTeX, Version beta-0.70.2-2012080612 (TeX Live 2012/W32TeX)
 \write18 enabled.
(minimalex-133.tex

ConTeXt  ver: 2012.05.30 11:26 MKIV  fmt: 2013.3.11  int: english/english


Thanks for any help!

Lars

___
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] Missing number, treated as zero error when using \definefont with \define'd dimension

2013-03-21 Thread Lars Huttar
Hello,

I reported a Missing Number error back in December (thread at
http://www.ntg.nl/pipermail/ntg-context/2012/070471.html) but got
sidetracked on another issue before finding a resolution.
Now I'm back to the Missing Number error, and I have a short example
that reproduces it:

  \define\largefontsize{13pt}

  % Works fine: \definefont[SerifL][Arial at 13pt]
  % Leads to error:
  \definefont[SerifL][Arial at \largefontsize]

  % Missing number, treated as zero error thrown on the following line:
  \starttext \SerifL{Hello} \stoptext

Note that the SerifL font definition works fine (no error) if I
hard-code in 13pt instead of using an intervening \largefontsize
definition. But if I hard-code the point size, it would hamper the
modularity of our font configuration and the use of modes in which
different size fonts are used.

Maybe \define is just the wrong command to use when creating an
identifier for a specified dimension?
I tried changing it to \def and the error went away!

I looked up the documentation of \define
(http://wiki.contextgarden.net/Command/define) and \def, and couldn't
find any obvious difference, except that \def is TeX and \define is
ConTeXt. The wiki page I just linked to mentions differences between
MkII and MkIV, but this error occurs in both (in XeTeX and LuaTeX).

Can someone help me understand why I should not use \define for this
case? (Or in general, when I should not use \define?) Or does the
problem lie somewhere else?

Thanks,
Lars

___
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] (XeTeX) trouble debugging a Missing number error

2012-12-07 Thread Lars Huttar
In response to Hans Hagen and Wolfgang Schuster's messages of Dec. 5,
Just to let you know, in response to your messages, I am working a
small, self-contained example that reproduces the problem.
However I have been asked to focus on a different project for a few
days, so ... please don't interpret my silence as We asked him to do
due diligence and he never answered. :-) Hopefully I'll be back with
more, next week.

Regards,
Lars

___
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] (XeTeX) trouble debugging a Missing number error

2012-12-05 Thread Lars Huttar
Hi all,

I'm working with some code that was developed by someone else.
The document I'm typesetting is now giving the following error:

! Missing number, treated as zero.
to be read again
   \otr:1:27
\OTRSETdoifcellelse ...er #1:\number #2\endcsname
  \@EA
\secondoftwoarguments...

\@@ar@@1 ...ellelse {\mofcolumns }\columnlastcell
  {\global \advance
\columnl...

\redoloop -\expandrecursecontent
  \endofloop
to be read again
   {
inserted text
28
...
l.12 \startabblist
  {
?

I haven't been able to figure out what's wrong or how to fix it.

I had just made changes to refactor the definitions of fonts. (I
confirmed that these changes really are a necessary cause of the error:
when I back out just these changes, the error goes away.)

From the above error message I understand the error was detected during
the expansion of \startabblist. Here's the definition of abblist:

% Abbreviations
\definestartstop
  [abblist]
  [before={\setupbackgrounds[text][background=verticalline]
\starttextbackground[text]
\setuptab[headstyle={\switchtobodyfont[SansB,\SansBsize]},width=20mm,location=left]
\startcolumnset[abbcolumn] \startalignment[flushleft,nothyphenated]},
   after={\stopalignment \stopcolumnset \stoptextbackground
\setupbackgrounds[text][background=off]}]

From that, one might guess that the font SansB or the font dimension
\SansBsize were the problem. But those definitions haven't changed
(though I would like to confirm that empirically with a run-time trace
message).

Here are the font settings changes that did occur:

E16fonts.tex:
changed this block:
  \definefont[SerifXLI][name:GentiumBookBasic-Italic at 10pt]
  \definefont[SerifXXL][name:GentiumBookBasic at 12pt]
  \definefont[SerifXXLB][name:GentiumBookBasic-Bold at 12pt]

to use size dimensions defined elsewhere:
\definefont[SerifXLI][name:GentiumBookBasic-Italic at \XLfontsize]
\definefont[SerifXXL][name:GentiumBookBasic at \XXLfontsize]
\definefont[SerifXXLB][name:GentiumBookBasic-Bold at \XXLfontsize]

E16settings.tex: I added these definitions:
\define\XLfontsize{14pt}
\define\XXLfontsize{16pt}

There are modes involved, so things are a bit more complicated, but I
believe that is the only effective difference.

I also created a log file, which I'll attach.
There is also a version with \tracingmacros=1, but it's 600K, so I'll
put it at
http://www.huttar.net/tmp/country-report-country_id-15-tracing.log

Thanks for taking a look. Please let me know what further information I
need to provide.
I can provide the .tex files themselves upon request.

I would especially like to know better techniques for debugging -- how I
can induce TeX/ConTeXt to tell me more about what's going on. I realize
that as a macro language, this is inherently difficult with TeX.

We are heavily invested in XeTeX, so switching to LuaTeX in the near
term is not an option.

ConTeXt version: ConTeXt  ver: 2012.05.30 11:26 MKII  fmt: 2012.11.14
int: english/english
(From TeX Live 2012)

XeTeX version: 3.1415926-2.4-0.9998 (TeX Live 2012) (format=cont-en
2012.11.14)

Lars



This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012) (format=cont-en 
2012.11.14)  4 DEC 2012 14:17
entering extended mode
 restricted \write18 enabled.
 %-line parsing enabled.
**country-report-country_id-15.tex
(./country-report-country_id-15.tex

ConTeXt  ver: 2012.05.30 11:26 MKII  fmt: 2012.11.14  int: english/english

system  : cont-new.mkii loaded
(/usr/local/texlive/2012/texmf-dist/tex/context/base/cont-new.mkii
systems : beware: some patches loaded from cont-new.mkii
)
system  : cont-sys.rme loaded
(/usr/local/texlive/2012/texmf-dist/tex/context/user/cont-sys.rme
(/usr/local/texlive/2012/texmf-dist/tex/context/base/type-siz.mkii)
(/usr/local/texlive/2012/texmf-dist/tex/context/base/type-otf.mkii)
(/usr/local/texlive/2012/texmf-dist/tex/context/base/type-xtx.mkii))
system  : country-report-country_id-15.top loaded
(./country-report-country_id-15.top)
bodyfont: 12pt rm is loaded
language: patterns nl-default:default-1-2:2 us-default:default-2-
2:3 de-default:default-3-3:3 da-default:default-4-2:2 sv-default:default
-5-2:2 af-default:default-6-2:2 gb-default:default-7-2:2 fr-default:de
fault-8-2:2 es-default:default-9-2:2 ca-default:default-10-2:2 it-defa
ult:default-11-2:2 la-default:default-12-2:2 pt-default:default-13-2:2 
ro-default:default-14-2:2 pl-default:default-15-2:2 cs-default:default-
16-2:2 sk-default:default-17-2:2 hr-default:default-18-2:2 sl-default:d
efault-19-2:2 tr-default:default-20-2:2 tk-default:default-21-1:2 lt-d
efault:default-22-2:2 agr-default:default-24-2:2 fi-default:default-25-
2:2 hu-default:default-26-2:2 ru-default:default-28-2:2 uk-default:defau
lt-29-3:3  loaded
specials: dvips loaded
\openout3 = 

Re: [NTG-context] (XeTeX) trouble debugging a Missing number error

2012-12-05 Thread Lars Huttar
/Hans Hagen wrote (///Wed Dec 5 14:10:12 CET 2012/):/


 
 On 12/5/2012 11:19 AM, Lars Huttar wrote:
 / Hi all,
 /

/...

/
 /
 //
 // % Abbreviations
 // \definestartstop
 //[abblist]
 //[before={\setupbackgrounds[text][background=verticalline]
 // \starttextbackground[text]
 // 
 \setuptab[headstyle={\switchtobodyfont[SansB,\SansBsize]},width=20mm,location=left]
 // \startcolumnset[abbcolumn] \startalignment[flushleft,nothyphenated]},
 // after={\stopalignment \stopcolumnset \stoptextbackground
 // \setupbackgrounds[text][background=off]}]
 /
 you can try

 \unexpanded\def\StartAbbList
{\setupbackgrounds[text][background=verticalline]
 \starttextbackground[text]
  
 \setuptab[headstyle={\switchtobodyfont[SansB,\SansBsize]},width=20mm,location=left]
 \startcolumnset[abbcolumn]
 \startalignment[flushleft,nothyphenated]}

 \unexpanded\def\StopAbbList
{\stopalignment
 \stopcolumnset
 \stoptextbackground
 \setupbackgrounds[text][background=off]}

 \definestartstop
[abblist]
[before=\StartAbbList,
 after=\StopAbbList]

Thanks, I will try this.
Is the goal of this change to fix the error? To help diagnose it?
I don't really understand the use of \unexpanded.

After making this change, the behavior is unaffected... I still get the
Missing number error, etc.


 in such case best make a small example, for instance how is abblist used?


\startabblist{
\tab{\ITC{alt.}}\AE{alternate name for}\par
...
\tab{USDS}\AE{US Department of State}\par
}\stopabblist

where \AE is defined as:

   \def\AE#1{\hskip -3mm \SerifL{#1} \vskip 1mm}


 /
 // E16settings.tex: I added these definitions:
 // \define\XLfontsize{14pt}
 // \define\XXLfontsize{16pt}
 //
 // There are modes involved, so things are a bit more complicated, but I
 // believe that is the only effective difference.
 /
 and how about:

 \def\XLfontsize{14pt}
 \def\XXLfontsize{16pt}

I will try that, but all our font size definitions have always used
\define, and it used to work fine without errors.
On http://wiki.contextgarden.net/Command/define it says that \define is
like the TeX primitive \def, but will print an error to the log file if
the new definition overwrites an existing command.
I checked the log file, and there is no error mentioning XLfontsize.

So the purpose of your suggestion is to remove the possibility of
reporting a duplicate definition? (There's probably more to it than that
- I'm just trying to understand.)

I tried changing \define to \def as you suggested. The result was
unchanged - same error.

Regards,
Lars

___
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] tool for reviewing hyphenation

2009-02-04 Thread Lars Huttar
On 2/4/2009 3:10 AM, Alan BRASLAU wrote:
 On Tuesday 03 February 2009 22:53:08 Martin Schröder wrote:
 2009/2/3 Lars Huttar lars_hut...@sil.org:
 Does anyone know how to tell xdvipdfmx to enable commenting rights in
 the PDF it creates? Or how to add these rights afterwards, without Adobe
 Acrobat?
 This is not (legally) possible.
 http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions
 
 Welcome to the world of proprietary software.
 
 Some pdf viewers
 (such as okular on KDE, now also available on Windows and MacOS)
 allow annotations, but the data is saved in an auxiliary file.

Can you tell me where to find Okular for Windows? I read some rumors
that it was available, but http://okular.kde.org/download.php only gives
 instructions for compiling Okular, using a bunch of Linux packages.

 This can be exchanged with collegues, but is specific
 to the reader employed, thus limiting the portability (pdf).
 
 The advantage, however, is that all formats handled
 by the document viewer can be annotated, in principle...

Sounds good... is the annotation mechanism available via an API? Or do I
have to go through and highlight each hyphen by hand?

Thanks,
Lars

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


Re: [NTG-context] tool for reviewing hyphenation

2009-02-04 Thread Lars Huttar
On 2/4/2009 12:08 PM, Alan BRASLAU wrote:
 On Wednesday 04 February 2009 17:16:12 Lars Huttar wrote:
 Can you tell me where to find Okular for Windows? I read some rumors
 that it was available, but http://okular.kde.org/download.php only gives
  instructions for compiling Okular, using a bunch of Linux packages.
 
 http://windows.kde.org
 
 KDE on Windows is not in the final state, so applications can be unsuitable 
 for day to day use yet.
 
 I installed it without any problems and it appears to work.
 
 Alan
 

Thanks for the pointer. I look forward to trying this out.

In the meantime, I downloaded Adobe Acrobat Pro Trial version so that I
could test my javascript function that adds annotations.
I'm happy to report that it works... pretty well. It highlights only
words hyphenated over line breaks, not just all hyphens, and makes them
very visible. But you do need Acrobat Pro (or a PDF that's
comment-enabled via LiveCycle) to run it.

I'll try to post the javascript to the wiki, as it may be useful to
others, within its limitations.
The wiki page will be called
http://wiki.contextgarden.net/Reviewing_Hyphenation

Lars

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


[NTG-context] tool for reviewing hyphenation

2009-02-03 Thread Lars Huttar
Hello,

We have a situation where hyphenation is an issue, due to a 2-column
layout where the columns are not very wide. We've done a lot of tweaking
of settings for hyphenation and interword spacing, and the result seems
pretty good. In particular, there are not many cases of consecutive
lines that end with hyphens, and not many cases where a hyphenation
occurs over a right-hand page break. The few cases that exist, we have
been fixing manually by using \hbox{...} to prevent hyphenation at the
trouble spot.

But the hyphenation is by nature somewhat volatile, so whenever we
change something we would like to be able to easily recheck the hyphenation.
And our book is over 1200 pages, so it would be very helpful to have
tools to make the checking more efficient.

One tool we found was the evince PDF viewer in Linux, which highlights
all search results at once. So you can search for -, and it will
highlight all hyphens, which makes it easier to scan the PDF visually
for hyphenation problems.
Still, this approach has its limitations... our layout domain experts
don't have Linux machines, and I haven't found a PDF viewer for Windows
that can highlight all search results at once.

Another approach we wondered about was having TeX highlight the
hyphenations... e.g. changed the background color to yellow or red, when
outputting a word that's dynamically broken/hyphenated. (Rather like we
have TeX output red grid lines to help with debugging layout.)
I think we would also want to highlight static hyphens that occur at the
end of a line, as in Niger-
Congo, because they have a similar visual impact. Possibly using a
different color.

This would be an ideal solution, I think, but we don't know how to have
TeX detect when a word gets dynamically hyphenated.

Another possibility we've looked into is using javascript in Adobe
Reader to find and highlight end-of-line (and end-of-page) hyphens. But
this approach has proved more difficult than expected... the API and the
DOM are complex, and I haven't figured out yet how to access the text of
the document to search for hyphens. (The search method seems to just
go to the first or next occurence, and highlight only one occurrence at
a time.)

Thanks for any help,
Lars
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] tool for reviewing hyphenation

2009-02-03 Thread Lars Huttar
On 2/3/2009 1:29 PM, Hans Hagen wrote:
 Lars Huttar wrote:
 
 But the hyphenation is by nature somewhat volatile, so whenever we
 change something we would like to be able to easily recheck the
 hyphenation.
 And our book is over 1200 pages, so it would be very helpful to have
 tools to make the checking more efficient.
 
 so, you only want to highlight hyphens?

Yes. Especially hyphens introduced by TeX for line-breaking.

Lars


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


Re: [NTG-context] tool for reviewing hyphenation

2009-02-03 Thread Lars Huttar
On 2/3/2009 2:22 PM, Hans Hagen wrote:
 Lars Huttar wrote:
 On 2/3/2009 1:29 PM, Hans Hagen wrote:
 Lars Huttar wrote:

 But the hyphenation is by nature somewhat volatile, so whenever we
 change something we would like to be able to easily recheck the
 hyphenation.
 And our book is over 1200 pages, so it would be very helpful to have
 tools to make the checking more efficient.
 so, you only want to highlight hyphens?

 Yes. Especially hyphens introduced by TeX for line-breaking.
 
 in mkiv it probably takes me a couple of hours to implement such a feature
 
 Hans


Unfortunately at this point I believe we are restricted to mkii.


However, I have made progress implementing a tool like this in Adobe
javascript. The obstacle I am facing now is that the PDF (produced by
xdvipdfmx) is not configured to allow Adobe Reader users to manipulate
comments; thus my js code to add highlighting throws an exception.
If we had an Adobe Acrobat license it probably would not be a problem;
but our current reality is that we don't.
Does anyone know how to tell xdvipdfmx to enable commenting rights in
the PDF it creates? Or how to add these rights afterwards, without Adobe
Acrobat?

Thanks,
Lars


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


Re: [NTG-context] tool for reviewing hyphenation

2009-02-03 Thread Lars Huttar
On 2/3/2009 4:27 PM, Hans Hagen wrote:
 Lars Huttar wrote:
 On 2/3/2009 3:53 PM, Martin Schröder wrote:
 2009/2/3 Lars Huttar lars_hut...@sil.org:
 Does anyone know how to tell xdvipdfmx to enable commenting rights in
 the PDF it creates? Or how to add these rights afterwards, without
 Adobe
 Acrobat?
 This is not (legally) possible.
 http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions

 Best
Martin

 OK, thanks for this explanation.

 Since what I want to do is really not about modifying the document but
 about displaying it differently, I wonder if there is a way to highlight
 parts of the document without requiring the right to manipulate
 comments. Maybe there's another PDF manipulation API I should be looking
 at. But that's probably beyond the scope of this list.
 
 i'm not talking of commenting, just processing it with non intrusive
 some option that will color the hyphens
 
 Hans
 

That sounds good! If it doesn't require us to move from mkii to mkiv...

We're in production, very close to being finished, and I don't think I
could convince the production manager that mkiv would be guaranteed to
produce exactly the same layout as mkii.

Lars

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


Re: [NTG-context] tool for reviewing hyphenation

2009-02-03 Thread Lars Huttar
On 2/3/2009 3:53 PM, Martin Schröder wrote:
 2009/2/3 Lars Huttar lars_hut...@sil.org:
 Does anyone know how to tell xdvipdfmx to enable commenting rights in
 the PDF it creates? Or how to add these rights afterwards, without Adobe
 Acrobat?
 
 This is not (legally) possible.
 http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions
 
 Best
Martin

OK, thanks for this explanation.

Since what I want to do is really not about modifying the document but
about displaying it differently, I wonder if there is a way to highlight
parts of the document without requiring the right to manipulate
comments. Maybe there's another PDF manipulation API I should be looking
at. But that's probably beyond the scope of this list.

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


[NTG-context] error when using uniqueMPgraphics

2008-12-22 Thread Lars Huttar
On 12/16/2008 1:28 PM, Lars Huttar wrote [Re: [NTG-context] distributed
/ parallel TeX?]:
 On 12/16/2008 11:37 AM, Hans Hagen wrote:
 Lars Huttar wrote:
...
 The advice I received said to define each mpgraphic using
 \startuseMPgraphic (we have about 18 of these), associate them with
 overlays using \defineoverlay (again, we have 18), and then use them in
 table cells using statements like
 \setupTABLE[c][first][background={LRtb}]
 Empirically, this seems to end up using one mpgraphic per table cell,
 hence our thousands of mpgraphics. I don't know why a new mpgraphic
 would be created for each cell. Can someone suggest a way to avoid this?
 metafun manual: unique mp graphics
 
 Great...
 I converted our useMPgraphics to uniqueMPgraphics. This reduced our
 number of mpgraphics from 7000 to 800!
 
 Unfortunately the result doesn't look quite right... but since we may
 not need to use mpgraphics anyway thanks to your patches, I'll hold off
 on debugging the result.

When I use uniqueMPgraphics, things run faster, but I get errors and
warnings. They look like this:

** WARNING ** Specified (image) object doesn't exist: MP::139
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING **  at page=32 position=(216.633, 268.835) (in PDF)
** WARNING **  xxx pdf:uxobj @MP::139
** WARNING ** Error locating image file MP::185
** WARNING ** Specified (image) object doesn't exist: MP::185
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING **  at page=32 position=(250.44, 268.835) (in PDF)
** WARNING **  xxx pdf:uxobj @MP::185
** WARNING ** Error locating image file MP::141
** WARNING ** Specified (image) object doesn't exist: MP::141
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING **  at page=32 position=(284.247, 268.835) (in PDF)
** WARNING **  xxx pdf:uxobj @MP::141
** WARNING ** Error locating image file MP::186
** WARNING ** Specified (image) object doesn't exist: MP::186
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING **  at page=32 position=(316.111, 268.835) (in PDF)
** WARNING **  xxx pdf:uxobj @MP::186
** WARNING ** Error locating image file MP::143
** WARNING ** Specified (image) object doesn't exist: MP::143
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING **  at page=32 position=(352.456, 268.835) (in PDF)
** WARNING **  xxx pdf:uxobj @MP::143



The tex looks like:

\startMPinitializations
numeric FrameDist, Inner, Middle, Outer ;
FrameDist := 0.6;
Middle  := -0.2 ;
Inner := Middle - FrameDist;
Outer  := Middle + FrameDist;
\stopMPinitializations

% 0 double sides
\startuniqueMPgraphic{table:frame:lrtb} % all single
draw OverlayBox enlarged Middle ;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic

% 1 double side
\startuniqueMPgraphic{table:frame:Lrtb} % left double
draw OverlayBox leftenlarged Outer topenlarged Middle bottomenlarged
Middle rightenlarged Middle ;
draw OverlayBox leftenlarged Inner topenlarged Middle bottomenlarged
Middle rightenlarged Middle ;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic
...
% 0 double sides
\defineoverlay[lrtb][\uniqueMPgraphic{table:frame:lrtb}]
% 1 double side
\defineoverlay[Lrtb][\uniqueMPgraphic{table:frame:Lrtb}]
\defineoverlay[lRtb][\uniqueMPgraphic{table:frame:lRtb}]
\defineoverlay[lrTb][\uniqueMPgraphic{table:frame:lrTb}]
\defineoverlay[lrtB][\uniqueMPgraphic{table:frame:lrtB}]

...

\def\setuptableone{\setupTABLE[frame=off,split=no,option=stretch,offset=0.85mm,distance=0mm,columndistance=0mm,leftmargindistance=0mm,rightmargindistance=0mm]
\setupTABLE[r][each][height=0.6cm,align={middle,lohi}]
\setupTABLE[2,3,4,5,6,7][4,5,6,7,8,9][align={flushright,lohi}]
\setupTABLE[1][4,5,6,7,8,9][align={flushleft,lohi}]
\setupTABLE[c][1][background={LRtb}]
\setupTABLE[c][2,4][background={Lrtb}]
...}

\bgroup
\setuptableone
\startTabTableHeader
[nc=7,height=0.8cm,align={right,lohi}]\switchtobodyfont[SansB,\countryheadersize]{Table
1.}
...

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


Re: [NTG-context] error when using uniqueMPgraphics

2008-12-22 Thread Lars Huttar
On 12/22/2008 9:48 PM, Lars Huttar wrote:
 On 12/16/2008 1:28 PM, Lars Huttar wrote [Re: [NTG-context] distributed
 / parallel TeX?]:
 On 12/16/2008 11:37 AM, Hans Hagen wrote:
 Lars Huttar wrote:
 ...
 The advice I received said to define each mpgraphic using
 \startuseMPgraphic (we have about 18 of these), associate them with
 overlays using \defineoverlay (again, we have 18), and then use them in
 table cells using statements like
 \setupTABLE[c][first][background={LRtb}]
 Empirically, this seems to end up using one mpgraphic per table cell,
 hence our thousands of mpgraphics. I don't know why a new mpgraphic
 would be created for each cell. Can someone suggest a way to avoid this?
 metafun manual: unique mp graphics
 Great...
 I converted our useMPgraphics to uniqueMPgraphics. This reduced our
 number of mpgraphics from 7000 to 800!

 Unfortunately the result doesn't look quite right... but since we may
 not need to use mpgraphics anyway thanks to your patches, I'll hold off
 on debugging the result.
 
 When I use uniqueMPgraphics, things run faster, but I get errors and
 warnings. They look like this:
 
 ** WARNING ** Specified (image) object doesn't exist: MP::139
 ** WARNING ** Interpreting special command uxobj (pdf:) failed.
 ** WARNING **  at page=32 position=(216.633, 268.835) (in PDF)
 ** WARNING **  xxx pdf:uxobj @MP::139
 ** WARNING ** Error locating image file MP::185
 ** WARNING ** Specified (image) object doesn't exist: MP::185
 ** WARNING ** Interpreting special command uxobj (pdf:) failed.
 ** WARNING **  at page=32 position=(250.44, 268.835) (in PDF)
 ** WARNING **  xxx pdf:uxobj @MP::185
 ** WARNING ** Error locating image file MP::141
 ** WARNING ** Specified (image) object doesn't exist: MP::141
 ** WARNING ** Interpreting special command uxobj (pdf:) failed.
 ** WARNING **  at page=32 position=(284.247, 268.835) (in PDF)
 ** WARNING **  xxx pdf:uxobj @MP::141
 ** WARNING ** Error locating image file MP::186
 ** WARNING ** Specified (image) object doesn't exist: MP::186
 ** WARNING ** Interpreting special command uxobj (pdf:) failed.
 ** WARNING **  at page=32 position=(316.111, 268.835) (in PDF)
 ** WARNING **  xxx pdf:uxobj @MP::186
 ** WARNING ** Error locating image file MP::143
 ** WARNING ** Specified (image) object doesn't exist: MP::143
 ** WARNING ** Interpreting special command uxobj (pdf:) failed.
 ** WARNING **  at page=32 position=(352.456, 268.835) (in PDF)
 ** WARNING **  xxx pdf:uxobj @MP::143
 
 
 
 The tex looks like:
 
 \startMPinitializations
 numeric FrameDist, Inner, Middle, Outer ;
 FrameDist := 0.6;
 Middle  := -0.2 ;
 Inner := Middle - FrameDist;
 Outer  := Middle + FrameDist;
 \stopMPinitializations
 
 % 0 double sides
 \startuniqueMPgraphic{table:frame:lrtb} % all single
 draw OverlayBox enlarged Middle ;
 setbounds currentpicture to OverlayBox ;
 \stopuniqueMPgraphic
 
 % 1 double side
 \startuniqueMPgraphic{table:frame:Lrtb} % left double
 draw OverlayBox leftenlarged Outer topenlarged Middle bottomenlarged
 Middle rightenlarged Middle ;
 draw OverlayBox leftenlarged Inner topenlarged Middle bottomenlarged
 Middle rightenlarged Middle ;
 setbounds currentpicture to OverlayBox ;
 \stopuniqueMPgraphic
 ...
 % 0 double sides
 \defineoverlay[lrtb][\uniqueMPgraphic{table:frame:lrtb}]
 % 1 double side
 \defineoverlay[Lrtb][\uniqueMPgraphic{table:frame:Lrtb}]
 \defineoverlay[lRtb][\uniqueMPgraphic{table:frame:lRtb}]
 \defineoverlay[lrTb][\uniqueMPgraphic{table:frame:lrTb}]
 \defineoverlay[lrtB][\uniqueMPgraphic{table:frame:lrtB}]
 
 ...
 
 \def\setuptableone{\setupTABLE[frame=off,split=no,option=stretch,offset=0.85mm,distance=0mm,columndistance=0mm,leftmargindistance=0mm,rightmargindistance=0mm]
 \setupTABLE[r][each][height=0.6cm,align={middle,lohi}]
 \setupTABLE[2,3,4,5,6,7][4,5,6,7,8,9][align={flushright,lohi}]
 \setupTABLE[1][4,5,6,7,8,9][align={flushleft,lohi}]
 \setupTABLE[c][1][background={LRtb}]
 \setupTABLE[c][2,4][background={Lrtb}]
 ...}
 
 \bgroup
 \setuptableone
 \startTabTableHeader
 [nc=7,height=0.8cm,align={right,lohi}]\switchtobodyfont[SansB,\countryheadersize]{Table
 1.}
 ...
 


Sorry, I left out a couple of things I meant to say...

Basically, when we run with uniqueMPgraphic instead of useMPgraphic, we
get a lot fewer mpgraphic files; but the tables we produce lack the
outer border. And we get the above errors.

Googling the errors leads us to dvipdfmx, e.g.
http://tug.org/texlive/devsrc/Build/source/texk/dvipdfmx/src/spc_pdfm.c
http://dvipdfmx.sourcearchive.com/documentation/1:20050831-5/pdfximage_8c-source.html

But I don't think dvipdfmx is the cause.
Can anyone explain the error messages or suggest a fix?
We would love to use uniqueMPgraphics for efficiency, but we can't if it
gives the wrong result...

Thanks,
Lars
___
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

Re: [NTG-context] distributed / parallel TeX?

2008-12-17 Thread Lars Huttar
Thanks, everybody, for the discussion on running TeX distributed / in
parallel.
I am much educated about the state of the art. :-)

Summary ...

- There is plenty of optimization that normally can be done. If a
ConTeXt run is taking a really long time, chances are that something is
not being done according to the design.

- For most (current) purposes, documents are small enough and ConTeXt is
fast enough that the effort to automate distribution of typesetting runs
may not be worthwhile. On the other hand, the usage of TeX might expand
if greater throughput were available.

- However, as things stand now, one can always divide documents up by
hand, typeset the parts independently, and stitch them back together
using tools such as divert/undivert. One can even design a document with
the spec that the canonical typesetting process is to typeset the
sections independently; then the sections can never affect each other,
except for explicitly added inter-section effects like page reference
updates.

If you're not aware of MarkMail, it's a handy place to browse / search
archives of mailing lists. This thread can be found at
http://markmail.org/search/?q=ntg+context+distributed+parallel

On 12/17/2008 2:47 AM, Taco Hoekwater wrote:
 There are some interesting ideas in this discussion, but with
 the current state of the code base all of this will be exceedingly
 difficult (especially because of all the synchronisation issues).

 Unless someone wants to work on this idea him/herself (and that
 would be great, there are not nearly enough people working on TeX
 development!), you could remind me, say, two years from now?

Sure. Thank you for your interest.

I wasn't asking for someone to implement new features for this, though I
would be happy to see it happen if it is worthwhile for the community.

As Dr Dobb's says, Single core systems are history
(http://www.ddj.com/hpc-high-performance-computing/207100560). Software
that can take advantage of multiple cores (or threads, or distributed
nodes) will continue to scale. Of course some effort, and often some
adjustment, is necessary to enable programs to effectively use parallelism.

I'll create a page at http://wiki.contextgarden.net/Parallel summarizing
this discussion if that's OK.

Regards,
Lars

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


[NTG-context] starting headings at top of column

2008-12-17 Thread Lars Huttar
Hello,

I've started talking to people in charge about contributing some money
to this mailing list, or the wiki, or something ... we're certainly
getting a lot of help from it. Is there an org or project to contribute to?

Anyway, my current challenge is this.
We have a two-column layout using columnsets. Fairly often, we start a
new section (within a column... this does not interrupt the flow of
columns).

Some constraints we want to fulfill are:

- Normally we want a little space before each new section heading
  - Except at the top of a column; can I check whether we're at the top
of a column and do a conditional \vskip based on that?(*)

- Avoid orphans: when starting a new section, if there's not enough room
left in the current column, do a column break before outputting the
section heading. I've tried \testcolumn[n], but it doesn't seem to work
right. What are the units of the argument to \testcolumn?

We also do manual column balancing using \definecolumnset,
\setupcolumnset, and \setupcolumnsetlines. My concern is, does this
apply after other layout is performed, so that any test performed above
(*) regarding position within the column would fail to reflect these
column balancing adjustments and therefore could give wrong results?
That could explain why \testcolumn has been behaving in unexpected ways...

Thanks,
Lars



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


Re: [NTG-context] distributed / parallel TeX?

2008-12-16 Thread Lars Huttar
On 12/16/2008 2:08 AM, Taco Hoekwater wrote:
 
 Hi Lars,
 
 Lars Huttar wrote:
 Hello,

 We've been using TeX to typeset a 1200-page book, and at that size, the
 time it takes to run becomes a big issue (especially with multiple
 passes... about 8 on average). It takes us anywhere from 80 minutes on
 our fastest machine, to 9 hours on our slowest laptop.
 
 You should not need an average of 8 runs unless your document is
 ridiculously complex and I am curious what you are doing (but that
 is a different issue from what you are asking).
 
 So the question comes up, can TeX runs take advantage of parallelized or
 distributed processing? 
 
 No. For the most part, this is because of another requisite: for
 applications to make good use of threads, they have to deal with a
 problem that can be parallelized well. And generally speaking,
 typesetting  does not fall in this category. A seemingly small change
 on page 4 can easily affect each and every page right to the end
 of the document.

Thank you for your response.

Certainly this is true in general and in the worst case, as things stand
currently. But I don't think it has to be that way. The following could
greatly mitigate that problem:

- You could design your document *specifically* to make the parts
independent, so that the true and authoritative way to typeset them is
to typeset the parts independently. (You can do this part now without
modifying TeX at all... you just have the various sections' .tex files
input common headers / macro defs.) Then, by definition, a change in
one section cannot affect another section (except for page numbers, and
possibly left/right pages, q.v. below).

- Most large works are divisible into chunks separated by page breaks
and possibly page breaks that force a recto. This greatly limits the
effects that any section can have on another. The division (chunking)
of the whole document into fairly-separate parts could either be done
manually, or if there are clear page breaks, automatically.

- The remaining problem, as you noted, is how to fix page references
from one section to another. Currently, TeX resolves forward references
by doing a second (or third, ...) pass, which uses page information from
the previous pass. The same technique could be used for resolving
inter-chunk references and determining on what page each chunk should
start. After one pass on of the independent chunks (ideally performed
simultaneously by separate processing nodes), page information is sent
from each node to a coordinator process. E.g. the node that processed
section two tells the coordinator that chapter 11 starts 37 pages after
the beginning of section two. The coordinator knows in what sequence the
chunks are to be concatenated, thanks to a config file. It uses this
information together with info from each of the nodes to build a table
of what page each chunk should start on, and a table giving the absolute
page number of each page reference. If pagination has changed, or is
new, this info is sent back to the various nodes for another round of
processing.

If this distributed method of typesetting a document takes 1 additional
iteration compared to doing it in series, but you get to split the
document into say 5 roughly equal parts, you could presumably get the
job done a lot quicker in spite of the extra iteration.

This is a crude description but hopefully the idea is clear enough.

 parallel pieces so that you could guarantee that you would get the same
 result for section B whether or not you were typesetting the whole book
 at the same time?
 
 if you are willing to promiss yourself that all chapters will be exactly
 20 pages - no more, no less - they you can split the work off into
 separate job files yourself and take advantage of a whole server
 farm. If you can't ...

Yes, the splitting can be done manually now, and when the pain point
gets high enough, we do some manual separate TeX runs.

However, I'm thinking that for large works, there is enough gain to be
had that it would be worth systematizing the splitting process and
especially the recombining process, since the later is more error-prone.

I think people would do it a lot more if there were automation support
for it. I know we would.

But then, maybe our situation of having a large book with dual columns
and multipage tables is not common enough in the TeX world.
Maybe others who are typesetting similar books just use commercial
WYSIWYG typesetting tools, as we did in the previous edition of this book.

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


Re: [NTG-context] distributed / parallel TeX?

2008-12-16 Thread Lars Huttar
On 12/16/2008 11:37 AM, Hans Hagen wrote:
 Lars Huttar wrote:
 
 We have close to 7000 mpgraphics, and they add about 15 minutes to the
 run time.
 
 most of them are the same so reusing them made sense
 
 But the run time was already quite long before we started using those.

 - define fonts beforehand

 OK, we will look into this. I'm sure Jelle knows about this but I'm a
 noob. I'm pretty sure we are not *loading* fonts every time, but maybe
 we're scaling fonts an unnecessary number of times.
 For example, we have the following macro, which we use thousands of
 times:
 \def\LN#1{{\switchtobodyfont[SansB,\LNfontsize]{#1}}}
 
 indeed this will define the scaled ones again and again (whole sets of
 them since you use a complete switch); internall tex reuses them but it
 only know so when they're defined
 
 Would it help much to instead use
 \definefont[SansBLN][... at \LNfontsize]
 and then
 \def\LN#1{{\SansBLN{#1}}}
 ?
 
 indeed:
 
 \definefont[SansBLN][... at \LNfontsize]
 
 but no extra { } needed:
 
 \def\LN#1{{\SansBLN#1}}

Thanks, we will try this.
(Jelle, since you have worked with this a lot longer than I have, please
stop me if you have concerns about my making this sort of change.)

 - use unique mpgraphic when possible

 I would be interested to know if this is possible in our situation. Most
 of our mpgraphics are due to wanting thick-and-thin or single-and-double
 borders on tables, which are not natively supported by the ConTeXt table
 model.
 
 i sent jelle the patched files

OK, I'll look to hear from him. Are these patches to support these kinds
of borders on tables, thus no longer needing to use MPgraphics?

 The advice I received said to define each mpgraphic using
 \startuseMPgraphic (we have about 18 of these), associate them with
 overlays using \defineoverlay (again, we have 18), and then use them in
 table cells using statements like
 \setupTABLE[c][first][background={LRtb}]
 Empirically, this seems to end up using one mpgraphic per table cell,
 hence our thousands of mpgraphics. I don't know why a new mpgraphic
 would be created for each cell. Can someone suggest a way to avoid this?
 
 metafun manual: unique mp graphics

Great...
I converted our useMPgraphics to uniqueMPgraphics. This reduced our
number of mpgraphics from 7000 to 800!

Unfortunately the result doesn't look quite right... but since we may
not need to use mpgraphics anyway thanks to your patches, I'll hold off
on debugging the result.

 i changes the definitions a bit and now get 5 pages per second on my
 laptop in luatex; xetex processes the pages a bit faster but spends way
 more time on the mp part

 My last run gave about 0.25 pages per second on our fastest server, when
 taking into account multiple passes; that comes out to about 2 pps for
 --once.
 
 the patched files do 5-10 pps on my laptop (was  1 sec pp) so an
 improvement factor of at least 5 is possible
 
 there are probably other optimizations possible but i cannot spent too
 much time on it

Thanks for all your help thus far.

Lars

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


  1   2   >