Hot answers tagged

8

TikZ-free suggestion. \documentclass{article} \newcommand\boxlist[2]{\begin{array}{|c|c|} \hline #1 & #2 \\ \hline \end{array}} \begin{document} \[ \phi \leftarrow \boxlist{a}{b} \leftrightarrow \boxlist{c}{d} \leftrightarrow \boxlist{e}{f} \leftrightarrow \cdots \leftrightarrow \boxlist{x}{y} \rightarrow \phi \] \end{document}


8

Arguably overkill, but here's a version using the TikZ libraries shapes.multipart, chains and positioning: \documentclass[border=20pt,tikz]{standalone} \usetikzlibrary{shapes.multipart,chains, positioning} \begin{document} \begin{tikzpicture} [ double link/.style n args=2{% page 726 on chain, rectangle split, rectangle ...


8

A short example with tikz-cd and some TikZ for drawing the node border. Output Code \documentclass{article} \usepackage{tikz-cd} \usepackage{amssymb} \newcommand\tkkz[2]{% \tikz{\node[draw, inner sep=2pt, minimum width=8mm,outer sep=0, text height=1.5ex, text depth=.3ex, append after command={\pgfextra{\draw ...


7

I've found one useful github repository with example of doubly linked list in tikz. You can inspire in this. Code of the example: \documentclass{article} \usepackage[pdftex,active,tightpage]{preview} \setlength\PreviewBorder{2mm} \usepackage{tikz} \usetikzlibrary{calc,shapes.multipart,chains,arrows,positioning} \tikzset{ squarecross/.style={ ...


6

Yes. you can do this on two ways: use \tikzset (not tikzstyle, it is deprecated) and put them after \begin{tikzpicture}, for example \begin{tikzpicture} \tikzset{ every node/.style = {draw, align= center, ...}, arrow/.style = {thick,-{Latext[]} } ... } \node (first) {...}; ... \end{tikzpicture} include styles as tikzpicture ...


6

Does this work for you? \makeatletter \tikzset{matrix of node keys/.code={ \pgfkeysalso{ matrix,% cells={anchor=base},% execute at begin cell=\matrix@ofnodekeys@start@cell, execute at empty cell=\tikz@lib@matrix@empty@cell } }} \bgroup \catcode`&=\active \gdef\monk@nil{\pgfutil@gobble{unique expansion text}} ...


5

\documentclass{article} \let\LA\leftarrow \let\RA\rightarrow \let\LRA\leftrightarrow \def\BOX(#1,#2){\tabular{|c|c|}\hline\strut#1&#2\\\hline\endtabular} \begin{document} $\thickmuskip=0mu\emptyset\, \LA\BOX(a,b)\LRA\BOX(c,d)\LRA\BOX(e,f)\LRA\cdots\LA\BOX(y,z)\RA\, \emptyset$ \end{document} If you want the a,b,... in italic use \array instead ...


4

Is this what you wanted? \documentclass[border=2pt]{standalone} \usepackage{tikz} \usetikzlibrary{backgrounds,fit, positioning} \tikzset{ nonlin/.style = { rectangle,thick,draw,minimum width=1cm,minimum height=0.6cm,#1, append after command={ \pgfextra{ \node[fit=(\tikzlastnode),#1, draw, inner sep=1.8pt] ...


3

An image worth 1 thousand words... \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} [ mynode/.style={ shade, % top/bottom color? right color=blue, left color=red, shading angle=0, align=center}, every node/.style=mynode ] \node {X}; \end{tikzpicture} ...


3

If you look in TikZ manual, you will find in chapter 65 Shading Library (from page 686 further) description of shadings. For color you have possibilities shading axis top color= ..., bottom color=... and middle color=... left color=..., right color=... and midle color (the same as above) and shading ball shading billinear transformation etc So in ...


2

This version adopts etoolbox, very powerful package for setting conditions. I guess it could be included in the \tikzset but I'm not sure how yet. I'll edit the answer in case. Output Code \documentclass[margin=10pt]{standalone} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} ...


2

Here's a way of doing it with PGF keys and a couple of macros. It allows you to say \tikzset{% S1 set={3,5,8}, S2 set={1,4}, } for example, to determine which nodes should take each of styles S1 and S2. It is probably a bad idea to name nodes using numbers alone, but I've not changed this in the code below. (Giving each a standard prefix is an easy ...


2

Taking some liberties (as pointed out in the comments, we don't know exactly what you are after) here is a quick implementation. The centers and radii of the circles are declared as commands and then the \clip command is used to build the intersecting regions, which are filled. \documentclass{article} \usepackage{tikz} \newcommand{\circleA}{(0cm,0cm) ...


2

Just to point out an alternative to "I know Tikz is the starting point." Here is an approach using Metapost as part of LuaLaTeX and the luamplib package. Compile with lualatex. \documentclass[border=5mm]{standalone} \usepackage{fontspec} \usepackage{luamplib} \setmainfont{Helvetica Neue} \begin{document} \mplibtextextlabel{enable} % this allows plain ...


1

You can overlay the text using TikZ nodes. You can even expand this to fill the entire page using [overlay] and (current page). \documentclass[11pt,letterpaper]{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{graphicx} \pgfmathdeclarerandomlist{MyRandomColors}{% {red}% {red!25}% {magenta}% {magenta!25}% {olive}% ...


1

This question gets some votes but the answer is somehow hidden in the comments. To sum up: this difference is due to the pdf viewer. Everything works fine with Adobe Reader, which should always be the reference. The reason why most viewers can display the effect when the class article is used, and not when the class beamer is used remains a mystery. For ...


1

Go to tikz.code.tex line 3713, there is the definition of \tikz@do@fig. This is the essential part of typesetting nodes. In the definition one can see \tikz@atbegin@node at line 3736 and \tikz@halign@check at 3755. As one might guess, \tikz@atbegin@node is the macro the stores execute at begin node-codes, and \tikz@halign@check checks if you says ...


1

Frankly said, I do not understand what you doing in your code and what should be your result, so the main purposes of this answer is clarify this. The MWE below generate this picture: where colors are select on basis even/odd number in \label: \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath,amsfonts,amssymb} ...



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