
Entonces, estoy creando un manual de operación basado en un diagrama de flujo para el SEM en el laboratorio en el que trabajo y tengo problemas para alinear un nodo con respecto a otros dos.
ya he visto algunas paginas[1][2][3][4]Aquí que presentan el mismo problema y probaron sus soluciones, pero sin éxito alguno, así que si alguien puede ayudarme se lo agradecería mucho.
Este es mi MWE:
%%% DOCUMENT SETTINGS %%%
\documentclass[12pt, a3paper]{article} %page type
\usepackage[margin=2cm]{geometry} %margins
\usepackage{setspace}
\usepackage{indentfirst} %indenting package
\setstretch{1.5} %between lines spacement
\setlength{\parindent}{1.5cm} %first line indentation
%page settings
\usepackage{fancyhdr}
\pagestyle{fancy} % seting to use the customizable head and footers
\fancyhf{} % cleaning standard head and footers to use the new one
\rfoot{Autores: Eduardo de Almeida Isoppo;\\Luiz Felipe Pompermaier.} % page number on the footer's right side
\renewcommand{\headrulewidth}{0pt} %remove the line on the headers
\usepackage{float} % tables and figures in multicols.
%font and language configs
\usepackage[brazil]{babel} %letter type
\usepackage[utf8]{inputenc} %normal acentuation
%\usepackage{arial}
% using pseudoarial font Helvetica.
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[T1]{fontenc}
%Reference configs
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=red,
citecolor=black,
filecolor=magenta,
urlcolor=blue,
breaklinks=false,
pdfauthor={Luiz Felipe Pompermaier}
}
%image config
\usepackage{graphicx} % Image using package
%\graphicspath{{Imagens/}} % Image path
\usepackage{caption} % Image, tables, and others captions.
\usepackage{subcaption} % SubImage package. More then one per line.
%math config
\usepackage{amssymb}
\usepackage{amsmath}
% text packages
\usepackage{blindtext} % lorem ipsum
%\usepackage{lipsum}
%\usepackage{titling} % used to make title higger in page
\usepackage{sectsty} % section title
\sectionfont{\fontsize{12}{15}\selectfont} %changing section fontsize
\usepackage{multicol} % multiple columns
\usepackage{xcolor} % coloring text
\usepackage[none]{hyphenat} % no hyphenation
\usepackage{microtype} % better justification
\usepackage{tcolorbox} % text in coloured boxes
% tikz package for flowchart drawings
\usepackage{tikz}
\usepackage{tikz-layers}
\usetikzlibrary{shapes.geometric, arrows}
\usetikzlibrary{positioning}
\usetikzlibrary{fit}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}
% Flowchart configs
\tikzstyle{startstop} = [ellipse, minimum width=3cm, minimum height=2cm,text centered, text width=3cm, draw=black, fill=red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, aspect=2, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth, line width=2pt]
\newlength{\AL}
\setlength{\AL}{2cm}
\begin{document}
\begin{center}
\Huge \textbf{Fluxograma de Operação do MEV}
\end{center}
\begin{figure}[!htb]
\centering
\begin{tikzpicture}
% Nodes and texts
\node (SftWrk) [decision, below=\AL of ScrnON] {Software está funcionando?};
\node (SftErr) [process, left=\AL of SftWrk] {Chame um Técnico};
\node (VentCb) [process, below=\AL of SftWrk] {Ventilar câmara segurando \textbf{VENT}.};
\node (SmplHd) [process, left=\AL of VentCb, dashed] {Montar Porta-amostras desejado.};
\begin{scope}[on behind layer]
\node (Sample) [io][fit=(SmplHd)]{};
\end{scope}
% Arrows
\begin{scope}[on background layer]
\draw[arrow] (SftWrk) -- node[anchor=south] {\textbf{NÃO}} (SftErr);
\draw[arrow] (SftWrk) -- node[anchor=east] {\textbf{SIM}} (VentCb);
\draw[arrow] (Sample) |- ($(EvacCb)!.5!(VentCb)$);
\draw[arrow] (VentCb) -- +(0,-\AL);
\end{tikzpicture}
\end{figure}
\end{document}
Este es el resultado que produce (centrándose en el área de interés):
Y lo que quiero es alinear el (SmplHd)
cuadro debajo (SftErr)
y a la izquierda (VentCb)
, si esto tiene sentido para todos los que leen esto.
Y para ser más explícito al respecto, no, el at (SftErr|-VentCb)
comando no funciona.
Para la compilación completa por favor consultehttps://www.overleaf.com/read/nfyvphkggdny
Respuesta1
Editar: Extensión del fragmento de imagen con dos nodos más y estilos de formas de nodos ligeramente modificados.
¿Como esto?
Este fragmento de imagen es producido por el siguiente MWE (ejemplo de trabajo mínimo)
\documentclass[12pt, margin=3mm]{standalone} % page type
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[brazil]{babel}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
backgrounds,
calc, chains,
fit,
intersections,
positioning,
quotes,
shapes.geometric,
babel
}
% Flowchart config
\makeatletter
\tikzset{
base/.style = {draw=black, semithick, font=\small,
minimum height=9mm, text width=33mm, align=flush center,
outer sep=0pt},
startstop/.style = {base,
ellipse, fill=red!30},
io/.style = {base,
trapezium, trapezium left angle=70, trapezium right angle=110,
fill=blue!30},
process/.style = {base, fill=orange!30},
decision/.style = {base, inner sep=1pt,
diamond, aspect=2, fill=green!30},
arr/.style = {-Stealth, thick},
every edge quotes/.append style = {auto, pos=0.4, font=\footnotesize\bfseries},
suspend join/.code = {\def\tikz@after@path{}} % for use in not showed image part
}
\makeatother
\newlength{\AL}
\setlength{\AL}{12mm}
\begin{document}
\begin{tikzpicture}[
node distance = \AL and \AL,
start chain = going below
]
% first branch (unfinished)
\begin{scope}[nodes = {on chain, join=by arr}]
\node (ScrnON) [process] {Ligar Monitores};
\node (SftWrk) [decision] {Software está funcionando?};
\node (VentCb) [process] {Ventilar câmara segurando \textbf{VENT}.};
\node (EvacCb) [process] {Evacuar câmara segurando \textbf{EVAC}.};
\end{scope}
% left from first branch
\node (SftErr) [process,
left=of SftWrk] {Chame um Technico};
\node (SmplHd) [process, dashed,
at={(SftErr |- VentCb)}] {Montar Porta-amostras desejado.};
\scoped[on background layer]
\node (Sample) [io, fit=(SmplHd)] {};
% second branch (unfinished)
\begin{scope}[nodes = {on chain, join=by arr}]
\node (HeatON) [process, suspend join,
right=2*\AL of ScrnON] {Subir corrente \textbf{devagar} até ponto de saturação.};
\node (SmpLct) [process] {Localizar Amostra a ser analisada.};
\end{scope}
% third branch
% Arrows
\path
(SftWrk) edge ["\textbf{NÃO}" '] (SftErr)
(SftWrk) edge ["\textbf{SIM}"] (VentCb);
\draw[arr]
(SftWrk) -- (SftErr);
\draw[arr]
(Sample) |- ($(VentCb.south)!0.5!(EvacCb.north)$);
\end{tikzpicture}
\end{document}
- En MWE se omite todo lo que no es relevante al dibujar la imagen.
- Se utiliza la sintaxis reciente para determinar los estilos de formas de los nodos (con
\tikzset
en lugar de obsoletotikzstyle
) - La posición del nodo con borde discontinuo es en la intersección de las líneas verticales que pasan por el nodo superior y la línea horizontal que pasa por el nodo derecho, es decir, por
at={(SftErr |- VentCb)}
. - Las posiciones de los nodos en otras ramas están planificadas para ser determinadas por
chains
(se indican solo con dos nodos superiores en la segunda cadena) - El código MWE está significativamente simplificado. Mediante el uso de
join=by ...
macro se dibujan todas las líneas de conexión entre los nodos de las ramas, por lo que deben dibujarse solo para los nodos fuera de las ramas y entre ramas.