タブ区切りのデータ、あるいはカンマ区切りのデータを
csvやExcel表からのコピペでLaTeXの表に変換「csv2tabular」というページを使いやすくしています。
Excelをそのままコピーするとタブ区切り、csvファイルをテキストで開いてコピーするとカンマ区切りになります。
Features
-
Excelの指数表記(例:1.2E-04)もLaTeXの数式(例:$1.2\times 10^{-4}$)に対応しています。
-
オンライン・オフラインのいずれでも使用することが出来ます。
このページから使えます。
ローカルにダウンロードする方法は主に2つあります。
- 適当なところに
cd
してこのリポジトリをcloneします。
git clone https://github.com/suzuyuyuyu/csvtoLaTeX.git
.git
ディレクトリは削除しても構いませんが、残しておくと更新が容易になります。
-
index.html
へのショートカットをデスクトップなどに貼り付けます。ショートカットの名称やアイコンは適当に変更して問題ありません。 -
あるいはWindowsの場合は
C:\Users\name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
にショートカットを作成します。- スタートメニュー、(Windowsキーを押下して)アプリの検索から開けるようになります。
コピペテスト用
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
このコードは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ボタンを押下するとクリップボードにコピーされます。 自動でコピーされないようにするためには
./script/main.js
function processText() {
//: 指数表記の数値の変換
let inputTextArea = document.getElementById('inputText');
let inputText = inputTextArea.value;
︙
//: ClipBoardにコピー
copyToClipboard();
}
の関数copyToClipboard();
を削除、あるいは//
でコメントアウトしてください。