From 1ad1d9222a654d4bd4cd01fa8c096f364bf55ef3 Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Mon, 30 Oct 2023 16:15:08 +0200 Subject: [PATCH] feat(env): add entity table env --- src/utils/entity-table.tex | 27 +++++++++++++++++++++++++++ src/utils/index.tex | 1 + 2 files changed, 28 insertions(+) create mode 100644 src/utils/entity-table.tex diff --git a/src/utils/entity-table.tex b/src/utils/entity-table.tex new file mode 100644 index 0000000..a0f403a --- /dev/null +++ b/src/utils/entity-table.tex @@ -0,0 +1,27 @@ +\newenvironment{entityTable}[2]{% + \tabularx{\linewidth}{|X|X|X|X|} + \caption{#1} \label{tab:#2} \\ + + \hline + \textbf{Lauks} & \textbf{Datu tips} & \textbf{Lauka atribūti} & \textbf{Apraksts} \\ \hline + \endfirsthead + + \hline \multicolumn{4}{r}{Turpinājums no iepriekšējās lapas} \\ \hline + \textbf{Lauks} & \textbf{Datu tips} & \textbf{Lauka atribūti} & \textbf{Apraksts} \\ \hline + \endhead + + \hline \multicolumn{4}{r}{Turpinājums nākamajā lapā} \\ \hline + \endfoot + + \hline + \endlastfoot + + \entityTableRow{id}{serial8}{primary key, not null}{Unikālais identifikators} +}{ + \endtabularx +} + + +\newcommand{\entityTableRow}[4]{ + #1 & \uppercase{\texttt{#2}} & \uppercase{\texttt{#3}} & #4 \\ \hline +} diff --git a/src/utils/index.tex b/src/utils/index.tex index 1f0f58d..31620d9 100644 --- a/src/utils/index.tex +++ b/src/utils/index.tex @@ -1 +1,2 @@ \input{./src/utils/function-table.tex} +\input{./src/utils/entity-table.tex}