Skip to content

Conversation

@zazedd
Copy link

@zazedd zazedd commented Jul 23, 2023

LaTeX support #425

LaTeX doesn't have code listings by default, so we assume the user has defined an environment for OCaml code and the mdx-errors, each called ocaml and mdx-errors respectively.
For example:

% LSTLISTING

\usepackage{listings}

\lstnewenvironment{ocaml}
  {\lstset{language=[Objective]Caml}}
  {} % styling

\lstnewenvironment{mdx-error}
  {\lstset{language=[Objective]Caml}}
  {} % styling

% MINTED

\usepackage{minted}

\newminted[ocaml]{ocaml}{
  % styling
}

\newminted[mdx-error]{ocaml}{
  % styling
}

Later on we can implement checking for a \lstset or \setminted, and if the language defined inside it is OCaml then instead of \begin{ocaml} for the code, we would accept \begin{lstlisting} or \begin{minted}, so the user doesn't need to as much setup beforehand.

Labels work the same as markdown, just as a comment in LaTeX:

% $MDX file=any_file.txt
\begin{ocaml}
...
\end{ocaml}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants