Re: [NTG-context] Setup for appendices: a bunch of questions

2015-02-06 Thread Mojca Miklavec
On Fri, Feb 6, 2015 at 9:09 AM, luigi scarso wrote:
 On Fri, Feb 6, 2015 at 8:59 AM, Mojca Miklavecwrote:

 (Well, my computer hoplessly crashed when I first tried it, but I hope
 it's not your code to be blamed ;)

 A crash (ie a seg. fault, or an infinite loop)
 with context ?

It's way too off-topic, but first my pdf viewer crashed while context
was still compiling the document, luatex was stuck in the middle of
compiling. I used Ctrl+C to break the compilation, but there was a
ghost process still there. I tried to remove the new code, then start
context again. It was stuck again, I had to use Ctrl+C to stop
compilation and there was again a new ghost luatex process in the
background. I tried kill -9 pid, but it didn't help. I tried to
force kill it in the GUI, no success either. Then I tried rm
filename.pdf and the rm process was stuck as well, forever. Finally
I tried to reboot the machine, but it refused to reboot, so I had to
shut it down the hard way (press the switch-off button for a long
time, an equivalent of removing the battery).

I don't think that any of that had anything to do with ConTeXt or
luatex. It sounds like a hardware issue to me (despite my first
thought that I ended up in an infinite loop).

--

Back on topic. If I move a figure to Appendices, the figure now gets
numbered as 1.V (I would want to see B.1 if it's the first figure
in Appendix B). But when I reference that figure in main text, it
becomes Figure 1.5 which is indistinguishable from another figure
1.5 in the first chapter.

Mojca
___
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] Setup for appendices: a bunch of questions

2015-02-06 Thread luigi scarso
On Fri, Feb 6, 2015 at 8:59 AM, Mojca Miklavec 
mojca.miklavec.li...@gmail.com wrote:


 (Well, my computer hoplessly crashed when I first tried it, but I hope
 it's not your code to be blamed ;)

 A crash (ie a seg. fault, or an infinite loop)
with context ?



-- 
luigi
___
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] Setup for appendices: a bunch of questions

2015-02-06 Thread luigi scarso
On Fri, Feb 6, 2015 at 9:20 AM, Mojca Miklavec 
mojca.miklavec.li...@gmail.com wrote:

 On Fri, Feb 6, 2015 at 9:09 AM, luigi scarso wrote:
  On Fri, Feb 6, 2015 at 8:59 AM, Mojca Miklavecwrote:
 
  (Well, my computer hoplessly crashed when I first tried it, but I hope
  it's not your code to be blamed ;)
 
  A crash (ie a seg. fault, or an infinite loop)
  with context ?

 It's way too off-topic, but first my pdf viewer crashed while context
 was still compiling the document, luatex was stuck in the middle of
 compiling. I used Ctrl+C to break the compilation, but there was a
 ghost process still there. I tried to remove the new code, then start
 context again. It was stuck again, I had to use Ctrl+C to stop
 compilation and there was again a new ghost luatex process in the
 background. I tried kill -9 pid, but it didn't help. I tried to
 force kill it in the GUI, no success either. Then I tried rm
 filename.pdf and the rm process was stuck as well, forever. Finally
 I tried to reboot the machine, but it refused to reboot, so I had to
 shut it down the hard way (press the switch-off button for a long
 time, an equivalent of removing the battery).

 I don't think that any of that had anything to do with ConTeXt or
 luatex. It sounds like a hardware issue to me (despite my first
 thought that I ended up in an infinite loop).

 to me it sounds as  mtxrun/luatex problem instead. I will try to reproduce
it.


-- 
luigi
___
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] Setup for appendices: a bunch of questions

2015-02-06 Thread Mojca Miklavec
On Thu, Feb 5, 2015 at 12:42 PM, Wolfgang Schuster wrote:
 Am 04.02.2015 um 22:06 schrieb Mojca Miklavec:

 Hello,

 I need a tiny bit of help with properly setting up the appendices.

 1.) I would like to include both chapters and titles. Is this the
 proper way to go? (It took me a while to figure out how to include the
 titles at all.)

\setuphead
[title]
[incrementnumber=list]
\placelist
[title,chapter,section]
[criterium=all,alternative=c]

 But why is there less space in front of a \title{...} in TOC than in
 front of a \chapter{…}?

 You can use the “margin” key to indent the title entries but unnumbered 
 chapter are still wrong aligned.

I'm sorry, that was a misunderstanding. I was referring to the
vertical alignment, not to the horizontal one. It's perfectly OK if
the title is aligned flushleft, but there's less vertical space in
front of it.

 2.) How can I define a different width for appendices in TOC (to
 reserve enough space for the word Appendix)?

 I use

 \setuplist
[section]
[width=10mm,numberstyle=\os\bf,pagestyle=\os,label=yes]

 but I would like to use width=27mm for sections inside
 \startappendices ... \stopappendices than for regular sections. Is
 there any workaround?

 Use the “numbercommand” key to measure the width of the number
 and apply different widths for narrow and wide entries.

Perfect, thank you.

(Well, my computer hoplessly crashed when I first tried it, but I hope
it's not your code to be blamed ;)

 3.) For appendices I want to set

 \setuphead
[chapter]
[number=no]
 \setuphead
[section]
[page=yes,sectionsegments=section,conversion=Character,sectionstopper=:]

 without affecting regular sections and chapters.

 Is it possible to do this on top of the document (or in the layout) as
 opposed to changing the settings just before appendices start? I would
 like to avoid messing up with such settings in the middle of the
 document.

 Use \startsectionblockenvironment to set the setups at the begin of the 
 document.

Thank you.

 I tried to play with
\defineconversionset
 and
\setupsectionblock
[appendix]
[sectionconversionset=...]
 but I'm unable to understand how these commands work exactly.

 Take a look at the example below how this can be achieved.

Thank you.

Now a couple of follow-up questions. The tables are now numbered in a
very weird way. It's now Table 1.VI instead of Table E.1 for the
first table in Appendix E. Which keys control numbering of tables? (Or
better yet: what's the reference for MKIV to find that out, if any?)

If I use sectionstopper=: and then try to reference it with
\in[appendix:label-for-this-appendix], I get the colon there as well
which is not desired, so I probably need to use another trick to get
the colon. Should I change the numbercommand in \setuphead and
\setuplist or is there a different trick?

Thanks again,
Mojca
___
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] Setup for appendices: a bunch of questions

2015-02-06 Thread Alan BRASLAU
On Fri, 6 Feb 2015 09:20:41 +0100
Mojca Miklavec mojca.miklavec.li...@gmail.com wrote:

  luatex was stuck in the middle of
 compiling. I used Ctrl+C to break the compilation, but there was a
 ghost process still there.

I noticed that Taco always uses SIGQUIT (ctrl+\) rather than SIGINT
(ctrl+c) with luatex. SIGQUIT usually results in a core dump but does
not leave a ghost process.

Perhaps Luigi (or Taco) can explain why luatex does not handle SIGINT
as we might expect?

Alan
___
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] Setup for appendices: a bunch of questions

2015-02-06 Thread Wolfgang Schuster

 Am 06.02.2015 um 08:59 schrieb Mojca Miklavec 
 mojca.miklavec.li...@gmail.com:
 
 On Thu, Feb 5, 2015 at 12:42 PM, Wolfgang Schuster wrote:
 Am 04.02.2015 um 22:06 schrieb Mojca Miklavec:
 
 Hello,
 
 I need a tiny bit of help with properly setting up the appendices.
 
 1.) I would like to include both chapters and titles. Is this the
 proper way to go? (It took me a while to figure out how to include the
 titles at all.)
 
   \setuphead
   [title]
   [incrementnumber=list]
   \placelist
   [title,chapter,section]
   [criterium=all,alternative=c]
 
 But why is there less space in front of a \title{...} in TOC than in
 front of a \chapter{…}?
 
 You can use the “margin” key to indent the title entries but unnumbered 
 chapter are still wrong aligned.
 
 I'm sorry, that was a misunderstanding. I was referring to the
 vertical alignment, not to the horizontal one. It's perfectly OK if
 the title is aligned flushleft, but there's less vertical space in
 front of it.

Because title uses the global values for the space before the entries
unlike chapters which use a customised value, you can change this
by adding \setuplist[title][before={\blank[preference,big]}] to your document.

 Now a couple of follow-up questions. The tables are now numbered in a
 very weird way. It's now Table 1.VI instead of Table E.1 for the
 first table in Appendix E. Which keys control numbering of tables? (Or
 better yet: what's the reference for MKIV to find that out, if any?)

You can change the counter and prefix conversion of floats with the
prefiixconverionset and numberconversionset key for \setupcaption.

 If I use sectionstopper=: and then try to reference it with
 \in[appendix:label-for-this-appendix], I get the colon there as well
 which is not desired, so I probably need to use another trick to get
 the colon. Should I change the numbercommand in \setuphead and
 \setuplist or is there a different trick?

Use

\setuphead[section][numbercommand=\groupedcommand{}{:}]

instead of

\setuphead[section][sectionstopper=:]

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

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

Re: [NTG-context] Setup for appendices: a bunch of questions

2015-02-06 Thread Mojca Miklavec
On Fri, Feb 6, 2015 at 10:12 AM, Hans Hagen wrote:
 On 2/6/2015 9:20 AM, Mojca Miklavec wrote:

 Back on topic. If I move a figure to Appendices, the figure now gets
 numbered as 1.V (I would want to see B.1 if it's the first figure
 in Appendix B). But when I reference that figure in main text, it
 becomes Figure 1.5 which is indistinguishable from another figure
 1.5 in the first chapter.


 weird indeed as it should default to numbers at that that level cf.

 \defineconversionset
   [appendix:default]
   [Romannumerals,Characters]
   [numbers]

 so for the moment use

 \defineconversionset
   [appendix:default]
   [Numbers,Characters]
   [numbers]

 (as the first level, part is not used by you anyway)

I get Figure 1.5 now which is way better than Figure 1.V, but I
would like to get Figure B.2 when in Chapter 1, Section B (=
Appendix B). So I would need to convince the counter to use the
section number rather than the chapter number. Is that possible?

(I can also switch and make each appendix a chapter rather than a
section, but then I wouldn't want every appendix to stand out in TOC
in the same way as a chapter does.)

Mojca
___
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] Setup for appendices: a bunch of questions

2015-02-06 Thread Hans Hagen

On 2/6/2015 9:37 AM, Alan BRASLAU wrote:

On Fri, 6 Feb 2015 09:20:41 +0100
Mojca Miklavec mojca.miklavec.li...@gmail.com wrote:


  luatex was stuck in the middle of
compiling. I used Ctrl+C to break the compilation, but there was a
ghost process still there.


I noticed that Taco always uses SIGQUIT (ctrl+\) rather than SIGINT
(ctrl+c) with luatex. SIGQUIT usually results in a core dump but does
not leave a ghost process.

Perhaps Luigi (or Taco) can explain why luatex does not handle SIGINT
as we might expect?


on windows one can also end up with an aborted ghost process but not 
always so it probably has to to do with the place where luatex is 
aborted or crashes (if one aborts a tex loop it's often ok, but in 
something lua it can be worse)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] Setup for appendices: a bunch of questions

2015-02-06 Thread Hans Hagen

On 2/6/2015 9:20 AM, Mojca Miklavec wrote:


Back on topic. If I move a figure to Appendices, the figure now gets
numbered as 1.V (I would want to see B.1 if it's the first figure
in Appendix B). But when I reference that figure in main text, it
becomes Figure 1.5 which is indistinguishable from another figure
1.5 in the first chapter.


Interesting is that this got unnoticed (here it's no surprise as in 
nearly most docs we produce for others have unnumbered figures).


The problem, is that numbered items use the 'default' conversionset and 
that one has an appendices setting.


So, what is needed is this:

\defineconversionset [number] [] [numbers]

\setupcounters
  [numberconversionset=number]

(math for instance already has its own conversionset)

Hans

ps. Each counter can have a dedicated conversion set and these travel 
around the system so that when referred they are also used - but they 
can also be overloaded then - which makes it possible to render numbers 
(prefix+number+suffix) independently. (In mkii we'd have to disassemble 
these 1.2.3.4 numbers in order to mess with separators in different 
colors in different places etc., not that i ran into a project that 
demanded this recently.)



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] Setup for appendices: a bunch of questions

2015-02-06 Thread Hans Hagen

On 2/6/2015 9:20 AM, Mojca Miklavec wrote:

On Fri, Feb 6, 2015 at 9:09 AM, luigi scarso wrote:

On Fri, Feb 6, 2015 at 8:59 AM, Mojca Miklavecwrote:


(Well, my computer hoplessly crashed when I first tried it, but I hope
it's not your code to be blamed ;)


A crash (ie a seg. fault, or an infinite loop)
with context ?


It's way too off-topic, but first my pdf viewer crashed while context
was still compiling the document, luatex was stuck in the middle of
compiling. I used Ctrl+C to break the compilation, but there was a
ghost process still there. I tried to remove the new code, then start
context again. It was stuck again, I had to use Ctrl+C to stop
compilation and there was again a new ghost luatex process in the
background. I tried kill -9 pid, but it didn't help. I tried to
force kill it in the GUI, no success either. Then I tried rm
filename.pdf and the rm process was stuck as well, forever. Finally
I tried to reboot the machine, but it refused to reboot, so I had to
shut it down the hard way (press the switch-off button for a long
time, an equivalent of removing the battery).

I don't think that any of that had anything to do with ConTeXt or
luatex. It sounds like a hardware issue to me (despite my first
thought that I ended up in an infinite loop).

--

Back on topic. If I move a figure to Appendices, the figure now gets
numbered as 1.V (I would want to see B.1 if it's the first figure
in Appendix B). But when I reference that figure in main text, it
becomes Figure 1.5 which is indistinguishable from another figure
1.5 in the first chapter.


weird indeed as it should default to numbers at that that level cf.

\defineconversionset
  [appendix:default]
  [Romannumerals,Characters]
  [numbers]

so for the moment use

\defineconversionset
  [appendix:default]
  [Numbers,Characters]
  [numbers]

(as the first level, part is not used by you anyway)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] Setup for appendices: a bunch of questions

2015-02-05 Thread Wolfgang Schuster

 Am 04.02.2015 um 22:06 schrieb Mojca Miklavec 
 mojca.miklavec.li...@gmail.com:
 
 Hello,
 
 I need a tiny bit of help with properly setting up the appendices.
 
 1.) I would like to include both chapters and titles. Is this the
 proper way to go? (It took me a while to figure out how to include the
 titles at all.)
 
\setuphead
[title]
[incrementnumber=list]
\placelist
[title,chapter,section]
[criterium=all,alternative=c]
 
 But why is there less space in front of a \title{...} in TOC than in
 front of a \chapter{…}?

You can use the “margin” key to indent the title entries but unnumbered chapter 
are still wrong aligned.

 2.) How can I define a different width for appendices in TOC (to
 reserve enough space for the word Appendix)?
 
 I use
 
 \setuplist
[section]
[width=10mm,numberstyle=\os\bf,pagestyle=\os,label=yes]
 
 but I would like to use width=27mm for sections inside
 \startappendices ... \stopappendices than for regular sections. Is
 there any workaround?

Use the “numbercommand” key to measure the width of the number
and apply different widths for narrow and wide entries.

 3.) For appendices I want to set
 
 \setuphead
[chapter]
[number=no]
 \setuphead
[section]
[page=yes,sectionsegments=section,conversion=Character,sectionstopper=:]
 
 without affecting regular sections and chapters.
 
 Is it possible to do this on top of the document (or in the layout) as
 opposed to changing the settings just before appendices start? I would
 like to avoid messing up with such settings in the middle of the
 document.

Use \startsectionblockenvironment to set the setups at the begin of the 
document.

 I tried to play with
\defineconversionset
 and
\setupsectionblock
[appendix]
[sectionconversionset=...]
 but I'm unable to understand how these commands work exactly.

Take a look at the example below how this can be achieved.

 begin example

\def\sc{\addff{smallcaps}}
\def\os{\addff{oldstyle}}

\setuplabeltext
[appendix=Appendix~]

\setuphead
[title]
[incrementnumber=list,page=yes]

\setuphead
[chapter]
[page=no,numberstyle=\os]

\setuphead
[section]
[style=\bfb,numberstyle=\os,appendixlabel=appendix]

\setuplist
[title,chapter]

[width=10mm,textstyle=\sc\bfb,numberstyle=\os\bfb,pagestyle=\os,aligntitle=no]

\setuplist
[title]
[margin=10mm]

\define[1]\SectionlistNumber
  {\dowithnextbox
 {\ifdim\nextboxwd10mm
\simplealignedbox{10mm}{flushleft}{\flushnextbox}%
  \else
\simplealignedbox{27mm}{flushleft}{\flushnextbox}%
  \fi}
 \hbox{#1}}

\setuplist
[section]

[width=0pt,numberstyle=\os\bf,pagestyle=\os,label=yes,numbercommand=\SectionlistNumber]

% The \defineconversionset command allows you to define
% different conversion for each sectionblock in your
% document by adding the name of the sectionblock in
% front of the name of the conversion set.

\defineconversionset [bodypart:sectioncounter] [n,n,n] [n]
\defineconversionset [appendix:sectioncounter] [n,n,A] [n]

\setuphead[chapter,section][sectionconversionset=sectioncounter]

% With the sectionblock environment you can list setups
% which are applied at the begin of the specified block
% in your document, e.g. the following setups are used
% after \startappendices:

\startsectionblockenvironment[appendix]

\setuphead
[chapter]
[number=no]

\setuphead
[section]
[page=yes,
 sectionsegments=section,
 sectionstopper=:]

\stopsectionblockenvironment

\setupbodyfont[palatino]

\starttext

\startfrontmatter

\title{Contents}
\placelist[title,chapter,section][criterium=all,alternative=c]

Why is there less space in front of a title in TOC than in front of a chapter?

How to define a different width for appendices (to reserve enough space for the 
word Appendix)?

\stopfrontmatter

\startbodymatter

\chapter{First Chapter}
\section{First Section}
\chapter{Second Chapter}
\section{Second Section}

\stopbodymatter

\startappendices

\chapter{Appendices}

\section{First Appendix}
\input tufte

\section{Second Appendix}
\input zapf

\title{Why is there less space in toc?}

\stopappendices

\stoptext

 end example

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

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