Giter Club home page Giter Club logo

Comments (8)

Hsins avatar Hsins commented on May 21, 2024 1

Also, I found that we can use listings package instead of minted in LaTeX and pandoc handle the lstlisting environment well.

image

from lkmpg.

Hsins avatar Hsins commented on May 21, 2024 1

After creating and running with a custom pandoc filter for minted package. Now it can handle the code block environment with minted package well:

image

It may take me some time for creating the pandoc filter to deal with the \newminted[codebash] environment that @jserv created.

from lkmpg.

jserv avatar jserv commented on May 21, 2024

make4ht is used for HTML generation (#20), and I would like to stick to LaTeX script at present.

from lkmpg.

Hsins avatar Hsins commented on May 21, 2024

Sure that we can keep the source files in *.tex format but find out another solution for HTML/EPUB generating. It's not really convenient to use TeX4ht with custom HTML template although it's enough at present.

from lkmpg.

fennecJ avatar fennecJ commented on May 21, 2024

I think build a markdown file then convert it into html sounds promising.
However pandoc doesn't support some extensions used in lkmpg.tex and caused several code blocks to be omitted.

from lkmpg.

Hsins avatar Hsins commented on May 21, 2024

More packages make more possible dependency issue but we don't have bunch of packages.

I've check that currently the format conversion of code block from tex to md would be like something below:

LaTeX Markdown
\subsection{Kernel module package}
\label{sec:packages}

Linux distributions provide the commands 
\emph{modprobe}, \emph{insmod} and \emph{depmod} 
within a package.

On Ubuntu/Debian:
\begin{codebash}
sudo apt-get install build-essential kmod
\end{codebash}
## Kernel module package {#sec:packages}

Linux distributions provide the commands 
*modprobe*, *insmod* and *depmod* 
within a package.

On Ubuntu/Debian:

::: codebash
sudo apt-get install build-essential kmod
:::

It seems that we can do something tricky: TeX -> Markdown -> HTML. Just replace ":::" with "```" and "codebash" (or something else programming languages) with "bash" before converting to HTML from Markdown.

from lkmpg.

fennecJ avatar fennecJ commented on May 21, 2024

Consider using \begin{minted}[linenos]{c} instead of \begin{minted}{c} so the line number can be shown.

from lkmpg.

Hsins avatar Hsins commented on May 21, 2024

There is a POC (Proof of Concept) site building with Pandoc + Hugo (theme: book) could be check at here. It seems that:

  • The lua-filters minted given by Pandoc officially could not deal with the [linenos] options well. And I need to modify it for custom use.
  • The \samplec{} macro for including *.c source code into document is not work when converting with pandoc. This could be resolve with hardcoded replacing before converting.

Now, waiting for #26 resolved so that I could split one page into several chapters.

from lkmpg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.