Changes

Jump to navigation Jump to search
2,153 bytes added ,  08:43, 3 March 2021
m
Hint about visual impression
= First one =
<texcodecontext mode="mkiv" source="yes">\setuppapersize[A6]
\setupcolors[state=start]
\startstandardmakeup
\raggedcenter
\vfill \definedfont[SerifBold at 48pt28pt]\setstrut \strut Penguins in Vietnam \blank[2*big] \definedfont[SerifBold at 24pt18pt]\setstrut \strut A Very Short Story
\vfill
\stopstandardmakeup
\stoptext
</texcode>
 
<context>
\setuplayout[location=middle,scale=.2]
\setupcolors[state=start]
 
\startuseMPgraphic{cover}
StartPage ;
fill Page withcolor .5green ;
path p ; p := unitcircle randomized .1 xsized(PaperWidth-1cm) ;
fill p shifted -center p shifted center Page withcolor red ;
StopPage ;
\stopuseMPgraphic
 
\defineoverlay[cover][\useMPgraphic{cover}]
 
\starttext
 
\setupbackgrounds[page][background=cover]
 
\startstandardmakeup
\raggedcenter
\vfill \definedfont[SerifBold at 48pt]\setstrut \strut Penguins in Vietnam
\blank[2*big] \definedfont[SerifBold at 24pt]\setstrut \strut A Very Short Story
\vfill
\stopstandardmakeup
 
\stoptext
</context>
= Another title page =
<texcodecontext mode="mkiv" source="yes">\setuppapersize[A6]
\definetype[ytyp][color=yellow]
\stoptext
</texcodecontext>
Guess who did this one :-) [http://archive.contextgarden.net/message/20050321.011152.0eb2d729.html Reference to mailing list]
 
<context>
\setuplayout[location=middle,scale=.2]
\definetype[ytyp][color=yellow]
 
\startbuffer[title]
\type{/(}\ytyp{h}\type{*?)testexpr/io}\par
\type{/t(}\ytyp{a}\type{*?)estexpr/io}\par
\type{/te(}\ytyp{n}\type{*?)stexpr/io}\par
\type{/tes(}\ytyp{s}\type{*?)texpr/io}\par
\type{/test(}\ytyp{h}\type{*?)expr/io}\par
\type{/teste(}\ytyp{a}\type{*?)xpr/io}\par
\type{/testex(}\ytyp{g}\type{*?)pr/io}\par
\type{/testexp(}\ytyp{e}\type{*?)r/io}\par
\type{/testexpr(}\ytyp{n}\type{*?)/io}\par
\stopbuffer
 
\setupcolors[state=start]
 
\definelayer
[TitleGraphic]
[width=\paperwidth,
height=\paperheight]
 
\setlayer
[TitleGraphic]
[preset=lefttop]
{\scale
[width=\paperwidth,
height=\paperheight]
{\framed
[frame=off,
offset=overlay,
background=color,
backgroundcolor=blue,
foregroundcolor=red,
align=normal]
{\getbuffer[title]}}}
 
\setupbackgrounds[page][background=TitleGraphic]
 
\starttext
 
\startstandardmakeup
 
\stopstandardmakeup
 
\stoptext
</context>
= 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 mode="mkiv" source="yes">
\setuppapersize[A7,landscape]
\showframestartTEXpage \startTEXpageexternalfigure \externalfigure[cow.pdf] [width=\paperwidth, height=\paperheight] \stopTEXpage
</context>
= Simple example with MetaFun (2019) =
 
from [https://tex.stackexchange.com/questions/472622/cover-page-coloring-in-context tex.stackexchange.com]
 
<context source=yes>
\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 24pt} 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[#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> = 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 [[CategoryFile:Sample documentslibreplanet2021.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>
 
= Background tricks without MetaPost =
 
[[File:ka37_cover.jpg|500px]]
 
The background structure is a photo (moiree effects in a microphone filter, JPEG), the left bar is made with a design program (Affinity Designer, PDF) and doesn’t include the structure, everything put together using [[Transparency]].
 
The image above is not a photo of the printed cover but just a JPEG export of the PDF; i.e. even if the cover paper is new and smooth, it looks structured and a bit faded.
 
<texcode>
 
\definefont[SubtitleFont][Sans*normnum at 14pt]
\definefont[SubjectFont][Chalkduster*default at 41pt]
 
\setupcolors[
pagecolormodel=auto,
rgb=no,cmyk=yes,spot=no,
overprint=yes,
intent={Uncoated FOGRA29 (ISO 12647-2:2004)},
textcolor=cmykblack,]
 
\definecolor[cmykblack][c=0,m=0,y=0,k=1]
\definecolor[SubjectColor][c=0,m=.1,y=.2,k=.3,a=2,t=1]
\definetransparency[tmultiply][a=2,t=1] % multiply
\definetransparency[tmoiree][a=1,t=.05] % normal, but very light
\definetransparency[tsidebar][a=2,t=.5] % multiply, light
 
\definemeasure[Bleed][3mm]
\definemeasure[maxWidth][\paperwidth + 1\measure{Bleed}]
\definemeasure[maxHeight][\paperheight + 2\measure{Bleed}]
\definemeasure[topOffset][\topspace + \measure{Bleed}]
 
\definelayer[background][
x=0mm,y=-\measure{Bleed},
width=\measure{maxWidth},
height=\measure{maxHeight}] % incl. bleed
\setupbackgrounds[page][background={background},state=start]
 
% background structure (moiree)
\setlayer[background][
hoffset=-\measure{Bleed},
voffset=-\measure{Bleed},
]{\starttransparent[tmoiree]%
\externalfigure[ka37/img/Moiree][height=216mm,orientation=90]%
\stoptransparent}
 
% sidebar
\setlayer[background][
hoffset=0mm,
voffset=-\measure{Bleed},
]{\starttransparent[tsidebar]%
\externalfigure[ka37/img/Sidebar_KA][height=303mm]%
\stoptransparent}
 
% Motto
\setlayerframed[background][
hoffset=45mm,
voffset=20mm,
offset=overlay,
frame=off,
align=flushleft,
]{\SubtitleFont%
Kritische Ausgabe\crlf\vskip4pt%
Zeitschrift für Literatur im Dialog}
 
% Issue No.
\setlayerframed[background][
hoffset=160mm,
voffset=20mm,
width=28mm,
align=flushright,
offset=overlay,
frame=off,
]{\definedfont[Sans*normnum at 36pt]37/38} %37
 
% Image
\setlayerframed[background][
hoffset=45mm,
voffset=148mm,
width=168mm,
offset=overlay,
frame=off,
]{\starttransparent[tmultiply]%
\clip[x=2mm,y=0mm,width=168mm,height=107mm]{% clip to target size
\externalfigure[ka37/img/Cover][width=168mm]}%
\stoptransparent
}
 
% Subject
\setlayer[background][
hoffset=45mm,
voffset=131mm,
]{\SubjectFont\WORD{\color[SubjectColor]{Werkgespräche}}}
\strut\page
</texcode>
[[Category:Sample documents]]

Navigation menu