Skip to content

LaTeX Export: Inline HTML not handled correctly as $ gets escaped #776

@opt12

Description

@opt12

After adding some inline HTLM in reqs\tutorial\TUT017.yml this works well in the HTML export, but the LaTeX export breaks:

Refer to #770.

  ### Math LaTex

  You can use Math LaTex expressions as `$$k_{n+1} = n^2 + k_n^2 - k_{n-1}$$`
  which is rendered like this:

  $$k_{n+1} = n^2 + k_n^2 - k_{n-1}$$

  Alternatively you can also use inline math like this: `$e=mc^2$` renders as $e=mc^2$.

is exported to LaTeX like this:

\subsubsection{Math LaTex}

You can use Math LaTex expressions as \lstinline`$k_{n+1} = n^2 + k_n^2 - k_{n-1}$`
which is rendered like this:\\

$k_{n+1} = n^2 + k_n^2 - k_{n-1}$\\

Alternatively you can also use inline math like this: \lstinline`\$e=mc^2\$` renders as \$e=mc^2\$.

As we can see, the Dollar Signs $ around the inline math gets escaped.

When compiling LaTeX, miktex tries to fix it, but gets it mixed up and hence everything breaks.

Hotfix

As a first remedy the inline math should be removed from the Tutorial code base.

Final Fix

Let's have a look on how to prevent the erroneous escaping of single $ signs in inline math.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions