Could anyone let me know if this could be done using LaTeX? And if so, how do we do that?
[Tex/LaTex] Calligraphy question
fontsgraphics
Related Solutions
In this answer, I will explain how to make animations in both PDF and GIF format:
Make sure you have installed the following applications and set the PATH system variable to their locations.
- TeXLive or MikTeX.
- GhostScript. You can install either the 32 or 64 bit version. The corresponding application names for 32 bit and 64 bit are
gswin32c.exe
andgswin64c.exe
repectively. - ImageMagick. It is required to create GIF animations. You can install either the 32 or 64 bit version.
The first two sections will guide you to create some supporting files that will simplify your workflow. The last section will show how to make use of the supporting files to create animations.
Creating A Multi Purpose Batch File for GIF Animation
Create a batch file named GifAnimate.bat
as follows. It is recommended to save it in a separate directory such that any other projects can make use of it. Don't forget to set the PATH to its location.
rem this is GifAnimate.bat
rem %1 : filename (without extension) of a PDF file having pages to be animated.
rem %2 : delay between frames (in 1/100 miliseconds).
rem %3 : density of the GIF output. The higher it is the bigger output.
echo off
rem remove the previous GIF animation if any.
del %1.gif
convert -delay %2 -loop 0 -density %3 %1.pdf %1.gif
Creating A Multi Purpose Batch File and Template for PDF Animation
Create a batch file named PdfAnimate.bat
as follows. It is recommended to save it in a separate directory such that any other projects can make use of it. Don't forget to set the PATH to its location.
rem this is PdfAnimate.bat
rem %1 : filename (without extension) of a PDF file having pages to be animated.
rem %2 : frame rate (in frames per second).
rem %3 : scale of the GIF output. The higher it is the bigger output.
echo off
rename %1.pdf %1-animate.pdf
pdflatex -interaction=batchmode --jobname=%1 "\newcommand\InputFileName{%1-animate}\newcommand\FrameRate{%2}\newcommand\OutputScale{%3}\input{PdfAnimateTemplate}"
del %1-animate.pdf
Create a template file named PdfAnimateTemplate.tex
as follows. It is recommended to save it in your local TDS such that any other projects can make use of it.
% this is PdfAnimateTemplate.tex
\documentclass[preview,border=12pt]{standalone}
\usepackage{animate}
\begin{document}
\animategraphics[autoplay,loop,scale=\OutputScale]{\FrameRate}{\InputFileName}{}{}
\end{document}
Creating GIF and PDF Animations
Create a LaTeX input file named test.tex
as follows:
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}
\psset{plotpoints=3000,algebraic}
\begin{document}
\multido{\r=-3.5+0.5}{15}
{
\begin{pspicture}(-4,-2)(4,2)
\psaxes[arrows=->,linewidth=0.2pt](0,0)(-3.5,-1.5)(3.5,1.5)[$x$,0][$y$,90]
\psplot[linecolor=red]{-3.5}{\r}{sin(3*x)}
\end{pspicture}
}
\end{document}
First compile it with either LaTeX or XeLaTeX.
With LaTeX is as follows (do one after another):
latex test.tex
dvips test.dvi
ps2pdf test.ps
With XeLaTeX is as follows:
xelatex test.tex
You will have a PDF output named test.pdf
. It consists of 15 pages.
To get the corresponding GIF animation, execute GifAnimate.bat test 20 250
, we will get the following output:
To get the corresponding PDF animation, execute PdfAnimate.bat test 25 3
, we will get a PDF animation (cannot be shown here).
Miscellaneous
Responding to Yiannis Lazarides' comment below. I am lazy to animate Batman as the curve has many discontinuities. Instead, I present another example. Hopefully the following graph is more exciting!
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-solides3d}
\psset{viewpoint=50 20 10 rtp2xyz,Decran=50,linewidth=0.5\pslinewidth}
\begin{document}
\multido{\rx=-0.5+0.05,\ry=-0.45+0.05,\i=1+1}{20}
{
\begin{pspicture}(-0.5,-0.5)(0.5,0.5)
\rput(0,0){%
\begin{pspicture*}(-0.5,-0.5)(0.5,0.5)
\defFunction[algebraic]{helicespherique}(t)
{0.5*cos(10*t)*cos(t)}
{0.5*sin(10*t)*cos(t)}
{0.5*sin(t)}
\ifnum\i=1
\psSolid
[
object=sphere,
linewidth=0.1pt,
linecolor=red,
resolution=720,
action=draw*,
ngrid=9 9,
r=0.5
]\fi
\psSolid
[
object=courbe,
linewidth=0.05pt,
linecolor=blue,
resolution=720,
range=pi \rx\space mul \ry\space pi mul,
function=helicespherique,
r=0.01
]
\end{pspicture*}}
\end{pspicture}
}
\end{document}
Responding to the given comment
If you want to animate test.pdf
(consists of 15 pages) in your PDF document, use the following template and compile with pdflatex
.
\documentclass{article}
\usepackage{animate}
\begin{document}
% your other contents go here
\animategraphics[autoplay,loop,scale=<OutputScale>]{<FrameRate>}{test}{}{}
% your other contents go here
\end{document}
where
<OutputScale>
is a real number representing the scaling factor.<FrameRate>
is an integer representing frames per second.
Of course, <
and >
are not the part of the syntax.
Here you are:
\documentclass{report}
\usepackage[english]{babel}
\usepackage{graphicx}
\begin{document}
\includegraphics[height=3cm]{example-image-b}
\includegraphics[width=5cm]{example-image-b}
\includegraphics[height=3cm, width=3cm]{example-image-b}
\includegraphics[height=3cm, width=6cm]{example-image-b}
\includegraphics[keepaspectratio,height=3cm, width=6cm]{example-image-b}
\end{document}
And the result:
Be very careful! By defining both height
and width
, you will distort the aspect ratio of the images. See the manual of the graphics bundle for more details and how to avoid distortions. To avoid the distortion, you can use the keepaspectratio
-option, as presented in the last command.
Best Answer
I don’t think that this image is created by using a digital font. It seems to be hand drawn, since there are so many different forms of the same characters, e.g. compare the very different
e
,i
,m
t
ors
forms:So the answer to your question is: No it can’t be done with TeX since there is no adequate font for this.
To do something like this, I guess, TeX isn’t the right approche … a vector based image software, like Inkscape or Adobe Illustrator, will do a better job on this … after drawing it in Inkskape one may export the image to TikZ and use this code in a TeX document or simply include an image file (PDF, JPG etc.).
If you find a calligraphy font that looks like you want, it would certanliy be possible to use it with XeTeX, or even PDFLaTeX, but it could be very hard to handle all the ligatures / joins between letters and the positioning so even with a nice font I would rather use Inkscape/Illustrator.