The Stack Overflow podcast is back! Listen to an interview with our new CEO.
43

2016 Christmas Edition I experimented here with trying to produce a geometric figure near the firework core, by using simple glyphs like + and -. When duplicated with rotation and shift, I think the effect is very nice way to highlight the event. 2015 CHRISTMAS EDITION Here I introduce my first triple-burst firework, with "For unto us" as the inner burst,...


18

\tag is intended to be used a a one-off equation number as an alternative to just adding one to the last number used. In particular it becomes the default text for \ref. This gives some clues as to when to use one or the other. If the comment is essentially part of the equation as in your examples, use \text you will never want see equation \ref{foo} to ...


16

This is more concise (and no less readable than most tikz code:-) \documentclass[tikz]{standalone}\usetikzlibrary{calc,intersections, angles,quotes}\def\c{\coordinate}\def\d{\draw}\def\p{\path} \def\pp#1#2#3#4#5{\p[name path=#1](#2)--+(#3);\p[name intersections={of=#1 and #4,#5}];}\let\q\pgfmathsetmacro \begin{document}\def\z#1#2#3#4#5#6#7#8{\begin{...


16

Fireworks, in any flavor of TeX, but only text? Then the old package happy4th meets the requirements. Really is only an little obfuscated TeX file: % Author: Brian Blackmore <blb8@po.cwru.edu> % Date: July 4, 2007 % Version: 20120102 % Original source: efnet #TeX % License: Public Domain % Requirements: Plain TeX % \nopagenumbers \centerline{...


15

With tikz: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[ node distance = 0mm, box/.style = {draw, minimum size=10mm, fill=black, outer sep=0pt}, ] \edef\size{4} \foreach \y in {0,...,\size} \foreach \x in {0,...,\size} {\ifnum\x=\y \node[box] at (\x,\size-\y) {}; \node[box] at (\x,\...


14

I hope, I got you right. \documentclass[letterpaper]{article} \usepackage{amsmath} \usepackage{tikz} \usepackage{epigraph} \usepackage{lipsum} \renewcommand\epigraphflush{flushleft} \renewcommand\epigraphsize{\normalsize} \setlength\epigraphwidth{0.7\textwidth} \definecolor{titlepagecolor}{cmyk}{0.436,.865,0,.478} \DeclareFixedFont{\titlefont}{T1}{ppl}{b}...


10

Some shortening without the angle arrow. But that can be done with angle library anyway. Changing the angle is possible. \documentclass[tikz]{standalone}% \begin{document} \begin{tikzpicture} \def\myang{35} \draw (0,0) coordinate(o) --+(\myang:1cm) +(1,0)arc (0:\myang:1cm) node[right,midway]{$\alpha$}--(\myang:3cm) coordinate (a) node[minimum ...


10

A PSTricks solution only for fun purposes! \documentclass[border=1pt]{standalone} \usepackage{pstricks} \def\obj#1{% \pspicture[dimen=m](#1,#1) \multips(0,0)(0,1){#1}{\multips(0,0)(1,0){#1}{\psframe(1,1)}} \multips(0,0)(1,1){#1}{\psframe*(1,1)} \multips(0,#1)(1,-1){#1}{\psframe*(1,-1)} \endpspicture} \begin{document} \...


9

Reducing the keystrokes even further (just for fun of course) with TikZ: \documentclass[tikz,border=5]{standalone} \begin{document} \begin{tikzpicture}[>=stealth] \draw [dashed] circle [radius=4]; \foreach \i [evaluate={\a=\i*45-45; \b=\a+22.5; \c=cos(\b)<0; \d=sin(\b)<0;}] in {1,...,8}{ \draw (\a:3.875) -- (\a:4.125) node [at end, anchor=\a+180] ...


9

Edit: The following works for all values of size \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \edef\size{4} \foreach \x in {0,...,\size} \foreach \y in {0,...,\size} { \pgfmathsetmacro{\colour}{(\x==\y || \x+\y==\size) ? "black" : "none"} \draw[fill=\colour] (\x,\y) rectangle ++ (1,1); } \end{tikzpicture} \...


8

For once, here is a TikZ solution to a PSTricks question: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=.1,thick,line join=round] % Parameters \def\h{150} % height \def\w{45} % width \def\hb{8} % height of base \def\hd{18} % height of drawer \def\d{1} % vertical space between drawers \def\b{1}...


8

It is still too short in an animation. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-eucl} \psset { CurveType=polygon, PointName=none, PointSymbol=none, LabelSep=.5, MarkAngleRadius=1, } \begin{document} \multido{\n=3.14+.10}{50}{% \begin{pspicture}(8,6) \pstGeonode{A}(7,0){B}(7,6){C} \pstMarkAngle[arrows=->...


7

I believe this solution is much simpler than the existing ones. Without declaring nodes! :-) \documentclass[pstricks]{standalone} \usepackage{pst-node,multido} \usepackage[locale=DE]{siunitx} \def\Label#1{\ncput*[nrot=:U]{\large\SI{#1}{\cm}}} \def\Inner{{% \psset{xunit=3.25cm,yunit=3cm} \begin{pspicture}(8,6) \bgroup \psset{linewidth=3pt} ...


7

Single: \documentclass[pstricks]{standalone} \usepackage{pst-node,pst-eucl} \usepackage{multido} \usepackage[nomessages]{fp} \FPset\Distance{1}% in cm \FPset\Radius{.25}% in cm \psset{MarkAngleRadius=.4,LabelSep=.6,arrows=<->,arcsep=2\pslinewidth,arrowinset=0,arrowscale=0.6,dimen=outer} \def\Picture#1{% \FPeval\Right{round((#1-1)*Distance/2+...


7

Without TikZ. \documentclass[pstricks,border=6pt]{standalone} \SpecialCoor \usepackage{fp} \FPset\RR{2}% circle radius \FPeval\XX{RR*root(2,3)} \FPeval\RX{XX+RR} \FPeval\Width{2*RX} \FPeval\Height{RX*root(2,3)} \def\Atom#1{% \pscircle(\XX,\RR){\RR} \psline(\RX;60)(0,0)(\RX,0) \bgroup \psset{linestyle=dashed} \psarc(0,0){15pt}{0}{60} ...


7

There's no problem in what you're doing, although I'd prefer leaving the restoration of the category code: \documentclass{article} \begingroup \catcode`\%=12 \gdef\datestring{ %d } \endgroup \begin{document} \datestring \end{document} If the filter has changed %d into something else, there will be no problem, because the definition of \datestring is ...


6

\documentclass{article} \usepackage[pdf]{pstricks} \usepackage{pst-eucl} \begin{document} \psset{unit=0.08cm} \newcommand\height{150 }% trailing spaces are necessary here!! \newcommand\width{45 } \newcommand\drawerheight{18 } \newcommand\drawercount{5 } \newcommand\baseheight{8 } % The triangle of \height and \halfwidth has the angle a at the top (called ...


6

UPDATE: Demonstrating the flexibility of my code. (Thanks to @Herbert for mentioning \pspolygon[showpoints].) Construction: In \tile we write the pstricks code how to create a tile (e.g., a triangle). For the length of a side of a triangle we use 2 for simplicity. Hence, half of the length of a side is 1. To create the entire figure we print \tile ...


6

I suggest using \centering instead of {center} since the former adds no vertical space and let’s you control the spacing exactly it without the need of fiddling with corrections. To use \centering only for a part of your document enclose it in a group, i.e. {…}, and add a \par after it but inside the group. Then use \(add)vspace with \baselineskip as value ...


5

I really don't understand the purpose of presenting the outer square especially for odd-side regular polygons. In this answer I omit the outer square. Single: \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot,pst-node,siunitx} \usepackage[nomessages]{fp} % constants declarator \def\LoadConstants{} \newcommand\const[3][6]{% \edef\...


5

Using pst-sex package to provide constants in both TeX and PS worlds at the same time. \documentclass[pstricks,border=1pt]{standalone} \usepackage{pst-node} \usepackage{pst-sex} \usepackage[locale=DE]{siunitx} \const[1]{Radius}{19.2} \const[1]{Width}{33.3} \const{Height}{2*Radius} \const{Length}{Width+Height} \psset{unit=0.168cm} \begin{document} \begin{...


5

Here is a TikZ solution. First, with dimensions: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture} \definecolor{r1}{RGB}{0,129,188} \definecolor{r2}{RGB}{252,177,49} \definecolor{r3}{RGB}{35,34,35} \definecolor{r4}{RGB}{0,157,87} \definecolor{r5}{RGB}{218,30,38} \coordinate (r1) at (-6.5,1....


5

I wrote several similar systems, none of them for LaTeX though, probably for the good reason raised by David Carlisle, that using such macro interfaces in LaTeX would confuse users and cancel any benefits you could have from such an interface. Let me review one of these systems, it is carefully described so that you can easily adapt these techniques to your ...


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