Git Product home page Git Product logo

csvtolatex's Introduction

csvtoLaTeX

Page Link

About this repository

タブ区切りのデータ、あるいはカンマ区切りのデータを $\mathrm{\LaTeX}$ の表に変換するためのものです。
csvやExcel表からのコピペでLaTeXの表に変換「csv2tabular」というページを使いやすくしています。

Excelをそのままコピーするとタブ区切り、csvファイルをテキストで開いてコピーするとカンマ区切りになります。

Features

  • Excelの指数表記(例:1.2E-04)もLaTeXの数式(例:$1.2\times 10^{-4}$)に対応しています。

  • オンライン・オフラインのいずれでも使用することが出来ます。

How to use

オンライン


このページから使えます。

オフライン


ローカルにダウンロードする方法は主に2つあります。

Gitを使う場合(推奨)

git clone https://github.com/suzuyuyuyu/csvtoLaTeX.git

.gitディレクトリは削除しても構いませんが、残しておくと更新が容易になります。

  • index.htmlへのショートカットをデスクトップなどに貼り付けます。ショートカットの名称やアイコンは適当に変更して問題ありません。

  • あるいはWindowsの場合はC:\Users\name\AppData\Roaming\Microsoft\Windows\Start Menu\Programsにショートカットを作成します。

    • スタートメニュー、(Windowsキーを押下して)アプリの検索から開けるようになります。

ダウンロードする場合

  • このリポジトリのCodeと書いてあるボタンからzipファイルをダウンロードします。

  • 適当なところで解凍して、ショートカットをデスクトップなどに貼り付けます。Gitを使う場合と同様です。

コピペテスト用
a, 2.00.E-03, 1.30E+00
b, 2.00.E+06, 1.30E+01
c, 2.00.E+00, 1.30E+01
d, 1.35.E+02, 1.35E+00
e, -1.20.E-13, 1.80E+01

Customize

このコードはHTML/CSS/JavaScriptで書かれているので、ローカルにダウンロードして使用している場合には自由にカスタマイズできます。

・ タブ区切り、カンマ区切りのデフォルトの値を変更する

デフォルトではタブ区切りにチェックが入っています。カンマ区切りに変更するには

./index.html

<div class="processRadio">
    <input type="radio" id="tabRadio" name="separator" value="tab" checked>
    <label for="tabRadio">タブ区切り</label><br>

    <input type="radio" id="commaRadio" name="separator" value="comma">
    <label for="commaRadio">カンマ区切り</label><br>
</div>

におけるcheckedの位置をvalue="comma"の後ろに移動させてください。

・ Convert 押下時にコピーしない

Convertボタンを押下するとクリップボードにコピーされます。 自動でコピーされないようにするためには

./script/main.js

function processText() {
    //: 指数表記の数値の変換
    let inputTextArea = document.getElementById('inputText');
    let inputText = inputTextArea.value;

    

    //: ClipBoardにコピー
    copyToClipboard();
}

の関数copyToClipboard();を削除、あるいは//でコメントアウトしてください。

csvtolatex's People

Contributors

suzuyuyuyu avatar

Watchers

 avatar

csvtolatex's Issues

SI単位認識機能

SI単位認識機能

csvのセル中の文字がSI単位などを用いた物理単位であった場合に\si{}で囲む機能。
e.g. kN/m^3 -> \si{kN/^3}

セル結合

セル結合

コピペされたExcel,csvデータに結合されているセルがあった場合の振る舞いを考える。

  • m×n(データサイズ)のマス目ようなものを表示して結合するところを一つずつ選択させ,jsで結合する。
  • セル結合のコピペが文字データだとどのようになるかが分かれば,それに対応してセル結合を組み込む。
    • その場合はon/offができるように設定すること。

横の結合

\multicolumn{2}{c}{hoge}

縦の結合

\multirow{2}{*}{hoge}

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.