It would like to call the kdb command from Elektra from within LaTeX documents and use its output to write LaTeX conditionals.

Ideally, I would like to have something like:


user/tests/examples is \kdb{user/tests/examples}


        {key value is empty}%
        {key value is not empty}

        {key is present}%
        {key is not present}

% should play well with standard xifthen features (like equal):
        {not something}

What I tried so far:


\def \var {\input|"kdb sget user/tests/examples 0"}

X\var{}X %works but adds additional spaces

\ifthenelse{\isin{0}{\var}}% does not work

\ifthenelse{\equal{\var}{1}}% does not work
        {is 1}%
        {is not 1}

\ifthenelse{\isempty{\var}}}% does not work
        {not empty}

Unfortunately I get "undefined control sequence" errors, except for the conditionals which use isin and isempty, which always return false.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.