
Me quedé atascado tratando de encontrar una manera de hacer una partitura de Okinawa llamada "Kunkunshi" (ver imagen a continuación).
Básicamente, estoy intentando hacer una cuadrícula de caracteres japoneses. Debe haber doce cuadrados en una columna, separados por un espacio de aproximadamente el 66% del ancho de los cuadrados. Los caracteres deben estar centrados en el cuadrado o en una fuente más pequeña en medio de dos cuadrados. Idealmente, las letras podrían escribirse junto a los caracteres en la cuadrícula como se muestra en la imagen.
La ayuda más cercana que pude encontrar fueesta pregunta sobre plantillas de escritura japonesa.
Respuesta1
Lo siguiente le proporcionará algo para empezar. Hay un bucle para dibujar la cuadrícula y una API rudimentaria para colocar letras en algunas celdas, líneas o lugares de "letras". Solicite aclaraciones en los comentarios si es necesario.
\documentclass [border=2mm]{standalone}
\usepackage{tikz}
\begin{document}
\def\atcenter#1#2#3{
% Puts #3 at cell (#1,#2)
\path (#1,#2) +(.3,.5) node {#3};
}
\def\atline#1#2#3{
% Puts #3 at the line between cells (#1, #2-0.5) and (#1, #2+0.5)
\path (#1,#2) +(.3,.5) node[fill=white, font=\tiny, inner xsep=1mm, inner ysep=0] {#3};
}
\def\lyrics#1#2#3{
% Puts #3 at the right side of the column #1, at fractional y-coordinate #2
\path (#1,.5) +(.6,#2) node[font=\tiny,anchor=west, inner sep=0.5mm] {#3};
}
\begin{tikzpicture}[x=10mm,y=-6mm]
% Draw the grid
\draw[thick] (1,1) rectangle (11,13);
\foreach \column in {1,...,10} {
\foreach \row in {1,...,12} {
\draw (\column,\row) rectangle +(0.6,1);
}
}
% Some example letters in cells
\foreach \letter [count=\i from 1] in {A,B,C,D,E,F,G,H,I,J,K,L} {
\atcenter{10}{\i}{\letter};
}
% Some example letters at lines
\atline{10}{2.5}{a};
\atline{10}{3.5}{b};
% Another column with letter
\foreach \letter [count=\i from 1] in {M,N,O,P,Q,R} {
\atcenter{9}{\i}{\letter};
}
% Example "lyrics". Note the expression used as #2
\foreach \letter [count=\i from 1] in {f,o,o,b,a,r} {
\lyrics{9}{3+\i*0.4}{\letter}
}
\end{tikzpicture}
\end{document}
El código anterior produce:
Actualizar
Sólo por diversión, lo probé con caracteres japoneses para ver si funcionaba. ¡Funcionó! (requiere xelatex y la fuente AozoraMinchoRegular.ttf, que esgratis).
Descargo de responsabilidadNo entiendo ni una palabra de japonés :-)
Código:
\documentclass [border=2mm]{standalone}
\usepackage{xeCJK}
\setCJKmainfont{AozoraMinchoRegular.ttf}
\usepackage{tikz}
\begin{document}
\def\atcenter#1#2#3{
% Puts #3 at cell (#1,#2)
\path (#1,#2) +(.3,.5) node {#3};
}
\def\atline#1#2#3{
% Puts #3 at the line between cells (#1, #2-0.5) and (#1, #2+0.5)
\path (#1,#2) +(.3,.5) node[fill=white, font=\tiny, inner xsep=1mm, inner ysep=0] {#3};
}
\def\lyrics#1#2#3{
% Puts #3 at the right side of the column #1, at fractional y-coordinate #2
\path (#1,.5) +(.6,#2) node[font=\tiny,anchor=west, inner sep=0.5mm] {#3};
}
\begin{tikzpicture}[x=10mm,y=-6mm]
% Draw the grid
\draw[thick] (1,1) rectangle (11,13);
\foreach \column in {1,...,10} {
\foreach \row in {1,...,12} {
\draw (\column,\row) rectangle +(0.6,1);
}
}
% Some example letters in cells
\foreach \letter [count=\i from 1] in {中,中,工,上,四,合,四,五,中,中,工,上}
{
\atcenter{10}{\i}{\letter};
}
% Some example letters at lines
\atline{10}{2.5}{五};
\atline{10}{3.5}{中};
% Another column with letter
\foreach \letter [count=\i from 1] in {四,合,四,五,中,中,工,上}
{
\atcenter{9}{\i}{\letter};
}
% Example "lyrics". Note the expression used as #2
\foreach \letter [count=\i from 1] in {日,本,語,で} {
\lyrics{9}{3+\i*0.5}{\letter}
}
\end{tikzpicture}
\end{document}
Resultado: