|
From: Mojca M. <moj...@gm...> - 2009-06-27 22:23:30
|
On Sun, Jun 28, 2009 at 00:12, Miguel Rubio Roy wrote:
> Hi,
>
> Maybe I'm doing something wrong, but I cannot make the latex newline to
> work.
>
> *Only* the *first* label of all these:
>
> set term epslatex standalone color size 9cm,9cm
> set output "test.tex"
> set label "a \n b" at 0,90
> set label 'a \\ b' at 0,70
> set label "a \\\\ b" at 0,60
> set label '$a \\ b$' at 0,50
> set label "$a \\\\ b$" at 0,40
> set label '$\displaystyle a \\ b$' at 0,30
> set label "$\\displaystyle a \\\\ b$" at 0,20
> f(x) = x**2
> plot f(x)
> unset output
>
> will produce two lines of text, and whenever I'll try to use \n in math mode
> like
> set label "$a \n b$"
>
> pdflatex will give me an error
You may not have (two or more subsequent) line breaks inside equations in TeX.
> Is all these normal?
I would say yes (though I didn't try anything out).
> How can I introduce a new line in math mode?
If it was plain TeX it would be something like
'$\displaystyle{\matrix{a \cr b}}$'
but I think that LaTeX has \matrix redefined, so you need to check (I
have not been using LaTeX for ages), the syntax might be slightly
different.
Another option would be to use
'$a$ \\ $b$'
Again - I didn't check it, but just to get you the idea: you need to
split the math expressions into two and make a break *outside* of
equations. TeX cannot make a line break with "\\" inside equation.
But this is hardly related to gnuplot. Gnuplot will just output the
label text unaltered to LaTeX document. You need to use the strengths
and limitations of TeX/LaTeX when typesetting. It's best if you try to
figure out how to achieve the desired effect in usual LaTeX document
first and then just add the needed escape characters to generate the
label inside gnuplot.
Mojca
|