Tag Info

Hot answers tagged

12

Compile this document via pdflatex: \documentclass[tikz]{standalone} \pdfcompresslevel=0 \pdfobjcompresslevel=0 \begin{document} \begin{tikzpicture} \draw[line width=0.01pt] (0,0) rectangle (1cm,1cm); \end{tikzpicture} \end{document} Then search w directives in the PDF (a simple text file). You find: 0.3985 w 0.00995 w The first occurrence is ...


8

It's not so hard with TikZ, it just requires some learning and working with it. Here is code for you to start, inspired by Gonzalo, follow the Link given by Alan to learn more. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \begin{tikzpicture}[decoration={markings, mark=at position 1cm with ...


7

You could simply protect the \par. The error goes away if I do this at both places in the definition of \EndMark: \addtocontents{toc}{\protect\label{en\thechapmark}% \protect\par\protect\begin{tikzpicture}[overlay,remember picture,baseline] \protect\node [anchor=base] (e\thechapmark) {}; ...


7

You don't have to place the pspicture environment to use pstricks. Instead you should use node-connections and specify the connection type after the equation: \documentclass{article} \usepackage{mathtools,lipsum} \usepackage{pstricks,pstricks-add} \psset{linewidth=.4pt} \begin{document} \lipsum[1] \vspace{2\baselineskip} \begin{equation} ...


6

I don't know what it should look like (I'm colorblind so everything looks OK to me) but here is the second one. Ifyour viewer can handle it play with the blend mode parameter for different effects. \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[mys/.style={pink!80,fill opacity=0.5,draw=black }] \begin{scope}[transparency group] ...


6

An alternative would be to use the tikzmark library: \documentclass{article} \usepackage{fontspec,kantlipsum,tikz} \usetikzlibrary{tikzmark,calc,decorations.pathreplacing} \begin{document} \kant[1] \vspace*{10ex} \begin{equation} \sum_{i,\,j,\,m,\,k} \!\!\!\! \left \langle \tikzmark{Ci} C_i \tikzmark{Cj} C_j \tikzmark{Cm} C_m \tikzmark{Ck} C_k ...


6

Replace all the \addplot by \foreach \a in {-2.4,-1.8,...,2.4}{ \addplot [domain=-5:5, samples=100, color=cyan]{\a*x^2}; } \foreach \a in {-2.1,-1.5,...,2.4}{ \addplot [domain=-5:5, samples=100, color=red,dashed]{\a*x^2}; } Code \begin{tikzpicture} \begin{axis}[grid=major, xmin=-5, xmax=5, ymin=-30, ymax=30, xlabel=$t$, ylabel=$y$]; \foreach \a in ...


5

Drawing a colored box is my catchword for offering a tcolorbox as solution. The exact white space dimension can be set with before skip and after skip. Since you want it to be the same, you can also use beforeafter skip. I use two boxes below: The first one is the normal one, the second one just to show the distance settings. ...


5

Here is a solution (using a similar method as my answer to question How to add a shadow to a tikz line?): \documentclass{standalone} \usepackage{pgf} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \usepackage{tikz} \usetikzlibrary{arrows,automata,calc,shapes, positioning,shadows,shadows.blur,shapes.geometric} \tikzset{ shadowed/.style={preaction={ ...


5

As the comment of percusse and cfr says, you can't use options for tikz library. And you can read in the manual that you can replace the curly braces with square brackets (ConTeXt specific). Here is an example how you can set the option by using .is choice handler. \documentclass[border=1cm]{standalone} \usepackage{tikz} \usetikzlibrary{calc} % ----------- ...


5

Next time, please provide a Minimum Working Example so that people don't have to copy every word from an image but can cut-and-paste at least the basic structure of the document and textual content of the diagram. This solution uses forest and constructs and adds the labels at the beginning of the nodes automatically. For this, I got very fast, accurate ...


4

Here is a conceptual way of doing it. I think there are a lot of things to improve (less macros because you only need the last two items in the color description, proper expansion control, possibility of custom macro name) but I didn't have time. I think you can take it from here. \documentclass[varwidth,border=50]{standalone} \usepackage{tikz} ...


4

Something like this? \documentclass[tikz, border=10pt]{standalone} \usetikzlibrary{shadings,calc,patterns} \begin{document} \begin{tikzpicture} \fill [left color=gray!50!black, right color=gray!50!black, middle color=gray!50, shading=axis, opacity=0.25] (2,0) coordinate (a) -- (2,6) coordinate (b) arc (360:180:2cm and 0.5cm) ...


4

Just for fun without PSTricks. \documentclass[tikz,12pt,dvipsnames,border=0cm]{standalone} \usetikzlibrary{patterns} \def\M{10}% columns \def\N{10}% rows \def\scale{1}% scale \def\filename{example-image-a}% filename \def\mygrid{% \draw[help lines,red,step=.1,ForestGreen!50](-\M,-\N) grid (\M,\N); \draw[help lines,red,step=1](-\M,-\N) grid ...


4

\documentclass{article} \usepackage{tikz} \usepackage{mwe} \begin{document} \begin{tikzpicture} \node {\includegraphics[]{example-image}}; \end{tikzpicture} \begin{tikzpicture} \begin{scope} \clip (2,0) rectangle (5cm,8cm); \node[anchor=south west] {\includegraphics[]{example-image}}; \end{scope} \end{tikzpicture} \end{document} ...


4

Here is an example using path picture. You can fill with imported image or with tikz image. \documentclass[varwidth,border=50]{standalone} \usepackage{tikz} \usepackage{mwe} \tikzset{ path image/.style={ path picture={ \node at (path picture bounding box.center) { \includegraphics[height=3cm]{example-image}};}}, path tikzimage/.style={ ...


4

I would suggest using the background package and a little trickery. The following defines a new command \installbackgrounds[]{}. The first argument is optional and sets the total number of pages in the file of backgrounds. The second, mandatory argument specifies the file. If no total is specified, the number defaults to 1. \documentclass[a4paper]{report} ...


3

\spy uses the coordinate system in the scope of the spy using outlines option. To use your special coordinate system for spying your picture, you may define named coordinates. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{spy} \begin{document} \begin{tikzpicture}[spy using outlines={circle,red,magnification=3,size=2.5cm, connect spies}] ...


3

With TikZ 3.0 arrives math library. This library defines a simple mathematical language to define simple functions and perform sequences of basic mathematical operations. Here is a code from the manual (p.629), slightly modified to include function use. \documentclass[varwidth,border=50]{standalone} \usepackage{tikz} \usetikzlibrary{math} \tikzmath{ ...


3

Or with just one \foreach: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[grid=major, xmin=-5, xmax=5, ymin=-30, ymax=30, xlabel=$t$, ylabel=$y$] \foreach \Valor [count=\Cont] in {-2.4,-2.1,...,2.4} { \ifodd\Cont\relax \def\Color{cyan} \def\Shape{} \else \def\Color{red} \def\Shape{dashed} ...


3

Another way, using a single \foreach and a user-defined cycle list. This cycle list can then be used throughout your document if desired. \documentclass{article} \usepackage{pgfplots} \pgfplotscreateplotcyclelist{mylist}{{color=cyan},{color=red,dashed}} % can now be used throughout the document \begin{document} \begin{tikzpicture} \begin{axis}[ ...


3

Possibly something like this? This was produced using the pin facility for labelling nodes. Note that I've updated your code to use \tikzset consistently since \tikzstyle is deprecated. \documentclass[tikz, border=10pt]{standalone} \begin{document} \tikzset{% point/.style = {fill=black,inner sep=1pt, circle, minimum ...


3

The dateplot library shipped with pgfplots cannot handle seconds due to limited accuracy. If you need accuracy of this granularity, you can probably ignore the DATE part of your input. In this case, a solution could be as follows: \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \def\checkSameDate#1{% \ifnum\coordindex=0 ...


3

Based on the information that MikTeX actually failed to update PGF to 3.0.0, I am able to confirm that this is a duplicate of Problem using atan in pgfplots and Miktex 2.9 pgfplots, circuitikz library collision problem . I will update Problem using atan in pgfplots to provide workarounds. There are actually two distinct problems: I introduced an ...


3

I'm not sure at all how you are determining the width of the line segment, but, unless you need the line to be exactly 0.01pt in width, TikZ certainly allows you to construct lines with extremely narrow widths % arara: pdflatex % arara: pdflatex % arara: open \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} ...


3

You can use the angles library which defines a pic for this purpose. The quotes library is used for ease of labelling. \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{calc,patterns,angles,quotes} \begin{document} \begin{tikzpicture} \coordinate (origo) at (0,0); \coordinate (pivot) at (1,5); % draw axes \fill[black] (origo) ...


3

As cfr said in the comment, there is easier solution for your particular problem by using shorten. Now for your question, the answer is : No, there are no anchor names that seats on the node line. But you can create them. If you want one particular anchor, let say "west 1mm inside", you can use something like label={[coordinate, name=in-west, label ...


3

Now as TikZ 3.0 is here we can use pic. \documentclass[tikz,border=5]{standalone} \tikzset{ pics/carc/.style args={#1:#2:#3}{ code={ \draw[pic actions] (#1:#3) arc(#1:#2:#3); } } } \begin{document} \begin{tikzpicture} \pic{carc=-30:30:2cm}; \draw[thick] (4,0) circle (1 cm) pic[red, -latex]{carc=100:150:1.3cm}; \end{tikzpicture} ...


3

This is an adaption of Kpym's answer. While Kpym's solution is closer to your stated desiderata, mine is shorter and more flexible in that it allows you to select any colour. \documentclass[border=5pt,tikz]{standalone} \usetikzlibrary{calc} \tikzset{ C/.style={circle}, theme color/.style={C/.append style={fill=#1!50}}, } \tikzset{theme color=magenta} ...


3

This should help you to get started. I used mostly the decorations.markings library for positioning. You may want to check section 48.5 of the mighty PGF manual for more info. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \begin{tikzpicture}[every node/.style={font=\tiny\itshape},decoration={markings, ...



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