feat(env): add entity table env

This commit is contained in:
Kristofers Solo 2023-10-30 16:15:08 +02:00
parent 3f8da5d9d2
commit 1ad1d9222a
2 changed files with 28 additions and 0 deletions

View File

@ -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
}

View File

@ -1 +1,2 @@
\input{./src/utils/function-table.tex}
\input{./src/utils/entity-table.tex}