Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kdb get from latex #2612

Open
markus2330 opened this Issue Apr 9, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@markus2330
Copy link
Contributor

markus2330 commented Apr 9, 2019

It would be nice to be able to query KDB from within LaTeX documents.

I would like to have something like:

\documentclass{article}
\usepackage{xifthen}
\usepackage{elektra}

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

\ifthenelse{\kdbistrue{user/tests/examples}}%
        {true}%
        {false}

\ifthenelse{\kdbisnull{user/tests/examples}}%
        {key value is empty}%
        {key value is not empty}

\ifthenelse{\kdbispresent{user/tests/examples}}%
        {key is present}%
        {key is not present}

% should play well with standard xifthen features (like equal):
\ifthenelse{\equal{\kdb{user/tests/examples}}{something}}%
        {something}%
        {not something}
\end{document}

What I tried so far:

\documentclass{article}
\usepackage{xifthen}

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

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

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

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

\ifthenelse{\isempty{\var}}}% does not work
        {empty}%
        {not empty}
\end{document}
@kodebach

This comment has been minimized.

Copy link
Contributor

kodebach commented Apr 9, 2019

Maybe this helps?

@markus2330

This comment has been minimized.

Copy link
Contributor Author

markus2330 commented Apr 9, 2019

Thank you for the tip, unfortunately I still get "undefined control sequence" errors. (Except for isin and isempty, which always return false.)

@markus2330

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.