Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/serve-ximera.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
run: |
ls -alrt
chmod +x xmScripts/xmlatex # Overleaf sync might reset it :-()
# ./xmScripts/xmlatex veryclean testXourses.TODO # TO BE REMOVED
# ./xmScripts/xmlatex veryclean . # TO BE REMOVED
./xmScripts/xmlatex ghaction $XOURSES
echo "✅ Published to $XIMERA_URL$XIMERA_NAME " >> $GITHUB_STEP_SUMMARY

Expand Down
17 changes: 17 additions & 0 deletions examples.TODO/math/math.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@

At this point, we use MathJax to display math.

With \verb|\[ ... \]| :
\[
\frac{\sin^2(x^2+\pi)}{\sigma + 1}
\]

With \verb|$$ ... $$| :
$$
\frac{\sin^2(x^2+\pi)}{\sigma + 1}
$$

With \verb|$ ... $| :
$
\frac{\sin^2(x^2+\pi)}{\sigma + 1}
$


There may be problems with \verb|\d| :
\[
\int f(x) \d x
\]
Expand Down
14 changes: 14 additions & 0 deletions global.css
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,17 @@ e.g. use "P1", "Problem 1", "Prob 1", "Exciting Problem 1", etc.
} */


/* fix \begin{center} for tabular; to be done properly...) */
div.center > .tabular {
/* margin: auto; */
}

/* try to make tabular not full-width by default ... */
div.tabular {
/* width: fit-content; */
/* max-width: max-content; */
}

table.tabular td {
/* padding: 0 15px; */
}
105 changes: 105 additions & 0 deletions table/tableBase.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
\documentclass{ximera}
\title{Tables}

%\input{preamble.tex}% Only add a preamble file if it is actually necessary for the demo/test.
\begin{document}
\begin{abstract}
\end{abstract}
\maketitle

\section{Basic Usage}


With \verb|tabular| (and \verb|center|):
\begin{center}
\begin{tabular}{lr}
x & 1 \\
y & 2 \\
z & 1
\end{tabular}
\end{center}

With \verb|tabular and @{} | (and \verb|center|):
\begin{center}
\begin{tabular}{@{}l@{ }r@{.}}
x & 1 \\
y & 2 \\
z & 1
\end{tabular}
\end{center}

With \verb|tabular and p{} | (and \verb|center|):
\begin{center}
\begin{tabular}{|p{1cm}|p{2cm}|p{3cm}|}
x & 1 & 2\\
y & 2 & 3\\
z & 1 & 4
\end{tabular}
\end{center}

With \verb|array|:
$$
\begin{array}{l|r}
x & 1 \\
\hline
y & 2 \\
z & 1
\end{array}
$$
With \verb|array and @{} and p{}|:
$$
\begin{array}{@{X }l@{|}p{2cm}|}
x & 1 \\
\hline
y & 2 \\
z & 1
\end{array}
$$

\section{Intended Outcome of Test}

The intended outcome section should show what the output of the demo case looks like, without actually using the DemoCom itself.
Any inconsistencies in formating/display should be noted as well as possible here as well, but it is important to not use the
DemoCom itself so that we have an objective ``anticipated output'' to use as a comparison to what is \textit{actually} output in
test.

\section{Start of Test/Demo Area}

This should contain the actual test/demonstration of DemoCom, which can then be compared to the description above to look for
unexpected behavior.

\hrulefill


\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% For copy/paste into new files: %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{ximera}
\title{Template}

%\input{preamble.tex}% Only add a preamble file if it is actually necessary for the demo/test.
\begin{document}
\begin{abstract}

\end{abstract}
\maketitle

{{\Huge \bfseries Last Updated: \today}} \\


\section{Basic Usage}


\section{Intended Outcome of Test}


\section{Start of Test/Demo Area}


\hrulefill


\end{document}
159 changes: 159 additions & 0 deletions table/tabularray.4ht
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
% tabularray.4ht (2025-06-20-11:36), generated from tex4ht-4ht.tex
% Copyright 2022-2025 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
\immediate\write-1{version 2025-06-20-11:36}

\NewConfigure{tabularray}{8}
\NewConfigure{tabularrayignoredcell}{2}
\NewConfigure{tabularrayattributes}[1]{\concat:config\CellAttributes{#1\space}}
\NewConfigure{tabularraystyles}[1]{\concat:config\CellStyle{#1}}
\NewConfigure{tabularraycolumnwidth}{1}

\ExplSyntaxOn
\NewConfigure{tabularrayhalign}[2]{%
\cs_set:cpn{tabularray_halign:#1}{#2}
}

\NewConfigure{tabularrayvalign}[2]{%
\cs_set:cpn{tabularray_valign:#1}{#2}
}
\ExplSyntaxOff

\ExplSyntaxOn
\long\def\:tempa#1#2#3#4{%
% insert <table>...</table>
\a:tabularray\o:__tblr_environ_code:nnnn:{#1}{#2}{#3}{#4}\b:tabularray
}
\HLet\__tblr_environ_code:nnnn\:tempa

\long\def\:tempa#1{\int_set:Nn \c@rownum {#1}\xdef\HRow{\@arabic\c@rownum}\c:tabularray\o:__tblr_build_row:N:{#1}\d:tabularray}
\HLet\__tblr_build_row:N\:tempa
\ExplSyntaxOff

% disable rules
\ht:special{t4ht@_}
\ExplSyntaxOn
% #1 row number, #2 column, #3 hline number (there can be multiple), #4 css property to be set
\def\:tblr:hlinestyle#1#2#3#4{
% get line height
\tl_set:Ne \l__tblr_h_tl{ \__tblr_spec_item:ne { hline } { [#1](#3) / @hline-height } }
% get dash style
\def\@tblr@dash{} % remove "dash" word from the variable for correct CSS string
\tl_set:Ne \l__tblr_f_tl{\__tblr_spec_item:ne { hline } { [#1][#2](#3) / @dash }}
% create CSS only when a dash style is set
\tl_if_empty:NF\l__tblr_f_tl{
% get hline color
\tl_set:Ne \l__tblr_g_tl { \__tblr_spec_item:ne { hline } { [#1][#2](#3) / fg } }
\def\:hlinecolor{\#000000}
% convert color to CSS value if color is set
\tl_if_empty:NF\l__tblr_g_tl{\get:xcolorcss{\l__tblr_g_tl}\:hlinecolor}
% \Configure{tabularraystyles} doesn't expand attributes, so we need to expand it here
% otherwise, we would get wrong color and hline style in the last row, because this macro is called twice here
\cs_set:ce{#4:}{#4:\dim_to_decimal_in_unit:nn{\l__tblr_h_tl*2}{1px}px~\l__tblr_f_tl\space~\:hlinecolor;}
\Configure{tabularraystyles}{\csname#4:\endcsname}
}
}

\def\:tblr:vlinestyle#1#2#3#4{
\tl_set:Ne \l__tblr_t_tl{ \__tblr_spec_item:ne { vline } { [#2](#3) / @vline-width } }
\def\@tblr@dash{} % remove "dash" word from the variable for correct CSS string
\tl_set:Ne \l__tblr_f_tl{\__tblr_spec_item:ne { vline } { [#1][#2](#3) / @dash }}
\tl_if_empty:NF\l__tblr_f_tl{
\tl_set:Ne \l__tblr_g_tl { \__tblr_spec_item:ne { vline } { [#1][#2](#3) / fg } }
\def\:hlinecolor{\#000000}
% convert color to CSS value if color is set
\tl_if_empty:NF\l__tblr_g_tl{\get:xcolorcss{\l__tblr_g_tl}\:hlinecolor}
% \Configure{tabularraystyles} doesn't expand attributes, so we need to expand it here
% otherwise, we would get wrong color and hline style in the last row, because this macro is called twice here
\cs_set:ce{#4:}{#4:\dim_to_decimal_in_unit:nn{\l__tblr_t_tl*2}{1px}px~\l__tblr_f_tl\space~\:hlinecolor;}
\Configure{tabularraystyles}{\csname#4:\endcsname}
}
}
\ExplSyntaxOff

\ExplSyntaxOn
\long\def\:tempa#1#2{%
% find columns that are covered by rowspan and colspan
\xdef\HCol{\@arabic\c@colnum}
\xdef\HRow{\@arabic\c@rownum}
\xdef\HMultispan{\lTblrCellColSpanInt}
\xdef\HRowspan{\lTblrCellRowSpanInt}
\let\CellAttributes\@empty
\let\CellStyle\@empty
% calculate ignored cells, if the current cell uses colspan or rowspan
\int_step_inline:nnn{\c@rownum }{\c@rownum - 1 + \lTblrCellRowSpanInt}{
\int_step_inline:nnn{\c@colnum }{\c@colnum - 1 + \lTblrCellColSpanInt}{
% the loop always matches the current cell, we must ignore it
\str_if_eq:eeF{\HCol.\HRow}{####1.##1}{%
\cs_gset:cpn{ignoredcell-####1-##1}{}
}
}
}
\cs_if_exist_use:c{tabularray_halign:\g__tblr_cell_halign_tl}
\cs_if_exist_use:c{tabularray_valign:\g__tblr_cell_valign_tl}
% the vertical aligment can be set also in \g__tblr_cell_middle_tl, so we should try it as well
\cs_if_exist_use:c{tabularray_valign:\g__tblr_cell_middle_tl}
% calculate column width
\dim_compare:nNnT {\__tblr_data_item:nen{column}{\HCol}{@col-width}} > {0pt}{
\__tblr_get_table_width:% initialize \tablewidth
\edef\HColWidth{\fp_eval:n{\__tblr_data_item:nen{column}{\HCol}{@col-width}/\tablewidth*100}\%}
% save table width, preferably in CSS
\a:tabularraycolumnwidth%
}
% there can be multiple hlines for each cell, but we only suport the first one, because of limitations of CSS
\:tblr:hlinestyle{#1}{#2}{1}{border-top}
\int_compare:nNnT{\HRow + \HRowspan - 1} = {\c@rowcount}{%
% draw hline below the last row
\:tblr:hlinestyle{\int_eval:n{\c@rownum + 1}}{#2}{1}{border-bottom}
}
% the same is true for vlines
\:tblr:vlinestyle{#1}{#2}{1}{border-left}
\int_compare:nNnT{\HCol + \HMultispan - 1} = {\c@colcount}{%
% draw hline below the last row
\:tblr:vlinestyle{#1}{\int_eval:n{\c@colnum + 1}}{1}{border-right}
}
% support for the background color
\tl_set:Ne \l__tblr_b_tl
{ \__tblr_data_item:neen { cell } {#1} {#2} { background } }
% save background color to the list of CSS, if it is set
\tl_if_empty:NF \l__tblr_b_tl{
\get:xcolorcss{\l__tblr_b_tl}\:bgcolor
\Configure{tabularraystyles}{background-color: \:bgcolor;}
}
% We can use something like \Configure{tabularrayattributes}{rowspan="\HRowspan"} in \Configure{tabularray}
% to declare correct attributes for joined cells
\int_compare:nNnT {\HRowspan} > {1}{\g:tabularray}
\int_compare:nNnT {\HMultispan} > {1}{\h:tabularray}
\cs_if_exist:cTF{ignoredcell-\the\c@colnum-\the\c@rownum}{%
\a:tabularrayignoredcell\e:tabularray\o:__tblr_build_cell_content:NN:{#1}{#2}\f:tabularray\b:tabularrayignoredcell
}{%
\e:tabularray\o:__tblr_build_cell_content:NN:{#1}{#2}\f:tabularray
}
% the ignored cell is global, so we must undefine it after the thes
\cs_undefine:c{ignoredcell-\the\c@colnum-\the\c@rownum}%
}
\HLet\__tblr_build_cell_content:NN\:tempa

\HLet\__tblr_get_vcenter_box:N\:gobble


\ExplSyntaxOff

\Hinput{tabularray}
\endinput

Loading