Skip to content
Discussion options

You must be logged in to vote

If you use \JSONParseArrayMapInline like in your example, the index can simply be accessed with #1. Of course, this would return 0 for the first item, because indices start with zero per default, but you could change this using zero-based=false:

\documentclass{article}
\usepackage{jsonparse}

\JSONParse[zero-based=false]{\myJSON}{
    {
        "array" : [
            {
                "key_a": "one", 
                "key_b" : "two"
            },
            {
                "key_a": "three", 
                "key_b" : "four"
            }
        ]
    }
}

\begin{document}
\begin{itemize}
    \JSONParseArrayMapInline[zero-based=false]{\myJSON}{array}{
        \item Group #1:
        …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Zumiha
Comment options

@jasperhabicht
Comment options

Answer selected by Zumiha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants