ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* two questions for the simplest slides
@ 2012-07-21 18:50 Pablo Rodríguez
  2012-07-21 19:21 ` Marco
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Pablo Rodríguez @ 2012-07-21 18:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi there,

I would like to create the simplest slides ever. I have done in LaTeX
before, but I'm not sure how to do it with ConTeXt.

All I want is to be able to center both vertically and horizontally
whatever each slide contains and to change background and text colors in
an easy manner (something like from now on background is red and text is
white).

Looking to http://tug.org/pracjourn/2006-2/schmitz/ and
http://wiki.contextgarden.net/Presentations, I still have two questions.

How can I get every single slide, no matter there is text or images,
vertically centered?

How can I change background and text colors after a \page? I mean
something like:

\setuppapersize[S6][S6]
\setupcolors[state=start]
\setuppagenumber[state=stop]
\setupbackgrounds[page][background=color,backgroundcolor=red]
\startcolor[white]
\starttext
Page is red and text is white.
\page
Page is blue and text is yellow.
\page
Page is green and text is white.
\page
Page is white and text is black.
\page
Page is red and text is white (again).
\stoptext

I mean, I know how to start, but I don't know how to change after the
start. And it would be extremely helpful to change text colors with a
switch (if that were possible), not within an environment (mainly
because most slides will only contain one of two words).

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-21 18:50 two questions for the simplest slides Pablo Rodríguez
@ 2012-07-21 19:21 ` Marco
  2012-07-21 20:51   ` Pablo Rodríguez
  2012-07-21 19:25 ` Peter Münster
  2012-07-21 21:10 ` Peter Münster
  2 siblings, 1 reply; 13+ messages in thread
From: Marco @ 2012-07-21 19:21 UTC (permalink / raw)
  To: ntg-context

Hi Pablo,

for each defined colour there is a command that can be called to
switch. \centerbox centres the text vertically. It is not the most
elegant solution, but the following does what you asked for.

\setuppapersize
  [S6] [S6]

\setuppagenumber
  [state=stop]

\setupbackgrounds
  [page] [background=color]

\define[1]\setpagecolor
  {\setupbackgrounds[page][backgroundcolor=#1]}

\setupalign
  [middle]

\starttext

\setpagecolor{blue}
\yellow
\centerbox{Page is blue and text is yellow.}

\stoptext


Marco


___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-21 18:50 two questions for the simplest slides Pablo Rodríguez
  2012-07-21 19:21 ` Marco
@ 2012-07-21 19:25 ` Peter Münster
  2012-07-21 20:57   ` Pablo Rodríguez
  2012-07-22  7:58   ` Wolfgang Schuster
  2012-07-21 21:10 ` Peter Münster
  2 siblings, 2 replies; 13+ messages in thread
From: Peter Münster @ 2012-07-21 19:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Jul 21 2012, Pablo Rodríguez wrote:

> Page is red and text is white.
> \page
> Page is blue and text is yellow.

Quick hack:

\definecolor[MyColor][white]
\setupbackgrounds[page][background=color, backgroundcolor=MyColor]
\def\Slide#1#2#3{% #1: background, #2: foreground, #3: words
  \definecolor[MyColor][#1]
  \startstandardmakeup
    \setupalign[middle]%
    \setupcolors[textcolor=#2]%
    #3
  \stopstandardmakeup
}
\starttext
\Slide{red}{white}{Page is red and text is white.}
\Slide{blue}{yellow}{Page is blue and text is yellow.}
\stoptext

Be patient, others (Wolfgang?!) will probably post cleaner solutions.

-- 
           Peter
___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-21 19:21 ` Marco
@ 2012-07-21 20:51   ` Pablo Rodríguez
  0 siblings, 0 replies; 13+ messages in thread
From: Pablo Rodríguez @ 2012-07-21 20:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 21/07/12 21:21, Marco wrote:
> Hi Pablo,
> 
> for each defined colour there is a command that can be called to
> switch. \centerbox centres the text vertically. It is not the most
> elegant solution, but the following does what you asked for.
> [...]

Thank you, Marco, for your reply.

Your color information and switches are what I was looking for.

\centerbox does the work, but I forgot to mention that sometimes a word
per line (something line digital\\privacy). But Peter's approach solves
this.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk


___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-21 19:25 ` Peter Münster
@ 2012-07-21 20:57   ` Pablo Rodríguez
  2012-07-22  7:58   ` Wolfgang Schuster
  1 sibling, 0 replies; 13+ messages in thread
From: Pablo Rodríguez @ 2012-07-21 20:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 21/07/12 21:25, Peter Münster wrote:
> On Sat, Jul 21 2012, Pablo Rodríguez wrote:
> 
>> Page is red and text is white.
>> \page
>> Page is blue and text is yellow.
> 
> Quick hack:
> 
>   \startstandardmakeup
>     \setupalign[middle]%
>     \setupcolors[textcolor=#2]%
>     #3
>   \stopstandardmakeup

Thanks for your reply, Peter.

I have realized that your hack centered multiline slides and that I have
implemented it through a \starsld...\stopsld environment (since I don't
need to setup colors for every single slide).

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk


___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-21 18:50 two questions for the simplest slides Pablo Rodríguez
  2012-07-21 19:21 ` Marco
  2012-07-21 19:25 ` Peter Münster
@ 2012-07-21 21:10 ` Peter Münster
  2012-07-21 21:22   ` Pablo Rodríguez
  2 siblings, 1 reply; 13+ messages in thread
From: Peter Münster @ 2012-07-21 21:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Jul 21 2012, Pablo Rodríguez wrote:

> Page is red and text is white.
> \page
> Page is blue and text is yellow.

All you need, can be done with \framed:

\setuppapersize[S6]
\setuplayout[page]
\def\Slide#1#2#3{% #1: background, #2: foreground, #3: words
  \framed[offset=overlay, width=\textwidth, height=\textheight,
    background=color, backgroundcolor=#1, foregroundcolor=#2,
    align={middle, lohi}, frame=off]{#3}}
\starttext
\Slide{red}{white}{Page is red and text is white.\\Newline}
\Slide{blue}{yellow}{Page is blue and text is yellow.}
\stoptext

-- 
           Peter
___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-21 21:10 ` Peter Münster
@ 2012-07-21 21:22   ` Pablo Rodríguez
  0 siblings, 0 replies; 13+ messages in thread
From: Pablo Rodríguez @ 2012-07-21 21:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 21/07/12 23:10, Peter Münster wrote:
> On Sat, Jul 21 2012, Pablo Rodríguez wrote:
> 
>> Page is red and text is white.
>> \page
>> Page is blue and text is yellow.
> 
> All you need, can be done with \framed:
> 
> \setuppapersize[S6]
> \setuplayout[page]
> \def\Slide#1#2#3{% #1: background, #2: foreground, #3: words
> [...]

Sorry, Peter, I haven't expressed myself accurately.

\def\Slide#1#2#3 has a problem, namely, that I have to enter both
background and foreground colors for each single slide.

\definestartstop[sld][before={\page\startstandardmakeup\setupalign[middle]},after=\stopstandardmakeup]

makes easier to change colors only when I really need it.

Many thanks again,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-21 19:25 ` Peter Münster
  2012-07-21 20:57   ` Pablo Rodríguez
@ 2012-07-22  7:58   ` Wolfgang Schuster
  2012-07-22  8:29     ` Pablo Rodríguez
  1 sibling, 1 reply; 13+ messages in thread
From: Wolfgang Schuster @ 2012-07-22  7:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 21.07.2012 um 21:25 schrieb Peter Münster:

> On Sat, Jul 21 2012, Pablo Rodríguez wrote:
> 
>> Page is red and text is white.
>> \page
>> Page is blue and text is yellow.
> 
> Quick hack:
> 
> \definecolor[MyColor][white]
> \setupbackgrounds[page][background=color, backgroundcolor=MyColor]
> \def\Slide#1#2#3{% #1: background, #2: foreground, #3: words
>  \definecolor[MyColor][#1]
>  \startstandardmakeup
>    \setupalign[middle]%
>    \setupcolors[textcolor=#2]%
>    #3
>  \stopstandardmakeup
> }
> \starttext
> \Slide{red}{white}{Page is red and text is white.}
> \Slide{blue}{yellow}{Page is blue and text is yellow.}
> \stoptext
> 
> Be patient, others (Wolfgang?!) will probably post cleaner solutions.

You mean something like this?

\setuppapersize[S6]

\definelayout[slide][page]
\definemakeup[slide][align=middle,backgroundcolor=lightgray]

\setupbackgrounds[page][background=color,backgroundcolor=\makeupparameter{backgroundcolor}]

\starttext

\startslidemakeup

Page is gray and text is black.

\stopslidemakeup

\startslidemakeup[backgroundcolor=red,color=white]

Page is red and text is white.

Newline

\stopslidemakeup

\startslidemakeup[backgroundcolor=blue,color=yellow]

Page is blue and text is yellow.

\stopslidemakeup

\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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-22  7:58   ` Wolfgang Schuster
@ 2012-07-22  8:29     ` Pablo Rodríguez
  2012-07-22  9:07       ` Wolfgang Schuster
  0 siblings, 1 reply; 13+ messages in thread
From: Pablo Rodríguez @ 2012-07-22  8:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 22/07/12 09:58, Wolfgang Schuster wrote:
> Am 21.07.2012 um 21:25 schrieb Peter Münster:
>> On Sat, Jul 21 2012, Pablo Rodríguez wrote:
>>> Page is red and text is white.
>> [...]
> 
> You mean something like this?

Many thanks for your reply, Wolfgang.

I mean something like that, but I have problems when adding such an xtable:

\startxtable[option={stretch,width},frame=off,split=yes]
\dorecurse{100}{  \startxrow
      \startxcell right \stopxcell
      \startxcell left \stopxcell
  \stopxrow}
\stopxtable

The xtable itself won't be aligned when I set split=yes and won't be
split in pages.

BTW, how can I make that the first column are aligned to the right?
\setupxtable[xcell][1][align=right] doesn't seem to work.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk


___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-22  8:29     ` Pablo Rodríguez
@ 2012-07-22  9:07       ` Wolfgang Schuster
  2012-07-22  9:23         ` Pablo Rodríguez
  0 siblings, 1 reply; 13+ messages in thread
From: Wolfgang Schuster @ 2012-07-22  9:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.07.2012 um 10:29 schrieb Pablo Rodríguez:

> On 22/07/12 09:58, Wolfgang Schuster wrote:
>> Am 21.07.2012 um 21:25 schrieb Peter Münster:
>>> On Sat, Jul 21 2012, Pablo Rodríguez wrote:
>>>> Page is red and text is white.
>>> [...]
>> 
>> You mean something like this?
> 
> Many thanks for your reply, Wolfgang.
> 
> I mean something like that, but I have problems when adding such an xtable:
> 
> \startxtable[option={stretch,width},frame=off,split=yes]
> \dorecurse{100}{  \startxrow
>      \startxcell right \stopxcell
>      \startxcell left \stopxcell
>  \stopxrow}
> \stopxtable
> 
> The xtable itself won't be aligned when I set split=yes and won't be
> split in pages.

The makeup environment creates a page sized box which doesn’t allow material which is split over many pages.

When you have such a large table you have to use a different implementation but maybe it’s better to look
if you can reduce the size of the table and or to use multiple columns (the new mixedcolumns environment
can be also used in a box).

> BTW, how can I make that the first column are aligned to the right?
> \setupxtable[xcell][1][align=right] doesn't seem to work.

Xtables don’t provide the same method as natural tables to set value for individual rows or columns,
you have to apply the setting to each cell or cell group (can be a direct setting via key-val or a named setting).

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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-22  9:07       ` Wolfgang Schuster
@ 2012-07-22  9:23         ` Pablo Rodríguez
  2012-07-22  9:30           ` Wolfgang Schuster
  0 siblings, 1 reply; 13+ messages in thread
From: Pablo Rodríguez @ 2012-07-22  9:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 22/07/12 11:07, Wolfgang Schuster wrote:
> Am 22.07.2012 um 10:29 schrieb Pablo Rodríguez:
>> [...]
>> The xtable itself won't be aligned when I set split=yes and won't be
>> split in pages.
> 
> The makeup environment creates a page sized box which doesn’t allow material which is split over many pages.
> 
> When you have such a large table you have to use a different implementation but maybe it’s better to look
> if you can reduce the size of the table and or to use multiple columns (the new mixedcolumns environment
> can be also used in a box).

Many thanks for your reply, Wolfgang,

I'm afraid I can't reduce the size or use multiple columns without
rendering the text to be unreadable.

All I need is that any material on the slides is centered both
vertically and horizontally and can be split over pages if needed. Is
there any way to get this?

>> BTW, how can I make that the first column are aligned to the right?
>> \setupxtable[xcell][1][align=right] doesn't seem to work.
> 
> Xtables don’t provide the same method as natural tables to set value for individual rows or columns,
> you have to apply the setting to each cell or cell group (can be a direct setting via key-val or a named setting).

\startxcell[align=right] right \stopxcell doesn't change alingment.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk


___________________________________________________________________________________
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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-22  9:23         ` Pablo Rodríguez
@ 2012-07-22  9:30           ` Wolfgang Schuster
  2012-07-22 11:19             ` Pablo Rodríguez
  0 siblings, 1 reply; 13+ messages in thread
From: Wolfgang Schuster @ 2012-07-22  9:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.07.2012 um 11:23 schrieb Pablo Rodríguez:

>>> BTW, how can I make that the first column are aligned to the right?
>>> \setupxtable[xcell][1][align=right] doesn't seem to work.
>> 
>> Xtables don’t provide the same method as natural tables to set value for individual rows or columns,
>> you have to apply the setting to each cell or cell group (can be a direct setting via key-val or a named setting).
> 
> \startxcell[align=right] right \stopxcell doesn't change alignment.


\startxcell[align=flushright … \stopxcell

or

\definextable[right][align=flushright]

\startxcell[right] … \stopxcell

That’s explained in the manual.

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] 13+ messages in thread

* Re: two questions for the simplest slides
  2012-07-22  9:30           ` Wolfgang Schuster
@ 2012-07-22 11:19             ` Pablo Rodríguez
  0 siblings, 0 replies; 13+ messages in thread
From: Pablo Rodríguez @ 2012-07-22 11:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 22/07/12 11:30, Wolfgang Schuster wrote:
> Am 22.07.2012 um 11:23 schrieb Pablo Rodríguez:
>> [...]
>> \startxcell[align=right] right \stopxcell doesn't change alignment.
> 
> \startxcell[align=flushright … \stopxcell
> 
> or
> 
> \definextable[right][align=flushright]
> 
> \startxcell[right] … \stopxcell
> 
> That’s explained in the manual.

Many thanks for your help, Wolfgang.

Sorry, I searched the manual for this information earlier this morning
and I didn't find it.

BTW, thank you again for proposing a different approach to the
horizontally and vertically centered slides. This does the job for me:

\setupalign[middle]
\definestartstop[slide][before=\page\mbox{}\vfill\mbox{},after=\vfill\vfill]

Thanks again for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 13+ messages in thread

end of thread, other threads:[~2012-07-22 11:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21 18:50 two questions for the simplest slides Pablo Rodríguez
2012-07-21 19:21 ` Marco
2012-07-21 20:51   ` Pablo Rodríguez
2012-07-21 19:25 ` Peter Münster
2012-07-21 20:57   ` Pablo Rodríguez
2012-07-22  7:58   ` Wolfgang Schuster
2012-07-22  8:29     ` Pablo Rodríguez
2012-07-22  9:07       ` Wolfgang Schuster
2012-07-22  9:23         ` Pablo Rodríguez
2012-07-22  9:30           ` Wolfgang Schuster
2012-07-22 11:19             ` Pablo Rodríguez
2012-07-21 21:10 ` Peter Münster
2012-07-21 21:22   ` Pablo Rodríguez

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