# Using Metadata “Variables” in LaTeX

#### Kolen

23 Dec, 2015 04:26 AM

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>
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.

1. Support Staff Posted by fletcher on 23 Dec, 2015 07:01 PM

The 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 Kolen on 24 Dec, 2015 04:10 AM

I 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 Kolen on 25 Dec, 2015 09:38 PM

The 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?

4. Kolen closed this discussion on 02 Mar, 2016 02:51 AM.

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

# Keyboard shortcuts

### Generic

? Show this help Blurs the current field

### Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

## Recent Discussions

 20 Dec, 2019 11:26 PM Sentence starting with apostrophe. 25 Oct, 2019 08:22 PM How to extend MMD to automatically add a wrapper for tables? 30 Aug, 2019 03:59 PM "You have logged x hours" 11 Aug, 2019 04:19 PM qlmanage and MultiMarkdown QuickLook.qlmanage 20 Jul, 2019 01:47 PM Can mmd6 latex support files be tweaked to support exporting mmd6 in-text citations to biblatex compatible commands?