# Using Metadata “Variables” in LaTeX

HTML Header:

Before I begins, this question relates both the MMD and MMD Composer, so I posted it here.

# Using Metadata “Variables” for Equations as in LaTeX

I typed equations a lot in MMD and later convert to LaTeX and then PDF. Trying to follow the practice people used in LaTeX when using the same equations repeatedly: one defines it and recalls it whenever it is used again. Looking at what MMD provides, it seems Metadata "Variables" should be the one to use. However, its effects are very different depending on the output method.

# MWE

```
HTML Header: <script type="text/javascript" src="https://beta.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML">
</script>
Base Header Level: 2
LaTeX Input: mmd-article-header
LaTeX Mode: memoir
LaTeX Input: mmd-article-begin-doc
LaTeX Footer: mmd-memoir-footer
test: \(\frac{1}{2}+\frac{1}{2}=1\)
[%test]
```

# Results

Output Method | Result |
---|---|

MMD2HTML 5.0.1 | \(\frac{1}{2}+\frac{1}{2}=1\) |

MMD Composer 2.8 | \(\frac{1}{2}+\frac{1}{2}=1\) |

MMD Composer 3.0b | `(rac{1}{2}+rac{1}{2}=1)` [^note] |

MMD2LaTeX |
`\textbackslash{}(\textbackslash{}frac\{1\}\{2\}+\textbackslash{}frac\{1\}\{2\}=1\textbackslash{})` |

(The first 2 are correct results using MathJax but seems like MathJax aren't support here.)

I tried using different delimiter but the results for the LaTeX are the same. Are there any existing way to accomplish this (define equation once and recall every time)? Or could you modified the way the metadata variables translated into LaTeX so that this use would work?

Another related question is, I read that in LaTeX it is advised
to use `\(...\)`

rather than `$...$`

(e.g.
the use of `$...$`

might break something when using the
AMS packages). But I see that in MMD2LaTeX, even when I used
`\\(...\\)`

, it is being translated into
`$...$`

. So could you change it, or provide a way to
choose between the 2 behavior, or are there already an existing way
of doing it?

Thanks.

[^note]: It occasionally displayed the Math correctly. I should start another question about Math support in MMD Composer 3.

Comments are currently closed for this discussion. You can start a new one.

# Keyboard shortcuts

### Generic

? | Show this help |
---|---|

ESC | Blurs the current field |

### Comment Form

r | Focus the comment reply box |
---|---|

^ + ↩ | Submit the comment |

You can use `Command ⌘`

instead of `Control ^`

on Mac

Support Staff 1 Posted by

fletcheron 23 Dec, 2015 07:01 PMThe Drag and Drop apps rely on whatever version of MultiMarkdown you

have installed (`multimarkdown -v`). You may need to update.

All of them work properly on my machine -- perhaps you are using an

outdated version?

Remember to "refresh preview" to see the formatted math in the preview.

Fletcher

2 Posted by

Kolenon 24 Dec, 2015 04:10 AMI wasn't clear: both the MMD2HTML and MMDC 2.8 are fine. The MathJax just don't appears here...

The MMDC 3 is behaving weirdly. I want to uninstall it and install it again. I am using AppCleaner, do you think it is enough?

My main focus is LaTeX. Are you able to get a correct output in LaTeX? In my test it will turn the metadata variable into

`\textbackslash{}(\textbackslash{}frac\{1\}\{2\}+\textbackslash{}frac\{1\}\{2\}=1\textbackslash{})`

. Are there anyway to prevent mmd2latex to not translate`\`

into`\textbackslash{}`

?3 Posted by

Kolenon 25 Dec, 2015 09:38 PMThe MMDC errors disappeared after I uninstall all MMDCs with AppCleaner and reinstall everything.

So, the only "problem" is how can I make the metadata variable renders correctly in LaTeX?

Kolen

closedthis discussion on 02 Mar, 2016 02:51 AM.