Skip to content

Commit

Permalink
[WIP] Upgrade and clean (#143)
Browse files Browse the repository at this point in the history
* add GH action (that will fail)

* caching

* star

* at least one successful test to create cache

* add extra packages

* non mais ...OH!

* fix all other tests

* exemple of complex tables

* parbox in Quotation (fix #141)

* use new member URL (fix #136)

* no more bsc on authors (fix #100)

* correct iframe color

* I indeed forgot to texlua
  • Loading branch information
pierre-24 authored Apr 23, 2024
1 parent c27f576 commit 882fb8f
Show file tree
Hide file tree
Showing 12 changed files with 160 additions and 134 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Run tests

env:
TEXMFDIR: ${HOME}/.texlive/texmf-local/tex/latex/

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install dependencies
run: |
sudo apt-get install imagemagick librsvg2-bin
pip install Pygments
- name: Use cache
id: cache-install
uses: actions/cache@v3
with:
path: |
~/.texlive
key: texlive
- name: Set up TeXLive
run: |
./scripts/install_font.sh
./scripts/install_texlive.sh
echo "PATH=${HOME}/.texlive/bin/x86_64-linux:$PATH" >> $GITHUB_ENV
- name: Set up template
run: |
mkdir -p ${{ env.TEXMFDIR }}
ln -s ${PWD} ${{ env.TEXMFDIR }}/latex-template
texhash
- name: Test Lua
run: |
cd tests
make lua-test
- name: Test LaTeX
run: |
cd tests
make simple-test
make author-test
make images-test
make nocolor-test
make big-test
make big-toc-test
- name: Remove template from TeXLive before caching
run: |
rm ${{ env.TEXMFDIR }}/latex-template
texhash
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

15 changes: 14 additions & 1 deletion documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ A \LaTeX command.

## Float environments

In addition to standard float (`table`, `figure`), the `equationFloat` could be used to have mathematics floats or to add a caption to an equation.
In addition to standard float (`figure`), the `equationFloat` could be used to have mathematics floats or to add a caption to an equation.

```latex
\[
Expand All @@ -174,6 +174,19 @@ In addition to standard float (`table`, `figure`), the `equationFloat` could be
\captionof{equationfloat}{A sum}
```

## Tabl

This template now relies on [`tabularray`](https://github.com/lvjr/tabularray), and one should thus use the specific `zdstblr` environment to create table.

```latex
\begin{zdstblr}{ccc}
element & element & element\\
element & element & element\\
element & element & element\\
\end{zdstblr}
\captionof{table}{Légende du tableau}
```

## Appendices

To add an appendix, use the `Appendix` environment. Appendix will be grouped in order of apparition at the end of the document.
4 changes: 0 additions & 4 deletions scripts/install_texlive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ function install_texlive {
$HOME/.texlive/bin/x86_64-linux/tlmgr update --self
$HOME/.texlive/bin/x86_64-linux/tlmgr install $EXTRA_PACKAGES

# Install tabu-fixed packages
mkdir -p $HOME/.texlive/texmf-local/tex/latex/tabu
wget -P $HOME/.texlive/texmf-local/tex/latex/tabu https://raw.githubusercontent.com/tabu-issues-for-future-maintainer/tabu/master/tabu.sty

# save list of extra packages
printf "$EXTRA_PACKAGES" > $EXTRA_PACKAGES_CACHE

Expand Down
2 changes: 2 additions & 0 deletions scripts/packages
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ xfor
xifthen
xpatch
xstring
tabularray
ninecolors
2 changes: 0 additions & 2 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ help:
@echo " help to get this help"

%.pdf: %.tex
export TEXINPUTS=".:../:$${TEXINPUTS}";\
export LUAINPUTS=".:../:$${LUAINPUTS}";\
$(TEX) $(TEXFLAGS) $(DRAFTFLAG) $<;\
$(TEX) $(TEXFLAGS) $(DRAFTFLAG) $<;\
makeglossaries $(basename $<); \
Expand Down
114 changes: 59 additions & 55 deletions tests/test.tex
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@

\begin{Quotation}[Clem]
Zeste de Savoir, la connaissance pour tous et sans pépins \smiley{diable}

Avec des vrais morceaux de paragraphe dedans !
\end{Quotation}

La suite, avec des touches \keys{CTRL + A}. Et on peut avoir une ligne avec
Expand Down Expand Up @@ -202,53 +204,55 @@

Et finalement, un tableau:

\begin{longtabu}{|c|c|c|} \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
\caption{Légende}
\end{longtabu}
\begin{zdstblr}{ccc}
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
\end{zdstblr}
\captionof{table}{Légende du tableau}


Notons que si une image est dans un tableau, elle est redimensionnée si elle est trop grande.
De même la largeur des lignes horizontales est adaptée si on est dans un tableau.
De plus, on peut faire des tableaux compliqués, avec de la fusion de ligne ou de colonnes, et même des paragraphes
dans les cases du tableau.

\begin{longtabu}{|m{\dimexpr(\linewidth) / 3}|m{\dimexpr(\linewidth) / 3}|m{\dimexpr(\linewidth) / 3}|} \hline
1 - 1 & \multirow{2}{*}{\parbox{\linewidth}{\centering 1 - 2 \endgraf 2 - 2}} & 1 \par 32 \par 4 \\ \cline{1-1} \cline{3-3}
\rowfont[l]{}
2 - 1 & & 2 - 3 \\ \hline
\rule{\linewidth}{1.0pt} & 3 - 2 & 3 - 3 \\ \hline
\end{longtabu}
\begin{zdstblr}{colspec={X[-1] X[-1] X[-1] X[-1]},rowhead=1,row{1}={font=\bfseries}}
Header 1 & Header 2 & Header 3 & Header 4 \\
Cell 1 & Cell 2 & Cell 3 & Cell 4 \\
Cell 5 & Cell 6 & Cell 7 & Cell 8 \\
\end{zdstblr}

\begin{longtabu}{|m{\dimexpr(\linewidth) / 3}|m{\dimexpr(\linewidth) / 3}|m{\dimexpr(\linewidth) / 3}|} \hline
Colonne 1 & Colonne 2 & \inlineImage{test-images/logo.png} \\ \hline
\rule{\linewidth}{1.0pt} & 3 - 2 & 3 - 3 \\ \hline
\end{longtabu}
\begin{zdstblr}{colspec={X[-1] X[-1] X[-1] X[-1]},rowhead=2,row{1,2}={font=\bfseries}}
\SetCell[c=2]{l} Table Headings & & Here \\
Sub & Headings & Too \\
\SetCell[r=2]{l} cell \endgraf spans \endgraf rows & \SetCell[c=2]{l} column spanning & \\
& normal & cell \\
multi \endgraf line \endgraf \endgraf cells \endgraf too & \SetCell[c=2]{l} cells can be \endgraf \textit{formatted} \endgraf \textbf{paragraphs} & \\
\end{zdstblr}


\begin{Spoiler}
Expand All @@ -268,14 +272,14 @@

Et un tableau:

\begin{longtabu}{|c|c|c|} \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
\caption{Légende du tableau}
\end{longtabu}
\begin{zdstblr}{ccc}
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
\end{zdstblr}
\captionof{table}{Légende du tableau}

Et une citation:

Expand Down Expand Up @@ -324,14 +328,14 @@
ou des tableaux
\footnote{Exemple de note
\begin{Appendix}
\begin{longtabu}{|c|c|c|} \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
element & element & element\\ \hline
\caption{Légende du tableau}
\end{longtabu}
\begin{zdstblr}{ccc}
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
element & element & element\\
\end{zdstblr}
\captionof{table}{Légende du tableau}
\end{Appendix}
où il y a un tableau
} ;
Expand Down
10 changes: 5 additions & 5 deletions tests/testlua.lua.expected
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
% --- Test authors
% one author:
\href{/Eskimon/}{\color{titlePageAuthorColor}\bsc{Eskimon}}\\
\href{Eskimon}{\color{titlePageAuthorColor}{Eskimon}}\\
% three authors:
\href{/Karnaj/}{\color{titlePageAuthorColor}\bsc{Karnaj}}\\,\href{/Heziode/}{\color{titlePageAuthorColor}\bsc{Heziode}}\\,\href{/pierre_24/}{\color{titlePageAuthorColor}\bsc{pierre_24}}\\
\href{Karnaj}{\color{titlePageAuthorColor}{Karnaj}}\\,\href{Heziode}{\color{titlePageAuthorColor}{Heziode}}\\,\href{pierre_24}{\color{titlePageAuthorColor}{pierre_24}}\\
% one author with link:
\href{http://test.com/author/Eskimon/}{\color{titlePageAuthorColor}\bsc{Eskimon}}\\
\href{http://test.com/authorEskimon}{\color{titlePageAuthorColor}{Eskimon}}\\
% one author with long name:
\href{/that_author_with_a_very_long_name/}{\color{titlePageAuthorColor}\bsc{that_author_...}}\\
\href{that_author_with_a_very_long_name}{\color{titlePageAuthorColor}{that_author_with_a_ver...}}\\
% one author with long name (but in author list, so full name):
\href{/that_author_with_a_very_long_name/}{\color{titlePageAuthorColor}\bsc{that_author_with_a_very_long_name}}\\
\href{that_author_with_a_very_long_name}{\color{titlePageAuthorColor}{that_author_with_a_very_long_name}}\\
% --- Test abbrv
AT(amp)T
pierre(und)24
Expand Down
3 changes: 0 additions & 3 deletions tests/travis.patch

This file was deleted.

5 changes: 0 additions & 5 deletions tobi.txt

This file was deleted.

Loading

0 comments on commit 882fb8f

Please sign in to comment.