* Re: horizontal space in \inframed and \hskip
[not found] <mailman.6617.1231995080.19169.ntg-context@ntg.nl>
@ 2009-01-15 5:44 ` Michael Green
2009-01-15 8:22 ` luigi scarso
0 siblings, 1 reply; 4+ messages in thread
From: Michael Green @ 2009-01-15 5:44 UTC (permalink / raw)
To: ntg-context
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: horizontal space in \inframed and \hskip
2009-01-15 5:44 ` horizontal space in \inframed and \hskip Michael Green
@ 2009-01-15 8:22 ` luigi scarso
0 siblings, 0 replies; 4+ messages in thread
From: luigi scarso @ 2009-01-15 8:22 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 713 bytes --]
On Thu, Jan 15, 2009 at 6:44 AM, Michael Green
<merely.ridiculous@gmail.com>wrote:
> 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
[-- Attachment #1.2: Type: text/html, Size: 1215 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: horizontal space in \inframed and \hskip
2009-01-15 0:04 Michael Green
@ 2009-01-15 4:50 ` luigi scarso
0 siblings, 0 replies; 4+ messages in thread
From: luigi scarso @ 2009-01-15 4:50 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 2468 bytes --]
On Thu, Jan 15, 2009 at 1:04 AM, Michael Green
<merely.ridiculous@gmail.com>wrote:
> 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
>
There is a space in between \ClassDate{..} and \ClassTopic{..}:
\ClassDate{Monday, January 26} \ClassTopic{glaucon's challenge}
Is my pdf right ?
--
luigi
[-- Attachment #1.2: Type: text/html, Size: 3049 bytes --]
[-- Attachment #2: test-michael-001.pdf --]
[-- Type: application/pdf, Size: 15728 bytes --]
[-- Attachment #3: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* horizontal space in \inframed and \hskip
@ 2009-01-15 0:04 Michael Green
2009-01-15 4:50 ` luigi scarso
0 siblings, 1 reply; 4+ messages in thread
From: Michael Green @ 2009-01-15 0:04 UTC (permalink / raw)
To: ntg-context
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-15 8:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <mailman.6617.1231995080.19169.ntg-context@ntg.nl>
2009-01-15 5:44 ` horizontal space in \inframed and \hskip Michael Green
2009-01-15 8:22 ` luigi scarso
2009-01-15 0:04 Michael Green
2009-01-15 4:50 ` luigi scarso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).