Skip to content
Snippets Groups Projects
Commit 60788413 authored by tuhe's avatar tuhe
Browse files

Updates to slider

parent 95ec9734
No related branches found
No related tags found
No related merge requests found
......@@ -57,11 +57,18 @@ And the generated PDF file looks like this:
Don't worry about the label in the upper-left corner: you can just turn it off with the LaTeX switch.
Next, go to the `osvgs` folder. It will contain an image called `myoverlay.svg` (remember this was our label name).
![alt text|small](https://gitlab.compute.dtu.dk/tuhe/slider/-/raw/main/docs/inkscape.png)
to start a beamer project. Edit index.tex (see how you add overlays in the file) and after you edit the overlay `.svg` files, run
At the start, this file contains all the LaTeX contents as editable `svg` contents which we can move around (for instance by rotating the text), and we can add
free-hand drawings to the slide. The bottom layer of the image will always be a non-editable layer containing the **actual** LaTeX content of the slide (in this case the logo and text). You can use this for reference when you edit. When you are happy, simply save the file and re-run
```terminal
slider.py index.tex
python -m slider index.tex
```
to update the overlays. Note the overlay `.svg` files by default contains all the text in the slide they are imported from. This is helpful
if you want to move elements around. You can always add new overlays by using the '\osvg{my_label}' command in LaTeX.
\ No newline at end of file
(it will automatically try to detect the `index.tex` if run without arguments). This will keep all layers up to date, flatten fonts and generally just make sure everything is okay.
You can find the output in the `examples/basic1` folder and the `pdf` file will now look as follows:
![alt text|small](https://gitlab.compute.dtu.dk/tuhe/slider/-/raw/main/docs/basic1_nup.png)
- You can add new overlays at any point by inserting a '\osvg{my_label}' command in your LaTeX document
- Overlay-images with multiple layers are automatically converted into '\pause'-frames in LaTeX
\ No newline at end of file
......@@ -35,11 +35,18 @@ And the generated PDF file looks like this:
Don't worry about the label in the upper-left corner: you can just turn it off with the LaTeX switch.
Next, go to the `osvgs` folder. It will contain an image called `myoverlay.svg` (remember this was our label name).
![alt text|small]({{resources}}/docs/inkscape.png)
to start a beamer project. Edit index.tex (see how you add overlays in the file) and after you edit the overlay `.svg` files, run
At the start, this file contains all the LaTeX contents as editable `svg` contents which we can move around (for instance by rotating the text), and we can add
free-hand drawings to the slide. The bottom layer of the image will always be a non-editable layer containing the **actual** LaTeX content of the slide (in this case the logo and text). You can use this for reference when you edit. When you are happy, simply save the file and re-run
```terminal
slider.py index.tex
python -m slider index.tex
```
to update the overlays. Note the overlay `.svg` files by default contains all the text in the slide they are imported from. This is helpful
if you want to move elements around. You can always add new overlays by using the '\osvg{my_label}' command in LaTeX.
\ No newline at end of file
(it will automatically try to detect the `index.tex` if run without arguments). This will keep all layers up to date, flatten fonts and generally just make sure everything is okay.
You can find the output in the `examples/basic1` folder and the `pdf` file will now look as follows:
![alt text|small]({{resources}}/docs/basic1_nup.png)
- You can add new overlays at any point by inserting a '\osvg{my_label}' command in your LaTeX document
- Overlay-images with multiple layers are automatically converted into '\pause'-frames in LaTeX
\ No newline at end of file
File added
docs/basic1_nup.png

31.7 KiB

......@@ -28,18 +28,17 @@ if __name__ == "__main__":
base = os.path.basename(dir)
out = beamer_nup(path, output="./" + base + "_nup.pdf", nup=2)
out_png = convert.pdf2png(out)
out_png = convert.pdf2png(out, scale_to=600)
print(out_png)
a =234
pass
my_nup(np + "/index.pdf")
my_nup(f"{np_basic1}/index.pdf")
convert.pdf2png(np + "/index.pdf", "./index0.png")
output = np +"/index_2up.pdf"
data = {}
data['resources'] = 'https://gitlab.compute.dtu.dk/tuhe/slider/-/raw/main'
with open(np + "/index.tex", 'r') as f:
data['basic0_tex'] = f.read()
......
No preview for this file type
docs/new_project_nup.png

103 KiB | W: | H:

docs/new_project_nup.png

27.9 KiB | W: | H:

docs/new_project_nup.png
docs/new_project_nup.png
docs/new_project_nup.png
docs/new_project_nup.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
......@@ -51,11 +51,13 @@ def pdf2svg(fin, fout, page_no=None):
execute_command(cmd)
def pdf2png(fin, fout=None):
def pdf2png(fin, fout=None, scale_to=None):
if fout is None:
fout = fin[:-4] + ".png"
fout = fout[:-4]
cmd = f"pdftocairo -png -singlefile {fin} {fout}"
if scale_to is not None:
cmd += f" -scale-to {scale_to}"
execute_command(cmd.split())
return fout + ".png"
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment