i try to read values from a csv file and propagate it into the package siunitx. But siunitx expects values und no macro code. How can i expand it to the real value? Below the MWE:
Code: Select all
\documentclass[fontsize=12pt,% changed because of the package info in the log fileDIV=14]{scrreprt}\usepackage[english]{babel}\usepackage[binary-units=true, detect-all]{siunitx}[=v2]\usepackage{readarray}\usepackage{xifthen}% siunitx settings\sisetup {exponent-to-prefix = true, % convert exponents into belonging prefixesround-mode = places,scientific-notation = engineering,% try to use next engineering unit instead of '.'per-mode = symbol,per-symbol = /}% Introduces command \csvvalfile[separator]{file.csv} and stores result in \csvvalfield{row, column}%% https://tex.stackexchange.com/questions/562789/how-to-look-up-a-cell-value-of-a-multi-column-csv-file% https://tex.stackexchange.com/questions/301665/error-when-using-num-command-from-siunitx-package-with-an-array-from-arrayjob-p\newcommand{\csvvalfile}[2][]{%% https://stackoverflow.com/questions/2144176/latex-newcommand-default-argument-is-empty\ifthenelse{\isempty{#1}} {%default separator\readarraysepchar{,}} {% else\readarraysepchar{#1}}%\hypercheckbounds\readdef{#2}\csvvaldata\readarray\csvvaldata\csvvalfielddata[-,\ncols]}\newcommand{\csvvalfield}[1]{%\arraytomacro\csvvalfielddata[#1]\csvvalfieldval\csvvalfieldval}