function pri_tex(x,s,lbl)

if nargin<2
    a=floor(log10(max(max(abs(x)))+0.1))+1;
    if a>0
        b=a+3;
        s=[num2str(b+3) '.3'];
    else
        b=2-a;
        s=[num2str(b+6) '.' num2str(b+3)];
    end
end

[k1,k2]=size(x);

formatSpec = ['&  $%' s 'f $ '];
for i1=1:k1
    fprintf(lbl{i1})
    for i2=1:k2
        fprintf(formatSpec,x(i1,i2))
        if i2*3==k2 || i2*3==k2*2
            fprintf(' & ')
        end
    end
    fprintf(' \\\\ \n')
end
end
    