Tag Info

Hot answers tagged

9

Below I present three possibilities Using basic boxes: \parboxes and \fbox (without color) or \fcolorbox (with color) nad \hline. Using tikz and chains. Drawing the diagram as a tree with forest. The code A TikZ-free solution: \documentclass{article} \usepackage{amsmath} \newcommand\MBox[2][2em]{% \fbox{\parbox[c][2em][c]{#1}{\centering#2}% }% } ...


9

You can do this with tcolorbox: The code (adjust the settings according to your needs): \documentclass{article} \usepackage[many]{tcolorbox} \definecolor{bluebg}{RGB}{201,218,248} \definecolor{bluelabel}{RGB}{0,0,255} \newtcbox{\labelbox}{ enhanced, nobeforeafter, tcbox raise base, boxrule=0.4pt, top=0.4cm, bottom=0.4cm, right=0pt, ...


5

The \parbox isn't really needed, but I wasn't sure if one could specify the text widths for each part separately. \documentclass[border=.1in]{standalone} \usepackage{adjustbox} \usepackage[svgnames]{xcolor} \usepackage{tikz} \usetikzlibrary{shapes.multipart} \begin{document} \begin{tikzpicture} \node[rectangle split,rectangle split horizontal,rounded ...


4

Here is one suggestion. Instead of using scopes and shifting those around, I place one of the lower nodes of the two automata on the sides relative to the closest of the lower nodes on the center one. The rectangles are drawn afterwards with the help of the fit library. Other remarks: I've changed from of= to =of, and loaded the positioning library. This ...


4

You already used |- syntax as intersection point: \draw[dashed] (circ.west) -- (circ.west-|origen.340); In this case means the intersection point between an horizontal line throgh circ.west and a vertical line through origen.340. A side comment: you can say (circ)--(circ-|origen.340) because path stops at node border and circ which is equivalent to ...


4

Just a possible solution. Instead of lines, use a rectangular node which fits desired coordinates. After that, place label and points using anchors. \documentclass[border=2mm,tikz]{standalone} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture}[scale=0.3, box/.style={draw, inner sep=0pt, outer sep=0pt}] \node[fit={(1,2) (8,4)}, box] (a){}; ...


4

I assume, you want to optimize the code of the question. All these operations can be put in one \draw command. Then the command form \tikz instead of the environment can be used. The path construction can be simplified via rectangle. \documentclass{article} \usepackage{tikz} \begin{document} \tikz[scale=.3]\draw (1, 2) node {\textbullet} ...


4

I think it should rather be a \csname type#1\endcsname instead of \noexpand\type#1. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes} \newcommand{\nodeperso}[1]{\node[\csname type#1\endcsname](){\csname nom#1\endcsname};} \newcommand{\typeAAB}{Boite} \newcommand{\nomAAB}{coucou} \begin{document} \begin{tikzpicture}[Boite/.style={rounded ...


3

You can use the handler .append style: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \tikzstyle{block} = [rectangle, draw,minimum width=3em,] \begin{document} \begin{tikzpicture} % This works ok \node[block, minimum width=3em,] (b1) {B1}; \end{tikzpicture} \begin{tikzpicture}[block/.append style={minimum ...


2

The inner sep key for the surrounding node is probably what you're after. To move the label, the easiest is to make a new node, placed relative to the surrounding node. \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{shapes,arrows,fit} \begin{document} \tikzset{ sum/.style = {draw, circle, node distance = 2cm, minimum size=.9cm}, % ...


2

Option scatter/use mapped color can be used to change the draw color of the marks to the same as the fill color. (The value none did not work.) The line width of ultra thick is 1.6 pt. The default draw line width is 0.4 pt. The the value of the size (radius) of the mark should be set to (1.6 pt - 2 * 0.4 pt/2)/2 = 0.6 pt. \documentclass{article} ...


2

You can draw this with TikZ as well. Drawing large block diagrams with TikZ is fairly straightforward, moreso than using LaTeX native structures. \documentclass{book} \usepackage{tikz} \usetikzlibrary{calc} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \begin{document} \begin{tikzpicture} \node (g) [draw, minimum ...


2

One line TikZ solution : \documentclass[tikz,border=7mm]{standalone} \usetikzlibrary{graphs} \begin{document} \tikz\graph[nodes=draw, grow right=14mm] { "$g(t)$" -- "System" -- "$y(t)$"}; \end{document}


2

Here's the solution with Tikz since you were asking for it. I basically defined a new command with four arguments: \tabb{#1}{#2}{#3}{#4} Position of the node Color (the second color will automatically be lighter than the label) Label text Main text I changed the x and y of the tikzpicture above for making it easier for me to place the examples. ...


1

What about the following code with fancyhdr package and tikz \documentclass{article} \usepackage{fancyhdr} \usepackage{lipsum} \pagestyle{fancy} \fancyhf{} \fancyfoot[C]{\dotfill \protect\circled{\thepage} \dotfill} \usepackage{tikz} \newcommand*\circled[1]{\tikz[baseline]{\node[shape=circle,draw,inner sep=2pt] (char) {#1};}} \begin{document} ...


1

Seems the plotmark doesn't end up in the center of the node for some reason. An alternative is to use the regular polygon shape for the node instead, see the triangle style that I defined. You need the shapes.geometric library to use it, but you're already loading shapes, so that's fine. Note I used the top corner of the triangle as the endpoint of the line. ...


1

A MetaPost solution, for whom it may interest: input boxes beginfig(1); boxjoin(b.w - a.e = (3cm, 0)); boxit.g(btex $g(t)$ etex); boxit.sys(btex System etex); boxit.y(btex $y(t)$ etex); defaultdx := .75cm; defaultdy := .5cm; drawboxed(g, sys, y); drawarrow g.e -- sys.w; drawarrow sys.e -- y.w; endfig; end.


1

I just replaced some "right" and "left" to "above" and "below" \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.5cm, thick,main node/.style={circle,fill=blue!10,draw,font=\sffamily\Large\bfseries}] % nodes \node[main node] (A) {A}; ...



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