Re: [NTG-context] horizontal space in \inframed and \hskip

2009-01-15 Thread luigi scarso
On Thu, Jan 15, 2009 at 6:44 AM, Michael Green
merely.ridicul...@gmail.comwrote:

 On Thu, Jan 15, 2009 at 1:04 AM, Luigi Scarso wrote:

  There is a space in between \ClassDate{..} and \ClassTopic{..}:
 \ClassDate{Monday, January 26} \ClassTopic{glaucon's challenge}

 Is my pdf right ?

 -- luigi



 Oh thank you, that's exactly what I wanted. It's hard to believe that
 didn't occur to me. A space takes space. Imagine that!

 mjg

In TeX, not always a space takes space (unfortunatly) ;
so one must be always becareful with macro/spaces/hmode/vmode .
And I did not see these spaces  until I copied your code  in a emacs buffer
,
so editor fonts play their role too .
Puff...
-- 
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] horizontal space in \inframed and \hskip

2009-01-14 Thread Michael Green
I am having some trouble with horizontal spacing. I'm trying to set  
one width for \inframed and \hskip but the two are coming out different.


Here is an example. It is a syllabus for a college course. I would  
like the entries for topics (e.g. “Glaucon’s challenge”), descriptions  
(e.g. “Glaucon poses …”), and readings (e.g. “{\it Republic} …”) to  
start at the same horizontal point on the page so that their left  
edges will be aligned.


I use the longest date on which class will be held to define a  
horizontal length (longestdate). I use that length to set the width of  
a frame for text that precedes ClassTopic and an hskip that precedes  
both ClassDesc and Reading. I expected the horizontal space to be  
equal. But ClassTopic is a couple points to the right of the other two.


Thanks!

%% Start example file

%% Horizontal length of longest date -- taken from 
http://archive.contextgarden.net/message/20070314.120612.adab0a8b.en.html

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

\setwidthof{{\it Wednesday, January 28.\hskip 1em}}\to\longestdate

%% Definitions

\def\ClassDate#1{\item \inframed[width= 
\longestdate,frame=off,align=right]{\it #1. }}%

\def\ClassTopic#1{{\WORD #1}}%
\def\ClassDesc#1{\hskip \longestdate #1}%
\def\Reading{\hskip \longestdate {\sc reading} }%


\starttext
\title{Syllabus test}

\startitemize[n]


\ClassDate{Monday, January 26} \ClassTopic{glaucon’s challenge}

	\ClassDesc{Glaucon poses a challenge for justice. We’ll talk about  
the nature of his test. What must Socrates prove about justice in  
order to satisfy the challenge? Do we really have to meet such a  
demanding test?}


\Reading{{\it Republic}, Bk. II, 357a–369b, pp. 38–44.}

\ClassDate{Wednesday, January 28} \ClassTopic{origins of the state}

	\ClassDesc{What problem does the state solve? That is, why would  
people who didn’t have a state want one? What did Plato believe was  
the primary cause of conflict in human affairs?}


\Reading{{\it Republic}, Bk. II, 368e–376e, pp. 43–52.}


\stopitemize


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


Re: [NTG-context] horizontal space in \inframed and \hskip

2009-01-14 Thread Michael Green

On Thu, Jan 15, 2009 at 1:04 AM, Luigi Scarso wrote:


There is a space in between \ClassDate{..} and \ClassTopic{..}:
\ClassDate{Monday, January 26} \ClassTopic{glaucon's challenge}

Is my pdf right ?

-- luigi



Oh thank you, that's exactly what I wanted. It's hard to believe that  
didn't occur to me. A space takes space. Imagine that!


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