Coder Social home page Coder Social logo

minoue-xx / livescript2markdown Goto Github PK

View Code? Open in Web Editor NEW
46.0 3.0 7.0 4.2 MB

MATLAB's live scripts to markdown. The provided function converts your latex (generated from a live script) to markdown so that it could easily produce README.md with MATLAB code, equations, and figures.

License: Other

MATLAB 100.00%

livescript2markdown's Introduction

Converting MATLAB Live Script to Markdown

Copyright 2020 The MathWorks, Inc. View livescript2markdown: MATLAB's live scripts to markdown.  on File Exchange

Imporant Note (2023/9/14)

As of R2023b, you can use export function of MATLAB to export markdown from livescript.

Here's a small document (in Japanese) on how to use export to convert livescripts to markdown.

NOTE (2020/02/10)

When exporting to LaTeX right after running the livescript, it's observed that the figures will be exported as eps files or not at all if the livescript contains more than 20 figures.

I suggest that you close the script and reopen and then export to latex.

Introduction

This repository provides a functions to convert your live scripts to markdown file. I hope this function makes your life easy to document your repository.

English instruction

日本語はこちら

I've checked the function with multiple live scripts but please note that it's not perfect. It's expected that you need some manual editing.


Feedback

Hope it accelerates your MATLAB life. Any comment and suggestions are always appreciated.

livescript2markdown's People

Contributors

minoue-xx avatar tohruk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

livescript2markdown's Issues

issue with processing \matlabheading

Example of tex syntax that does not provide the right markdown

\matlabheadingthree{\href{https://xxxx.xxx}{BBBBB}}

which is currently translates as

\matlabheadingthree{[BBBB](https://xxxx.xxx)}

Wrong name for images directory.

From R2023b, the directory for saving images is changed from "file name + _images" to "file name + _media". So, code should be changed as below.

Line 185, latex2markdown.m
disp("Note: Related images are saved in " + name + "_media");

Line 18, processincludegraphics.m
imagedir = filename + "_media/";

issue with \matlabheading{}

Example:

\matlabheading{\includegraphics[width=\maxwidth{19.36778725539388em}]{image_2}}

becomes

\matlabheading{![image_2.png](HeartSoundClassification_LiveScript_JP_images/image_2.png)}

latex math function nonconvertable

in Matlab live editor, there are three ways to wite equations;
First: by using Matlab editor insert math structures, symbols
Second: by writing standard keyboard characters
Third: using LaTex format ( \theta)

If we write first way It can be convertible to MD but LaTex equation cant convert to MD

The font size of equations after exporting to markdown

Hi, thank you so much for your hard work for this repo. This repo is super helpful.
Is it possible to change or tune the font size of equations (latex) after exporting to md file?
I would like to write a blog post, but the font size of equations is a bit small than I expected.

Table of contents

Is is possible to export "table of contents" as markdown file? I would like to obtain table of contents after creating it in "insert tab".

The Japanese text encoding is broken.

Overview

The text encoding of the function/private/processincludegraphics.m
is broken. Neither UTF8, SJIS nor EUC can decode the Japanese text in this file.

Also, some files are encoded by UTF-8, some files are encoded by SJIS. Note that both develop and master have the same problem.

Investigated files

BROKEN :

UTF8 :

  • function/latex2markdown.m

SJIS :

  • function/private/mergeSameEnvironments.m
  • function/private/processDocumentOutput.m
  • function/private/processEquations.m
  • function/private/processLiteralOutput.m

Suggested fix

At least function/private/processincludegraphics.m should be fixed.

Other files might be better to align as UTF8 encoding, which is the default of the Matlab.

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.