Menu

#1535 cairolatex missing math environment/missing $ $

None
closed-invalid
nobody
2015-06-08
2015-01-08
Anonymous
No

Hello,

I hope I do it correctly and I help you with this information. Please excuse me if this is my fault of wrong dealing with gnuplot.

Using cairolatex there is a error(I think). Following code I used in gnuplot4.6.6 under windows:

set encoding utf8
set terminal cairolatex pdf input
set output 'gp0037.tex'
rpar(R1,R2)=((R1 > 0.0) ? ((R2 > 0.0) ? ((R1 * R2)/(R1 + R2)) : 0.0) : 0.0)
set xrange [0:10]
set xlabel "\(R_1\)"
set ylabel "\(R_{\textrm{ges}}\)"
set key left top
set grid
show grid
plot rpar(x,10.0) title "\(R_{\textrm{ges}}\)"

A gp0037.tex file and a gp0037.pdf file were created. Including the gp0037.tex file with

\begin{figure}%
{\centering%
\input{gp0037.tex}\caption{Mein Diagramm}\label{fig:mein-diagramm}%
}%
\end{figure}

in an existing tex-project there will be errors. In the struct{} section for the legend, y- and x-label there isn`t a math-environment opend for them(the $$ are missing. for example instead of $R_i$ only R_i is written.)

Is this a bug of gnuplot/cairolatex or is this my fault in any way? Can I solve this problem by my own?

Regads,

Gabriel
(fb.mail@gmx.de)

Discussion

  • Bastian Märkisch

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -4,26 +4,26 @@
    
     Using cairolatex there is a error(I think). Following code I used in gnuplot4.6.6 under windows:
    
    -set encoding utf8
    -set terminal cairolatex pdf input
    -set output 'gp0037.tex'
    -rpar(R1,R2)=((R1 > 0.0) ? ((R2 > 0.0) ? ((R1 * R2)/(R1 + R2)) : 0.0) : 0.0)
    -set xrange [0:10]
    -set xlabel "\(R_1\)"
    -set ylabel "\(R_{\textrm{ges}}\)"
    -set key left top
    -set grid
    -show grid
    -plot rpar(x,10.0) title "\(R_{\textrm{ges}}\)"
    
    +    set encoding utf8
    +    set terminal cairolatex pdf input
    +    set output 'gp0037.tex'
    +    rpar(R1,R2)=((R1 > 0.0) ? ((R2 > 0.0) ? ((R1 * R2)/(R1 + R2)) : 0.0) : 0.0)
    +    set xrange [0:10]
    +    set xlabel "\(R_1\)"
    +    set ylabel "\(R_{\textrm{ges}}\)"
    +    set key left top
    +    set grid
    +    show grid
    +    plot rpar(x,10.0) title "\(R_{\textrm{ges}}\)"
    
    
     A gp0037.tex file and a gp0037.pdf file were created. Including the gp0037.tex file with 
    
    -\begin{figure}%
    -{\centering%
    -\input{gp0037.tex}\caption{Mein Diagramm}\label{fig:mein-diagramm}%
    -}%
    -\end{figure}
    
    +    \begin{figure}%
    +    {\centering%
    +    \input{gp0037.tex}\caption{Mein Diagramm}\label{fig:mein-diagramm}%
    +    }%
    +    \end{figure}
    
     in an existing tex-project there will be errors. In the struct{} section for the legend, y- and x-label there isn`t a math-environment opend for them(the $$ are missing. for example instead of $R_i$ only R_i is written.) 
    
    • status: open --> pending-invalid
     
  • Bastian Märkisch

    gnuplot simply outputs the strings you provide. It does not attempt to guess wether they are math-mode or not. So you have to mark it yourself:

    set xlabel '$R_1$'
    

    Also, tic labels are normally output in text-mode. To change that you have to change their format like in

    set format y '$%g$'
    
     
  • Christoph Bersch

    Looking at the tex file should give you a hint what's going wrong. One line looks like

    \put(1869,3948){\makebox(0,0)[r]{\strut{}(R_{   extrm{ges}})}}%
    

    If you have the labels in double quotes, you must escape the backslashes in order to get the correct output:

    set ylabel "\\(R_{\\textrm{ges}}\\)"
    

    or you use single quotes

    set ylabel '\(R_{\textrm{ges}}\)'
    
     
  • Ethan Merritt

    Ethan Merritt - 2015-06-08
    • status: pending-invalid --> closed-invalid
    • Group: -->
    • Priority: 5 -->
     

Log in to post a comment.

MongoDB Logo MongoDB