Revision history [back]

LaTeX Outpu: How to replace Brakcets and add Dollars

I have

x = 1
data = [x/n for n in range (1,4)]
M = latex(m0)

print M
print M.replace('\left[', '$').replace(', ', '$, ').replace('\right]', '$')  Out Actual: \left[1, \frac{1}{2},$\frac{1}{3}$\right]$1$, \frac{1}{2},$\frac{1}{3}$\right]  But I need: Out Target: $1$,$\frac{1}{2}$,$\frac{1}{3}$ LaTeX Outpu: How to replace Brakcets and add Dollars I have x = 1 data = [x/n for n in range (1,4)] M = latex(m0) print M print M.replace('\left[', '$').replace(', ', '$, ').replace('\right]', '$')


Out Actual:

\left[1, \frac{1}{2}, $\frac{1}{3}$ \right]
$1$, \frac{1}{2}, $\frac{1}{3}$\right]


But I need:

Out Target:

$1$, $\frac{1}{2}$, $\frac{1}{3}$


LaTeX Outpu: Output: How to replace Brakcets and add Dollars

I have

x = 1
data = [x/n for n in range (1,4)]
M = latex(m0)
latex(data)

print M
print M.replace('\left[', '$').replace(', ', '$, ').replace('\right]', '$')  Out Actual: \left[1, \frac{1}{2},$\frac{1}{3}$\right]$1$, \frac{1}{2},$\frac{1}{3}$\right]  But I need: Out Target: $1$,$\frac{1}{2}$,$\frac{1}{3}$  4 None FrédéricC 4385 ●3 ●37 ●93 LaTeX Output: How to replace Brakcets and add Dollars I have x = 1 data = [x/n for n in range (1,4)] M = latex(data) print M print M.replace('\left[', '$').replace(', ', '$, ').replace('\right]', '$')


Out Actual:

\left[1, \frac{1}{2}, $\frac{1}{3}$ \right]
$1$, \frac{1}{2}, $\frac{1}{3}$\right]


But I need:

Out Target:

$1$, $\frac{1}{2}$, $\frac{1}{3}$