120 votes

Drawing Super Mario Bros.....in LaTeX

As everyone knows, the game was released in 1985, and at that time LaTeX was just making it out into the world and there was no such thing as pdfTeX, let alone TikZ and other fancy systems, so what ...
Phelype Oleinik's user avatar
69 votes
Accepted

Welcoming 2019 Lunar New Year: How to draw a (lovely) pig?

The very first appearance of the tikzpig: \documentclass{standalone} \usepackage{tikz} \definecolor{piglight}{RGB}{246,208,198} \definecolor{pigdark}{RGB}{241,164,142} \begin{document} \begin{...
samcarter_is_at_topanswers.xyz's user avatar
68 votes

Welcoming 2019 Lunar New Year: How to draw a (lovely) pig?

You really don't need any packages for this \documentclass{article} \begin{document} \begin{picture}(100,100) \put(43,56){\circle{6}} \put(43,56){\circle*{1}} \put(57,56){\circle{6}} \put(57,56){\...
David Carlisle's user avatar
52 votes

Drawing on an image with TikZ

In meantime there is a new package callouts In the annotate-environment you define the image width and an annotation scale. If you scale both with the same factor, then you can change the size of the ...
knut's user avatar
  • 8,748
51 votes
Accepted

a+b whole cubed in Latex

Welcome to TeX.SE!!! Here is a possibility. For this you'll need TikZ package an its libraries 3d and perspective. What I'm proposing is to create two macros. The first one, simplecube draws a ...
Juan Castaño's user avatar
45 votes

Welcoming 2019 Lunar New Year: How to draw a (lovely) pig?

For the sake of completeness, let's go for a Unicode pig! % arara: xelatex \documentclass{standalone} \usepackage{fontspec} \usepackage{graphicx} \setmainfont{Symbola} \begin{document} \scalebox{10}...
Paulo Cereda's user avatar
  • 44.1k
43 votes
Accepted

Drawing Super Mario Bros.....in LaTeX

What if Mario and Luigi are going to a party? Somebody said that they love ducks!! From The TikZducks package MWE \documentclass[border=2mm]{standalone} \usepackage{xcolor} \usepackage{tikzducks} \...
Sigur's user avatar
  • 37k
26 votes

How can I draw the trefoil knot in 3D co-ordinates in Latex using these parametric equations?

I think that the key here is to put more samples. This is your code, with 100 samples. I changed the domain too, from 0 to 2pi, because yours draws everything twice. I also added a view more alike to ...
Juan Castaño's user avatar
25 votes
Accepted

How to create a Langton's ant in latex?

Here's a simple approach in Metapost wrapped up in the luamplib library - compile with lualatex. \RequirePackage{luatex85} \documentclass[border=5mm]{standalone} \usepackage{luamplib} \begin{document}...
Thruston's user avatar
  • 41.9k
25 votes
Accepted

Plot complete Fermi-Dirac integral in Lualatex

This answer has been published as an article in H. Menke, “Tutorial: Using external C libraries with the LuaTeX FFI”, TUGboat, 39 (1), 37–40 (2018) The PDF is available here: https://...
Henri Menke's user avatar
25 votes

How to draw $y^4 - y^2 = x$?

Here is a PGF solution. Responding to your request for plotting multiple functions of the form y^4 - y^2 = x - n, I've added a \foreach loop. Updated with axis labels \documentclass[border=0.5cm]{...
Milo's user avatar
  • 9,390
25 votes

How can I draw the trefoil knot in 3D co-ordinates in Latex using these parametric equations?

This is basic Asymptote code: // // trefoil.asy // // to get trefoil.png, run // asy -f png -render=4 trefoil.asy // // to view it in internal Asymptote 3d-viewer, run // asy -V trefoil.asy // // or,...
g.kov's user avatar
  • 21.8k
20 votes

Drawing on an image with TikZ

For simple tasks, such a heavy weapon like tikz is not always necessary. If only simple shapes or text should be added a picture environment is more then enough: \documentclass{article} \usepackage{...
samcarter_is_at_topanswers.xyz's user avatar
20 votes

Vertical spiral: from old fashioned to tikz

While waiting for a Tikz's answer, see a bit with Asymptote. Compile on http://asymptote.ualberta.ca/ I don't know what \alpha and \gamma mean! settings.render=8; import solids; import graph3; ...
Nguyen Van Chi's user avatar
19 votes

How to draw $y^4 - y^2 = x$?

This answer can be a possible solution for to draw $y^4 - y^2 = x$. \documentclass[10pt]{article} \usepackage{pstricks-add} \usepackage{pst-func} \begin{document} \psset{xunit=1....
Sebastiano's user avatar
  • 52.7k
19 votes

How to draw an eagle?

\documentclass[12pt]{article} \usepackage{tikz} \usepackage{tikzducks} \begin{document} \begin{figure} \centering \begin{tikzpicture}[scale=2.5] \clip(0,0) .. controls (.15,.35) and (2,-.1).. (2,...
Ian Thompson's user avatar
  • 43.4k
18 votes
Accepted

Render stl files in asymptote

Actually, an ascii stl file is so simple it's easy to write an Asymptote script to read it directly. Note, however, that the code below is too simple to offer useful feedback in case the stl file has ...
Charles Staats's user avatar
18 votes
Accepted

How to plot Lambert W function with pgfplots

Since the Lambert W function is a multivalued non-elementary function, then PGFplots can't plot it by just typing \addplot {LambertW(x)};. On the other hand, the inverse function, y e^y is elementary ...
JP-Ellis's user avatar
  • 8,859
17 votes

Flexure of a Grid

If all you need on the belt is the grid, there is an easy way by combining postactions (for lines parallel to the path) and dash patterns (for lines perpendicular to the path) \documentclass[border=9,...
Symbol 1's user avatar
  • 36.7k
16 votes
Accepted

Illustrating Stokes theorem with asymptote

In this solution the surface is defined by function triple f(pair z){ path3 p; p=shift((0, 0, log(1+z.y / (imax / 2)))) * scale3(sqrt(1-(z.y^2)/imax^2)) * path3D; return relpoint(p,z.x); } ...
g.kov's user avatar
  • 21.8k
16 votes

How to create a Langton's ant in latex?

Here is a LaTeX solution that uses tikz to draw the world. The rules of Langton's ant according to Wikipedia: At a white square, turn 90° right, flip the color of the square, move forward one unit. ...
gernot's user avatar
  • 48.7k
16 votes

pgfplots: problem with convergence of addplot on (sin(x) - x cos(x)) / x^3

If you want to go all the way to 0, then I would suggest using the first terms of the Taylor expansion near 0 \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
Andrew Swann's user avatar
  • 94.9k

Only top scored, non community-wiki answers of a minimum length are eligible