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}