Skip to content

Commit

Permalink
Convert pdf images to svg (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact authored Jan 27, 2025
1 parent 0fc3da2 commit 27d1777
Show file tree
Hide file tree
Showing 29 changed files with 5,916 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Shakefile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
removeFilesAfter "_build" ["//*"]

"_build/hydra-spec" <.> "pdf" %> \out -> do
assets <- getDirectoryFiles "src" ["//*.sty", "Hydra/Protocol/Figures/*.pdf", "//*.bib", "//*.ttf"]
assets <- getDirectoryFiles "src" ["//*.sty", "Hydra/Protocol/Figures/*.svg", "//*.bib", "//*.ttf"]
need ["_build/latex" </> c | c <- assets]

srcs <- getDirectoryFiles "src" ["//*.lagda", "//*.tex"]
Expand All @@ -23,7 +23,7 @@ main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
cmd_ "cp _build/latex/Main.pdf _build/hydra-spec.pdf"

-- Copy assets
forM ["sty", "pdf", "bib", "ttf"] $ \ext ->
forM ["sty", "svg", "bib", "ttf"] $ \ext ->
("_build/latex//*." <> ext) %> \out -> do
let src = "src" </> dropDirectory1 (dropDirectory1 out)
copyFile' src out
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
nativeBuildInputs = with pkgs; [
(agdaPackages.withPackages agdaLibraries)
(haskellPackages.ghcWithPackages (p: [ p.shake ]))
inkscape
texlive.combined.scheme-full
];
meta = { };
Expand Down
Binary file removed src/Hydra/Protocol/Figures/abortTx.pdf
Binary file not shown.
731 changes: 731 additions & 0 deletions src/Hydra/Protocol/Figures/abortTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/closeTx.pdf
Binary file not shown.
243 changes: 243 additions & 0 deletions src/Hydra/Protocol/Figures/closeTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/collectComTx.pdf
Binary file not shown.
793 changes: 793 additions & 0 deletions src/Hydra/Protocol/Figures/collectComTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/commitTx.pdf
Binary file not shown.
600 changes: 600 additions & 0 deletions src/Hydra/Protocol/Figures/commitTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/contestTx.pdf
Binary file not shown.
258 changes: 258 additions & 0 deletions src/Hydra/Protocol/Figures/contestTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/decrementTx.pdf
Binary file not shown.
451 changes: 451 additions & 0 deletions src/Hydra/Protocol/Figures/decrementTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/deposit-tx.pdf
Binary file not shown.
343 changes: 343 additions & 0 deletions src/Hydra/Protocol/Figures/depositTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/fanoutTx.pdf
Binary file not shown.
193 changes: 193 additions & 0 deletions src/Hydra/Protocol/Figures/fanoutTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/incrementTx.pdf
Binary file not shown.
839 changes: 839 additions & 0 deletions src/Hydra/Protocol/Figures/incrementTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/initTx.pdf
Binary file not shown.
645 changes: 645 additions & 0 deletions src/Hydra/Protocol/Figures/initTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/recover-tx.pdf
Binary file not shown.
281 changes: 281 additions & 0 deletions src/Hydra/Protocol/Figures/recoverTx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Hydra/Protocol/Figures/utxo-graph.pdf
Binary file not shown.
523 changes: 523 additions & 0 deletions src/Hydra/Protocol/Figures/utxo-graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions src/Hydra/Protocol/OnChain.tex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ \subsection{Init transaction}\label{sec:init-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/initTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/initTx.svg}
\caption{\mtxInit{} transaction spending a seed UTxO, and producing the head
output in state $\stInitial$ and initial outputs for each participant.}\label{fig:initTx}
\end{figure}
Expand Down Expand Up @@ -177,7 +177,7 @@ \subsection{Commit Transaction}\label{sec:commit-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/commitTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/commitTx.svg}
\caption{\mtxCom{} transaction spending an initial output and a single
committed output, and producing a commit output.}\label{fig:commitTx}
\end{figure}
Expand Down Expand Up @@ -243,7 +243,7 @@ \subsection{Abort Transaction}\label{sec:abort-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/abortTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/abortTx.svg}
\caption{\mtxAbort{} transaction spending the $\stInitial$ state head
output and collecting all initial and commit outputs, which get reimbursed
by outputs $o_{1} \dots o_{m}$. Note that each $\pt$ may be in either, an
Expand Down Expand Up @@ -320,7 +320,7 @@ \subsection{CollectCom Transaction}\label{sec:collect-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/collectComTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/collectComTx.svg}
\caption{\mtxCCom{} transaction spending the head output in $\stInitial$
state and collecting from multiple commit outputs into a single
$\stOpen$ head output.}\label{fig:collectComTx}
Expand Down Expand Up @@ -368,7 +368,7 @@ \subsection{Deposit Transaction}\label{sec:deposit-tx}
\]
\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/deposit-tx}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/depositTx.svg}
\caption{\mtxDeposit{} transaction spending multiple UTxO into a deposit
output.}\label{fig:depositTx}
\end{figure}
Expand Down Expand Up @@ -403,7 +403,7 @@ \subsection{Recover Transaction}\label{sec:recover-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/recover-tx}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/recoverTx.svg}
\caption{\mtxRecover{} transaction restoring UTxO of a deposit
output.}\label{fig:recoverTx}
\end{figure}
Expand Down Expand Up @@ -480,7 +480,7 @@ \subsection{Increment Transaction}\label{sec:increment-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/incrementTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/incrementTx.svg}
\caption{\mtxIncrement{} transaction spending an open head output,
producing a new head output which includes the new UTxO.}\label{fig:incrementTx}
\end{figure}
Expand Down Expand Up @@ -533,7 +533,7 @@ \subsection{Decrement Transaction}\label{sec:decrement-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/decrementTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/decrementTx.svg}
\caption{\mtxDecrement{} transaction spending an open head output,
producing a new head output and multiple decommitted outputs.}\label{fig:decrementTx}
\end{figure}
Expand All @@ -550,7 +550,7 @@ \subsection{Close Transaction}\label{sec:close-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/closeTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/closeTx.svg}
\caption{\mtxClose{} transaction spending the $\stOpen$ head output and producing a $\stClosed$ head output.}\label{fig:closeTx}
\end{figure}

Expand Down Expand Up @@ -686,7 +686,7 @@ \subsection{Contest Transaction}\label{sec:contest-tx}
\end{itemize}

\begin{figure}
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/contestTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/contestTx.svg}
\caption{\mtxContest{} transaction spending the $\stClosed$ head output and
producing a different $\stClosed$ head output.}\label{fig:contestTx}
\end{figure}
Expand Down Expand Up @@ -825,7 +825,7 @@ \subsection{Fan-Out Transaction}\label{sec:fanout-tx}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{Hydra/Protocol/Figures/fanoutTx.pdf}
\includesvg[width=0.8\textwidth]{Hydra/Protocol/Figures/fanoutTx.svg}
\caption{\mtxFanout{} transaction spending the $\stClosed$ head output and
distributing funds with outputs $o_{1} \dots o_{m+n+n'}$.}\label{fig:fanoutTx}
\end{figure}
Expand Down
2 changes: 1 addition & 1 deletion src/Hydra/Protocol/Preliminaries.tex
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ \subsection{Extended UTxO}\label{sec:eutxo}

\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{Hydra/Protocol/Figures/utxo-graph.pdf}
\includesvg[width=0.5\textwidth]{Hydra/Protocol/Figures/utxo-graph.svg}
\caption{Example of a plain UTxO graph}\label{fig:utxo-graph}
\end{figure}

Expand Down
1 change: 1 addition & 0 deletions src/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
\usepackage[font=small]{caption}
\usepackage[many]{tcolorbox} % for COLORED BOXES

\usepackage{svg}
\usepackage{authblk}

% footnotes in table and tabular
Expand Down

0 comments on commit 27d1777

Please sign in to comment.