Questions tagged [json]

JSON (JavaScript Object Notation) is a 100% textual data interchange format originally inspired by JavaScript objects. It is widely used in RESTful web services. Parsers for JSON exist in nearly all languages, and libraries also exist which can deserialize JSON to native objects or serialize native objects to JSON.

Filter by
Sorted by
Tagged with
2 votes
2 answers
105 views

Define categorized, changeable variables for use throughout a document

TL;DR How do I print categorized and subcategorized values declared in a JSON file (or in some similar type of file) inside of a LaTeX document? In my document, I am assigning a bunch of values to ...
  • 203
0 votes
0 answers
63 views

use bibjson with latex

I'm trying to use bibjson for a LaTeX document. Here are my files: ecm.tex \documentclass{article} \begin{document} Hello \cite{foo_ref}. \bibliographystyle{unsrtnat} \bibliography{ecm} \...
0 votes
1 answer
55 views

Add two text column into a frame

I'm new to Latex and to Lyx as well. I'm trying to create a frame in Lyx containing 2 columns, the first one being JSON formatted text, and the second one being comments of the lines of the fist ...
  • 103
0 votes
0 answers
43 views

Having trouble compiling and running basic pythontex code

I am new to latex and python. I am trying to run a very simple pythontex program in VS Code in Windows 10. I am getting the error message (pop up) "Cannot read properties of undefined (reading '...
0 votes
0 answers
54 views

Including citations in equations when converting LaTeX to Word with pandoc

I have the following example document: \documentclass[10pt,a4paper]{article} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amssymb} \usepackage{makeidx} \...
  • 1,691
0 votes
0 answers
77 views

Unable to read a 'second' json file from inside a 'for' loop (Lua+Latex)

I'm looping through a json file and displaying content in the format below: Zone 1 Projection(Main.tex) Grat Table(gratsection.tex) Zone 2 Projection (Main.tex) Grat table (gratsection....
  • 37
2 votes
1 answer
185 views

Dynamic tikz bar plot from JSON data

I have JSON file that looks something like this { "data": [ { "type": "SENIOR", "male": 350000.0, "female": 225000.0 ...
  • 131
1 vote
0 answers
154 views

(Lualatex)How to loop over an array of JSON objects

How do I loop over MP in the JSON below and print the key/value of the objects into a table? { "MP": [ { "A": "A1" }, { "B": &...
  • 37
0 votes
1 answer
77 views

Split table cell to multiple rows based on array length and PRESERVE ORDER

I'm reading a json file and writing to table but want to split one cell of the table based on the number of values in the array..How do I achieve this inside Lua? using JSON.lua package by Jeffrey ...
  • 37
1 vote
0 answers
647 views

It takes long time to built file

I made this file: \documentclass[uplatex, dvipdfmx]{jsarticle} \begin{document} \LaTeX \begin{equation} x^2 + y^2 = 5 \end{equation} \begin{equation} x^2 + y^2 = 13 \end{equation} \end{...
5 votes
1 answer
743 views

How to plot data from json

Given a json file in the following format: "name":"list_of_xy_values", "data":[[1,2],[2,4],[3,6],[4,3],[5,0]] I'd like to import data to my document to plot it with tikz/...
  • 259
1 vote
0 answers
2k views

LaTeX listings package JSON formatting

I am using package listings for JSON data. I am following this example How to improve listings display of JSON files from this stackexchange answer. It generates the following output: I added caption ...
  • 113
1 vote
2 answers
519 views

How to convert a nested array in a json file into a matrix and a table in LaTeX

I would like to read a nested array such as the following in a json file into the LaTeX and convert it into a matrix with each base array becoming a row, and a table with each base array becoming a ...
  • 115
0 votes
1 answer
508 views

Templating with Scriban

I want to create a PDF with dynamic data from a JSON object. I'm vaguely familiar with LaTeX and minimally familiar with Templating Engines and I'm struggling with how to implement the engine and ...
  • 171
2 votes
1 answer
578 views

LaTeX3 - Read Json as Input in LaTeX3

I would like to generate LaTeX template based on JSON Input. It is possible to take JSON as input in LaTeX3 and create LaTeX template? I had the solutions are found in LuaLaTeX. Ways to parse JSON in ...
  • 95
0 votes
0 answers
131 views

How to write in arabic using lstlinsting for the JSON and XML environment?

I'm an IT developer, and for some reason I've JSON and XML to make in report but with Arabic. For JSON and XML environment I'm using this: \documentclass{report} \usepackage[latin1]{inputenc} \...
5 votes
0 answers
2k views

Highlight JSON code snippet with minted

I have a JSON code snippet that I like to include into my LaTeX document: "builders": [ { "type": "test", "image": "ubuntu:latest", "changes": [ "EXPOSE 123 ...
  • 267
3 votes
1 answer
3k views

How to loop over the JSON object / list?

I want to loop over section in the following JSON and print name the number of times it appears under section. How could I do this? { "ID": "23", "section": [ { "name": "A", ...
  • 377
0 votes
1 answer
468 views

Error as I try to read and display the results from JSON file [closed]

I am trying to read a JSON file and trying to display some of its content. But as I try this, I get an error saying attempt to call a nil value as also shown below. I could not understand the reason ...
  • 377
1 vote
1 answer
125 views

Word wrap 64 character hexadecimal strings in verbatim JSON

I'd like to document example requests/replies in our protocol per How to write narrative documentation. We're using the texlive-latex-base on Ubuntu for our documentation, and I'm linting with lacheck ...
  • 141
1 vote
1 answer
1k views

How to assign variables from a [json|yaml|toml] file

I have two Latex files for a weekly document I create. template.tex contains a large list of variables that get changed each week: \newcommand{\var}{foo} \newcommand{\othervar}{bar} Then the ...
1 vote
0 answers
138 views

Make Asymptote read YAML or JSON files

I often write my data-files from simulations written in Python or C++ in json on yaml files. I recently heard about the asymptote software which can be used for really 2d and 3d plotting. Is it ...
4 votes
2 answers
2k views

Load fields from JSON file using LuaLatex

I want to load a lot of numbers in my document from a single JSON file that is returned from a simulation. To do that I so far followed this stackexchange answer but for multiple values I would have ...
  • 171
3 votes
1 answer
785 views

Parse JSON for Dropbox path

I keep all my tex files in a Dropbox directory, but different computers (all Windows-based) have different user names, so I would like to define a command in my template that is the Dropbox path, to ...
  • 207
6 votes
1 answer
16k views

Simple coloring of json attributes

Could someone please explain me how I can color the json attributes for a json string in listing? An example would be great. Thanks. Example String: {"name1":"attribute1","name2":"attribute2"}. How ...
  • 173
0 votes
1 answer
282 views

How to fix or change randomly marked json snippet?

So my problem is that my json snippets are marked red, but I don't want to mark them red. How my JSON looks like: [ {obj1} {obj2} {obj3} ] And my snippet looks like: [ {obj1} ... ] And that ... ...
  • 131
5 votes
1 answer
3k views

Dynamic Table based on Json File

I'm trying to add in a dynamic table based on a two-dimensional array that is stored as JSON in a file on the disk. I've got no control of the file, as it gets pulled in from a web-service and ...
  • 153
5 votes
1 answer
1k views

make all values of the JSON format red

I am using the latex beamer and trying to get the true value of the flag key in the JSON format red too but I am just getting it black as shown in the screen shot below. How can I get it red too? ...
  • 839
4 votes
2 answers
3k views

API JSON in Latex

I want to know if it's possible to get data from a website using api json in a document .tex I want to do this without luatex because the idea is compile online with the sharelatex website, that does'...
7 votes
7 answers
17k views

Convert RIS or NBIB or JSON to bibtex?

This article is not in Google Scholar, and they offer citations in RIS, NBIB, and JSON. So the big question is, how can I convert this to bibtex? Here is how it looks in JSON: {"source":&...
22 votes
4 answers
16k views

Ways to parse JSON in LaTeX?

I'm writing my recipes (food) in a small textfile in JSON. Are there any ways to parse this in LaTeX? I know, that are lots of templates dealing with recipes, but I want to have my own style, which ...
1 vote
0 answers
1k views

How can I typeset JSON code with the listings package? [duplicate]

I got this error with the listings package (v 1.5c). Should I install the language manually? ! Package Listings Error: Couldn't load requested language. See the Listings package documentation for ...
  • 4,474
9 votes
2 answers
9k views

How can I highlight JSON string values but not attributes?

example { "name" : "alan", "alias" : "nala" } If I use morecomment=[s][\color{red}]{"}{"}, How can I highlight JSON string values (on the right side) but not the attributes (left side)?
50 votes
2 answers
77k views

How to improve listings display of JSON files?

I was wondering if there is a good way for JSON files to be listed with the listings package. The only language definition I could come up with, is this: \lstdefinelanguage{json} { morestring=[b]...
  • 3,425