Compilateur LaTeX en ligne
www.cpierquet.fr
fichiers/c.pierquet/stockelargeurs.tex
↓ télécharger
%!TEX pdflatex

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage{pas-tableur}
\usepackage{calc}
\usepackage{etoolbox}
\setlength\parindent{0pt}

\NewDocumentCommand\storewidthtolength{ omm }{%
	%increase
	%content
	%macro length
	\ifdeflength{#3}{\settowidth#3{\hbox{#2}}}{\newlength{#3}\settowidth#3{\hbox{#2}}}%
	\IfNoValueF{#1}{\addtolength#3{#1}}%
}

\begin{document}

%optimisation des longueurs
\storewidthtolength[2mm]{\bfseries période}{\pastableurcolA}%
\storewidthtolength[2mm]{\bfseries dette en début de période}{\pastableurcolB}%
\storewidthtolength[2mm]{4\,290,00\,€}{\pastableurcolC}%
\storewidthtolength[2mm]{\bfseries amortissement}{\pastableurcolD}%
\storewidthtolength[2mm]{30\,232,52\,\%}{\pastableurcolE}%
\storewidthtolength[2mm]{\bfseries dette en fin de période}{\pastableurcolF}%

%le tableau
\begin{tikzpicture}
	\tablineheight{1.75em}\tabnumlinewidth{1.75em}
	\tableur*[5]{A/\pastableurcolA,B/\pastableurcolB,C/\pastableurcolC,D/\pastableurcolD,E/\pastableurcolE,F/\pastableurcolF}
	%Ligne 1
	\celtxt[align=center,font={\bfseries},width=\pastableurcolA]{A}{1}{période}
	\celtxt[align=center,font={\bfseries},width=\pastableurcolB]{B}{1}{dette en début de période}
	\celtxt[align=center,font={\bfseries},width=\pastableurcolC]{C}{1}{intérêt}
	\celtxt[align=center,font={\bfseries},width=\pastableurcolD]{D}{1}{amortissement}
	\celtxt[align=center,font={\bfseries},width=\pastableurcolE]{E}{1}{annuité}
	\celtxt[align=center,font={\bfseries},width=\pastableurcolF]{F}{1}{dette en fin de période}
	%reste
	\celtxt[align=center,font={\bfseries},width=\pastableurcolA]{A}{2}{1}
	\celtxt[align=center,font={\bfseries},width=\pastableurcolA]{A}{3}{2}
	\celtxt[align=center,font={\bfseries},width=\pastableurcolA]{A}{4}{3}
	\celtxt[align=center,font={\bfseries},width=\pastableurcolA]{A}{5}{4}
	\celtxt[align=right,font={},width=\pastableurcolB]{B}{2}{110\,000,00\,€}
	\celtxt[align=center,font={},width=\pastableurcolC]{C}{2}{4\,290,00\,€}
	\celtxt[align=center,font={},width=\pastableurcolE]{E}{2}{30\,232,52\,€}
	\celtxt[align=center,font={},width=\pastableurcolE]{E}{3}{30\,232,52\,€}
	\celtxt[align=center,font={},width=\pastableurcolE]{E}{4}{30\,232,52\,€}
	\celtxt[align=center,font={},width=\pastableurcolE]{E}{5}{30\,232,52\,€}
	\celtxt[align=center,font={},width=\pastableurcolF]{F}{2}{84\,057,48\,€}
	\selecCell{F}{5}
\end{tikzpicture}

\end{document}