Math & ScienceCircling text in \underbrace mode

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
feryee
Posts: 20
Joined: Sun Aug 09, 2015 12:57 pm

Circling text in \underbrace mode

Post by feryee »

I really appreciate your prompt and nice impressive work. I have heared about the Tikz but never tried it before. Do you know if any well short tutorial available on the net?
Regarding the code, I would like to learn more about following:
1) The meaning of these line at begining,

Code: Select all

\usetikzlibrary{shapes,positioning,quotes,arrows.meta}
\pgfdeclarelayer{bg}%   background layer
\pgfsetlayers{bg,main}% order of the layers
\tikzset{
  block/.style  = {draw, rectangle, align = center,
                   text width = 5em, fill = white},
  bullet/.style = {draw, circle, inner sep = 0.3ex,
                   fill = black},
  round/.style  = {draw, circle},
             >  = {Triangle[width = 1.5ex, length = 1.5ex]}
}
2) Also inside \tikz,

Code: Select all

\draw (right) -- ++ (0em,-9em) -- ++ (-14.8em,0em)
                  -- ++ (0em,1em) edge[->] ++(5.5em,5.5em);
what do they represent?

3) Which line of the code is responsible for the angled arrow on the adaptive filtering block.

4) When I inserted the same code (except \documentclass[border=10pt]{standalone}) in
the my article (\documentclass{article}) with a specific sty file, after compilation the whole fonts throughout the documents changed to the same font labeled on each block. Do you have any idea why this happens?

Thanks,
Farhad

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Circling text in \underbrace mode

Post by Stefan Kottwitz »

Hi Farhad!

The TikZ manual contains some short tutorials at the beginning. You could try them. For the start, you could ignore the rest of the big reference manual, or just look there in case of specific questions.

The TikZ gallery is nice for starting with examples, like choosing one which is similar to the own task.

You can also ask questions here any time. TikZ is fun for us. :-)
    • \usetikzlibrary loads additional TikZ libraries which are not included by default. For example, the positioning library gives me the relative positioning syntax like right = 3em of node. quotes gives me the "label" syntax which is pretty new and shorter than using a node for a label. arrows.meta gives me a lot of new arrow tips. It's just that newer versions of TikZ implement some features in libraries to separate things and be faster.
    • \pgfdeclarelayer allows me to have a background layer. The main layer is the default. I used it later, near the end, to draw an arrow below the Adaptive Filter node.
    • By \tikzset I defined styles for using in the document later. It's like having macros with normal LaTeX. Later I just give the style name to a node, and so he got those style settings. It's not only less to type, but easier to adjust styles later on. Just changing the style in the preamble instead of doing it for each node.
  1. It's relative drawing. -- just makes a line. ++(delta_x,delta_y) moves from the current (x,y) to (x+delta_x,y+delta_y). So, -- ++(1,2) means draw an line to a point 1cm to the right and 2cm above.
  2. That angled arrow was the line construction above, several -- steps and on -> edge.
  3. I chose sans-serif font globally for that drawing. Just remove the lines

    Code: Select all

    \usepackage{sfmath}
    \renewcommand*{\familydefault}{\sfdefault}
    to keep the standard font. You could add font=\sffamily to the block style. But math would be italic as usual. But that's ok, because it's the same like your normal math. I just loaded sfmath so it's more like in the original drawing.
LaTeX.org admin
Post Reply