# Sutra Styles

**URL:** <https://community.wanikani.com/t/sutra-styles/47303>\
**Category:** Japanese Language\
**Created:** [November 22, 2020, 7:04pm UTC](https://community.wanikani.com/t/sutra-styles/47303 "2020-11-22T19:04:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 22, 2020, 7:04pm UTC](https://community.wanikani.com/t/sutra-styles/47303/1 "2020-11-22T19:04:24Z")

</div>

I’ve been messing about with typesetting Buddhist Sutras in Japanese, inspired by @RoseWagsBlue and her scholarly and typesetting projects. What started as a fix for one file has become a collection of LaTeX code that makes typesetting your favorite Japanese text easy. I hope so anyway.

Here is the project in its latest stage. I’d love feedback, bug reports, comments, etc.

ジョージ

> **[sutra-styles.pdf](https://gwmatthews.github.io/sutra-styles.pdf)**
>
> 107.60 KB

---

<div class="post-metadata">

**Author:** ![RoseWagsBlue](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rosewagsblue/32/713093_2.png) [@RoseWagsBlue](https://community.wanikani.com/u/RoseWagsBlue)\
**Post date:** [November 22, 2020, 7:42pm UTC](https://community.wanikani.com/t/sutra-styles/47303/2 "2020-11-22T19:42:11Z")

</div>

I am going to have some hints for you. In the past, I have typeset vertical text by other methods than multicol…

Looking back through documents, I have things like this:

\newcommand{\yojipage}[1]  
{  
\newpage  
\fontsize{24}{24}  
\begin{center}  
\rotatebox{-90}{  
\begin{minipage}{0.95\textwidth}  
\CJKfamily{cjk-vert}  
#1\  
\end{minipage}  
}  
\end{center}  
}

In isolation this code does not mean much, it is just a way I found to rotate a single little page with a line of kanji.

Also, you need clever ways to rotate the character “–”, (ichi) which appears quite frequently. I seem to recall some documentation for xeCJK that is in Chinese, but can be deciphered with effort.  
Also, there are a few other \LaTeX heads here.

Here is a workaround in isolation:

\newcommand{\stick}{\scalebox{-1}[1]{\rotatebox[origin=tr]{90}{ー}\hspace{0.75em}}}

I used this to rotate ichis. Where there is an ichi in your doc, you just use the command \stick. I don’t know how I came up with the 0.75em hspace. Maybe I should document better!

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 22, 2020, 8:10pm UTC](https://community.wanikani.com/t/sutra-styles/47303/3 "2020-11-22T20:10:38Z")

</div>

> [@RoseWagsBlue](#):
>
> \newcommand{\stick}{\scalebox{-1}[1]{\rotatebox[origin=tr]{90}{ー}\hspace{0.75em}}}

Oh is that what the stick command is for… It makes lots of sense now. I’ll use it!

So far I think multicol works really well. And now that I figured out how to add chunks of text all at once, the job of typesetting has become easy. One can easily change column numbers and font sizes to get the spacings right.

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 22, 2020, 9:03pm UTC](https://community.wanikani.com/t/sutra-styles/47303/4 "2020-11-22T21:03:56Z")

</div>

Updated things. What do you think now? Are the ichi’s properly rotated?

---

<div class="post-metadata">

**Author:** ![RoseWagsBlue](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rosewagsblue/32/713093_2.png) [@RoseWagsBlue](https://community.wanikani.com/u/RoseWagsBlue)\
**Post date:** [November 22, 2020, 11:56pm UTC](https://community.wanikani.com/t/sutra-styles/47303/5 "2020-11-22T23:56:27Z")

</div>

Nice ichis, dude!  
Actually, your documents look real sharp how they are set up.  
If you need a challenge, you could use some code to set the desired number of characters in each column, and the code would calculate the right size of text so that it would fit. 🙂

Actually, what I will do soon is use the Styles to lay out a few pages, and then suggest some new features. I never wrote a Style or a Package, so I am now envious.

I have always intended to make a little package for making multifolded booklets with Japanese and English text. I have a nice system for putting them together, but I just want to make a final reproducible version of it.

> [@One yojijukugo (four character idiomatic compound) for each level](https://community.wanikani.com/t/one-yojijukugo-four-character-idiomatic-compound-for-each-level/32878/63):
>
> This is the book as is. Each little folded part is one “signature”. Each signature is one piece of paper, folded, then the edges chopped off. If you look closely at decently bound books, they are all assembled this way. I just realized that the first purchase I ever made as an adult (over 30 years ago) was my paper cutter. I still use it. It has cut a lot of little books. Still to do: bind book. Clamp pages Drill holes Stitch binding Make cardboard cover Glu…

Scroll down a little on that thread and you will see the finished and bound result. Another user even bound one too!

---

<div class="post-metadata">

**Author:** ![RoseWagsBlue](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rosewagsblue/32/713093_2.png) [@RoseWagsBlue](https://community.wanikani.com/u/RoseWagsBlue)\
**Post date:** [November 23, 2020, 12:03am UTC](https://community.wanikani.com/t/sutra-styles/47303/6 "2020-11-23T00:03:22Z")

</div>

Not rotated properly here! ☹

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/4X/c/b/8/cb8c4c1844f7b52cc381028d72b73521500be9d0.png)

Very confuse! Tex wut?

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 23, 2020, 12:20am UTC](https://community.wanikani.com/t/sutra-styles/47303/7 "2020-11-23T00:20:55Z")

</div>

Should it be centered? Was that the function of the 0.75 em (I took that out and fiddled around with position parameters to not much avail)? Is there any way to use your `\stick` command to push the uchi arbitrary distances to the left?

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 23, 2020, 12:40am UTC](https://community.wanikani.com/t/sutra-styles/47303/8 "2020-11-23T00:40:12Z")

</div>

> [@RoseWagsBlue](#):
>
> \hspace{0.75em}

Ok So I think it fixed the spacing of the ichis.

As for packages and such, I have never really built one before. I am trying to stick to ideas of modular design and not repeating myself, but beyond that I am making things up as I go, so any ideas or strategic advice would be appreciated. I think the next step should be to organize the already burgeoning code. I think examples can be shortened, moved aside and automated as a next step. And then finally the whole things should probably be rewritten as a LaTeX .sty file I imagine. That will be a fun thing to figure out how to do!

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 23, 2020, 3:01am UTC](https://community.wanikani.com/t/sutra-styles/47303/9 "2020-11-23T03:01:09Z")

</div>

It’s now officially a LaTeX package called `sutras.sty`.

> **[sutra-styles.pdf](https://gwmatthews.github.io/sutra-styles.pdf)**
>
> 107.60 KB

---

<div class="post-metadata">

**Author:** ![RoseWagsBlue](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rosewagsblue/32/713093_2.png) [@RoseWagsBlue](https://community.wanikani.com/u/RoseWagsBlue)\
**Post date:** [November 23, 2020, 9:58am UTC](https://community.wanikani.com/t/sutra-styles/47303/10 "2020-11-23T09:58:05Z")

</div>

Thank goodness! I couldn’t sleep worrying about those uncentered ichis. I will look at the code a bit. Maybe this will push me to finally write my own package of some kind.

…

Now I have looked though the .sty code. Simple, nice, functional. I like. Good work!  
Also, you took enough care to fix things like turning a しゅ to a しゅう in my sloppy work.

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 23, 2020, 6:08pm UTC](https://community.wanikani.com/t/sutra-styles/47303/11 "2020-11-23T18:08:15Z")

</div>

Was lucky I caught that missing う

Thanks for the kind words! I redid the \haiku \compactVerse and \spacedVerse commands to make them easier to use. You don’t need a comma separated list of characters any more but can enter a string, with the possibility of grouping them as well like so {ab}.

```auto
\begin{multicols}{7}
	\RLmulticolcolumns
	\compactVerse{%
		般若心經ロ\stick マ字佛説摩訶般若波羅蜜多心經観自在菩薩行深般若波羅蜜多時照見五蘊皆空度 \stick 切苦厄
	}
\end{multicols}

```

[https://gwmatthews.github.io/verse-test.pdf](https://gwmatthews.github.io/verse-test.pdf)

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 24, 2020, 9:41pm UTC](https://community.wanikani.com/t/sutra-styles/47303/12 "2020-11-24T21:41:19Z")

</div>

> [@RoseWagsBlue](#):
>
> If you need a challenge, you could use some code to set the desired number of characters in each column, and the code would calculate the right size of text so that it would fit. 🙂

I have a quicker way to do this. You just use `\raggedcolumns` attached to the `\RLmulticolumns` – that allows for variable length columns. Then you use an individual `\haiku{}` group for each coulumn’s set, separated by `\columnbreak`

```auto
\renewcommand{\kanji}{\centering\fontsize{35}{35}}
	\begin{multicols}{4}
		\RLmulticolcolumns\raggedcolumns
		
		\haiku{古池や}
		\columnbreak
		\haiku{蛙飛び込む}
		\columnbreak
		\haiku{水の音}
		\columnbreak
		\haiku{\coda{ 芭蕉 }\coda}
			
	\end{multicols}

```

This is the famous Basho haiku about the frog and the pond. The last two characters are his name kanji, so they are typeset to appear side by side, with a dot before and after.

> **[verse-test.pdf](https://gwmatthews.github.io/examples/verse-test.pdf)**
>
> 114.84 KB

---

<div class="post-metadata">

**Author:** ![RoseWagsBlue](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rosewagsblue/32/713093_2.png) [@RoseWagsBlue](https://community.wanikani.com/u/RoseWagsBlue)\
**Post date:** [November 24, 2020, 9:52pm UTC](https://community.wanikani.com/t/sutra-styles/47303/13 "2020-11-24T21:52:00Z")

</div>

You have inspired me to work on a style for my books of 四字熟語. Somewhat backwardsly, I can never get LaTeX typesetting to work on my linux laptop, but I have no problem on my windows desktop. But my back gets sore in front of that computer, so that limits my time working on it (which is good, I suppose).

For your code, I would like to see you further abstract the whole process. In other words, instead of a renewcommand, the command would accept more options and variables. You have abstracted much of it already.

I am going to go log into my other computer and send myself some documents, so that I can work on this computer! I really need to get LaTeX set up right on this.

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 24, 2020, 10:02pm UTC](https://community.wanikani.com/t/sutra-styles/47303/14 "2020-11-24T22:02:51Z")

</div>

Well good for you and I look forward to seeing those books!

Just so you know, I modularized things so now it should be easy add new texts. So far I have files in the /texts subdirectory with titles such as `four-vows-compact.tex` or `heart-sutra-tracing.tex` that are basically pre-formatted chunks of text that can be inserted into a document with a simple `input{../texts/heart-sutra-compact}` command.

Things are improving! And if you have more texts to contribute, with or without readings, have a look in the /texts folder for what they look like.

Linux and LaTeX play together just fine on my laptop! For what it’s worth, I installed LaTeX in this machine in a stripped down way to avoid the bloat that I used to have with it (Linux MInt 20 xfce version on a Lenovo Y700). This time I around I installed it via RStudio (used for other projects), and in particular using the rstudio tinytex package. It is trimmed down but also installs things in a way that I don’t need to be root to install new packages as needed. Other than that it is just occasional `tlmgr install package` when I need things,

---

<div class="post-metadata">

**Author:** ![RoseWagsBlue](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rosewagsblue/32/713093_2.png) [@RoseWagsBlue](https://community.wanikani.com/u/RoseWagsBlue)\
**Post date:** [November 24, 2020, 10:06pm UTC](https://community.wanikani.com/t/sutra-styles/47303/15 "2020-11-24T22:06:35Z")

</div>

You need to do a Japanese Lorum Ipsum with it. 🙂

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 24, 2020, 10:07pm UTC](https://community.wanikani.com/t/sutra-styles/47303/16 "2020-11-24T22:07:14Z")

</div>

That’s what the 4 vows and the heart sutra have become!

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 25, 2020, 12:19am UTC](https://community.wanikani.com/t/sutra-styles/47303/17 "2020-11-25T00:19:32Z")

</div>

And speaking of the heart sutra… let me know if you see any mistakes. And yes other fonts are possible.

> **[heart-sutra-annotated-master.pdf](https://gwmatthews.github.io/examples/heart-sutra-annotated-master.pdf)**
>
> 90.01 KB

Here’s the entire source code for the document:

```auto
% Typeset sutras for tracing, reading, chanting

\documentclass[letterpaper]{article}
\usepackage[left=2cm, right=2cm, top=0.3cm, bottom=0.3cm]{geometry}

\usepackage{sutras}
%%% CHOICE OF FONTS
 
%\setCJKmainfont{KanjiStrokeOrders} %% for tracing 
%\setCJKmainfont{ipam.ttf} %% serif
%\setCJKmainfont{ipaexm.ttf} %% serif
\setCJKmainfont{ipag.ttf} %% sans
%\setCJKmainfont{ipamp.ttf} %% sans
%\setCJKmainfont{ipaexg.ttf} %% sans
%\setCJKmainfont{YOzM90.ttf} %% calligraphic
%\setCJKmainfont{Harano Aji Mincho SemiBold} %% calligraphic
%\setCJKmainfont{KouzanGyoushoOTF.otf} %% calligraphic

%%%%%%%
%%%%%% END PREAMBLE
%%%%%%%

\begin{document}
	
	\input{../texts/heart-sutra-annotated.tex}
	
\end{document}

```

---

<div class="post-metadata">

**Author:** ![RoseWagsBlue](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rosewagsblue/32/713093_2.png) [@RoseWagsBlue](https://community.wanikani.com/u/RoseWagsBlue)\
**Post date:** [November 29, 2020, 12:21pm UTC](https://community.wanikani.com/t/sutra-styles/47303/19 "2020-11-29T12:21:31Z")

</div>

I need to apologize. I am such a total doofus.  
I some how got this thing about rotating ichis. And I have sometimes seen text with them rotated.  
But they are not usually rotated, and they certainly don’t need to be.  
I was corrected here on WK, and then looked through some books.  
I don’t know how I ever got the idea in my head. But I am glad I have fixed it.  
In the meanwhile, I have spread my faulty knowledge on to you. ☹  
I am so sorry for that. But it can all be fixed. 🙂

---

<div class="post-metadata">

**Author:** ![MashusuJooji](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/mashusujooji/32/302199_2.png) [@MashusuJooji](https://community.wanikani.com/u/MashusuJooji)\
**Post date:** [November 29, 2020, 3:01pm UTC](https://community.wanikani.com/t/sutra-styles/47303/20 "2020-11-29T15:01:06Z")

</div>

Haha, thanks for letting me know! I had no idea about them being a beginning Japanese reader, but figured, sure why not, maybe there is a taboo about covering things with sticks in Japan. It’s a simple fix – find and replace \stick with 一. Now I just have to issue a recall and second edition notice to all of the myriads of people who downloaded the whole heart sutra and were happily tracing it out, vertical lines and all ☹

---

<div class="post-metadata">

**Author:** ![RoseWagsBlue](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rosewagsblue/32/713093_2.png) [@RoseWagsBlue](https://community.wanikani.com/u/RoseWagsBlue)\
**Post date:** [November 29, 2020, 3:31pm UTC](https://community.wanikani.com/t/sutra-styles/47303/21 "2020-11-29T15:31:13Z")

</div>

This is a lesson about how something totally wrong can get stuck in a person’s head. I cannot now remember how I picked the idea up. And yet, in any text I read, the ichis are clearly horizontal. You have my deepest apologies for passing this wrong information on to you.

This is a lesson that I will remember.

[Next page](https://community.wanikani.com/t/sutra-styles/47303.md?page=2)
