In my exemple I want to put two lists together, and order them
\def\Wmax{10^8}
\def\Wmin{.01}
\def\mySamplLst{\Wmin}
\xdef\mySamplNb{10}
\pgfmathparseFPU{(\Wmax/\Wmin)^(1/\mySamplNb)}
\xdef\myStep{\pgfmathresult}
\foreach \i in {1,2,...,\mySamplNb} {\pgfmathparseFPU{\Wmin*(\myStep^(\i))}
\xdef\mySamplLst{\mySamplLst,\pgfmathresult}}
\def\mySamplNb{10}
\def\mySamplCenter{10}
\def\mySamplwidth{2}
\pgfmathparseFPU{\mySamplwidth^(1/\mySamplNb)}
\xdef\myStep{\pgfmathresult}
\foreach \i in {-\mySamplNb,...,-1,0,1,2,...,\mySamplNb} {\pgfmathparseFPU{\mySamplCenter*(\myStep^(\i))}
\xdef\mySamplLst{\mySamplLst,\pgfmathresult}}
\mySamplLst
It gives of something like : once you're done rounding up.
.01,0.1,1,10,100,1000,10000,100000,1000000,10000000,100000000,5,5,5,6,6,7,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19
if you want to know I'm going to use that list in a samples at= for a semilog plot
- Would you know a way to order that list ?
That seems like a straight forward request, it should be the simplest \sort{s,o,r,t,e,d} giving out a list containing {d,e,o,r,s,t} but noooooo... I've been wandering aimlessly between post on sorting specific objects and documentation of l3sort which give no working example...
Ok I can stop this rant...
Thank you for your time.
(I am seriously thinking of giving up on latex calculation and start using python to generate latex, since every little task seems to require 1 day of work, an acquaintance that speaks in latex source code as a first language or prepare a readable question on here and wait for generous experts.)
Yes, I know about Sorting a list of randomly generated numbers and I can't understand what's done.
P.S. : And you know what, if I put the code I gave, without the last line that displays the list, inside my standalone document, it actually takes some space... It's just calculations, no displays, and still it takes space on the document... I swear sometimes I think LaTeX is intentionally made to drive people crazy.
%, but it's likely easier to either do the work in the preamble or perhaps if absolutely necessary between paragraphs. – Joseph Wright May 06 '21 at 13:40