Re: [NTG-context] Equivalent to \settowidth

2007-03-17 Thread Robin Kirkham
 From: Hans Hagen [EMAIL PROTECTED]
 Wolfgang Schuster wrote:
 2007/3/14, Robin Kirkham [EMAIL PROTECTED]:

 Is there a ConTeXt equivalent to LaTeX \settowidth{}, or better  
 still
 some macro I can do things like

 \setupsomething[
  ...
  width={\widthof{\bf sometext\emspace}},
  ...]

 \def\setwidthof#1\to#2%
 {\bgroup
  \setbox\scratchbox\hbox{#1}%
  \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}}

Thanks Wolfgang, Chen and Hans for your responses. I used Hans'  
one ... it seems to work.

I'm actually trying to indent tables of contents by level. I want  
each indent to match the start of the heading text of the previous  
level, i.e.,

1  Chapter
1.1  Section
 1.1.1  Subsection
 1.1.2  Subsection
...
Title

in other words, the indent is not quite a fixed width per level.

The following complete example sort of does what I want (using Hans'  
\setwidthof) but it will fail when the section numbers have more  
digits than I have allowed for.
I have a feeling I should be using \setupcombinedlist[content] 
[distance=1em] or something, but that puts an em space in front of  
unnumbered chapters (titles) as well.

What I have done seems very ugly, surely there is a proper way?

Robin

% widthof macro from Hans
\def\setwidthof#1\to#2%
 {\bgroup
 \setbox\scratchbox\hbox{#1}%
 \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}}

\setupcombinedlist[content][
 alternative=c,
 aligntitle=yes]
\setuplist[chapter][
 alternative=b,
 style=bold]

% calculate widths of numbers
\setwidthof{\bf 9\emspace}\to\WDA
\setwidthof{9.9\emspace}\to\WDB
\setwidthof{9.9.9\emspace}\to\WDC
\setwidthof{9.9.9.9\emspace}\to\WDD

% calculate margins
\setwidthof{{\bf 9\emspace}}\to\MAB
\setwidthof{{\bf 9\emspace}9.9\emspace}\to\MAC
\setwidthof{{\bf 9\emspace}9.9\emspace 9.9.9\emspace}\to\MAD

\setuplist[chapter] [margin=0em,  width=\WDA]
\setuplist[section] [margin=\MAB, width=\WDB]
\setuplist[subsection]  [margin=\MAC, width=\WDC]
\setuplist[subsubsection]   [margin=\MAD, width=\WDD]


\starttext

\completecontent[criterium=all]
\page

\startfrontmatter
\chapter{Unnumbered Chapter}
\stopfrontmatter

\startbodymatter
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\chapter{Chapter}
\stopbodymatter

\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] texshow does not read t-vim.xml

2007-03-17 Thread Peter Münster
Hello,

it seems, that texshow does not read t-vim.xml. Is this normal? How can I
change it?

Cheers, Peter

-- 
http://pmrb.free.fr/contact/
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] texshow does not read t-vim.xml

2007-03-17 Thread Taco Hoekwater
Peter Münster wrote:
 Hello,
 
 it seems, that texshow does not read t-vim.xml. Is this normal? How can I
 change it?

Yes, that is normal. Did you notice how the version number for texshow
is way below one? This is one of the reasons why that is so. At first,
I had no time to implement all features. Then, I was no longer happy
with perl. Then, the XML format was not complete enough to cover all
of the nice extensions in texshow-web. Even later, we wanted to create
a local http server using ruby (and reuse the texshow-web code), but we
could not figure out how to make that work reliably. And right now, we
have all these problems, combined.

Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] textblocks in tables

2007-03-17 Thread Bernhard Michael
 
 Hi Michael,
 
 I found a very ugly solution to reset the \Requirement counter.
 

Hi Wolfgang

Thanks for the solution. It works for me too.

However the page breaking problem remains. The tabulate environment and the 
natural table produce both to large 'cells' containing all textblocks.

It would be really nice to have a solution where I can typeset the to 
textblocks (Requirements and Priority) in a list, each block in a cell.

I don't understand why I can't place arbitrary commands in the 'begin' and 
'after' fields of '\setupblock'. Does the '\useblocks' command not produce 
plain TeX-Code in iterative fashion (like a for-loop over all textblocks)?

Is there somebody in the list, who already had a similar problem?

Michael
winmail.dat___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context