Skip to content

Commit

Permalink
resync ja lesson
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarlisle committed May 31, 2020
1 parent fa1fa83 commit 24f4916
Showing 1 changed file with 57 additions and 6 deletions.
63 changes: 57 additions & 6 deletions ja/language-01.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
---
title: "Language-specifics for Japanese"
title: "LaTeX engines for Japanese"
next: "extra-01"
---

## platex
## p{{site.latex}}

```latex
% !TEX platex
\documentclass{jsarticle}
\bibliographystyle{jplain}
\title{p\LaTeX\ 実験}
\author{林蓮枝}
Expand All @@ -18,13 +17,65 @@ next: "extra-01"
\maketitle
\begin{abstract}
本稿では、文書組版システムp\LaTeX{}の使い方を解説します。p\LaTeX{}を利用するときには、あらかじめ文章中に\TeX{}コマンドと呼ばれる組版用の指示を混在させ\ldots
本稿では、文書組版システムp\LaTeX{}の使い方を解説します。
p\LaTeX{}を利用するときには、あらかじめ文章中に\TeX{}コマンドと呼ばれる組版用の指示を混在させ\ldots
\end{abstract}
\section{導入}
こんにちは世界!%\cite{確率統計}
こんにちは世界
%\bibliography{refs}
\end{document}
```

## up{{site.latex}}

```latex
% !TEX uplatex
\documentclass[uplatex]{jsarticle}
\title{up\LaTeX\ 実験}
\author{林蓮枝}
\begin{document}
\maketitle
\begin{abstract}
本稿では、文書組版システムup\LaTeX{}の使い方を解説します。
up\LaTeX{}を利用するときには、あらかじめ文章中に\TeX{}コマンドと呼ばれる組版用の指示を混在させ\ldots
\end{abstract}
\section{導入}
こんにちは世界
\end{document}
```


## Lua{{site.latex}}

```latex
% !TEX lualatex
\documentclass{article}
\usepackage{luatexja}
\usepackage[japanese]{babel}
\title{Lua\LaTeX\ 実験}
\author{林蓮枝}
\begin{document}
\maketitle
\begin{abstract}
本稿では、文書組版システムLua\LaTeX{}の使い方を解説します。
Lua\LaTeX{}を利用するときには、あらかじめ文章中に\TeX{}コマンドと呼ばれる組版用の指示を混在させ\ldots
\end{abstract}
\section{導入}
こんにちは世界
\end{document}
```

4 comments on commit 24f4916

@MonsieurV
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @davidcarlisle,

I've seen your comment on Latex-Online about platex and uplatex support.
You can try Latex-on-HTTP, another Latex online compiler/API (that I maintain), for which platex and uplatex can be used.

For eg. with uplatex using the json API to compile a PDF:

curl -v -X POST https://latex.ytotech.com/builds/sync \
    -H "Content-Type:application/json" \
    -d '{
        "compiler": "uplatex",
        "resources": [
            {
                "main": true,
                "content": "% !TEX uplatex\n\\documentclass[uplatex]{jsarticle}\n\n\\title{up\\LaTeX\\ 実験}\n\\author{林蓮枝}\n\n\\begin{document}\n\n\\maketitle\n\n\\begin{abstract}\n本稿では、文書組版システムup\\LaTeX{}の使い方を解説します。\nup\\LaTeX{}を利用するときには、あらかじめ文章中に\\TeX{}コマンドと呼ばれる組版用の指示を混在させ\\ldots\n\\end{abstract}\n\n\\section{導入}\nこんにちは世界\n\n\\end{document}"
            }
        ]
    }' \
    > hello_japan.pdf

(For encoding the Latex content to JSON, you can use JSON.stringify in javascript; or online tools like https://onlinetexttools.com/json-stringify-text)

PS. Tell me if you have special integration needs (iframe examples, HTML embed, CLI, etc.)

@davidcarlisle
Copy link
Owner Author

@davidcarlisle davidcarlisle commented on 24f4916 Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonsieurV Thanks for this heads up. I saw your system mentioned in some of the issues over on latexonline.

I may make some experiments and get back to you. As you may have seen I've requested platex support already from latexonline.cc (which is now using the island of tex docker image for texlive 2020 (https://gitlab.com/islandoftex/images/texlive) so I think adding platex should be fairly straightforward I think. However it would be good to have a choice of systems...

Unless I'm mistaken, since I'm starting from a DOM String (the textContent of the pre node with the example), the normal javascript serialisation would make a JSON valid string wouldn't it?

I'll set something up....

@MonsieurV
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm mistaken, since I'm starting from a DOM String (the textContent of the pre node with the example), the normal javascript serialisation would make a JSON valid string wouldn't it?

Yes, using JSON.stringify should make a valid serialization of the Latex file content.

I've just added a querystring GET API, where you can pass your Latex content to be compiler in a string like /builds/sync?compiler=platex&content=\documentclass{article} ....

For eg. https://latex.ytotech.com/builds/sync?compiler=platex&content=%25+%21TEX+platex%0D%0A%5Cdocumentclass%7Bjsarticle%7D%0D%0A%0D%0A%5Ctitle%7Bp%5CLaTeX%5C+%E5%AE%9F%E9%A8%93%7D%0D%0A%5Cauthor%7B%E6%9E%97%E8%93%AE%E6%9E%9D%7D%0D%0A%0D%0A%5Cbegin%7Bdocument%7D%0D%0A%0D%0A%5Cmaketitle%0D%0A%0D%0A%5Cbegin%7Babstract%7D%0D%0A%E6%9C%AC%E7%A8%BF%E3%81%A7%E3%81%AF%E3%80%81%E6%96%87%E6%9B%B8%E7%B5%84%E7%89%88%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0p%5CLaTeX%7B%7D%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9%E3%82%92%E8%A7%A3%E8%AA%AC%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%0D%0Ap%5CLaTeX%7B%7D%E3%82%92%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B%E3%81%A8%E3%81%8D%E3%81%AB%E3%81%AF%E3%80%81%E3%81%82%E3%82%89%E3%81%8B%E3%81%98%E3%82%81%E6%96%87%E7%AB%A0%E4%B8%AD%E3%81%AB%5CTeX%7B%7D%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A8%E5%91%BC%E3%81%B0%E3%82%8C%E3%82%8B%E7%B5%84%E7%89%88%E7%94%A8%E3%81%AE%E6%8C%87%E7%A4%BA%E3%82%92%E6%B7%B7%E5%9C%A8%E3%81%95%E3%81%9B%5Cldots%0D%0A%5Cend%7Babstract%7D%0D%0A%0D%0A%5Csection%7B%E5%B0%8E%E5%85%A5%7D%0D%0A%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C%0D%0A%0D%0A%5Cend%7Bdocument%7D

The Latex content is to be encoded, for eg. with encodeURIComponent

See more examples on: https://github.com/YtoTech/latex-on-http#hello-world-get-querystring-api-experimental

@davidcarlisle
Copy link
Owner Author

@davidcarlisle davidcarlisle commented on 24f4916 Jun 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonsieurV actually I got it working with the json post API, see any of the examples on this site (new latex http button) , but I had some thoughts I'll send mail later see for example the 10-file upload at https://davidcarlisle.github.io/ll/en/lesson-13

Please sign in to comment.