Changes

Jump to navigation Jump to search
10,758 bytes added ,  18:10, 16 January 2023
add reference to multimedia inclusion
< [[Main Page]] | \[[SlideWithSteps]] >= Warning =This page has rarely been updated since 2006.
= Producing Your Presentations with ConTeXt =
== Using existing presentation styles ==After using ConTeXt for a while, many users begin to think about producingtheir presentations with it, too. ConTeXt is ideally suited for thistask. Here’s just a very selective list of the advantages you gain:
Even if *The superior typographic quality of TeX and ConTeXt will be available for your presentations. Users doing scientific presentations will also appreciate the well-known mathematical abilities TeX offers. *In addition, ConTeXt has great graphics abilities (placing images and floats) and can make excellent use of color. *Moreover, you can use all of the advanced features of ConTeXt, such as interaction or integration of metafun code. *The material of your presentations can be reused for handouts, papers, notes, etc. If you are not going to make use of the existing [[Modes]] feature, you can even recompile your entire presentation styles (in a different format without changing a single line in your source.  As you probably know, ConTeXt produces PDF output by default; that’s a greatadvantage when you're strongly encouraged thinking about a presentation: you can simply produce apdf-file and open it with a viewer such as xpdf or Acrobat Reader and show thepages in fullscreen mode. This is especially appealing when you want to make distribute your own anyway)presentations via mail or the web or when you have to show themon equipment you don’t know: while proprietary software may or may not beavailable, these are wonderful examples you can usually be certain that everyone has an application fordisplaying pdf-files. This section of the wiki wants to learn some new techniquesget you started with presentations inConTeXt. See There’s lots of <s>amazing</s> stuff in the distribution already, such as<s>truly amazing</s> 20-year-old [[Presentation Styles|prebuilt styles]] for a list of available stylespresentations which you can simply use by typing, e.g.
<texcode>
\usemodule[pre-funnyoriginal]
</texcode>
You The styles are fully documented, and you can usually change background color or make minor changes learn <s>amazing</s> tricks by looking atthe source and the documentation. However, for beginners, it might be easier tostart with a very basic presentation and then slowly add more fancy stuff. Thissection is thus targeted at newcomers; more experienced users may want to skipthe existing style in first sections. This document deals with presentations that will be shownwith the help of a pretty simple way (I hope it digital projector, but many elements will be described applicable tointeractive screen presentations as well. Many information are included in this [http://www.tug.org/pracjourn/2006-2/schmitz/schmitz.pdf article] by Thomas (2006). Aditya Mahajan maintains a step by step instruction about [Presentation Styles]] https://github.com/adityam/context-slides-example on how to do that one daycreate slides in ConTeXt] in 40 commits (2020). You may have to override some font definitions used for a specific style if you don't have the font installed. = Your First Presentation =
== Making your own presentation style ==
Building The first thing you will need to do is adapt the papersize: you need a presentation paperlayout in ConTeXt landscape mode that fits a computer screen. (Actually, this layout is not much different smaller than preparing an usual ConTeXt a screen, but a pdf-document, with some exceptionscan be scaled without losingquality. If you're using an existing style (like ''pre-funny'' in the example above), most definitions described below are already done for you.
<texcode>\usemodule[pre-general]</texcode>
will include some [[source:s-pre-00.tex|general definitions]] that you may find useful or not.
=== Setting screen dimensions ===
<texcode>\setuppapersize[S6][S6]</texcode>
will set the proper document ratio (3:2) to fit the computer screen.
And you probably do not want any page numbers on your slides: <texcode>\setuppagenumbering[state=stop]</texcode> == Setting the tolerance == Moreover, on slides, you want TeX to be tolerant with its horizontal space(since you will normally be typesetting not entire paragraphs, but single linesonly, this shouldn’t be a problem): <texcode>\setuptolerance[verytolerant,stretch] </texcode> == Full-screen mode ===
<texcode>\setupinteractionscreen[option=max]</texcode>
will cause launcing the PDF document in full-screen mode. In Acrobat you can use CTRL-L to switch between normal and full-screen mode.
=== Hyperlinks, buttons & navigation ===
{{todo|write something about them}}
Here is a small example showing how to include hyperlinks: <texcode>\setupcolors[state=start]\setupinteraction[state=start,color= Including Graphics middlered]\useURL [garden][http://contextgarden.net]\starttextThe \from[garden] site is useful.\stoptext</texcode> It looks like this (in a PDF viewer the red link is clickable and should call up a browser on the link when you click it): <context>\setupcolors[state=start]\setupinteraction[state=start,color=middlered]\useURL [garden][http://contextgarden.net]\starttextThe \from[garden] site is useful.\stoptext</context> If you want an alternative text to show up in the clickable area, use the fourth argument to \useURL, like this:<texcode>\setupcolors[state=start]\setupinteraction[state=start,color=middlered]\useURL [garden][http://contextgarden.net][][Context garden]\starttextThe \from[garden] is useful.\stoptext</texcode> It looks like this: <context>\setupcolors[state=start]\setupinteraction[state=start,color=middlered]\useURL [garden][http://contextgarden.net][][Context garden]\starttext The \from[garden] is useful.\stoptext</context> The same technique can be used to add navigation buttons. [[Symbols/nav]] provides the symbol. <texcode>\def\fp{\goto{\symbol[firstpage]}[page(1)]}\setupheadertexts[\fp]</texcode> We can also add the button to the footer with [[Command/setupfootertexts]].
Everything works just the same way as graphics in usual documents<context>\setupcolors[state=start]\setupinteraction[state=start]\def\fp{\goto{\symbol[firstpage]}[page(1)]}\setupheadertexts[\fp]\starttextLorem ipsum dolor sit amet. But if a presentation is your first document, let's repeat it once more here:\stoptext</context>
<texcode>\externalfigure[name][width=...]%% (probably surrounded by \placefigure)</texcode>= Including Graphics ==
=See [[Using_Graphics]]. == Graphics with Metafun ===
{{todo|how to make page-dependant graphics}}
=== Animation ===
See [[Animation]] (page is still under construction).
== Compiling Your First Presentation ==
 
If you compile a document with these settings, you have something that you
could show as a presentation slide:
 
<texcode>
\setuppapersize[S6][S6]
\setuppagenumbering[state=stop]
\setuptolerance[verytolerant,stretch]
 
\starttext
 
Here’s my first presentation in \CONTEXT!
 
Isn’t it amazing?
 
\stoptext
 
</texcode>
 
= Refining the Presentation =
 
 
OK, this is not too impressive yet. The first thing you will want to do is
adapt the font size. With a paper size of S6, I find a font size of 20pt about
right:
 
<texcode>
\switchtobodyfont[modern,20pt]
</texcode>
 
This looks better.
 
== Colors ==
 
Next up: colors. Now I'm aware that the use of colors is an immensely personal
choice -- I've seen people present their slides with a dark gray font on a
light gray background, and they seemed very proud of their design. Others use
psychedelic colors that can induce serious sickness. So let’s go for a rather
conservative combination of colors. Something I find very readable even in
rooms where the lighting is a bit problematic is a white typeface on a blue
background. So let’s add this. Our document will now look like this:
 
<texcode>
\setuppapersize[S6][S6]
\setuppagenumbering[state=stop]
\switchtobodyfont[modern,20pt]
\setupcolors[state=start]
\setupbackgrounds[page][background=color,backgroundcolor=darkblue]
\startcolor[white]
\starttext Here’s my first presentation in \CONTEXT! Isn’t it amazing? \stoptext</texcode> This will give you something to start from. You can now go and build apresentation with this design: make every slide a new page, use all the ConTeXtfeatures (such as lists, itemize, tables, math, chemical formulae, etc.) youwant. == Adding fancier effects == Now when you look at your slides, you will certainly feel that there’s room forimprovement. There’s only a few things I can mention here; for the rest, have alook at the predefined styles to get some ideas. First, the background. Something I find very attractive is a background thathas different shades, beginning in a very dark blue at the top and ending in anoticeably lighter blue at the bottom. Metafun can easily produce such shadedbackgrounds: <texcode>\definecolor[a][r=0,g=0,b=1]\definecolor[b][r=0,g=0,b=0.05] \startuniqueMPgraphic{LinearShade}path p ;p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;linear_shade(p,6,\MPcolor{a},\MPcolor{b}) ;\stopuniqueMPgraphic \defineoverlay[shaded][\useMPgraphic{LinearShade}] \setupbackgrounds[page][background={shaded}]</texcode> What we have done: defined two colors; a is a very light, b a very dark blue.We let metafun calculate an interpolation between both colors. Try other valuesfor the colors and be amazed! You can also try to set "p,6" to other valuessuch as "p,0" or "p,4."  == Adding a Footer == Next, the bottom of our slides. If the audience is apt to forget your name, thetitle of your talk, and the date, you could include this vital information inthe footer of the page.  <texcode>\setupfootertexts[{\color[white]{\tfxx \midaligned{\rlap{\currentdate} \hfill TITLE HERE\hfill \llap{YOUR NAME HERE}}}}]</texcode>Don’t forget to put<texcode>\setupfooter[state=start]</texcode>into your document where you want the footer to appear first (probably not onthe title of your presentation...). == Adding a Progress Meter == If your audience is able to remember these details, but you suspect they maybe yearning for the end of your presentation, you may want to include a"progress meter" that highlights how many slides they have seen and how manymore they will have to stand. Put this in your preamble: <texcode>\definecolor [InteractionColor] [s=.2]\definecolor [ContrastColor] [s=.5] \setupinteraction [page=yes, color=InteractionColor, contrastcolor=ContrastColor, menu=on, state=start] \setupsubpagenumber [way=bytext, state=start] \setuplayout[bottomspace=.8cm, bottom=12pt] \startinteractionmenu[bottom] {\interactionbar[alternative=f,width=\makeupwidth,height=1ex]}\stopinteractionmenu</texcode>Again, don’t forget to put <texcode>\setupinteractionmenu[state=start]</texcode>into your text. Finally, a few things about the placement of pictures. This can be done withthe {{cmd|framed}} command. You probably have to try and adjustdifferent parameters to get exactly what you need, but here’s something thatworked for me: == Adding Pictures == In the case of wide pictures, it’s fairly easy. You will want them midaligned,and you'll want them to fill as much space of the area between your title andthe footer as possible: <texcode>\midaligned{\externalfigure[NAME][height=.75\textheight]} %Adjust!\vfill</texcode> I found it more difficult to have longish narrow pictures: in that case, Idon’t want a title above the picture, but I want it to fill all the verticalspace between the top margin and the footer. I want the text accompanying thepicture opposite it, centered horizontally and vertically. This can be donewith a {{cmd|startcombination}}: <texcode>\setupcombinations[distance=0pt] \setupframed[frame=off,height=.9\textheight,width=.5\textwidth,top=\vss,bottom=\vss,align=middle] \startcombination\framed{\externalfigure[NAME][width=.5\textwidth]}{} %watch the pair of empty braces,\framed{YOUR TEXT GOES HERE}{} % it’s essential\stopcombination</texcode>  = Post Processing Presentation = Sometimes one wants to give a handout of the presentation, with multiple slides on one page. It is easy to do this using {{cmd|combinepages}} or <code>texexec --pdfcombine</code> To use {{cmd|combinepages}}, suppose that your presentation is <code>slides.tex</code>. Create a file <code>handout.tex</code> with the following content <texcode>\setuppapersize [A4][A4] % or [A4,landscape][A4,landscape] \setuplayout [header=0pt,footer=1cm, backspace=1cm,topspace=1cm, width=middle,height=middle] \setupfootertexts [presentation---\currentdate\space---\space\pagenumber] \starttext \combinepages[slides][nx=2,ny=3,frame=on]\stoptext</texcode>This will give you 2*3 slides on A4 paper. = Additional modules ==
* The [[RawSteps]] module enables you to build a presentation step-by-step without the usage of JavaScript
* <s>[[Stepper]] which is buit in ConTeXt.</s>Broken
* The simple slides module [http://github.com/adityam/simple-slides/tree/master simple-slides] serves too.
* [[Presentation effects]], [[Presentation Styles]], [[SlideWithSteps]]
* See [[Using Graphics]] or [[Multimedia Inclusion]] how to use movies.
== Examples of presentations ==
See also [[Sample documents]]
If you're interested in presentations, your first stop should be the [http://www.pragma-ade.nl/ pragma website]. You can download pdfs with the documented source-code of 18 presentation modules at http://www.pragma-ade.nl/dir/general/sources/. To get a first impression of the visual appearance that the prebuilt styles offer, have a look at http://www.pragma-ade.nl/show-pre.pdf (big document, ~ 3 MB!). {{Todotodo|collect some + some extremely simple}}
* '''Introduction to ConTeXt''' (in French) by Denis Roegel at Gutenberg meeting in 2002 [http://www.gutenberg.eu.org/manifestations/92-supports-29mai2002.html] ([http://www.loria.fr/~roegel/TeX/context-gut2002.tex tex], [http://www.loria.fr/~roegel/TeX/context-gut2002.pdf pdf]) <i>(please add a link to the page from where these two documents are linked to if you find it)</i>.
== Some Ideas ==* [https://github.com/adityam/context-slides-example Slides example] by Aditya Mahajan
Here'= Some Ideas =<s >Here’s an Interesting post, written by Maurice Diamantini:
[[http://archive.contextgarden.net/message/20041103.074705.2f196f69.html]]
* pdf file '''one pdf page''' for each final step by page
** Good format for printing 2up or 4up slides
** This third output would also allow to print a ''"slide + comment"'' version of the presentation for the speackerspeaker.
The option of texexec could be something like
* In general, I seem to have much more luck with advi then with xdvi for doing slides. It supports all kinds of interactive things. I've been told it can even do plugins (movies and such), but they only have a LaTeX package to support that.
</s>
===Working Example (for the ones not satisfied with \presentationstep)===
Here are some simple macros almost fully satisfying the idea above with [[SlideWithSteps]], shared with the others by Otared Kavian:
[[http://archive.contextgarden.net/message/20041103.083500.43ac3121.html]]. David Munger also derived an alternative [[http://archive.contextgarden.net/message/20041106.080646.2544e4f3.html]] from Otared Kavian's Kavian’s work.Bateni has ported that work to MkiV [[https://github.com/bateni/rawsteps-mkiv]]  [[Category:Layout]][[Category:Interaction]][[Category:Presentation]]
139

edits

Navigation menu