I was wondering whether there is a way to embed a tweet in a LuaTex document so it looks as similar to tweets embedded on websites? (like shown here: https://dev.twitter.com/web/embedded-tweets)

I've found How to cite tweets? and beamer: how to render a tweet?, but was wondering whether there's something that could combine both? (i.e. downloading all the information needed just from the tweet's link, then formatting it to look like a tweet)

  • The first problem you'll encounter with a pure LuaLaTeX solution would be the lack of built-in support for https. As shown in Get cell content from a Google doc spreadsheet using LuaTeX, you'll need an extra luasec library. Assuming you want regular LaTeX and not ConTeXt, it'd just be a matter of how much you want to translate Python code for JSON parsing and such into Lua. – Mike Renfro Sep 27 '15 at 13:45
  • @MikeRenfro it doesn't have to be pure LuaTeX, I noticed that the first link uses Python that's called from LaTeX (but I'm assuming it'd be better to use Lua because it can be called directly from LuaTex?), I'm just looking for some way to insert something that looks like how the tweet would look like on the web, without having to resort to just using manually-made screenshots. – callym Sep 27 '15 at 13:53
  • Take your pick. A Python dependency isn't a big deal on Unix-like systems, so I'd rather have that than rewrite all the Python in Lua. But if you do rewrite that in Lua, you'll still need an external tool like curl that speaks https, or else you'll need to add a Lua library for https support. It's largely a matter of how much you want to automate, and how much you want the solution tied to your particular TeX installation, versus more easily usable by others. – Mike Renfro Sep 27 '15 at 14:33
  • Are you intending for everything to be handled by TeX or is a Makefile more appropriate? – Sean Allred Sep 27 '15 at 14:57
  • @SeanAllred I'm currently using Latexmk in TeXstudio, but I'd be happy learning something else if it'd make it easier/possible – callym Sep 27 '15 at 15:04

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.