ausführbarer Code etc.
This commit is contained in:
2025-05-02 19:12:08 +02:00
parent 729cebda55
commit 20784d7701
2 changed files with 62 additions and 17 deletions
+41 -13
View File
@@ -23,6 +23,7 @@
\usepackage{lmodern}
\ifPDFTeX\else
% xetex/luatex font selection
\setmainfont[]{FreeSerif}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
@@ -224,6 +225,10 @@
\usepackage[bidi=default]{babel}
\fi
\babelprovide[main,import]{ngerman}
\ifPDFTeX
\else
\babelfont{rm}[]{FreeSerif}
\fi
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
@@ -316,7 +321,7 @@ schreiben, direkt zu sehen, wie sie aussehen, und sie professionell als
PDF oder HTML zu exportieren. Quarto nutzt LaTeX für den PDF-Export,
lässt sich aber viel leichter bedienen als reines LaTeX.
\begin{tcolorbox}[enhanced jigsaw, rightrule=.15mm, bottomrule=.15mm, coltitle=black, colback=white, toprule=.15mm, colbacktitle=quarto-callout-note-color!10!white, left=2mm, arc=.35mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, opacitybacktitle=0.6, toptitle=1mm, leftrule=.75mm, titlerule=0mm, opacityback=0, breakable, bottomtitle=1mm, colframe=quarto-callout-note-color-frame]
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-note-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-note-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, titlerule=0mm, opacityback=0, rightrule=.15mm]
Dies ist \textbf{kein} Leitfaden zum Schreiben einer wissenschaftlichen
Arbeit, sondern eine Anleitung, wie man Quarto verwendet.
@@ -343,10 +348,10 @@ du die entsprechenden Schritte überspringen.
Lade \href{https://quarto.org/docs/download/}{Quarto} herunter und
installiere es.
\item
Installiere das Jupyter-Paket mit:
\texttt{python3\ -m\ pip\ install\ jupyter\ jupyterlab}
\item
Prüfe die Installation mit: \texttt{quarto\ check\ jupyter}
Wenn du Python-Code direkt im Dokument beim Rendern ausführen willst,
installiere das Jupyter-Paket mit:
\texttt{python3\ -m\ pip\ install\ jupyter} und prüfe die Installation
mit: \texttt{quarto\ check\ jupyter}
\item
Um PDF-Dateien zu exportieren, installiere TinyTeX mit:
\texttt{quarto\ install\ tinytex}
@@ -371,7 +376,7 @@ verwenden}\label{quarto-mit-vs-code-verwenden}
\item
Quarto
\item
Jupyter
Jupyter (nur, wenn Du das Jupyter-Paket installiert hast)
\end{itemize}
\item
Öffne deine \texttt{.qmd}- oder \texttt{.ipynb}-Datei mit VS Code.
@@ -380,7 +385,7 @@ verwenden}\label{quarto-mit-vs-code-verwenden}
Mehr Infos gibt's im \href{https://quarto.org/docs/tools/vscode.html}{VS
Code Kapitel des Leitfadens}.
\begin{tcolorbox}[enhanced jigsaw, rightrule=.15mm, bottomrule=.15mm, coltitle=black, colback=white, toprule=.15mm, colbacktitle=quarto-callout-note-color!10!white, left=2mm, arc=.35mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, opacitybacktitle=0.6, toptitle=1mm, leftrule=.75mm, titlerule=0mm, opacityback=0, breakable, bottomtitle=1mm, colframe=quarto-callout-note-color-frame]
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-note-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-note-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, titlerule=0mm, opacityback=0, rightrule=.15mm]
Die Vorschau in VS Code ist \textbf{nicht live}. Speichere die Datei,
damit sie aktualisiert wird. Wenn Fehler auftreten, versuche den
@@ -413,7 +418,7 @@ Falls du lieber mit RStudio arbeitest:
Mehr Infos im
\href{https://quarto.org/docs/tools/rstudio.html}{RStudio-Leitfaden}.
\begin{tcolorbox}[enhanced jigsaw, rightrule=.15mm, bottomrule=.15mm, coltitle=black, colback=white, toprule=.15mm, colbacktitle=quarto-callout-note-color!10!white, left=2mm, arc=.35mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, opacitybacktitle=0.6, toptitle=1mm, leftrule=.75mm, titlerule=0mm, opacityback=0, breakable, bottomtitle=1mm, colframe=quarto-callout-note-color-frame]
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-note-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-note-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, titlerule=0mm, opacityback=0, rightrule=.15mm]
Auch hier: Änderungen werden erst nach dem Speichern sichtbar.
@@ -434,12 +439,26 @@ verwenden}\label{quarto-mit-jupyterlab-verwenden}
Weitere Infos:
\href{https://quarto.org/docs/tools/jupyter-lab.html}{JupyterLab-Leitfaden}.
\begin{tcolorbox}[enhanced jigsaw, rightrule=.15mm, bottomrule=.15mm, coltitle=black, colback=white, toprule=.15mm, colbacktitle=quarto-callout-note-color!10!white, left=2mm, arc=.35mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, opacitybacktitle=0.6, toptitle=1mm, leftrule=.75mm, titlerule=0mm, opacityback=0, breakable, bottomtitle=1mm, colframe=quarto-callout-note-color-frame]
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-note-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-note-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, titlerule=0mm, opacityback=0, rightrule=.15mm]
Auch hier gilt: Speichern aktualisiert die Vorschau.
\end{tcolorbox}
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-note-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-note-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, titlerule=0mm, opacityback=0, rightrule=.15mm]
JupyterLab ist eine grafische Benutzeroberfläche zum Bearbeiten und
Ausführen von \texttt{.ipynb}-Dateien (Notebooks). Du kannst JupyterLab
als Editor verwenden, um Notebooks mit Quarto zu rendern.
Du darfst den Jupyter-Kernel nicht mit JupyterLab verwechseln. Der
Kernel ist das \emph{Rechenherz} von Jupyter. Er führt den Python-Code
(oder anderen Code, z.\,B. R oder Julia) aus, falls Du mit Quarto
Codeblöcke in .qmd- oder .ipynb-Dateien direkt beim Rendern auszuführen
willst.
\end{tcolorbox}
\subsection{Wechsel zwischen
Dateiformaten}\label{wechsel-zwischen-dateiformaten}
@@ -447,14 +466,14 @@ Du kannst \texttt{.qmd}- und \texttt{.ipynb}-Dateien problemlos
ineinander umwandeln: \texttt{quarto\ convert\ deine\_datei.qmd} oder
\texttt{quarto\ convert\ deine\_datei.ipynb}
\begin{tcolorbox}[enhanced jigsaw, rightrule=.15mm, bottomrule=.15mm, coltitle=black, colback=white, toprule=.15mm, colbacktitle=quarto-callout-note-color!10!white, left=2mm, arc=.35mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, opacitybacktitle=0.6, toptitle=1mm, leftrule=.75mm, titlerule=0mm, opacityback=0, breakable, bottomtitle=1mm, colframe=quarto-callout-note-color-frame]
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-note-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-note-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-note-color}{\faInfo}\hspace{0.5em}{Hinweis}, titlerule=0mm, opacityback=0, rightrule=.15mm]
Die Konvertierung ist \textbf{verlustfrei}. Du kannst frei zwischen den
Formaten wechseln.
\end{tcolorbox}
\begin{tcolorbox}[enhanced jigsaw, rightrule=.15mm, bottomrule=.15mm, coltitle=black, colback=white, toprule=.15mm, colbacktitle=quarto-callout-important-color!10!white, left=2mm, arc=.35mm, title=\textcolor{quarto-callout-important-color}{\faExclamation}\hspace{0.5em}{Wichtig}, opacitybacktitle=0.6, toptitle=1mm, leftrule=.75mm, titlerule=0mm, opacityback=0, breakable, bottomtitle=1mm, colframe=quarto-callout-important-color-frame]
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-important-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-important-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-important-color}{\faExclamation}\hspace{0.5em}{Wichtig}, titlerule=0mm, opacityback=0, rightrule=.15mm]
Wenn du eine \texttt{.qmd}-Datei als PDF speicherst und eine
\texttt{.ipynb}-Datei mit dem gleichen Namen existiert, wird diese
@@ -607,7 +626,7 @@ Ausführbarer Python-Code:
\begin{Shaded}
\begin{Highlighting}[]
\ControlFlowTok{for}\NormalTok{ i }\KeywordTok{in} \BuiltInTok{range}\NormalTok{(}\DecValTok{3}\NormalTok{):}
\BuiltInTok{print}\NormalTok{(}\StringTok{"Hallo Quarto!"}\NormalTok{)}
\BuiltInTok{print}\NormalTok{(}\StringTok{"Hallo Quarto!"}\NormalTok{) }
\end{Highlighting}
\end{Shaded}
@@ -617,6 +636,15 @@ Hallo Quarto!
Hallo Quarto!
\end{verbatim}
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-important-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-important-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-important-color}{\faExclamation}\hspace{0.5em}{Wichtig}, titlerule=0mm, opacityback=0, rightrule=.15mm]
Wenn Du keinen Jupyter-Kernel installiert hast, kannst du das Dokument
so nicht rendern. Wenn du keinen ausführbaren Code für deine Arbeit
brauchst, kannst du den Code-Block einfach löschen, danach kannst du das
Dokument rendern.
\end{tcolorbox}
Code ohne Ausführung, aber mit Syntax-Hervorhebung:
\begin{Shaded}
@@ -785,7 +813,7 @@ Weitere Informationen zum Zitieren und zu Referenzen findest du in
diesem Abschnitt der
\href{https://quarto.org/docs/authoring/footnotes-and-citations.html}{Anleitung}.
\begin{tcolorbox}[enhanced jigsaw, rightrule=.15mm, bottomrule=.15mm, coltitle=black, colback=white, toprule=.15mm, colbacktitle=quarto-callout-tip-color!10!white, left=2mm, arc=.35mm, title=\textcolor{quarto-callout-tip-color}{\faLightbulb}\hspace{0.5em}{Tipp}, opacitybacktitle=0.6, toptitle=1mm, leftrule=.75mm, titlerule=0mm, opacityback=0, breakable, bottomtitle=1mm, colframe=quarto-callout-tip-color-frame]
\begin{tcolorbox}[enhanced jigsaw, left=2mm, coltitle=black, breakable, colframe=quarto-callout-tip-color-frame, leftrule=.75mm, opacitybacktitle=0.6, colback=white, colbacktitle=quarto-callout-tip-color!10!white, arc=.35mm, toprule=.15mm, toptitle=1mm, bottomrule=.15mm, bottomtitle=1mm, title=\textcolor{quarto-callout-tip-color}{\faLightbulb}\hspace{0.5em}{Tipp}, titlerule=0mm, opacityback=0, rightrule=.15mm]
In deiner \texttt{.bib}-Datei (\texttt{assets/literatur.bib}) sollte der
Eintrag für eine Webseite so aussehen: