ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* modife the style of taspresent
@ 2009-03-03 10:18 Bill Long
  2009-03-03 10:27 ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Bill Long @ 2009-03-03 10:18 UTC (permalink / raw)
  To: ntg-context

Dear All,

anybody can help me on this problem? 
As most of the ppt file's background are graphics, but I don't know
how to do it by modify the sytelefile. for example bellow style:


---------------------------------------------
%D \module
%D   [      file=t-horizontalblue,
%D        version=2007.07.17, 
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module horizontalblue,
%D         author=Thomas A. Schmitz,
%D           date=\currentdate,
%D      copyright={Thomas A. Schmitz}]
%C
%C Copyright 2007 Thomas A. Schmitz.
%C This file may be distributed under the GNU General Public License v. 2.0.

%D This file provides the \quotation{horizontalblue} style for the presentation
%D module. It is loaded at runtime. The look of this style was inspired by the
%D \quotation{Copenhagen} theme of the \LaTeX\ {\tt beamer} package.

\writestatus{loading}{module newstyle}

\startmodule[newstyle]

\unprotect

%D The taspresentation module provides a skeleton into which different styles
%D can be hooked. It uses a number of variables and macros which have to be set
%D beforehand. Some parts are optional. We begin with the necessary definitions:

%D We start colors:

\setupcolors[state=start]

%D These macros are used for placing figures/pictures:

\define\NormalHeight{.97\textheight}
\define\NormalWidth{.476\textwidth}
\define\PictureFrameHeight{.97\textheight}
\define\PictureFrameWidth{.476\textwidth}

%D The page layout:

\setuplayout [width=fit,
              margin=0cm,
              height=14.7cm,
              header=1.75cm, 
              footer=1.2cm, 
              topspace=1cm, 
              backspace=1cm,
              location=singlesided]

%D The macro for typesetting the Slidetitle; this is adapted from a sample
%D document that Brooks Moses published on the wiki:

\definelayer[slidetitle]
    [width=\paperwidth,
    height=\paperheight,
    x=10mm]

\define[1]\Slidetitle{\page\setlayer[slidetitle]%
     {\framed[frame=off,width=\textwidth,height=2.2cm,offset=0pt,top=\vss,bottom=\vss]{\switchtobodyfont[\Titlesize]\color[c]{#1}}}}

%D The macro \tex{Maketitle} produces a default title page with the author, the
%D title of the presentation, and the date. Using it is not mandatory.

\define\Maketitle{%
\titback
\null
\vfill
\framed[frame=off,width=\textwidth,height=.75\textheight,top=\vss,bottom=\vss,align=middle]{\switchtobodyfont[\Titlesize]\color[c]{\bf \getvariable{taspresent}{title}}\switchtobodyfont[\Normalsize]\blank[line]\getvariable{taspresent}{author}\blank[2*line]\currentdate}
\vfill
\null}

%D The following parts are optional; if you don't use backgrounds and are
%D content with CONTEXT's default itemization, you don't have to set these
%D macros. 

%D We define our colors:

\definecolor [a]                [s=.95]
\definecolor [b] 	        [r=.58,g=.58,b=.82]
\definecolor [c]                [r=.2,g=.2,b=.73]
\definecolor [Item]             [r=.2,g=.2,b=.73]

%D We let Metapost calculate the background:



\startuniqueMPgraphic{vertical} 
StartPage ;
pair zd[] ;
path pb[] ;
fill Page withcolor \MPcolor{a} ;
z.d1 = ulcorner Page shifted (0,-5pt) ;
z.d2 = urcorner Page shifted (0,-5pt) ;
pb[1] = ulcorner Page -- z.d1 -- z.d2 -- urcorner Page -- cycle ;
z.d3 = llcorner Page shifted (0,5pt) ;
z.d4 = lrcorner Page shifted (0,5pt) ;
pb[3] = llcorner Page -- z.d3 -- z.d4 -- lrcorner Page -- cycle ;
pb[4] = pb[3] shifted (0,.75cm) ;
fill pb[1] withcolor \MPcolor{b} ;
fill pb[3] withcolor \MPcolor{b} ;
fill pb[4] withcolor \MPcolor{b} ;
StopPage ;
\stopuniqueMPgraphic 

\startuniqueMPgraphic{horizontal}
StartPage ;
pair zd[] ;
path pb[] ;
z.d1 = ulcorner Page shifted (0,-5pt) ;
z.d2 = urcorner Page shifted (0,-5pt) ;
pb[1] = ulcorner Page -- z.d1 -- z.d2 -- urcorner Page -- cycle ;
pb[2] = pb[1] shifted (0,-2cm) ;
fill pb[2] withcolor \MPcolor{b} ;
StopPage ;
\stopuniqueMPgraphic

%D We define these backgrounds as overlays:

\defineoverlay 
[lecbackground] 
[\useMPgraphic{horizontal}] 


\defineoverlay 
[picbackground] 
[\useMPgraphic{vertical}] 

%D We define the footer

\setupfooter[color=c,style={\switchtobodyfont[10pt]},strut=yes]
\setupfootertexts[{\framed[frame=off,height=.45cm,width=\textwidth]{\getvariable{taspresent}{title}\hfill \pagenumber \ of \lastpage}}]

%D These are shortcuts to switch backgrounds:

\define\lecback{\setuplayout[header=1.75cm]\setupfooter[state=start]\setupbackgrounds[page][background={picbackground,lecbackground,slidetitle}]}
\define\titback{\setuplayout[header=1.75cm]\setupfooter[state=stop]\setupbackgrounds[page][background={picbackground,lecbackground}]}
\define\picback{\setuplayout[header=0cm]\setupfooter[state=start]\setupbackgrounds[page][background={picbackground}]}
\define\noback{\setupbackgrounds[page][background=nobackground]}

%D We use combinations for placing vertical pictures and text side by side, and
%D we want a distance of 1.1 cm between both.

\setupcombinations[distance=1.1cm]

%D The symbol for the first level of itemizations. 

\definesymbol[1][\useMPgraphic{ItSquare}]
\setupitemize[1][color=c]

\protect
\stopmodule

\endinput

-----------------------------------------------------------

I try to modify 

\defineoverlay 
[lecbackground] 
[\useMPgraphic{horizontal}] 


to something like

\defineoverlay 
[lecbackground] 
[\externalfigure[figure]] 

but it doesn't work. any idea? I need for example a.png on right
top. and b.png  bottom.








-- 
   卷548_80 【送沈单作尉江都(一作许浑诗)】薛逢 

炀帝都城春水边,笙歌夜上木兰船。三千宫女自涂地, 
十万人家如洞天。焰焰花枝官舍晚,重重云影寺墙连。 
少年作尉须矜慎,莫向楼前坠马鞭。



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

end of thread, other threads:[~2009-03-12  4:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-03 10:18 modife the style of taspresent Bill Long
2009-03-03 10:27 ` Wolfgang Schuster
2009-03-09  2:36   ` Bill Long
2009-03-09  9:53     ` Thomas A. Schmitz
2009-03-11  2:59       ` Bill Long
2009-03-12  1:02       ` Jesse Alama
2009-03-12  4:50         ` Aditya Mahajan

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