Tag Info

Hot answers tagged

104

Here's a TikZ solution: \documentclass{article} \usepackage{tikz} \newcommand*\circled[1]{\tikz[baseline=(char.base)]{ \node[shape=circle,draw,inner sep=2pt] (char) {#1};}} \begin{document} Numbers aligned with the text: \circled{1} \circled{2} \circled{3} end. \end{document} It's just a node. TikZ options are used to align the base line, ...


62

I was pleasantly surprised how many people decided to give it a try, and a lot of interesting solutions popped out. As per tradition, this answer will be community wiki and will summarize and compare all suggested solutions. I hereby suggest three different evaluation criteria, each graded from 1 to 5: Simplicity. This is a measure how easy it is to ...


54

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 ...


49

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, ...


31

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 ...


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} ...


21

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 ...


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) ...


19

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} ...


19

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 ...


19

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} ...


18

The quickest fix would be to use the \raisebox command. I've played around with it a bit, and it seems lowering the text by 0.9pt puts the figure approximately in the center: \textcircled{\raisebox{-0.9pt}{8}} You could play around with it to get the absolute center but it's definitely between 0.9 and 1pt. I got the idea here. It seems the \textcircled ...


18

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 ...


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: ...


14

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} ...


14

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 ...


13

PGF is overkill for this one application, but if you already have it loaded, you can use it: \documentclass{article} \usepackage{tikz} \newcommand{\pgftextcircled}[1]{ \setbox0=\hbox{#1}% \dimen0\wd0% \divide\dimen0 by 2% \begin{tikzpicture}[baseline=(a.base)]% \useasboundingbox (-\the\dimen0,0pt) rectangle (\the\dimen0,1pt); ...


13

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 ...


13

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 ...


12

run with xelatex \documentclass{article} \usepackage{pst-poly} \providecommand{\PstPolygonNode}{% \psdots[dotscale=2](1;\INode) \multido{\iA=0+1}{\INode}{% \multido{\iB=\iA+1}{\numexpr\INode-\iA+1\relax}{% \psline[linecolor=blue!50](1;\iA)(1;\iB)}}} \begin{document} \psset{unit=2,linewidth=0.2pt} \PstPolygon[PolyNbSides=4] \qquad ...


12

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. ...


11

As percusse commented, the easiest way is to use two arcs, one of which is without reversing the text. \documentclass[11pt]{scrartcl} % TikZ \usepackage{tikz, pgfornament, tikzrput} \usetikzlibrary{decorations, decorations.text} % font size \usepackage{fix-cm} % cryillic font \usepackage[OT2, OT1]{fontenc} \newcommand\cyr{% ...


11

Edit Here is a second (better?) solution: \documentclass[border={0pt 0pt 0pt 0pt}]{standalone} \usepackage{graphicx,xcolor} \usepackage{pgf,tikz} \usetikzlibrary{arrows,shadings,decorations.text,shadows,fadings} \pgfdeclareradialshading{glow}{\pgfpoint{0cm}{0cm}}{ color(0mm)=(white); color(3mm)=(white); color(7mm)=(black); color(10mm)=(black) ...


11

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 ...


10

The CircularSequence macro below takes three paramaters: The outer radius the inner radius the sequence to be applied which should be able to create this image with any desired number of elements. Below are examples with 8 and 16 elements: References: Macro to access a specific member of a list Code: \documentclass{article} \usepackage{tikz} ...


10

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: ...


10

Just 4 fun with PSTricks. \documentclass[pstricks,border=12pt]{standalone} \SpecialCoor \makeatletter \def\N{26} \begin{document} % speficy the angular distance between the 2 sets of alphabets \def\offset{13} \begin{pspicture}(-5,-5)(5,5) \psforeach{\r} {2,3,4}{\pscircle{\r}} \degrees[\N] \psforeach{\t}{65,66,..,90}{% ...


10

From symbols.pdf, it looks like pifont can do what you want with \ding{172} through \ding{181} or \ding{192} through \ding{201}. Or the igo package with \whitestone{1} through \whitestone{99}, although that's meant for typesetting Go boards. It sounds like the solution has been found, but here's a simple comparison. \documentclass{article} ...


9

pst-3dplot forms part of the pstricks suite and provides macros to print regular 2D stuff on planes in 3D (amongst other things). Here is a minimal example the plots a circle on the 3 orthogonal planes: xy, xz and yz: \documentclass{article} \usepackage{graphicx}% http://ctan.org/pkg/graphicx \usepackage{pst-3dplot}% http://ctan.org/pkg/pst-3dplot ...


9

You can get the tangents to extend by adding shorten >=<negative length>, and use the intersections library to locate the points of intersection and add the appropriate labels: If you use \coordinates for the poitns then using a \foreach is a convienent way to mark each of the points. Code: \documentclass[11pt, oneside]{article} ...



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