Engee documentation
Notebook

Demonstration of the presentation generator capabilities

This file shows all the features of the slide generator: headings, text,
code, output, graphs, and two-column slides.

To run the example, call slides_compile(имя_файла.ngscript)

In [ ]:
# SKIP
gr(fmt=:png, size=(400,400))
Out[0]:
Plots.GRBackend()

If there is an image in the slide, it becomes the only element.

image.png

This text will not be included in the presentation.

And these are images and text.

image.png

Engee is a Russian platform for mathematical calculations and dynamic modeling

First section: text and formulas

Plain text with bold and italics and кодом inside the string.

Formulas are displayed in a simplified way:

As well as linear formulas:

A bit of code

In [ ]:
x = range(0, 2π, length=100)
plot(x, sin.(x), label="sin(x)", lw=2, c=:blue)
plot!(x, cos.(x), label="cos(x)", lw=2, c=:red, ls=:dash)
title!("Trigonometric functions")
xlabel!("x")
ylabel!("y")
Out[0]:
No description has been provided for this image

The second section: tables and code

In [ ]:
using DataFrames
df = DataFrame(
    Метод = ["Euler", "Runge Kutta 2", "Runge Kutta 4"],
    Accuracy = [1e-2, 1e-4, 1e-8],
    Time = [0.01, 0.05, 0.15]
)
print(df)
3×3 DataFrame
 [1m Row [0m│ [1m Method [0m [1m Accuracy [0m [1m Time [0m
      String         Float64   Float64 
─────┼──────────────────────────────────
   1 │ Euler 0.01 0.01
   2 │ Runge-Kutta 2 0.0001 0.05
   3 │ Runge-Kutta 4 1.0e-8 0.15

Another option for displaying tables

In [ ]:
using DataFrames
df = DataFrame(
    Метод = ["Euler", "Runge Kutta 2", "Runge Kutta 4"],
    Accuracy = [1e-2, 1e-4, 1e-8],
    Time = [0.01, 0.05, 0.15]
)
df
Out[0]:
3×3 DataFrame
RowМетодТочностьВремя
StringFloat64Float64
1Эйлер0.010.01
2Рунге-Кутта 20.00010.05
3Рунге-Кутта 41.0e-80.15

Third section: two-column slides

Advantages of the method:

  • High precision
  • Fast convergence
  • Sustainability

Disadvantages of the method:

  • Complexity of implementation
  • Memory requirements
  • Sensitivity to noise

Fourth section: code only

In [ ]:
# A simple example of the algorithm
function bubble_sort!(a)
    n = length(a)
    for i in 1:n-1
        for j in 1:n-i
            if a[j] > a[j+1]
                a[j], a[j+1] = a[j+1], a[j]
            end
        end
    end
    return a
end

data = [5, 2, 8, 1, 9]
bubble_sort!(copy(data))
Out[0]:
5-element Vector{Int64}:
 1
 2
 5
 8
 9

The fifth section: the image with the code

In [ ]:
# On the left is the code for building a heat map, on the right is the graph itself.
# This is an example of how you can place the code and the result side by side.

x = range(-3, 3, length=100)
y = range(-3, 3, length=100)
f(x,y) = exp(-(x^2 + y^2))
contour(x, y, f, fill=true, title="The Gaussian function")
Out[0]:
No description has been provided for this image

Slide with the image in the center

In [ ]:
# CODE_SKIP
x = range(-3, 3, length=100)
y = range(-3, 3, length=100)
f(x,y) = exp(-(x^2 + y^2))
contour(x, y, f, fill=true, title="The Gaussian function")
Out[0]:
No description has been provided for this image

And the same goes for the text after the image.

In [ ]:
# CODE_SKIP
x = range(-3, 3, length=100)
y = range(-3, 3, length=100)
f(x,y) = exp(-(x^2 + y^2))
contour(x, y, f, fill=true, title="The Gaussian function")
Out[0]:
No description has been provided for this image

On the left is the code for building a heat map, on the right is the graph itself.
This is an example of how you can place the code and the result side by side.

Conclusion

The generator supports:

  1. Three-level headings
  2. Text with formatting
  3. LaTeX formulas (inline and display)
  4. Code cells with output
  5. Graphs with captions
  6. Tables with names
  7. Two-column slides
  8. Hiding the code (#CODE_SKIP)
  9. Skipping cells (#SKIP)

and many other designs!

Thanks for your attention!