### TeX formatting question

Number of replies: 15
I am trying to set up an equation where 11.15 g is placed over 120.0 g so their decimals line up with each other exactly.

I can't figure out the formatting that works in moodle, though. I've tried:

11.15 g \break \underline{ + \thinspace 120.0 g}

but the TeX filter doesn't recognize it. any suggestions?

I can't figure out the formatting that works in moodle, though. I've tried:

11.15 g \break \underline{ + \thinspace 120.0 g}

but the TeX filter doesn't recognize it. any suggestions?

### Re: TeX formatting question

you could try to implement dcolumn....

or add space and zeros

$$\begin{align*}

7.15\\

8.30\\

\underline{+ 9.00}\\

24.45\\

\end{align*}$$

\begin{align*}

7.15\\

8.30\\

\underline{+ 9.00}\\

24.45\\

\end{align*}

or add space and zeros

$$\begin{align*}

7.15\\

8.30\\

\underline{+ 9.00}\\

24.45\\

\end{align*}$$

\begin{align*}

7.15\\

8.30\\

\underline{+ 9.00}\\

24.45\\

\end{align*}

### Re: TeX formatting question

the problem is that it has to have different # of figures before and after the decimal.

$$\begin{align*}

1.201 L\\

\underline{- 0.2543 L}\\

\end{align*}

$$

\begin{align*}

1.201 L\\

\underline{- 0.2543 L}\\

\end{align*}

needs to have the decimals line up exactly.

### Re: TeX formatting question

So add trailing zeros. That is a simple answer unless your lesson is addressed to elementary students you are trying to teach that 2.1=2.100

### Re: TeX formatting question

I can't alter the number of figures present, that would alter the number of signficiant figures given, and ruin the whole point of the question. I guess I'll just use html tables.

### Re: TeX formatting question

All distributions of latex do not support this but

\begin{tabular}{r@{.}l}11&15 g\\+120&0 g\\\hline131&15 g\\\end{tabular}

may render with tex live

(does not work here in moodle.org anyway - probably some blacklisted command like \line breaks tex filter code here) Edit: works ok also here:

$$\begin{tabular}{r@{.}l}11&15 g\\+120&0 g\\\hline131&15 g\\\end{tabular}$$

\begin{tabular}{r@{.}l}11&15 g\\+120&0 g\\\hline131&15 g\\\end{tabular}

may render with tex live

(does not work here in moodle.org anyway - probably some blacklisted command like \line breaks tex filter code here) Edit: works ok also here:

$$\begin{tabular}{r@{.}l}11&15 g\\+120&0 g\\\hline131&15 g\\\end{tabular}$$

### Re: TeX formatting question

Bah, we don't have that upto date on TeX apparently, because it gets to **}{r@{.}l** and freaks out.

this is what I see:

### Re: TeX formatting question

Is it Mimetex?

You can get close to similar effect in Mimetex with normal array and syntax like

\begin{array}{rcl}11&.&15 g\\+\;120&.&0 g\\\hline131&.&15 g\\\end{array}

which looks like this rendered by mimetex:

### Re: TeX formatting question

ah!!! That one worked. SWEET!

### Re: TeX formatting question

How about

$$ \begin{array}{rll} 11&.15 &g \\ +120&.0 &g \\ \hline 131&.15&g \end{array} $$

$$$ \begin{array}{rll} 11&.15 &g \\ +120&.0 &g \\ \hline 131&.15&g \end{array} $$$

hahahaaaaa!!!!! You are just too quick for me Mauno..

2nd Edit:

Well if nothing else works... just as Mauno has posted using the default TeX Notation works, not all that nicely, but it is aligned and tidier than the alternatives...

$$ \begin{array}{rll} 11&.15 &g \\ +120&.0 &g \\ \hline 131&.15&g \end{array} $$

$$$ \begin{array}{rll} 11&.15 &g \\ +120&.0 &g \\ \hline 131&.15&g \end{array} $$$

hahahaaaaa!!!!! You are just too quick for me Mauno..

2nd Edit:

Well if nothing else works... just as Mauno has posted using the default TeX Notation works, not all that nicely, but it is aligned and tidier than the alternatives...

### This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.

### Re: TeX formatting question

$$

\begin{tabular}{r@{.}l}

3&14159\\

16&2\\

123&456\\

\end{tabular}

$$

Nicely done, though I think dcolumn still the way to go if you are managing Tex: http://newton.ex.ac.uk/research/qsystems/people/latham/LaTeX/dcolumn.pdf

\begin{tabular}{r@{.}l}

3&14159\\

16&2\\

123&456\\

\end{tabular}

$$

Nicely done, though I think dcolumn still the way to go if you are managing Tex: http://newton.ex.ac.uk/research/qsystems/people/latham/LaTeX/dcolumn.pdf

### Re: TeX formatting question

Felicia,

the problem with {tabular}{r@{.}l} was that James has Mimetex and Mimetex does not support this expression - distros like Tex Live do support it

### Re: TeX formatting question

Which leads on to the question Mauno, is it possible for a developer to tweak something like MimeTex to accept such symbols? Or create a MoodleTeX that is seriously adaptable? Rather than using external packages and adapting them to Moodle, or not, develop something that can be easily used in Moodle? Something easily adaptable specific for Moodle?

I know I could not do it, I do not have the knowledge of TeX nor the programming skills, but could it be done?

I know I could not do it, I do not have the knowledge of TeX nor the programming skills, but could it be done?

### This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.

### Re: TeX formatting question

Tex has extraordinary capacity to do most anything you wish ( as you can see from the range of options here: http://www.tug.org/interest.html), but the more abbreviated the solution, the less one gets. John Forkosh created mimetex and mathtex and you can find out more about them at john's site, forkosh.com. The same applies to MathTran, asciimath, and mathjax. They are all subsets designed to provide an economical solution to addressing math online.

IMHO, if you want and need all that Tex can do, do a full install of Tex Live and use CPAN via tl_mgr to pull whatever packages or macros you might need.

I continue to hope that with the work being done on STACK and MathJax that at some point we will see, as was targeted by the MathTran project, full correspondence between Tex and Mathml allowing us to go in both directions, but that is a mammoth task and while lots of educators in the US opine about the issues we have with Math education, we see record profits for companies like Pearson while we see little investment in basic tools to make Math education possible.

In the meantime, one could hack on ASCIIMathML (see e.g., http://asciimathml.com/ ) and you can play with DragMath as well (via the xml files) as far as displaying directly via MathML

MathJax may well be the future of Tex on the web, but there is a long way to go

IMHO, if you want and need all that Tex can do, do a full install of Tex Live and use CPAN via tl_mgr to pull whatever packages or macros you might need.

I continue to hope that with the work being done on STACK and MathJax that at some point we will see, as was targeted by the MathTran project, full correspondence between Tex and Mathml allowing us to go in both directions, but that is a mammoth task and while lots of educators in the US opine about the issues we have with Math education, we see record profits for companies like Pearson while we see little investment in basic tools to make Math education possible.

In the meantime, one could hack on ASCIIMathML (see e.g., http://asciimathml.com/ ) and you can play with DragMath as well (via the xml files) as far as displaying directly via MathML

MathJax may well be the future of Tex on the web, but there is a long way to go