[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using fprintf to output a .tex file
From: |
bondmatt |
Subject: |
Using fprintf to output a .tex file |
Date: |
Sun, 16 Jun 2013 19:46:35 -0700 (PDT) |
I have been working on an Octave script that outputs a .tex file to generate
a report with Latex. I tried copying my tex file into my Octave script using
the arrangement below but I have had issues. I started with a file from
someone else so I was aware of the need to replace single backslashes with
double backslashes. Additionally, I found a helpful hint in the forum to
obtain double backslashes (\\ - critical in Latex) by putting four
backslashes (\\\\) in the string to be output with fprintf.
However, I have been unable to get my script to output the Latex file. I see
the error 'error: fprintf: invalid format specified'.
Any suggestions, perhaps better methods I should be considering, would be
greatly appreciated!
Thanks!
A stripped example of the Latex output portion of my script (the last few
lines):
s=['\\end{tabular}\n'];
s=[s '\\end{document}\n'];
file=fopen('report.tex','w');
fprintf(file,s);
--
View this message in context:
http://octave.1599824.n4.nabble.com/Using-fprintf-to-output-a-tex-file-tp4654338.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Using fprintf to output a .tex file,
bondmatt <=