ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Columns (text alignment)
@ 2005-12-23 15:39 Fabio Mancinelli
  2005-12-23 15:44 ` Hans Hagen
  2005-12-23 16:54 ` Peter Rolf
  0 siblings, 2 replies; 6+ messages in thread
From: Fabio Mancinelli @ 2005-12-23 15:39 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]

Hi everybody.

I am experimenting with ConTeXt and columns. I am creating a simple 
style and I setup 3 columns and redefined some heading (section, 
subsection, subsubsections).

Now the problem is that the text at the end of the columns is not 
aligned (i.e., the columns end at different heights).

I thought that this was due to the \blank commands that I specified as 
before and after parameters in the heading definitions, but even by 
using the flexible modifier doesn't change that behavior.

I don't know where the problem is. The tex file is attached.

Thank you,
Fabio

P.S.: By using the attached file, I cannot specify the position 
parameter for \placefigure. If I write 
\placefigure{Name}{\externalfigure[...} it works. 
\placefigure[btlr]{name}{\externalfigure[...} does not. Weird.

P.P.S.: I was reading the columns.pdf "tutorial". I saw that a 
\definecolumnsethsize command is used but I haven't found any 
documentation about that command anywhere. I use width=2\textwidth which 
seems to produce the same effects (2 columns span).

[-- Attachment #2: style.tex --]
[-- Type: text/x-tex, Size: 1864 bytes --]

\usetypescript[adobekb][\defaultencoding]
\usetypescript[sans]
\setupbodyfont[sans,10pt]

\setuphead[section][%
  style={\setupbodyfont[sans,14pt]\bf},
  before={\blank[3*halfline, flexible]},
  after={\blank[small, flexible]}%
]

\setuphead[subsection][%
  style={\setupbodyfont[sans,12pt]\bf},
  before={\blank[2*halfline, flexible]},
  after={\blank[small, flexible]}%
]

\def\runin#1#2{#2.}
\setuphead[subsubsection][%
  style={\setupbodyfont[sans,10pt]\bf},
  before={\blank[halfline, flexible]},
  command=\runin,
  alternative=text%
]

\setuppapersize[a4][a4]
\setuplayout[%
  width=middle,
  height=middle,
  topspace=1cm,
  bottomspace=1cm,
  header=1cm,
  footer=1cm,
  backspace=1cm%
]

\setupcolumns[%
  n=3, 
  distance=14pt, 
  balance=no, 
  rule=off%
]


\setupheadertexts[{\sl XNemesis.org Research and Development}][{\sl The vault}]

\setuppagenumbering[location=bottom]

\starttext

\startcolumns

\startcolumnspan[%
  n=2%
]

\bgroup
\switchtobodyfont[32pt]
{\bf Title}
\switchtobodyfont[20pt]
{\par\noindent\sl Subtitle}
\blank[20pt, flexible]
\egroup

\stopcolumnspan

\bgroup
\blank[line,flexible]
\setupindenting[none]
\switchtobodyfont[9pt]
{\bf Abstract}\par
AbstractHere
\ignorespaces
\egroup

\bgroup
\blank[line,flexible]
\setupindenting[none]
\switchtobodyfont[9pt]
{\bf Keywords:}
Keywords here
\ignorespaces
\egroup

\dorecurse{4}{
\section{Section}
\dorecurse{1}{
\input abstract

\startitemize
\item A
\item B
\item C
\stopitemize
}

\subsection{Subsection}
\dorecurse{1}{\input abstract}

\placefigure[btlr]{Simple figure}{\externalfigure[buttons][width=2\textwidth]}


\subsubsection{Subsubsection}
\dorecurse{1}{\input abstract}
}

\blank[3*line, flexible]

\bgroup
\switchtobodyfont[9pt]
{\bf Author}\par
Author
\ignorespaces
\egroup


\stopcolumns

\stoptext
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

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

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

* Re: Columns (text alignment)
  2005-12-23 15:39 Columns (text alignment) Fabio Mancinelli
@ 2005-12-23 15:44 ` Hans Hagen
  2005-12-23 16:54 ` Peter Rolf
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2005-12-23 15:44 UTC (permalink / raw)


Fabio Mancinelli wrote:

> Hi everybody.
>
> I am experimenting with ConTeXt and columns. I am creating a simple 
> style and I setup 3 columns and redefined some heading (section, 
> subsection, subsubsections).
>
> Now the problem is that the text at the end of the columns is not 
> aligned (i.e., the columns end at different heights).
>
> I thought that this was due to the \blank commands that I specified as 
> before and after parameters in the heading definitions, but even by 
> using the flexible modifier doesn't change that behavior.
>
> I don't know where the problem is. The tex file is attached.

widows and such force tex to break

Hans

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

* Re: Columns (text alignment)
  2005-12-23 15:39 Columns (text alignment) Fabio Mancinelli
  2005-12-23 15:44 ` Hans Hagen
@ 2005-12-23 16:54 ` Peter Rolf
  2005-12-26 15:42   ` Fabio Mancinelli
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Rolf @ 2005-12-23 16:54 UTC (permalink / raw)


Hi Fabio

Fabio Mancinelli wrote:
> Hi everybody.
> 
> I am experimenting with ConTeXt and columns. I am creating a simple
> style and I setup 3 columns and redefined some heading (section,
> subsection, subsubsections).
> 
> Now the problem is that the text at the end of the columns is not
> aligned (i.e., the columns end at different heights).
> 
> I thought that this was due to the \blank commands that I specified as
> before and after parameters in the heading definitions, but even by
> using the flexible modifier doesn't change that behavior.
> 
using \blank[line] (and also the derived halfline) inserts *no* glue
(see definition in context manual). use small,medium,big or any
fraction/combination of these instead.

> I don't know where the problem is. The tex file is attached.
> 
> Thank you,
> Fabio
> 
> P.S.: By using the attached file, I cannot specify the position
> parameter for \placefigure. If I write
> \placefigure{Name}{\externalfigure[...} it works.
> \placefigure[btlr]{name}{\externalfigure[...} does not. Weird.
> 
> P.P.S.: I was reading the columns.pdf "tutorial". I saw that a
> \definecolumnsethsize command is used but I haven't found any
> documentation about that command anywhere. I use width=2\textwidth which
> seems to produce the same effects (2 columns span).
>
i can't help you with this stuff (never used it, although it looks awesome).

Greetings, Peter

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

* Re: Columns (text alignment)
  2005-12-23 16:54 ` Peter Rolf
@ 2005-12-26 15:42   ` Fabio Mancinelli
  2005-12-26 17:47     ` Peter Rolf
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Mancinelli @ 2005-12-26 15:42 UTC (permalink / raw)


Peter Rolf wrote:

> using \blank[line] (and also the derived halfline) inserts *no* glue
> (see definition in context manual). use small,medium,big or any
> fraction/combination of these instead.
> 

I did several (simpler) tests:

\starttext
\startcolumns
\showmakeup
\dorecurse{5}{
   \section{Section}
   \input text
}
\stopcolumns
\stoptext

Line alignment is totally wrong. Putting "sections" while having columns 
leads to wrong alinged lines.

I tried several combinations of the following:
\setuplayou[grid=yes], \setupcolumns[blank={line,fixed}], various align 
assignments... The result is always the same.

I have read the manual where it is stated that "When a switch in 
fontsize is desirable you should do so before starting the column 
mechanism." (page 65). I don't see how this statement is applicable to 
\section(s)

Thanks,
Fabio

P.S.: text.tex is a simple text paragraph without any control sequence

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

* Re: Columns (text alignment)
  2005-12-26 15:42   ` Fabio Mancinelli
@ 2005-12-26 17:47     ` Peter Rolf
  2005-12-27  8:50       ` Fabio Mancinelli
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Rolf @ 2005-12-26 17:47 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]

Fabio Mancinelli wrote:
> Peter Rolf wrote:
> 
>> using \blank[line] (and also the derived halfline) inserts *no* glue
>> (see definition in context manual). use small,medium,big or any
>> fraction/combination of these instead.
>>
> 
> I did several (simpler) tests:
> 
> \starttext
> \startcolumns
> \showmakeup
> \dorecurse{5}{
>   \section{Section}
>   \input text
> }
> \stopcolumns
> \stoptext
> 
> Line alignment is totally wrong. Putting "sections" while having columns
> leads to wrong alinged lines.
> 
> I tried several combinations of the following:
> \setuplayou[grid=yes], \setupcolumns[blank={line,fixed}], various align
> assignments... The result is always the same.
> 
> I have read the manual where it is stated that "When a switch in
> fontsize is desirable you should do so before starting the column
> mechanism." (page 65). I don't see how this statement is applicable to
> \section(s)
> 
> Thanks,
> Fabio
>
Hi Fabio,

sorry, my first advice was bad. In the meantime I have played around
with columns and everything is working as expected. There are several
problems in your source. The first is, that you have to use

\setuplayout[grid=yes]

Read about grid snapping of headers in the details.pdf manual and look
into the columns environment (defined at the beginning of the columns
manual).

You can then adjust the headers (2 lines high) vertically by using the
'grid' parameter.

The problem with the graphic placing results from using \startcolumns
instead of \startcolumnset (see example in columns.pdf).

I attach my working example.

Greetings, Peter

> P.S.: text.tex is a simple text paragraph without any control sequence
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 


[-- Attachment #2: style.tex --]
[-- Type: text/plain, Size: 2526 bytes --]

\setupoutput[pdftex]

%\usetypescript[adobekb][\defaultencoding]
%\usetypescript[sans]
%\setupbodyfont[sans,10pt]
\loadmapfile [texnansi-bitstrea-zapfhumanist.map]
\usetypescriptfile [type-bitstrea-zapfhumanist]
\usetypescript [ZapfHumanist]
\setupbodyfont [ZapfHumanist,11pt]%



\definefont [SectionHeaderFont] [ZapfHumanist-Bold at 14pt]
\definefont [SubSectionHeaderFont] [ZapfHumanist-Bold at 12pt]
\definefont [SubSubSectionHeaderFont] [ZapfHumanist-Bold at 10pt]


\setuplayout[
  width=middle,
  height=middle,
  grid=yes,
  lines=50,
  topspace=1cm,
  bottomspace=1cm,
  header=1cm,
  footer=1cm,
  backspace=1cm,
]

\setuptolerance[verytolerant,stretch]


\setuphead[section][
  style=\SectionHeaderFont,
  grid={line,4pt},
%  before=,
%  after=,
]

\setuphead[subsection][
  style=\SubSectionHeaderFont,
  grid={line,-4pt},
  before=\blank,
  after=,
]

\def\runin#1#2{#2.}
\setuphead[subsubsection][
  style=\SubSubSectionHeaderFont,
%  before=\blank,
  command=\runin,
  alternative=text,
]


\setupheadertexts[{\sl XNemesis.org Research and Development}][{\sl The vault}]

\setuppagenumbering[location=bottom]


\useexternalfigure[test][ringbearer][frame=true] % resolution 96ppi, 256colors



\definecolumnset[threecolumns][n=3]

\definecolumnsetspan[spantwo][n=2]
\definecolumnsetspan[spanthree][n=3]

\definecolumnsethsize{threecolumns}{1}{1}\One
\definecolumnsethsize{threecolumns}{1}{2}\Two
\definecolumnsethsize{threecolumns}{1}{3}\Three


%----------------------------------------%
\starttext

\showstruts
\showgrid
\showgridboxes


%\startcolumns
\startcolumnset[threecolumns]

%
\startcolumnsetspan[spantwo]

\bgroup
\switchtobodyfont[32pt]
{\bf Title}
\switchtobodyfont[20pt]
{\par\noindent\sl Subtitle}
\blank[20pt, flexible]
\egroup

\stopcolumnsetspan
%


\bgroup
\blank
\setupindenting[none]
\switchtobodyfont[9pt]
{\bf Abstract}\par
AbstractHere
\ignorespaces
\egroup

\bgroup
\blank
\setupindenting[none]
\switchtobodyfont[9pt]
{\bf Keywords:}
Keywords here
\ignorespaces
\egroup




\dorecurse{4}{
\section{Section}
\dorecurse{1}{
\input tufte

\startitemize[packed]
\item A
\item B
\item C
\stopitemize
}

\subsection{Subsection}
\dorecurse{1}{\input tufte\relax}

\placefigure[btlr]{Simple figure}{\externalfigure[test][width=\Two]}


\subsubsection{Subsubsection}
\dorecurse{1}{\input tufte}
}

\blank[3*line, flexible]

\bgroup
\switchtobodyfont[9pt]
{\bf Author}\par
Author
\ignorespaces
\egroup

\stopcolumnset


\stoptext
%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

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

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

* Re: Columns (text alignment)
  2005-12-26 17:47     ` Peter Rolf
@ 2005-12-27  8:50       ` Fabio Mancinelli
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio Mancinelli @ 2005-12-27  8:50 UTC (permalink / raw)


Peter Rolf wrote:

> I attach my working example.
> 
Thank you Peter!
Your example has been enlightening.

Fabio

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

end of thread, other threads:[~2005-12-27  8:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-23 15:39 Columns (text alignment) Fabio Mancinelli
2005-12-23 15:44 ` Hans Hagen
2005-12-23 16:54 ` Peter Rolf
2005-12-26 15:42   ` Fabio Mancinelli
2005-12-26 17:47     ` Peter Rolf
2005-12-27  8:50       ` Fabio Mancinelli

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