Text Formattingopen and compile a tex document from another program

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
mpaudel
Posts: 3
Joined: Thu Feb 17, 2011 12:43 am

open and compile a tex document from another program

Post by mpaudel »

Hi All,
I am pretty new to this community and LaTex itself. I have created an Excel macro that is used to collect employee info and it writes out a .tex file. what I am trying to do and not being able is to compile the .tex file by calling the latex compiler from within Excel. I am a windows user and have been using LED and/or Texnic Center
any help will be greatly appreciated.
Last edited by mpaudel on Thu Feb 24, 2011 6:03 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
coachbennett1981
Posts: 269
Joined: Fri Feb 05, 2010 10:15 pm

Re: open and compile a tex document from another program

Post by coachbennett1981 »

Can you put up the file and also the error message. What steps are you using to try to compile the file?
I have never heard of excel being able to compile a latex file. I know you can save excel files as .csv and use them in some packages (pstricks).

Nick
mpaudel
Posts: 3
Joined: Thu Feb 17, 2011 12:43 am

Re: open and compile a tex document from another program

Post by mpaudel »

Nick,
Thanks for your reply. I am not compiling the .tex file with Excel :) in fact I am using Excel to create the .tex file (by writing out the data in the spreadsheets to a text file... properly formatted and ready to use in LaTex).
I can open .tex compilers such as LED or Texnic center manually and compile the file I write out but I am trying to open the compilers using Excel macro and have it compiled automatically os that the whole process can be automated.
Hope I am making more sense here :-)
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Re: open and compile a tex document from another program

Post by localghost »

So this seems to be more an issue with Excel than with LaTeX. If so, you are not in the right forum and should ask this question elsewhere.


Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
mpaudel
Posts: 3
Joined: Thu Feb 17, 2011 12:43 am

open and compile a tex document from another program

Post by mpaudel »

Hi there!
Problem with Excel than with LaTex... well Yes and No. I used Excel to get the .tex file written out. Then I tried running LaTex compiler from within Excel. So, I would say it is a kind of combined problem.
But I got it figured out. This is what I did:
- Write the .tex file (properly formatted from Excel)
- Called a batch file pdfLaTex.bat from Excel using "Shell" as follows:

Code: Select all

program = pdflatexbatfile & " " & directory & " " & texfilename
TaskID = Shell(program, 1)
This command actually worked just like that!!!!!! Opens the batch file, compiles my .tex and generates a pdf!
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

open and compile a tex document from another program

Post by localghost »

mpaudel wrote:[…] Problem with Excel than with LaTex... well Yes and No. I used Excel to get the .tex file written out. Then I tried running LaTex compiler from within Excel. So, I would say it is a kind of combined problem. […]
I don't think so. The generated source file compiles smoothly. The only problem is to call a LaTeX compiler from within Excel. So, clearly not a LaTeX problem.

Nevertheless, if the problem is solved with that, please mark the topic (not the last post) accordingly.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Chris Peh
Posts: 1
Joined: Wed Nov 13, 2024 12:53 am

open and compile a tex document from another program

Post by Chris Peh »

@mpaudel: I'm glad you found a solution since I'm trying to do the same.
However, could you please let me know, how you write into a .tex file in the first place
Plus please explain the Dim of the variables used since I'm not sure what `pdflatexbatfile` should be declared as (as well as program)
Post Reply