Converting legacy mintmod content

In this chapter some findings are documented on how to prepare content so it can be read by the innoconv-mintmod command.

Note

It’s not a complete list and there might be things missing that need to be done in your specific case.

First of all make sure all content is UTF-8 encoded. If not, tools like iconv can be helpful.

Adjust commands

There are some mintmod commands Pandoc is not able to parse. You need to manually replace them throughout your project.

Remove \ifttm…\else…\fi commands

mintmod_ifttm can get rid of all \ifttm commands.

Usage:

$ mintmod_ifttm < file_in.tex > file_out.tex

Automate on many files:

$ find . -name '*.tex' | xargs -I % sh -c 'mintmod_ifttm < % > %_changed && mv %_changed %'

Warning

The script cares only about \ifttm…\else…\fi with an \else command. There may be occurences of \ifttm…\fi (without \else). You need to remove them manually!

Unwanted LaTeX commands

A couple of commands are superflous or doesn’t make sense in a web-first content publishing platform like innoDoc. So remove any occurences of the following commands.

  • \input{mintmod.tex}

  • \input{english.tex}

  • \begin{document} \begin{document}

  • \MPragma{MathSkip}

  • \Mtikzexternalize

  • \relax

  • \- (hyphenation)

  • \pagebreak

  • \newpage

  • \MPrintIndex

  • \relax

Automate:

find . -type f -name '*.tex' -or -name '*.rtex' | xargs perl -i -pe 's/\\input{mintmod(.tex|)}\w*\n//igs'

Including other modules

Pandoc doesn’t understand \IncludeModule. Change these statements to proper LaTeX commands.

\IncludeModule{folder}{file.tex}\input{folder/file.tex}.

Replace strings

There are a couple of special characters you need to replace yourself.

  • \"aä

  • \"oö

  • \"uü

  • \"AÄ

  • \"OÖ

  • \"UÜ

  • \"sß

  • \"sß

  • {\ss}ß

  • \ss `` ``ß

  • \ss\ß

  • \ss{}ß

  • \ssß

  • "aä

  • "oö

  • "uü

  • "AÄ

  • "OÖ

  • "UÜ

  • "`

  • ``

  • ''

  • "'

Automate:

find . -type f -name '*.tex' -or -name '*.rtex' | xargs sed -i 's/\\"a/ä/g'

Clean up code

Remove unused files from your project and keep track of your changes using a VCS.