I am trying to create a workflow in which a single Markdown source document will spit HTML and LaTex friendly Markdown files. Since my content editor uses PC I need him to work on source document but also able to see output in HTML or LaTeX.

I am looking for a simple macro expanding software which will process my macros and create necessary doc both in Linux and Windows.

Mock example

My Source Markdown File

{@ verse @}
| first line
| second line
{@ verse @}


HTML-friendly Markdown                   LaTex Friendly Markdown

<div id="" class="verse">                     \begin{verse}
| first line                                  | first line   
| second line                                 | second line
</div>                                        \end{verse}

In short

The macro expanding software should be:

  1. Simple
  2. Available in Linux and Windows
  • Are you willing to install Cygwin?
    – Mawg
    Oct 5, 2017 at 8:36
  • Yes, Cygwin can be installed Oct 7, 2017 at 16:28
  • I like autohotkey. You could make it to traverse a document and macro-replace text. It runs on just about anything and is relatively simple to operate. Nov 7, 2017 at 19:38
  • Do you want to add the gratis tag, or state a budget?
    – Mawg
    Dec 8, 2017 at 7:52

2 Answers 2


Since you say, in comments above, that Cygwin is a possibility, that opens up the possibility of may *nix utilities, such as sed & awk.

Personally, I would code a Python script, but, if you don't code, take a look at sed & awk


I can recommend to write Python plugin for CudaText (or Sublime Text). Py library exists for MD, Latex, etc. Then you set a hotkey for plugin. This hotkey will generate 2 files in the folder needed, from text opened in editor. No ready program which I know.

MD to HTML - plugin exists. Only need plugin for MD to Latex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.