Changes

Jump to navigation Jump to search
1,139 bytes added ,  22:31, 27 December 2020
simplified thanks to Hans' feedback
= A simple centered cover for a booklet =
<texcode>
<context mode="mkiv" source="yes">\setuppapersize[A5][A5A6]
\setuppagenumbering[alternative=doublesided]
pagestate=start]% we want to number this
{\bfc bfb This should be the long title, Andreas' solution\par}
\stoppagemakeup
\stoptext
</texcodecontext>
Reference: http://www.ntg.nl/pipermail/ntg-context/2011/063030.html
</context>
= Simple example with MetaFun (2019) =
 
from [https://tex.stackexchange.com/questions/472622/cover-page-coloring-in-context tex.stackexchange.com]
 
<context source=yes>
\setuppapersize[A6]
 
\setupbodyfont [palatino]
 
\definecolor [Top] [h=a5b291]
\definecolor [Bottom] [h=b7c1a7]
\definecolor [TitleColor] [h=96433a]
 
\define[1]\titlefont{%
\setcharacterkerning[extrakerning]%
\cap
\definedfont[#1]%
\ignorespaces
}
 
\starttext
 
\startMPpage
 
StartPage ;
 
numeric w ; w := bbwidth(Page) ;
numeric h ; h := bbheight(Page) ;
 
fill (unitsquare xyscaled (w,.8h)) withcolor \MPcolor{Bottom} ;
fill (unitsquare xyscaled (w,.2h) yshifted .8h) withcolor \MPcolor{Top} ;
draw (0,.8h) -- (w,.8h) withpen pensquare scaled 2pt withcolor white ;
 
draw textext.rt("\definedfont[Serif at 10pt]Author") shifted (.1w,.95h) ;
draw textext.rt("\titlefont{Serif at 20pt} Cover Page Title") shifted (.1w,.85h) withcolor \MPcolor{TitleColor} ;
draw textext.rt("\titlefont{SerifBold at 10pt} Subhead Title") shifted (.1w,.75h) withcolor \MPcolor{TitleColor} ;
draw textext.rt("\titlefont{SerifBold at 10pt} Another subhead") shifted (.1w,.70h) ;
 
 
% picture p; p := externalfigure "matterhorn.png" ;
% draw p scaled (w/bbwidth p) ;
 
StopPage ;
 
\stopMPpage
 
\stoptext
</context>
= A very very simple one =
And that's it, a very simple cover page. While it may be useful as such, it has several shortcomings. For example, the positions are not absolute, so a change in the title may move the information block in the lower right corner. Using the TABLE is just a show-off. If you do not need the "align-by-rightmost" alignment, <tt>\startnarrower[..][..] ... \stopnarrower</tt> provides much the same functionality with fewer commands and cleaner code.
= Simple example with MetaFun (2019) = from [https://tex.stackexchange.com/questions/472622/cover-page-coloring-in-context tex.stackexchange.com] <context source=yes>\setuppapersize[A6] \setupbodyfont [palatino] \definecolor [Top] [h=a5b291]\definecolor [Bottom] [h=b7c1a7]\definecolor [TitleColor] [h=96433a] \define[1]\titlefont{% \setcharacterkerning[extrakerning]% \cap \definedfont[Category#1]% \ignorespaces} \starttext \startMPpage  StartPage ;  numeric w ; w :Sample documents= bbwidth(Page) ; numeric h ; h := bbheight(Page) ;  fill (unitsquare xyscaled (w,.8h)) withcolor \MPcolor{Bottom} ; fill (unitsquare xyscaled (w,.2h) yshifted .8h) withcolor \MPcolor{Top} ; draw (0,.8h) -- (w,.8h) withpen pensquare scaled 2pt withcolor white ;  draw textext.rt("\definedfont[Serif at 10pt]Author") shifted (.1w,.95h) ; draw textext.rt("\titlefont{Serif at 20pt} Cover Page Title") shifted (.1w,.85h) withcolor \MPcolor{TitleColor} ; draw textext.rt("\titlefont{SerifBold at 10pt} Subhead Title") shifted (.1w,.75h) withcolor \MPcolor{TitleColor} ; draw textext.rt("\titlefont{SerifBold at 10pt} Another subhead") shifted (.1w,.70h) ;  % picture p; p := externalfigure "matterhorn.png" ;% draw p scaled (w/bbwidth p) ;  StopPage ; \stopMPpage \stoptext</context> = Poster 01 - proposal for Libre Planet 2021 = * [https://salsa.debian.org/zleap-guest/libreplanet2021/-/raw/master/ConTeXt_version/poster_libreplanet_2021.pdf PDF]* [https://salsa.debian.org/zleap-guest/libreplanet2021/-/blob/master/ConTeXt_version/poster_libreplanet_2021.tex Source code]* Preview [[File:libreplanet2021.png|500px]] = Empty or Transparent letters = This one requires LMTX. <context source="yes">\definecolor [ColorHighA] [h=c4a000]\definecolor [ColorHighB] [h=602217]\definecolor [ColorLow] [0.8(white)] \startMPpage picture tt ; tt := lmt_outline [ kind = "fillup", text = "\definedfont[name:texgyrepagellabold*default]%\framed[frame=off,offset=3mm,align=middle,strut=none] {MetaPost\\is Fun !\\Aujourd'hui\\Today\\*§ 2020 §*}", ] xsized 12cm ; path bb ; bb := boundingbox tt ; path pp ; pp := bb enlarged 2cm ; fill pp withshademethod "linear" withshadedirection (2.,0.) withshadecolors (\MPcolor{ColorHighA}, \MPcolor{ColorHighB}) ; for i within tt : nofill pathpart i; endfor ; eofill bb withcolor "gray";\stopMPpage</context>
[[Category:Sample documents]]

Navigation menu