Hot answers tagged

74

There is now a package pullquote which allows to create various shapes of inserts. All you have to specify is the text which should "flow" plus some rectangular "object" which is inserted. Everything else is calculated automatically by the environment pullquote. In principle, every shape can be defined by providing an appropriate shape function macro. See ...


65

One easy way would be to use TikZ as in the following MWE \documentclass[a4paper,12pt]{scrartcl} \usepackage{tikz} \begin{document} Some Text \tikz\draw[red,fill=red] (0,0) circle (.5ex); further text \end{document} which produces Where the first red defines the line style of the drawn circle to be red and the fill=red specifies, that its solid red. You ...


53

Commands \drawCaesarsDisk that works with a number of letters (only A to Z) \drawCaesarsList that works with one list for both rings or two different lists Keys inner radius/middle radius/outer radius Improvements: Specify inner radius and add inner height and outer height respectively to calculate the actual radii. Improvements: With these heights, ...


41

Here's a macro that implements what you described. It takes four arguments: The width and height of the rectangle to be filled, the radius of the circles, and the number of attempts. For each attempt, a random position is generated. The distances between this position and all existing circles are calculated, and if there's a collision, no circle is drawn. ...


33

Just with the help of TikZ it is perfectly possible to do such a job. Here is indeed a possible solution that allows you to easily set the number of points on the circle; set the circle radius; decide the position of the picture in terms of coordinates eventually position labels. The first three things are did by one command: \drawconnectvertices while to ...


31

I'm not sure what you mean by "\textcircled doesn't seem to like this", because \documentclass{article} \begin{document} \raisebox{.5pt}{\textcircled{\raisebox{-.9pt} {$f_n$}}} \end{document} compiles fine for me. That said, it does look a bit rubbish: You might consider a little TikZ picture for this situation. You could put the $f_n$ inside a ...


30

Here's one possibility using \foreach and its evaluate=<variable> as <macro> using <formula> and count=<macro> from <value> syntax: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,shapes.geometric,arrows,fit,calc,positioning,automata,} \usepackage{amsmath} \definecolor{myblue}{RGB}{153,205,255} \begin{...


30

Two examples of what you can draw with the 3d library. The first on has been modified because something was wrong with shade colour. \documentclass[]{article} \usepackage{tikz} \usetikzlibrary{3d} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{5pt}% \begin{document} \begin{tikzpicture} [x={(-0.2cm,-0....


29

\documentclass{standalone} \usepackage{tikz} \usepackage{calc} \newlength{\outerradius} \newlength{\innerradius} \setlength{\outerradius}{2cm} \setlength{\innerradius}{1.5cm} \newcommand{\progresscircle}[1]{ \begin{tikzpicture} \fill[black!50] (0,0) circle (\outerradius); \fill[violet!70] (0,0) -- (0, \outerradius) arc (90:90-3.6*#1:\...


29

in tikz any coordinate of any path command is determined for the infinitely thin lines. the real lines lie over them so that their centers matches. line width of real lines is accessible with length \pgflinewidth. knowing it, it is simple to correct size of some elementary shapes as are rectangles, squares and circles with considering line widths. for ...


28

Here's a new style double circle that can be supplied to a node. It takes two arguments, one for specifying how much larger the radius of the outer circle is (default is 2pt), and the second for specifying the colour (or any combination of options, really) of the inner circle (default is blue). If you specify a node name, this will refer to the outer node (...


28

Something like this? \documentclass{article} \usepackage{tikz,calc} \newlength\charwidth \newlength\chwidth \newcommand*\circled[1]{% \settowidth\charwidth{#1\,\%}% \settototalheight\chwidth{#1\,\%}% \ifdim\chwidth>\charwidth\let\charwidth\chwidth\fi \addtolength\charwidth{5pt}% twice inner sep plus half line width \tikz[baseline=(char.base)]{% ...


24

Another solution with TikZ, but this one creates a command \tikzcircle to be used in the document: \newcommand{\tikzcircle}[2][red,fill=red]{\tikz[baseline=-0.5ex]\draw[#1,radius=#2] (0,0) circle ;}% It takes one mandatory argument, the radius of the circle and an optional argument that helps in customizing the circle's aspect. The code: \documentclass[...


22

I don't think there are automated approached for this kind of thing in LaTeX. The procedure I've implemented is based on trial-and-error and uses \parshape. Here are the steps I followed: 0. Preliminaries \parshape <n> <i1> <w1> <i2> <w2> ... <in> <wn> The first "argument" to \parshape represents the number of ...


21

Here's a different variation. The idea is to generate a bunch of circles, and then to cull those that intersect. For the culling phase, I used a halfway implementation of Sweep & Prune which speeds things up a bit as far as collision detection goes for large n. Generate points randomly Sort their x-coordinates Save pairs whose x-coordinates overlap ...


21

Time to call \foreach. \documentclass{report} \usepackage{tikz,calc} \begin{document} \begin{tikzpicture} \foreach \a in {1,2,...,17}{ \draw (\a*360/17: 4cm) node{angle \a}; } \end{tikzpicture} \end{document}


21

How about this: The command \satisfaction takes one parameter, which has to be a number from 0 to 4. And with the optional parameter, the color can be set. It scales with fontsize. And without optional parameter it takes the surrounding color. The code: \documentclass[10pt,a4paper]{article} \usepackage{tikz} \newdimen\satlevel \newdimen\satdiameter \...


20

morbusg already mentioned that some fonts have encircled numbers as Unicode glyphs and showed how to embed them directly. Some fonts provide a more user-friendly interface for accessing the numbers, e.g. Linux Libertine and Junicode. Obviously, this means that we’re deviating from your requirement to use Computer Modern. The advantage of these Unicode ...


20

Here is what I've done so far: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \pgfmathsetmacro{\alphsize}{26} \pgfmathsetmacro{\ang}{360/\alphsize} \pgfmathsetmacro{\d}{10} \pgfmathsetmacro{\op}{98 + \ang/2 - 1.2} \pgfmathsetmacro{\e}{\ang + \ang*\d} \pgfmathsetmacro{\ep}{\op + \ang*\d} \...


20

In this case it is pretty simple to use the calc and intersections library: \documentclass[tikz,border=0.125cm]{standalone} \usetikzlibrary{calc,intersections} \begin{document} \begin{tikzpicture} \path [rotate=60] (0,0) coordinate (A) (-2,-3) coordinate (B) (0,-3) coordinate (C) ($(B)!2!(C)$) coordinate (D) ($(A)!0.5!(B)$) coordinate (...


19

A recommended solution with PSTricks (plus supporting Chinese characters as you are living in Macau, China), just for best-practitioners. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-eucl} \usepackage{CJKutf8} \newsavebox\IBox \begin{document} \begin{CJK}{UTF8}{bsmi} \savebox\IBox{中} \begin{pspicture}[showgrid=false](5.75,4.25) \...


18

Not sure exactly what you want, but here are five different ways: \documentclass[border=2pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} % Version 1 \draw [red ] (0,0) circle (5pt); \draw [blue] (0,0) circle (10pt); \node at (0,0) {1}; % Version 2 \node [draw=blue,double=red, circle, inner sep=1pt] at (1,0) {2}; % Version 3 \...


18

You don't need to connect nodes. First draw background lines. All starting from (0,0). \foreach \angle in {0,1,...,359} \draw[cyan!50!black] (0,0)--++(\angle:4); Second, draw a circular node white filled: \node[circle, fill=white, text=cyan!50!black, text width=15mm, align=center]{Orion\\2000}; And third (although it's the first command), define the ...


18

It's among the worst notation I have ever seen. If you really want it, at least do it right, with the dot in the middle of the D. \documentclass{article} \usepackage{amsmath} \usepackage{xparse} \usepackage{mathpazo} \NewDocumentCommand{\disk}{smm}{% \IfBooleanTF{#1}{\puncturedD}{D}[#2,#3]% } \makeatletter \newcommand{\puncturedD}{{\vphantom{D}\...


17

Use named nodes. They do that automatically. To name nodes, use either the name=<name> key, or the special syntax (<name>) (see example below) Code \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}% \draw[help lines] (0,0) grid (1,1); \node [draw, circle] (c1) at (0,0) {};% special syntax \...


17

This is a possible solution mainly based on How to generate n points on a circumference and connect all of them while having constraints on the image size? The adaptation from that code concerns how the labels and the colors are customized: I developed two ways basically circumference with labels which allows to customize both; they should be inserted as ...


16

Draw Arched "Rectangle" Around Circle: Below is a macro that draws the desired shape around the circle: \DrawAlong{(Center)}{\Radius}{\Separation}{120}{60} yields the blue shape from 120 to 60 degrees, and \DrawAlong[draw=black,fill=yellow, fill opacity=0.4]{(Center)}{\Radius}{\Separation}{-30}{-60} yields the filled in yellow shape from -30 to -60 degrees: ...


16

Here: \documentclass{article} \usepackage{tikz} \usepackage{ifthen} \newcounter{encrypted} \newcounter{original} \newcommand{\increase}[1]{%command to increase a counter by 1 modulo 26 \ifthenelse{\arabic{#1}<26}{\addtocounter{#1}{1}}{\setcounter{#1}{1}} } \begin{document} \setcounter{encrypted}{7} \setcounter{original}{1} \begin{tikzpicture}[scale=0....


16

Opening notes There is a lot of interesting examples created in the D3js library, see e.g. mbostock's blocks or this gallery. It's quite inspiring. Those examples are fast and we could get SVG files at a JavaScript level, if needed (easily convertible to PDF, TikZ etc.). Let me focus on these types of graphs. I believe these examples belong to a field of ...


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