Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early LaTeX support #432

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Early LaTeX support #432

wants to merge 16 commits into from

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