ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Toward the use of inleft for custom section's command… or not…
@ 2010-11-24 18:32 Renaud AUBIN
  2010-11-25 20:27 ` \inmargin / full textwidth line interaction (was Toward the use of inleft…) Renaud AUBIN
  0 siblings, 1 reply; 8+ messages in thread
From: Renaud AUBIN @ 2010-11-24 18:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello there,

Thanks to a hdd crash, I need to rewrite an old document of mine from
scratch (after setting up a software RAID on my machine).
Unfortunately, I let my ConTeXt faculties to rust…

I must deal with several problems (but I will apply the good old divide
and conquer rule).

So, here is a collection of unforgivable workarounds to produce what I
want to:

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
\enableregime[utf8]

\setuppapersize[A4][A4]

\setupbodyfont[10pt]


\setuplayout[reset]
\setuplayout[
  location=singlesided,
  leftedge=0mm,
  leftmargin=45mm,
  rightedge=0mm,
  rightmargin=0mm,
  backspace=60mm,
  topspace=10mm,
  bottomspace=10mm,
  header=0mm,
  headerdistance=0mm,
  footer=0mm,
  footerdistance=0mm,
  margindistance=0mm,
  height=fit,
  width=fit,
  grid=yes]

\setuppagenumbering[state=stop]

\setupinmargin[style=normal,align=outer]

\define[1]\SectionCommand {
\blank % just because I always need some vertical space just before my
Section
\inleft{\bfa #1}
{\line{\leaders\hbox{\vrule width 1pt height .5\strutht depth
      -\dimexpr.5\strutht-\linewidth\relax} \hfil}}
\blank[-1*big] % Are you kidding me with that negative blank???
}

\define[4]\TopicCommand {
\inleft{{\em #1}}{\bfa #2 \hfill \tfx #3}
% \crlf % OK, give me a newline! But, the problem is that there is a big
%       % after space from inleft!
\blank[-1*big] % REALLY DUMMY WORKAROUND!!!
{\em #4}
}

\starttext

\SectionCommand{A Section}
\TopicCommand{The date}{Knuth's topic}{some text}{The detailled topic
  (more than one line)}

\input knuth

\blank % Are you kidding me???
\TopicCommand{Another date}{Zapf}{some text}{The detailled topic
  (more than one line)}

\input zapf

\SectionCommand{Section}

\TopicCommand{A date}{Tufte}{}{Some details}

\input tufte

\stoptext
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

OK, I need that… but a clean version…

Best Regards,

Renaud
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* \inmargin / full textwidth line interaction (was  Toward the use of inleft…)
  2010-11-24 18:32 Toward the use of inleft for custom section's command… or not… Renaud AUBIN
@ 2010-11-25 20:27 ` Renaud AUBIN
  2010-11-26 10:52   ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Renaud AUBIN @ 2010-11-25 20:27 UTC (permalink / raw)
  To: ntg-context

Since my previous post doesn't seem inspiring at all (sniff), here is a
simplified and more precise description of what need to be done:

1 − I need a full textwidth black line as separator with a short title
centered vertically at left
2 − This separator must be followed by text, and the inbetween vertical
space must be configurable (i.e. .5lineheight or a full lineheight
doesn't satisfy me)

My first idea has been to combine a vertically centered line with inleft
or inmargin but that introduces an annoying afterspace…
Another idea could be to combine some \hairlines or full textwidth
fillinline but then don't know how to vertically align my inmargin text…

−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− TEST
\setuplayout[reset]
\setuplayout[
  location=singlesided,
  leftedge=0mm,
  leftmargin=25mm,
  rightedge=0mm,
  rightmargin=0mm,
  backspace=40mm,
  topspace=10mm,
  bottomspace=10mm,
  header=0mm,
  headerdistance=0mm,
  footer=0mm,
  footerdistance=0mm,
  margindistance=0mm,
  height=fit,
  width=fit,
  grid=yes]

\setuppagenumbering[state=stop]

\setupinmargin[style=normal,align=outer]

\starttext

\inmargin{blurp}{\line{\leaders\hbox{\vrule width 1pt height .5\strutht
depth -\dimexpr.5\strutht-\linewidth\relax} \hfil}}
This is not a test

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re:  \inmargin / full textwidth line interaction (was  Toward the use of inleft…)
  2010-11-25 20:27 ` \inmargin / full textwidth line interaction (was Toward the use of inleft…) Renaud AUBIN
@ 2010-11-26 10:52   ` Wolfgang Schuster
  2010-11-26 19:25     ` BUG? Strange behavior (vertical space added!!!) with accentuated letters (was \inmargin / full textwidth line interaction) Renaud AUBIN
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2010-11-26 10:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 25.11.2010 um 21:27 schrieb Renaud AUBIN:

> Since my previous post doesn't seem inspiring at all (sniff), here is a
> simplified and more precise description of what need to be done:
> 
> [...]

\setupbodyfont[10pt]

\setuplayout
  [leftedge=0mm,
   leftmargin=45mm,
   rightedge=0mm,
   rightmargin=0mm,
   backspace=60mm,
   topspace=10mm,
   bottomspace=10mm,
   header=0mm,
   headerdistance=0mm,
   footer=0mm,
   footerdistance=0mm,
   margindistance=0mm,
   height=middle,
   width=middle,
   grid=yes]

\setuppagenumbering[state=stop]

\setuphead[section]   [style=,command=\SectionCommand]
\setuphead[subsection][style=,command=\SubsectionCommand]

\define[2]\SectionCommand
  {\inleftmargin{\leftaligned{\structuretitle}}%
   \blackrule
     [ width=\textwidth,
      height=+.3\lineheight,
       depth=-.2\lineheight]}

\define[2]\SubsectionCommand
   {\vbox\bgroup
      \inleftmargin{\leftaligned{\em\structureuservariable{date}}}%
      {\bfa\structuretitle}\wordright{\tfx\structureuservariable{topic}}
      \blank
      {\em\structureuservariable{info}}%
    \egroup}

\starttext

\startsection[title={A Section}]

\startsubsection
  [title={The detailled topic (which takes more than one line)}]
  [date={The date},topic={Knuth’s topic},info={some text}]

\input knuth

\stopsubsection

\startsubsection
  [title={The detailled topic (which takes more than one line)}]
  [date={Another date},topic={Zapf},info={some text}]

\input zapf

\stopsubsection

\stopsection

\startsection[title={Section}]

\startsubsection
  [title={Some details}]
  [date={A date},topic={Tufte}]

\input tufte

\stopsubsection

\stopsection

\stoptext

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* BUG? Strange behavior (vertical space added!!!) with accentuated letters (was \inmargin / full textwidth line interaction)
  2010-11-26 10:52   ` Wolfgang Schuster
@ 2010-11-26 19:25     ` Renaud AUBIN
  2010-11-26 21:06       ` Renaud AUBIN
  2010-11-27  8:17       ` Otared Kavian
  0 siblings, 2 replies; 8+ messages in thread
From: Renaud AUBIN @ 2010-11-26 19:25 UTC (permalink / raw)
  To: ntg-context

Hi Wolfgang,

First, thank you!

Now, if I use some accentuated letters in title (the É just after the
second subsection and before \input zapf), there is an unwanted vertical
space… Bug, feature or misuse???
Could you confirm the bug? (the resulting pdf:
http://dl.dropbox.com/u/5289718/testWolfgang.pdf)

I use the latest minimals on debian 64.

Test −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
\setupbodyfont[10pt]

\setuplayout
  [leftedge=0mm,
   leftmargin=45mm,
   rightedge=0mm,
   rightmargin=0mm,
   backspace=60mm,
   topspace=10mm,
   bottomspace=10mm,
   header=0mm,
   headerdistance=0mm,
   footer=0mm,
   footerdistance=0mm,
   margindistance=0mm,
   height=middle,
   width=middle,
   grid=yes]

\setuppagenumbering[state=stop]

\setuphead[section]   [style=,command=\SectionCommand]
\setuphead[subsection][style=,command=\SubsectionCommand]

\define[2]\SectionCommand
  {\inleftmargin{\leftaligned{\structuretitle}}%
   \blackrule
     [ width=\textwidth,
      height=+.3\lineheight,
       depth=-.2\lineheight]}

\define[2]\SubsectionCommand
   {\vbox\bgroup
      \inleftmargin{\leftaligned{\em\structureuservariable{date}}}%
      {\bfa\structuretitle}\wordright{\tfx\structureuservariable{topic}}
%      \blank
      {\em\structureuservariable{info}}%
    \egroup}

\starttext

\startsection[title={A Section}]

\startsubsection
  [title={The detailled topic (which takes more than one line)}]
  [date={The date},topic={Knuth’s topic},info={some text}]

\input knuth

\stopsubsection

\startsubsection
  [title={Éhe detailled topic (which takes more than one line)}]
  [date={Another date},topic={Zapf},info={some text}]

É
\input zapf

\stopsubsection

\startsubsection
  [title={The detailled topic (which takes more than one line)}]
  [date={Another date},topic={Zapf},info={some text}]

\input zapf

\stopsubsection

\stopsection

\startsection[title={Section}]

\startsubsection
  [title={Some details}]
  [date={A date},topic={Tufte}]

\input tufte

\stopsubsection

\stopsection

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: BUG? Strange behavior (vertical space added!!!) with accentuated letters (was \inmargin / full textwidth line interaction)
  2010-11-26 19:25     ` BUG? Strange behavior (vertical space added!!!) with accentuated letters (was \inmargin / full textwidth line interaction) Renaud AUBIN
@ 2010-11-26 21:06       ` Renaud AUBIN
  2010-11-27  8:17       ` Otared Kavian
  1 sibling, 0 replies; 8+ messages in thread
From: Renaud AUBIN @ 2010-11-26 21:06 UTC (permalink / raw)
  To: ntg-context

Ok, that seems to be due to grid=yes…

Le 26/11/2010 20:25, Renaud AUBIN a écrit :
> \setupbodyfont[10pt]
>
> \setuplayout
>   [leftedge=0mm,
>    leftmargin=45mm,
>    rightedge=0mm,
>    rightmargin=0mm,
>    backspace=60mm,
>    topspace=10mm,
>    bottomspace=10mm,
>    header=0mm,
>    headerdistance=0mm,
>    footer=0mm,
>    footerdistance=0mm,
>    margindistance=0mm,
>    height=middle,
>    width=middle,
>    grid=yes]
>
> \setuppagenumbering[state=stop]
>
> \setuphead[section]   [style=,command=\SectionCommand]
> \setuphead[subsection][style=,command=\SubsectionCommand]
>
> \define[2]\SectionCommand
>   {\inleftmargin{\leftaligned{\structuretitle}}%
>    \blackrule
>      [ width=\textwidth,
>       height=+.3\lineheight,
>        depth=-.2\lineheight]}
>
> \define[2]\SubsectionCommand
>    {\vbox\bgroup
>       \inleftmargin{\leftaligned{\em\structureuservariable{date}}}%
>       {\bfa\structuretitle}\wordright{\tfx\structureuservariable{topic}}
> %      \blank
>       {\em\structureuservariable{info}}%
>     \egroup}
>
> \starttext
>
> \startsection[title={A Section}]
>
> \startsubsection
>   [title={The detailled topic (which takes more than one line)}]
>   [date={The date},topic={Knuth’s topic},info={some text}]
>
> \input knuth
>
> \stopsubsection
>
> \startsubsection
>   [title={Éhe detailled topic (which takes more than one line)}]
>   [date={Another date},topic={Zapf},info={some text}]
>
> É
> \input zapf
>
> \stopsubsection
>
> \startsubsection
>   [title={The detailled topic (which takes more than one line)}]
>   [date={Another date},topic={Zapf},info={some text}]
>
> \input zapf
>
> \stopsubsection
>
> \stopsection
>
> \startsection[title={Section}]
>
> \startsubsection
>   [title={Some details}]
>   [date={A date},topic={Tufte}]
>
> \input tufte
>
> \stopsubsection
>
> \stopsection
>
> \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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: BUG? Strange behavior (vertical space added!!!) with accentuated letters (was \inmargin / full textwidth line interaction)
  2010-11-26 19:25     ` BUG? Strange behavior (vertical space added!!!) with accentuated letters (was \inmargin / full textwidth line interaction) Renaud AUBIN
  2010-11-26 21:06       ` Renaud AUBIN
@ 2010-11-27  8:17       ` Otared Kavian
  2010-11-27  8:57         ` Strange behavior (vertical space added!!!) with accentuated letters Wolfgang Schuster
  1 sibling, 1 reply; 8+ messages in thread
From: Otared Kavian @ 2010-11-27  8:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks to Wolfgang and Renaud for sharing all this…

However, Renaud, I didn't notice what you says about having « É » in the title: it seems that everything works as expected: see
http://dl.dropbox.com/u/4316076/inmargin-fullwidth-1.pdf

(using, ConTeXt  ver: 2010.11.26 22:49 MKIV, on MacOS 10.6.5).
Best regards: OK

On 26 nov. 2010, at 20:25, Renaud AUBIN wrote:

> Hi Wolfgang,
> 
> First, thank you!
> 
> Now, if I use some accentuated letters in title (the É just after the
> second subsection and before \input zapf), there is an unwanted vertical
> space… Bug, feature or misuse???
> Could you confirm the bug? (the resulting pdf:
> http://dl.dropbox.com/u/5289718/testWolfgang.pdf)
> 
> I use the latest minimals on debian 64.
> 
> Test −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
> \setupbodyfont[10pt]
> 
> \setuplayout
>  [leftedge=0mm,
>   leftmargin=45mm,
>   rightedge=0mm,
>   rightmargin=0mm,
>   backspace=60mm,
>   topspace=10mm,
>   bottomspace=10mm,
>   header=0mm,
>   headerdistance=0mm,
>   footer=0mm,
>   footerdistance=0mm,
>   margindistance=0mm,
>   height=middle,
>   width=middle,
>   grid=yes]
> 
> \setuppagenumbering[state=stop]
> 
> \setuphead[section]   [style=,command=\SectionCommand]
> \setuphead[subsection][style=,command=\SubsectionCommand]
> 
> \define[2]\SectionCommand
>  {\inleftmargin{\leftaligned{\structuretitle}}%
>   \blackrule
>     [ width=\textwidth,
>      height=+.3\lineheight,
>       depth=-.2\lineheight]}
> 
> \define[2]\SubsectionCommand
>   {\vbox\bgroup
>      \inleftmargin{\leftaligned{\em\structureuservariable{date}}}%
>      {\bfa\structuretitle}\wordright{\tfx\structureuservariable{topic}}
> %      \blank
>      {\em\structureuservariable{info}}%
>    \egroup}
> 
> \starttext
> 
> \startsection[title={A Section}]
> 
> \startsubsection
>  [title={The detailled topic (which takes more than one line)}]
>  [date={The date},topic={Knuth’s topic},info={some text}]
> 
> \input knuth
> 
> \stopsubsection
> 
> \startsubsection
>  [title={Éhe detailled topic (which takes more than one line)}]
>  [date={Another date},topic={Zapf},info={some text}]
> 
> É
> \input zapf
> 
> \stopsubsection
> 
> \startsubsection
>  [title={The detailled topic (which takes more than one line)}]
>  [date={Another date},topic={Zapf},info={some text}]
> 
> \input zapf
> 
> \stopsubsection
> 
> \stopsection
> 
> \startsection[title={Section}]
> 
> \startsubsection
>  [title={Some details}]
>  [date={A date},topic={Tufte}]
> 
> \input tufte
> 
> \stopsubsection
> 
> \stopsection
> 
> \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
> ___________________________________________________________________________________

%%%%%%%%%%%%%%%%%%
Otared Kavian
Département de Mathématiques
Université de Versailles Saint-Quentin
Bâtiment Fermat
45 aveue des Etats Unis
78035 Versailles cedex

Téléphone: +33 1 39 25 46 42
Secrétariat: +33 1 39 25 46 44 
Secrétariat: +33 1 39 25 46 46

e-mail: Otared.Kavian@math.uvsq.fr



___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Strange behavior (vertical space added!!!) with accentuated letters
  2010-11-27  8:17       ` Otared Kavian
@ 2010-11-27  8:57         ` Wolfgang Schuster
  2010-11-27 12:03           ` Renaud AUBIN
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2010-11-27  8:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 27.11.2010 um 09:17 schrieb Otared Kavian:

> Thanks to Wolfgang and Renaud for sharing all this…
> 
> However, Renaud, I didn't notice what you says about having « É » in the title: it seems that everything works as expected: see
> http://dl.dropbox.com/u/4316076/inmargin-fullwidth-1.pdf

He means the space between the header and the following paragraph,
he can fix this by changing the interlinespace, e.g.

   \setupinterlinespace[height=.8,depth=.2]

or

   \setupinterlinespace[line=3ex]

He can also try if a different grid option give the correct output
without changing the interlinespace.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Strange behavior (vertical space added!!!) with accentuated letters
  2010-11-27  8:57         ` Strange behavior (vertical space added!!!) with accentuated letters Wolfgang Schuster
@ 2010-11-27 12:03           ` Renaud AUBIN
  0 siblings, 0 replies; 8+ messages in thread
From: Renaud AUBIN @ 2010-11-27 12:03 UTC (permalink / raw)
  To: ntg-context

Thanks to Wolgang and Otared,

My initial problem has disappeared using the latest beta 2010.11.26
22:49. I don't really know why but it works ;)
By the way, in the mean time, I've fixed that using the default grid
policy (i.e. removing grid=yes in setuplayout).

Cheers,

Renaud

Le 27/11/2010 09:57, Wolfgang Schuster a écrit :
> He can also try if a different grid option give the correct output
> without changing the interlinespace.

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-11-27 12:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-24 18:32 Toward the use of inleft for custom section's command… or not… Renaud AUBIN
2010-11-25 20:27 ` \inmargin / full textwidth line interaction (was Toward the use of inleft…) Renaud AUBIN
2010-11-26 10:52   ` Wolfgang Schuster
2010-11-26 19:25     ` BUG? Strange behavior (vertical space added!!!) with accentuated letters (was \inmargin / full textwidth line interaction) Renaud AUBIN
2010-11-26 21:06       ` Renaud AUBIN
2010-11-27  8:17       ` Otared Kavian
2010-11-27  8:57         ` Strange behavior (vertical space added!!!) with accentuated letters Wolfgang Schuster
2010-11-27 12:03           ` Renaud AUBIN

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).