Tag Info

Hot answers tagged

10

You could use the TikZ polygon shapes in a \foreach loop. Add color and styles as you like. Key points are regular polygon shape of the shapes.geometric library relative positioning of the positioning library remember the last node, using characters a, b, ... for node names using the south anchor for positioning and anchoring at the same base line ...


8

Update I simplified the code using a \pic for the fundamental domain. For the color, I present three options: Randomly selecting shades of a fixed color (red, in my example), gives different coloring for each piece: \documentclass[tikz]{standalone} \usetikzlibrary{calc} \tikzset{ fundamental/.pic={ \draw[,scale=0.4,black,fill=red!\tmp,rotate ...


8

The definitions of \B and \C are the problem: \def\B{\advance\cnt@a by-1} \def\C{\ifnum\cnt@a>0} TeX does not stop at the end of the numbers, but continue expanding until it finds a token, which is not a digit, e.g.: \B1234\relax will decrease \cnt@a by -11234, not by -1. Or \B\C Then the \ifnum is executed before the counter is decreased. Both ...


5

Like this? \documentclass{article} \usepackage{pgffor} \usepackage{graphicx} \begin{document} \foreach \x in {a,b,c} { \begin{figure}[p] \includegraphics[scale=.5]{example-image-\x} \caption{So, three figures displayed, and this one has the number \x\ of the letter position (or iteration count)} % ie. 1 for a, 2 for b, 3 for c \end{figure} ...


5

As a single path: \documentclass[tikz,border=5]{standalone} \begin{document} \tikz\draw (0,0) \foreach \i in {3,...,10} \foreach \j in {1,...,\i}{ -- ++(360/\i*\j:1) }; \end{document}


3

You can also do this very simply in plain Metapost. My poly_on routine will return the path of an n-sided polygon using the line between points a and b as a base. prologues := 3; outputtemplate := "%j%c.eps"; % return the path of a polygon with n sides % using points a and b as the base vardef poly_on(expr a,b,n) = save s,t,c; pair c; s = 360/n; ...


3

As I understand the question, all the polygons should have the same side and should sit on a common base. Here's how to easily do it. \Multipol{<number>} builds regular polygones of 3,4,...,<number> sides all sitting on a common base. The code: \documentclass[border=4pt]{standalone} \usepackage{tikz} \newcommand\polygon[2][]{ ...


2

How about this: \documentclass{article} \usepackage{forloop} \begin{document} \newcounter{i} \forloop{i}{1}{\value{i} < 4} { $\thei$ } \forloop{i}{1}{\value{i} < 4} { \roman{i} } \end{document}


2

This is a halfway construction. \documentclass{beamer} \usepackage{xparse} \ExplSyntaxOn \def\addpause#1{\rotatebox{180}{$\mathord{}=#1$}\pause} \DeclareDocumentCommand\BeamerRep{>{\SplitList{=}}m}{ \edef\tempA{{\tl_reverse_items:n{#1}}} \expandafter\ProcessList\tempA{\addpause} } \ExplSyntaxOff \begin{document} \begin{frame}\Huge ...


1

Try this code. Instead of 5 put the max number of files you have. The optional argument allow you to input a particular file if you need. \documentclass{article} \usepackage{graphicx} \makeatletter \newcount\sk@vignette \newcommand*\vignette[1][]{\begingroup \ifx\@empty#1\@empty \global\advance\sk@vignette by\@ne\relax \else \sk@vignette=#1\relax ...



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