How to fix LaTeX standalone.cls not found problem on Heroku?

Viewed 1386

I am trying to make a discord bot on Heroku. I wanted to use sympy preview feature on my bot. I used git://github.com/holiture/heroku-buildpack-tex.git build pack. My code is:

x = sympy.symbols('x')
ex = x**2
sympy.prievew(ex, viewer='file', filename='tex.png')

But everytime I run it I get:

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
 restricted \write18 enabled.
entering extended mode
(./texput.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ba
sque, danish, dutch, ukenglish, usenglishmax, finnish, french, german, ngerman,
 swissgerman, hungarian, italian, bokmal, nynorsk, polish, portuguese, spanish,
 swedish, loaded.

! LaTeX Error: File `standalone.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Enter file name:
! Emergency stop.
<read *>

l.2 ^^M

No pages of output.
Transcript written on texput.log.

How to fix this?

I'm just a high school student and making bots for fun. I'm not professional. Sorry if I made any foolish mistake.

2 Answers

The standalone.cls is included in the standalone package, so installing the package should resolve the error.

You can create a file named "texlive.packages" (no file extension) which will automatically install the given packages. I needed the following packages to get preview() to work:

standalone
xkeyval
varwidth
euler
dvipng

You should be able to copy that into "texlive.packages" and your code should work

Related