LaTeX output

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

LaTeX output

Heber Farnsworth
Hi all,
        In my work I do a lot of statistical analysis and present them in
tables in my papers.  I am trying to write a function which creates a
LaTeX file from a matrix.  It seems to work fine except that I can't find
a way to get Octave to print a \ character as is \begin{tabular} or
\end{tabular}  (this will only make sense to LaTeX users).  The first
gives me egin{tabular} and the second gives the warning

warning: unrecognized escape sequence `\e' -- converting to `e'

so I get end{tabular} rather than \end{tabular}.  Is there an output
conversion that applies to this case?  I know there is one for the symbol
%.  For the other symbols like & no conversion is necessary but Octave
attaches importance to the symbol \.

Any suggestions would be appreciated.

  Heber Farnsworth                               | Department of Finance
  Univerity of Washington                        | Box 353200
  tele:  (206) 528-0793 home                     | Seattle, WA 98195-3200
  tele:  (206) 543-4773 finance     web: http://weber.u.washington.edu/~heberf
  fax:   (206) 685-9392             email: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: LaTeX output

Dutt, Vinayak, Ph.D.
#
#Hi all,
# In my work I do a lot of statistical analysis and present them in
#tables in my papers.  I am trying to write a function which creates a
#LaTeX file from a matrix.  It seems to work fine except that I can't find
#a way to get Octave to print a \ character as is \begin{tabular} or
#\end{tabular}  (this will only make sense to LaTeX users).  The first
#gives me egin{tabular} and the second gives the warning
#
#warning: unrecognized escape sequence `\e' -- converting to `e'
#
#so I get end{tabular} rather than \end{tabular}.  Is there an output
#conversion that applies to this case?  I know there is one for the symbol
#%.  For the other symbols like & no conversion is necessary but Octave
#attaches importance to the symbol \.
#

try \\ (double backslash) like:

fprintf(fd,'\\end{tabular}\n`);


Vinayak Dutt

Ultrasound Research
Mayo Clinic
Rochester MN 55905
E-Mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: LaTeX output

Heber Farnsworth
>
> try \\ (double backslash) like:
>
> fprintf(fd,'\\end{tabular}\n`);
>
>

This does in fact work.  On a similar note I found that \\\\ will return
\\ which is also important for arrays and tables in LaTeX.

Thanks!


Reply | Threaded
Open this post in threaded view
|

Re: LaTeX output

Andreas Kratzert
In reply to this post by Heber Farnsworth

Heber Farnsworth wrote:
>
> In my work I do a lot of statistical analysis and present them in
> tables in my papers.  I am trying to write a function which creates a
> LaTeX file from a matrix.  It seems to work fine except that I can't find
> a way to get Octave to print a \ character as is \begin{tabular} or
> \end{tabular}  (this will only make sense to LaTeX users).  The first
> gives me egin{tabular} and the second gives the warning

You have to double the \ character:
    printf ("\\begin  \\end");

Andreas

-----------------------------------------------------------
Andreas Kratzert
Universitaet Erlangen, Lehrstuhl fuer Technische Elektronik
email: [hidden email]