Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7500511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:12:35+00:00 2026-05-29T20:12:35+00:00

I need to generate a pdf from a tex file, as a temporary file.

  • 0

I need to generate a pdf from a tex file, as a temporary file. However I’m facing an error. I believe it’s due to the fact that the function tools::texi2dvi is just a call for the system command with the same name. Since the Rtmp directory just allow R to create files, I can’t create the pdf file there.

There’s what I’m trying to the, and the error I get:

> tf <- tempfile()
> brew("template.brew", tf)
> tools::texi2dvi(tf)

Error in tools::texi2dvi(tf) : 
    Running 'texi2dvi' on '/tmp/Rtmp9n4JFU/filea5811e6a32a' failed.
Messages:
    /usr/bin/texi2dvi: etex exited with bad status, quitting.

I believe one workaround would be create a new temporary file using tempfile() and ask tools::texi2dvi to write the output on it. However I don’t know if the system is allowed to edit a file. And also, I couldn’t find a way to set tools::texi2dvi output file.

Does anyone know a workaround?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:12:37+00:00Added an answer on May 29, 2026 at 8:12 pm

    TeX is apparently confused by the lack of file extension.
    The following should work.

    tf <- tempfile(fileext=".tex")
    cat(
      "\\documentclass{minimal}\\begin{document}test\\end{document}", 
      file=tf
    )
    tools::texi2dvi(tf)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to automatically generate a PDF file from an exisiting (X)HTML-document. The input
I need to generate a pdf file by adding pages from an already generated
I need to generate a PDF and an Excel file from my ASP.net MVC
I need to generate thumbnails from a set of jpg's that need to have
I need to generate a pdf from Ubecarts orders. I know how to access
I need to dinamicaly generate a PDF from HTML, but I have PDF Support
What I am doing is to generate a pdf booklet from database. I need
I have a project where I need to generate a PDF file. Within this
I've got a project where I need to generate PDF reports from a template.
Is there an easy way to generate a PDF report from an RDL that's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.