def addSlideTextPlotPlotPlot(slideTitle, bullets, plotName1, plotName2, plotName3, drawType="includegraphics", opts=""): opts = utils.parseOptions(opts) code = "\\begin{frame}\\frametitle{%s} \n" % (slideTitle) code += utils.handleStartingOpts(opts) height = 0.5 * utils.textLinesToPlotHeight(utils.bulletNLines(bullets)) width = 1.0 code += utils.bulletsToCode(bullets, opts) code += "\\begin{columns}[c]\n" code += "\\column{0.5\\textwidth}\n" code += "\\centering" code += "\\%s[height=%.2f\\textheight,width=%.2f\\textwidth,keepaspectratio]{%s}\\\\ \n" % ( drawType, height, width, plotName1) code += "\\%s[height=%.2f\\textheight,width=%.2f\\textwidth,keepaspectratio]{%s} \n" % ( drawType, height, width, plotName2) code += "\\column{0.55\\textwidth}\n" code += "\\centering" code += "\\hspace*{-0.10\\textwidth}\\%s[height=%.2f\\textheight,width=%.2f\\textwidth,keepaspectratio]{%s} \n" % ( drawType, 1.5 * height, width, plotName3) code += "\\end{columns}" return code
def addSlideTextPlots(slideTitle, bullets, plots=[], drawType="includegraphics", opts=""): opts = utils.parseOptions(opts) code = "\\begin{frame}\\frametitle{%s} \n" % (slideTitle) code += utils.handleStartingOpts(opts) nRows = int(opts["numrows"]) if opts["numrows"] else 2 plotChunks = [plots[i:i + nRows] for i in range(0, len(plots), nRows)] nCols = len(plotChunks) height = (1.0 / nRows) * utils.textLinesToPlotHeight( utils.bulletNLines(bullets)) width = 1.0 code += utils.bulletsToCode(bullets, opts) code += "\\begin{columns}[t]\n" for chunk in plotChunks: code += "\\column{%.2f\\textwidth}\n" % (1.0 / nCols) code += "\\centering" for plot in chunk: code += "\\%s[height=%.2f\\textheight,width=%.2f\\textwidth,keepaspectratio]{%s}\\\\ \n" % ( drawType, height, width, plot) code += "\\end{columns}" return code
def addSlideText(slideTitle, bullets, opts=""): opts = utils.parseOptions(opts) pos = "" if (opts["texttop"]): pos = "[t]" if (opts["textbottom"]): pos = "[b]" code = "\\begin{frame}%s\\frametitle{%s} \n" % (pos, slideTitle) code += utils.handleStartingOpts(opts) code += utils.bulletsToCode(bullets, opts) return code
def addSlidePlotPlot(slideTitle, plotName1, plotName2, drawType="includegraphics", opts=""): opts = utils.parseOptions(opts) code = "" if (opts["vertical"]): totalSize = 0.84 size1, size2 = 0.5 * totalSize, 0.5 * totalSize if (opts["sizeratio"]): size1, size2 = float(opts["sizeratio"]) * totalSize, ( 1.0 - float(opts["sizeratio"])) * totalSize code = "\\begin{frame}\\frametitle{%s}" % (slideTitle) code += utils.handleStartingOpts(opts) code += """ \\begin{center} \\%s[height=%.2f\\textheight,keepaspectratio]{%s}\\vfill \\%s[height=%.2f\\textheight,keepaspectratio]{%s} \\end{center} """ % (drawType, size1, plotName1, drawType, size2, plotName2) else: totalSize = 0.96 size1, size2 = 0.5 * totalSize, 0.5 * totalSize if (opts["sizeratio"]): size1, size2 = float(opts["sizeratio"]) * totalSize, ( 1.0 - float(opts["sizeratio"])) * totalSize code = "\\begin{frame}\\frametitle{%s}" % (slideTitle) code += utils.handleStartingOpts(opts) code += """ \\begin{center} \\vspace*{-0.035\\textheight}\\%s[width=%.2f\\textwidth,keepaspectratio]{%s} \\hfill \\vspace*{-0.035\\textheight}\\%s[width=%.2f\\textwidth,keepaspectratio]{%s} \\end{center} """ % (drawType, size1, plotName1, drawType, size2, plotName2) return code
def addSlideTextText(slideTitle, bullets1, bullets2, opts=""): opts = utils.parseOptions(opts) pos = "" if (opts["texttop"]): pos = "[t]" if (opts["textbottom"]): pos = "[b]" code = "\\begin{frame}%s\\frametitle{%s} \n" % (pos, slideTitle) code += utils.handleStartingOpts(opts) code += "\\begin{columns}\n \\begin{column}{0.5\\textwidth} \n" code += utils.bulletsToCode(bullets1, opts) code += "\\end{column}\n \\begin{column}{0.5\\textwidth}" code += utils.bulletsToCode(bullets2, opts) code += "\\end{column}\n\\end{columns} \n" return code
def addSlideTextPlotPlot(slideTitle, bullets, plotName1, plotName2, drawType="includegraphics", opts=""): opts = utils.parseOptions(opts) code = "\\begin{frame}\\frametitle{%s} \n" % (slideTitle) code += utils.handleStartingOpts(opts) if (opts["plottop"]): code += "\\begin{center}" code += "\\%s[height=%.2f\\textheight,width=0.48\\textwidth,keepaspectratio]{%s} \n" \ % (drawType, utils.textLinesToPlotHeight(utils.bulletNLines(bullets)),plotName1) code += "\\%s[height=%.2f\\textheight,width=0.48\\textwidth,keepaspectratio]{%s} \n" \ % (drawType, utils.textLinesToPlotHeight(utils.bulletNLines(bullets)),plotName2) code += "\\end{center}" code += utils.bulletsToCode(bullets, opts) elif (opts["plotsleft"]): height = 0.45 width = 0.55 code += "\\begin{columns}\n" code += "\\column{%.2f\\textwidth}\n" % width code += "\\centering" code += "\\%s[height=%.2f\\textheight,width=%.2f\\textwidth,keepaspectratio]{%s}\\\\ \n" % ( drawType, height, 1.0, plotName1) code += "\\%s[height=%.2f\\textheight,width=%.2f\\textwidth,keepaspectratio]{%s} \n" % ( drawType, height, 1.0, plotName2) code += "\\column{%.2f\\textwidth}\n" % (1.0 - width) code += "\\centering" code += utils.bulletsToCode(bullets, opts) code += "\\end{columns}" else: code += utils.bulletsToCode(bullets, opts) code += "\\begin{center}" code += "\\%s[height=%.2f\\textheight,width=0.48\\textwidth,keepaspectratio]{%s} \n" \ % (drawType, utils.textLinesToPlotHeight(utils.bulletNLines(bullets)),plotName1) code += "\\%s[height=%.2f\\textheight,width=0.48\\textwidth,keepaspectratio]{%s} \n" \ % (drawType, utils.textLinesToPlotHeight(utils.bulletNLines(bullets)),plotName2) code += "\\end{center}" return code
def addSlideTextPlot(slideTitle, bullets, plotName, drawType="includegraphics", opts=""): opts = utils.parseOptions(opts) code = "\\begin{frame}\\frametitle{%s} \n" % (slideTitle) code += utils.handleStartingOpts(opts) if (opts["sidebyside"]): code += "\\begin{columns}\n \\begin{column}{0.5\\textwidth} \n" code += utils.bulletsToCode(bullets, opts) code += "\\end{column}\n \\begin{column}{0.5\\textwidth}" code += " \\begin{center}" code += " \\%s[width=\\textwidth,keepaspectratio]{%s} \n" % ( drawType, plotName) code += " \\end{center}\n \\end{column}\n\\end{columns} \n" elif (opts["plottop"]): code += "\\begin{center}" code += " \\%s[height=%.2f\\textheight,keepaspectratio]{%s} \n" \ % (drawType, utils.textLinesToPlotHeight(utils.bulletNLines(bullets)),plotName) code += "\\end{center}\n" code += utils.bulletsToCode(bullets, opts) else: code += utils.bulletsToCode(bullets, opts) code += "\\begin{center}" if (opts["fithorizontal"]): code += " \\vspace*{%.2f\\textheight}\\%s[width=0.99\\textwidth,keepaspectratio]{%s} \n" \ % (0.9-utils.textLinesToPlotHeight(utils.bulletNLines(bullets)),drawType,plotName) else: code += " \\%s[height=%.2f\\textheight,keepaspectratio]{%s} \n" \ % (drawType, utils.textLinesToPlotHeight(utils.bulletNLines(bullets)),plotName) code += "\\end{center}\n" return code