\draw[opacity=.2, color=MidnightBlue, line width=15pt, line join=round, line cap=rect] (a_1) -- (b_1) -- (b_n-1);
\draw[->] (b_n-1) -- (a_n);
\draw[fill=Orange,opacity=.2] (a_n) circle (1em);
\end{tikzpicture}
\end{align*}
\newpage
\section{TikZ에 포함된 matrix 라이브러리}
어떤 행렬의 이름을 `Soo'라고 하자. 이때 해당 원소의 고유 노드는 `Soo-i-j'가 된다. 예를 들어 2행 3열의 원소라면 `Soo-2-3'이다. 해당 노드의 가운데(center)를 중심으로 8방위, 즉 동-서-남-북-북동-남동-남서-북서 지점을 제어할 수 있다.
\subsection{먼저 대충 행렬을 그려본다}
\[
\begin{tikzpicture}[baseline]
\matrix (Soo) [matrix of math nodes, left delimiter = \lbrack, right delimiter = )] at (0,0)
{
a_1 & a_2 & a_3 & \dotsb & a_{n-1} & & a_n \\
+ & & & & & & \\[-1ex]
& b_1 & b_2 & b_3 & \dotsb & b_{n-1} & & \\
};
\end{tikzpicture}
\]
\subsection{미세조정}
행과 열간격을 좀 늘여보자. $+$ 기호는 좀 우측으로 밀어보자. 행렬 좌우의 괄호는 없애버린다.
\[
\begin{tikzpicture}[baseline]
\matrix (Soo) [matrix of math nodes, row sep={1cm,between origins}, column sep={1cm,between origins}, left delimiter = ., right delimiter = .] at (0,0)
{
a_1 & a_2 & a_3 & \dotsb & a_{n-1} & & a_n \\
\rlap{\hspace*{1em}+} & & & & & & \\[-1ex]
& b_1 & b_2 & b_3 & \dotsb & b_{n-1} & & \\
};
\end{tikzpicture}
\]
\subsection{색깔 칠하고 미세조정}
\begin{itemize}
\item 1행1열에서 3행2열을 지나 3행6열 원소를 지나는 선을 긋는다.
\item 1행7열 $a_n$에 동그라미를 씌운다.
\item 3행6열 원소에서 1행7열까지 화살표를 긋는다.
\end{itemize}
\[
\begin{tikzpicture}[baseline]
\matrix (Soo) [matrix of math nodes, row sep={1cm,between origins}, column sep={1cm,between origins}, left delimiter = ., right delimiter = .] at (0,0)
{
a_1 & a_2 & a_3 & \dotsb & a_{n-1} & & a_n \\
\rlap{\hspace*{1em}+} & & & & & & \\[-1ex]
& b_1 & b_2 & b_3 & \dotsb & b_{n-1} & & \\
};
%1행1열에서 3행2열을 지나 3행6열을 지나는 선을 긋기
\draw [opacity=.2, color=MidnightBlue, line width=2em, line cap=round] (Soo-1-1.center) -- (Soo-3-2.center) -- ([xshift=-.1ex]Soo-3-6.east);
%a_n에 동그라미
\draw [fill=DarkGreen,opacity=.2] (Soo-1-7) circle (.5cm) ;
tikz를 마음대로 조종할 실력은 안 되지만 아이디어라도 얻으시길 바라며...
두 번째 것만 조금 생각해봤습니다.
첫 번째 것도 두 번째 것을 응용하시면 충분히 하실 수 있으리라 생각합니다.
%% test8.tex
\documentclass[twocolumn,a4paper]{xoblivoir}
\usepackage[dvipsnames,svgnames,x11names]{xcolor}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,shapes}
\usepackage{amsmath}
\usepackage{tikz}
\parindent=0pt
\begin{document}
\section{노드 연습}
\tikz[remember picture] \node[circle,fill=red!50] (n1) {};\hspace*{5cm}
\tikz[remember picture] \node[fill=blue!50] (n2) {};
\begin{tikzpicture}[remember picture,overlay]
\draw[->,very thick] (n1) -- (n2);
\end{tikzpicture}
\section{라인 캡과 라인 조인}
\subsection{라인 캡}
\begin{tikzpicture}[line width=10pt]
\draw[line cap=rect] (0,0 ) -- (1,0);
\draw[line cap=butt] (2,0) -- (3,0);
\draw[line cap=round] (4,0 ) -- (5,0);
\end{tikzpicture}
\subsection{라인 조인}
\begin{tikzpicture}[line width=10pt]
\draw[line join=round] (0,0) -- ++(.5,1) -- ++(.5,-1);
\draw[line join=bevel] (2,0) -- ++(.5,1) -- ++(.5,-1);
\draw[line join=miter] (4,0) -- ++(.5,1) -- ++(.5,-1);
\end{tikzpicture}
\section{수식을 써 놓은 다음, 특정 부분에 노드를 표시하고 잇기}
\subsection{align 환경으로 수식 쓰기}
\begin{align*}
a_1 &\quad a_2 \quad \dotsb \quad a_{n-1} \qquad\qquad a_n \\
&+ \\
&\quad b_1 + b_2 + \dotsb + b_{n-1}
\end{align*}
\subsection{거칠게 그리기}
\begin{align*}
\tikz[remember picture,overlay]\node (a_1) {};a_1 &\quad a_2 \quad \dotsb \quad a_{n-1} \qquad\qquad \tikz[remember picture,overlay]\node (a_n) {}; a_n \\
&+ \\
&\quad \tikz[remember picture,overlay]\node (b_1) {};b_1 + b_2 + \dotsb + b_{n-1}\tikz[remember picture,overlay]\node (b_n-1) {};
\begin{tikzpicture}[remember picture,overlay]
\draw[opacity=.2, color=MidnightBlue, line width=15pt, line join=round, line cap=rect] (a_1) -- (b_1) -- (b_n-1);
\draw[->] (b_n-1) -- (a_n);
\draw[fill=Orange,opacity=.2] (a_n) circle (1em);
\end{tikzpicture}
\end{align*}
\subsection{노드 위치 미세 조정: xshift, yshift}
\begin{align*}
\tikz[remember picture,overlay,xshift=.33em,yshift=.33em]\node (a_1) {};a_1 &\quad a_2 \quad \dotsb \quad a_{n-1} \qquad\qquad \tikz[remember picture,overlay,xshift=.33em,yshift=.33em]\node (a_n) {}; a_n \\
&+ \\
&\quad \tikz[remember picture,overlay,xshift=.33em,yshift=.33em]\node (b_1) {};b_1 + b_2 + \dotsb + b_{n-1}\tikz[remember picture,overlay,yshift=.33em]\node (b_n-1) {};
\begin{tikzpicture}[remember picture,overlay]
\draw[opacity=.2, color=MidnightBlue, line width=15pt, line join=round, line cap=rect] (a_1) -- (b_1) -- (b_n-1);
\draw[->] (b_n-1) -- (a_n);
\draw[fill=Orange,opacity=.2] (a_n) circle (1em);
\end{tikzpicture}
\end{align*}
\newpage
\section{TikZ에 포함된 matrix 라이브러리}
어떤 행렬의 이름을 `Soo'라고 하자. 이때 해당 원소의 고유 노드는 `Soo-i-j'가 된다. 예를 들어 2행 3열의 원소라면 `Soo-2-3'이다. 해당 노드의 가운데(center)를 중심으로 8방위, 즉 동-서-남-북-북동-남동-남서-북서 지점을 제어할 수 있다.
\subsection{먼저 대충 행렬을 그려본다}
\[
\begin{tikzpicture}[baseline]
\matrix (Soo) [matrix of math nodes, left delimiter = \lbrack, right delimiter = )] at (0,0)
{
a_1 & a_2 & a_3 & \dotsb & a_{n-1} & & a_n \\
+ & & & & & & \\[-1ex]
& b_1 & b_2 & b_3 & \dotsb & b_{n-1} & & \\
};
\end{tikzpicture}
\]
\subsection{미세조정}
행과 열간격을 좀 늘여보자. $+$ 기호는 좀 우측으로 밀어보자. 행렬 좌우의 괄호는 없애버린다.
\[
\begin{tikzpicture}[baseline]
\matrix (Soo) [matrix of math nodes, row sep={1cm,between origins}, column sep={1cm,between origins}, left delimiter = ., right delimiter = .] at (0,0)
{
a_1 & a_2 & a_3 & \dotsb & a_{n-1} & & a_n \\
\rlap{\hspace*{1em}+} & & & & & & \\[-1ex]
& b_1 & b_2 & b_3 & \dotsb & b_{n-1} & & \\
};
\end{tikzpicture}
\]
\subsection{색깔 칠하고 미세조정}
\begin{itemize}
\item 1행1열에서 3행2열을 지나 3행6열 원소를 지나는 선을 긋는다.
\item 1행7열 $a_n$에 동그라미를 씌운다.
\item 3행6열 원소에서 1행7열까지 화살표를 긋는다.
\end{itemize}
\[
\begin{tikzpicture}[baseline]
\matrix (Soo) [matrix of math nodes, row sep={1cm,between origins}, column sep={1cm,between origins}, left delimiter = ., right delimiter = .] at (0,0)
{
a_1 & a_2 & a_3 & \dotsb & a_{n-1} & & a_n \\
\rlap{\hspace*{1em}+} & & & & & & \\[-1ex]
& b_1 & b_2 & b_3 & \dotsb & b_{n-1} & & \\
};
%1행1열에서 3행2열을 지나 3행6열을 지나는 선을 긋기
\draw [opacity=.2, color=MidnightBlue, line width=2em, line cap=round] (Soo-1-1.center) -- (Soo-3-2.center) -- ([xshift=-.1ex]Soo-3-6.east);
%a_n에 동그라미
\draw [fill=DarkGreen,opacity=.2] (Soo-1-7) circle (.5cm) ;
%b_{n-1}에서 a_n까지 화살표 긋기
\draw [->,>=stealth,color=DarkRed] (Soo-3-6.north east) -- (Soo-1-7.south west);
\draw [->,>=latex,color=MidnightBlue,line width=1pt] (Soo-3-6.east) -- (Soo-1-7.south);
\draw [->,>=triangle 45,color=SeaGreen,line width=.5pt,dashed] (Soo-3-6.north) -- (Soo-1-7.north west);
\end{tikzpicture}
\]
\end{document}
===
여러 번 말씀 드린 것 같은데...
어디까지 하다가 막히더라 하시면서 소스를 좀 올리시면 댓글이 달릴 확률이 높아질 겁니다.
하다못해 지금 같은 질문은 수식이라도 입력해서 주시면 더 좋았겠고요.