« Return to Thread: New line not working for latex math mode?

Re: New line not working for latex math mode?

by Miguel Rubio Roy :: Rate this Message:

Reply to Author | View in Thread

> You may not have (two or more subsequent) line breaks inside equations in TeX.

I've only tried one line break, not two and not subsequent:
>> set label "a \n b" at 0,90
>> set label 'a \\ b' at 0,70
>> set label "a \\\\ b" at 0,60

and anyway, I'd say these commands do not generate equations.

>> 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.

I haven't tried something like that but, I guess I would have to
replace \cr with something like \\ which is not working, anyway.

> 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.

Some of my attempts weren't equations, and they weren't working, anyway:
>> set label "a \n b" at 0,90
>> set label 'a \\ b' at 0,70
>> set label "a \\\\ b" at 0,60

> 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.

I agree. Compiling the following with pdflatex works fine (places "a"
and "b" in different lines):

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\begin{document}
a \\ b
\end{document}


Thanks

Miguel

------------------------------------------------------------------------------
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

 « Return to Thread: New line not working for latex math mode?