I just updated my way of replacing the dot with a comma. Just after the "\ begin{document}", I insert this:
\begin{sagesilent} # Pour adapter la sortie LaTeX de sage aux conventions francaises. def numprint(x): x = latex(x) x = str(x) x = x.replace('.', ',\!').replace('\\times','\, \ldotp') x = sage.misc.latex.LatexExpr(x) return x #and use \sagestr{numprint(x)} \end{sagesilent} \newcommand{\SageVirgule}[1]{\sagestr{numprint(RDF(#1))}} "Virgule" is comma in french. The RDF is not mandatory: it is just convenient for me! Sorry, I don't output enough graphics for me to search a solution to your problem. Le vendredi 4 mai 2012 02:50:39 UTC+2, Felipo Bacani a écrit : > > Is there a way that *every* printed number (and not only the ones that one > uses "replace" ou "locale.format" ) have a comma as a separator for > decimals? > I ask this because I can't make the ticks of my graphics to print in this > format. > > > Thanks. > BTW, there's a ticket on this: > http://trac.sagemath.org/sage_trac/ticket/8594 > There's no milestone for it =/ > > Em terça-feira, 23 de março de 2010 11h25min29s UTC-3, iDan escreveu: >> >> Hi, >> In french, we use comma as decimal separator. How can I convert the >> result of the instruction \sage{} (from sagetex package) ? >> >> %!TEX TS-program = sage >> \documentclass{article} >> \usepackage[latin1]{inputenc} >> \usepackage[T1]{fontenc} >> \usepackage[francais]{babel} >> \usepackage{numprint} >> \usepackage{sagetex} >> \begin{document} >> $\sage{sqrt(3.)}$ % Output is 1.73205080756888, but I would like >> 1,7320... >> $\mathrm{\sage{sqrt(3.)}}$ % Output is 1.73205080756888 >> $\numprint{12.34567}$ % Ok, outpout is 12,345 67 (with comma) >> %$\numprint{\sage{sqrt(3.)}}$ % don't work (bad argument for >> numprint) >> %\numprint{$\sage{sqrt(3.)}$} % don't work (bad argument for >> numprint) >> %\numprint{$\mathrm{\sage{sqrt(3.)}}$} % don't work (Generic Error) >> \end{document} >> >> Thanks >> iDan >> >> > Em terça-feira, 23 de março de 2010 11h25min29s UTC-3, iDan escreveu: >> >> Hi, >> In french, we use comma as decimal separator. How can I convert the >> result of the instruction \sage{} (from sagetex package) ? >> >> %!TEX TS-program = sage >> \documentclass{article} >> \usepackage[latin1]{inputenc} >> \usepackage[T1]{fontenc} >> \usepackage[francais]{babel} >> \usepackage{numprint} >> \usepackage{sagetex} >> \begin{document} >> $\sage{sqrt(3.)}$ % Output is 1.73205080756888, but I would like >> 1,7320... >> $\mathrm{\sage{sqrt(3.)}}$ % Output is 1.73205080756888 >> $\numprint{12.34567}$ % Ok, outpout is 12,345 67 (with comma) >> %$\numprint{\sage{sqrt(3.)}}$ % don't work (bad argument for >> numprint) >> %\numprint{$\sage{sqrt(3.)}$} % don't work (bad argument for >> numprint) >> %\numprint{$\mathrm{\sage{sqrt(3.)}}$} % don't work (Generic Error) >> \end{document} >> >> Thanks >> iDan >> >> > Em terça-feira, 23 de março de 2010 11h25min29s UTC-3, iDan escreveu: >> >> Hi, >> In french, we use comma as decimal separator. How can I convert the >> result of the instruction \sage{} (from sagetex package) ? >> >> %!TEX TS-program = sage >> \documentclass{article} >> \usepackage[latin1]{inputenc} >> \usepackage[T1]{fontenc} >> \usepackage[francais]{babel} >> \usepackage{numprint} >> \usepackage{sagetex} >> \begin{document} >> $\sage{sqrt(3.)}$ % Output is 1.73205080756888, but I would like >> 1,7320... >> $\mathrm{\sage{sqrt(3.)}}$ % Output is 1.73205080756888 >> $\numprint{12.34567}$ % Ok, outpout is 12,345 67 (with comma) >> %$\numprint{\sage{sqrt(3.)}}$ % don't work (bad argument for >> numprint) >> %\numprint{$\sage{sqrt(3.)}$} % don't work (bad argument for >> numprint) >> %\numprint{$\mathrm{\sage{sqrt(3.)}}$} % don't work (Generic Error) >> \end{document} >> >> Thanks >> iDan >> >> > Em terça-feira, 23 de março de 2010 11h25min29s UTC-3, iDan escreveu: >> >> Hi, >> In french, we use comma as decimal separator. How can I convert the >> result of the instruction \sage{} (from sagetex package) ? >> >> %!TEX TS-program = sage >> \documentclass{article} >> \usepackage[latin1]{inputenc} >> \usepackage[T1]{fontenc} >> \usepackage[francais]{babel} >> \usepackage{numprint} >> \usepackage{sagetex} >> \begin{document} >> $\sage{sqrt(3.)}$ % Output is 1.73205080756888, but I would like >> 1,7320... >> $\mathrm{\sage{sqrt(3.)}}$ % Output is 1.73205080756888 >> $\numprint{12.34567}$ % Ok, outpout is 12,345 67 (with comma) >> %$\numprint{\sage{sqrt(3.)}}$ % don't work (bad argument for >> numprint) >> %\numprint{$\sage{sqrt(3.)}$} % don't work (bad argument for >> numprint) >> %\numprint{$\mathrm{\sage{sqrt(3.)}}$} % don't work (Generic Error) >> \end{document} >> >> Thanks >> iDan >> >> -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.