Skip to content

Instantly share code, notes, and snippets.

@k16shikano
Created February 4, 2021 09:34
Show Gist options
  • Save k16shikano/caecb90c912342063002e580afa4788b to your computer and use it in GitHub Desktop.
Save k16shikano/caecb90c912342063002e580afa4788b to your computer and use it in GitHub Desktop.
扇形に文字を配置するやつ
\documentclass[uplatex,dvipdfmx]{jlreq}
\usepackage{tikz}
\usetikzlibrary {decorations.text}
\def\mycommand#1{\rotatebox{-90}{#1}\relax}
\newlength{\ripplelength}
\newlength{\ripplewidth}
\newcommand{\ripple}[2]{
\settowidth{\ripplelength}{#1}
\setlength\ripplewidth{\dimexpr\ripplelength/3}
\begin{tikzpicture}[remember picture, overlay]
\draw (#2) [decorate,decoration={text effects along path,
text={#1},text align=center,
every letter/.style={character command=\mycommand}}]
arc [start angle=120, end angle=240, x radius=\ripplewidth, y radius=\ripplelength];
\end{tikzpicture}
}
\begin{document}
\ripple{吾輩は猫である。}{3,0}
\ripple{名前はまだ無い。}{2,0}
\ripple{どこで生れたかとんと見当がつかぬ。}{1.5,2.5}
\end{document}
@k16shikano
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment