I have no problems with this slightly changed file:
\documentclass{article}
\usepackage{filecontents}% <-- useful for embedding external files in the main file
\begin{filecontents*}{\jobname.bib}
@MISC{maldives,
author = {Connoly, Darlene},
title = {Controversy in the Maldives},
editor = {Surfline.com},
month = {August},
year = {2012},
url = {http://www.surfline.com/surf-news/maldives-surf-access-controversy-update_75296/},
note = {[Online; posted 27-August-2012]},
}
@MISC{maldives-alt,
author = {Connoly, Darlene},
title = {Controversy in the Maldives},
editor = {Surfline.com},
month = {August},
year = {2012},
note = {\href{http://www.surfline.com/surf-news/maldives-surf-access-controversy-update_75296/}{Surfline.com} {[Online; posted 27-August-2012]}},
}
@MISC{mull,
author = {Mull, Jeff},
title = {Maldives Controversy},
editor = {Surfing Magazine},
month = {September},
year = {2010},
url = {http://www.surfermag.com/features/maldives-controversy/},
note = {[Online; posted 13-September-2012]},
}
\end{filecontents*}
\usepackage{natbib}
\usepackage{url}
\usepackage[colorlinks]{hyperref}
\begin{document}
Please refer to \cite{maldives} and \cite{mull}.
And this citation `hides' the link `in the url portion of the citation': \cite{maldives-alt}.
\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}
You can set minted
to allow line breaks at anywhere. And manfully add empty lines to align the both side text. Took a look if this is what you wanted? let me know if you have any questions:
\documentclass{beamer}
\usepackage{xcolor}
\usepackage{minted}
\begin{document}
\begin{frame}[fragile]{Frame Title}
\begin{columns}[t] % align text from top
\begin{column}{0.5\linewidth}
\begin{scriptsize}
\begin{minted}[
bgcolor=lightgray!20, % add background color
breaklines, % allow line break
breakanywhere, % allow line break at anywhere
]
{c}
{
"public_properties": {
"name": "Name",
"info": "Some Info Here",
"value": 34.5
},
"private properties": {
"id": "12",
"authkey": "aVeryLongKeyThatItSProbablyTooLongToccupyOnlyOneLineAndINeedToShowOn"
"timestamp": "20200101T23:00:00"
"signedonclient": true
}
}
\end{minted}
\end{scriptsize}
\end{column}
\begin{column}{0.5\textwidth}
\begin{scriptsize}
\begin{minted}[
bgcolor=lightgray!20, % add background color
breaklines, % allow line break
breakanywhere, % allow line break at anywhere
escapeinside=@@ % add empty lines using @@
]
{c}
@@
//Public properties
//This is the name
//This is a short information
//This is the actual value
//Private properties
//This is the ID
//This is a very long authentication key
//This is only the timestamp but I'm doing it very long on purpose so the line jump is noticed
//Indicates if the client is signed
@@
\end{minted}
\end{scriptsize}
\end{column}
\end{columns}
\end{frame}
\end{document}
Best Answer
I would recommend against trying to import data directly into LaTeX from a REST/JSON API. This would in any case require outside tools as LaTeX cannot open network connections. I'd suggest to use a language like Python or Ruby to query the API and to transform the JSON data into something that is easier to process with LaTeX.
A great tool for transforming JSON data is jq - I'm using it to trim down JSON data to the bits that I need in a document in combination with Curl to retrieve the data from a REST API.
Here is code using Curl, jq, and the API from above. It emits
which would be easy to parse in LaTeX by creating a command
\geo
.