flowchart LR O([presentation.pptx]) --> P A[helper_filter.lua] -.- P B[custom.css] -.- P C[_metadata.yml] -.- P P[convert_pptx_to_qmd.py] --> |keep hyperlinks| Q([presentation.qmd]) Q --> M(Minor manual fixes) M --> |quarto render| H([presentation.html])
How to: Collaborate digitally
The term digital collaboration refers to the process of working with others using digital tools. See the CRS Primer: Digital Collaboration for more information on the topic in general.
Version control with git and gitlab
CRS team members use https://gitlab.uzh.ch/ for version control of our code and our manuscripts. This facilitates collaboration on code and maintains a history of our work. As a CRS team member you should be part of the crsuzh group. If you are not part of it yet, ask a member to add you! CRS collaborative projects should be directly added as a project under the crsuzh group. Personal projects or projects that are not directly related or linked to CRS work should/can be created under your personal account. When in doubt discuss this with your supervisor.
Dynamic reporting with RMarkdown and Quarto
At the CRS we use RMarkdown and Quarto for dynamic reporting. RMarkdown is a file format for writing reports, papers and slides as dynamic documents with R. Quarto is the next-generation version of RMarkdown that supports multiple programming languages and is more flexible in terms of output formats. Both tools allow you to create reports, presentations, and other documents that can include code, text, and visualizations.
If you are new to dynamic reporting make sure to check out our CRS primer on the topic (Primer: Dynamic reporting).
LaTex and Overleaf
CRS team members use Overleaf for collaborative writing of LaTeX documents. Overleaf is a cloud-based LaTeX editor that allows multiple users to work on the same document simultaneously. It is particularly useful for writing scientific papers, especially when collaborating with co-authors who may not be familiar with dynamic reporting in Rmarkdown and Quarto. For some projects, you might consider producing a first draft in Rmarkdown or Quarto and then converting it to LaTeX for final editing/reviewing of co-authors and formatting in Overleaf, especially when writing-up a collaborative project with many authors.
UZH provides a subscription the Overleaf Professional plan. Use Login with SSO and then your edu-ID to access it.
Google Drive
We use a Google Drive for collaborative developments and writing of documents and slides, such as flyers and calls for events, slides for our GRP course and other presentations, corporate design materials, etc. While Google Drive is not optimal for privacy reasons, it is practical and easy to use and popular among many (let’s just quickly set up a google doc for this …).
Do not upload any personal or even confidential information (work contracts, legal documents or similar) on our Google Drive. For such documents, use the UZH internal file system (Microsoft SharePoint).
Gitlab pages with custom domain
This workflow was used in our Research on Research event site. It uses hostpoint to provide a custom domain
After Creating and Deploying the Gitlab pages we have the page reachable in the
crsuzh.pages.uzh.ch/ror-eventaddressIn Gitlab menu:
deploy > pages > Domains & Settingstab you can click inadd domainand add two domains: one starting withhttps://and one starting withhttps://www..
- In each of them you will add a DNS specifying the name of your custom domain ALIAS and gitlab domain . And you will get a verification
TXTstring
- In Hostpoint. See picture below
- you will need to add CNAME, A and TXT fields. The first CNAME is linking our gitlab page name to the custom name.
- The A is used to link the custom domain name with the IP of our gitlab page (retrieve the ip by going into the terminal of your computer and typing `nslookup crsuzh.pages.uzh.ch`
- The TXT fields need to include the verification codes obtained in gitlab pages when adding domains.
Convert presentation from Powerpoint to Quarto
Quarto uses pandoc to convert documents across formats. If you use the command in terminal quarto pandoc yourpresentation.pptx -o yourpresentation.qmd -t markdown the resulting .qmd file will not render the slides with nice formatting. In addition, it will miss the hyperlinks! There are some additional files and script you can do to make the automatic conversion relatively OK so that only minimal manual revision is needed:
Note: this will still not convert the animations from the powerpoint.
1. Add some helper files
These files can be used as templates to help the conversion of any presentation
- Use a .lua filter file to help pandoc with some of the conversion. For example this will improve the way images are referred to in the .qmd and remove the slide numbers that appear at the wrong place (slide number is better added with the YAML of the .qmd).
Image = function(el)
el.title = ""
el.caption = {}
return el
end
Para = function(el)
-- Remove lone slide number paragraphs (e.g. "1", "12", "23")
if #el.content == 1 and el.content[1].t == "Str" then
if el.content[1].text:match("^%d+$") then
return {}
end
end
end- Add a file named **_metadata.yaml** in your folder. This will have the
YAMLinformation that will be applied when you render the converted.qmdfile (should be in the same folder). For example you may add this content in the _metadata file:
format:
revealjs:
embed-resources: true
menu: true
pdf: true
navigation-mode: linear
controls: true
smaller: true
auto-stretch: false
progress: true
slide-number: true
footer: "Center for Reproducible Science (CRS)"
css: custom.css #Optional
fig-width: 8
fig-height: 8- Add custom styles, for example:
custom.cssfile. The following example helped prevent images from overflowing the slide:
.reveal img {
max-width: 100%;
max-height: 60vh;
object-fit: contain;
}2. Python code to preserve hyperlinks
This code:
- Extracts hyper links from the powerpoint
- Calls
quarto pandocto convert the PPTX to QMD - Patches the hyperlinks into the QMD file
import subprocess
from pptx import Presentation
import json
from pathlib import Path
# Specify file paths
pptx_file = "yourpresentation.pptx"
qmd_file = "output.qmd"
quarto_path = r"C:\\Program Files\\Quarto\\bin\\quarto.exe"
## Extract links from PPTX
prs = Presentation(pptx_file)
links = []
for slide_index, slide in enumerate(prs.slides, start=1):
for shape in slide.shapes:
if not hasattr(shape, "text_frame"):
continue
for paragraph in shape.text_frame.paragraphs:
for run in paragraph.runs:
text = run.text.strip()
url = run.hyperlink.address
if text and url:
links.append({
"slide": slide_index,
"text": text,
"url": url
})
print("Found links:", len(links))
# Save extracted links (optional for debugging)
Path("links.json").write_text(json.dumps(links, indent=2), encoding="utf-8")
## Convert PPTX using Pandoc from Quarto
# --extract-media=. is used to extract images in the presentation)
subprocess.run(
[quarto_path, "pandoc", pptx_file,"-o", "output.qmd","-t", "markdown","--extract-media=.", "--lua-filter=clean-images.lua"],
check=True,
shell=True)
# Patch the hyperlinks back into QMD
qmd_text = Path(qmd_file).read_text(encoding="utf-8")
for item in links:
text = item["text"]
url = item["url"]
if not text or not url:
continue
# avoid double-wrapping
if f"]({url})" in qmd_text:
continue
qmd_text = qmd_text.replace(text, f"[{text}]({url})", 1)
Path(qmd_file).write_text(qmd_text, encoding="utf-8")
print("Done ->", qmd_file)
3. Render the quarto file
Execute this in the terminal: quarto render output.qmd and manually revise the outputs.


