Hi all,

First I want to thank you for this very usefull program!
Here's my issue: I'm trying to export a diagram and use it in a TeX document, and I want nice TeX mathematical formulas to appear there. I tried both PSTricks and PGF export formats, and it appears to me that both are buggy... Here is the problem on a simple example:

1) I draw an arrow and call it $\overrightarrow{e_\theta}$ in a textbox.

2) I export the diagram (PSTricks or PGF) and include it in my TeX document. The arrow is fine but the text is displayed "$\overrightarrow{e_\theta}$" with the "$" the backslash and all the stuff...

3) To display it properly, I have to edit the Diagram.tex file generated by Dia and make these changes:
- In the PSTricks output, replace
\rput[l](12.000000,15.000000){\psscalebox{1 -1}{\$\textbackslash{}overrightarrow\}e\_\textbackslash{}theta\}\$}}
by
\rput[l](12.000000,15.000000){\psscalebox{1 -1}{$\overrightarrow{e_\theta}$}}
- In the PGF output, replace
\node[anchor=west] at (12.000000\du,15.000000\du){\$\ensuremath{\backslash}overrightarrow\{e\_\ensuremath{\backslash}theta\}\$};
by
\node[anchor=west] at (12.000000\du,15.000000\du){$\overrightarrow{e_\theta}$};

Maybe I'm doing something wrong in Dia, but now that I've found this workaround I have to say it's quite a pain to do it for all math formulas in all diagrams... So I'd like to know whether you can give me a hint or change a piece of code in the next Dia version!

I attached to this message the Dia file and both outputs (with my edits), however I don't know whether attachments are allowed in the mailing list. Please tell me if you need something more!

Regards,

A.Bourgeois

Attachment: Diagramme1.dia
Description: application/dia

% Graphic for TeX using PGF
% Title: C:\Users\Lapinou\Pictures\Diagramme1.dia
% Creator: Dia v0.97.2
% CreationDate: Sun Jul 14 11:16:59 2013
% For: Lapinou
% \usepackage{tikz}
% The following commands are not supported in PSTricks at present
% We define them conditionally, so when they are implemented,
% this pgf file will use them.
\ifx\du\undefined
  \newlength{\du}
\fi
\setlength{\du}{15\unitlength}
\begin{tikzpicture}
\pgftransformxscale{1.000000}
\pgftransformyscale{-1.000000}
\definecolor{dialinecolor}{rgb}{0.000000, 0.000000, 0.000000}
\pgfsetstrokecolor{dialinecolor}
\definecolor{dialinecolor}{rgb}{1.000000, 1.000000, 1.000000}
\pgfsetfillcolor{dialinecolor}
\pgfsetlinewidth{0.100000\du}
\pgfsetdash{}{0pt}
\pgfsetdash{}{0pt}
\pgfsetbuttcap
{
\definecolor{dialinecolor}{rgb}{0.000000, 0.000000, 0.000000}
\pgfsetfillcolor{dialinecolor}
% was here!!!
\pgfsetarrowsend{stealth}
\definecolor{dialinecolor}{rgb}{0.000000, 0.000000, 0.000000}
\pgfsetstrokecolor{dialinecolor}
\draw (10.000000\du,15.000000\du)--(15.000000\du,10.000000\du);
}
% setfont left to latex
\definecolor{dialinecolor}{rgb}{0.000000, 0.000000, 0.000000}
\pgfsetstrokecolor{dialinecolor}
%\node[anchor=west] at 
(12.000000\du,15.000000\du){\$\ensuremath{\backslash}overrightarrow\{e\_\ensuremath{\backslash}theta\}\$};
\node[anchor=west] at (12.000000\du,15.000000\du){$\overrightarrow{e_\theta}$};
\end{tikzpicture}
% PSTricks TeX macro
% Title: C:\Users\Lapinou\Pictures\Diagramme1.dia
% Creator: Dia v0.97.2
% CreationDate: Sun Jul 14 11:21:46 2013
% For: Lapinou
% \usepackage{pstricks}
% The following commands are not supported in PSTricks at present
% We define them conditionally, so when they are implemented,
% this pstricks file will use them.
\ifx\setlinejoinmode\undefined
  \newcommand{\setlinejoinmode}[1]{}
\fi
\ifx\setlinecaps\undefined
  \newcommand{\setlinecaps}[1]{}
\fi
% This way define your own fonts mapping (for example with ifthen)
\ifx\setfont\undefined
  \newcommand{\setfont}[2]{}
\fi
\pspicture(9.929289,-15.175000)(22.722500,-9.920943)
\psscalebox{1.000000 -1.000000}{
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\newrgbcolor{diafillcolor}{1.000000 1.000000 1.000000}%
\psset{fillcolor=diafillcolor}
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(10.000000,15.000000)(14.655778,10.344222)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon*(14.920943,10.079057)(14.744166,10.609387)(14.655778,10.344222)(14.390613,10.255834)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(14.920943,10.079057)(14.744166,10.609387)(14.655778,10.344222)(14.390613,10.255834)
\setfont{Helvetica}{1.058333}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
%\rput[l](12.000000,15.000000){\psscalebox{1 
-1}{\$\textbackslash{}overrightarrow\}e\_\textbackslash{}theta\}\$}}
\rput[l](12.000000,15.000000){\psscalebox{1 -1}{$\overrightarrow{e_\theta}$}}
}\endpspicture
_______________________________________________
dia-list mailing list
dia-list@gnome.org
https://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia

Reply via email to