Credits: Based on http://tex.stackexchange.com/a/208824/24794
Compile .tex
file using following command:
# Increase buffer size to support large images
# Setting the environment variable to a higher value works here
export buf_size=99999999999
# To do this permanently, you'll have to update `texmf.cnf` file.
# To know the location of `texmf.cnf` file type following command
kpsewhich texmf.cnf
# On Ubuntu, output is: /etc/texmf/web2c/texmf.cnf
Add/Change following settings/values:
main_memory=6000000
buf_size=9999999
Now you need to run fmtutil-sys --all
. You may have to use sudo for this.
xelatex -interaction=nonstopmode -shell-escape sample_inline_image.tex