이렇게 3개의 tikz 사진을 나란히 놓고 싶지만각각 아래에 캡션이 있음:
\documentclass[a4paper,12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish,es-tabla]{babel}
\usepackage{tikz}
\usepackage{tkz-tab}
\usepackage{caption}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{subcaption}
\usetikzlibrary{quotes,angles,babel}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (-2,-2) coordinate (rumbo);
\path pic["HDG",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm,pic text options={shift={(+.3cm,0)}}] {angle=rumbo--O--NM};
\path pic["-$\alpha$",draw=blue,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=rumbo--O--xpos};
\end{tikzpicture}
%\captionof{figure}{$\alpha$=BLA}
\hspace{1cm}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (-2,2) coordinate (rumbo);
\path pic["HDG",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm,pic text options={shift={(0,1.25cm)}}] {angle=rumbo--O--NM};
\path pic["$\alpha$",draw=blue,->,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=xpos--O--rumbo};
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (2,2) coordinate (rumbo);
\draw [->,>=stealth,thick,white] (O) -- (0,-2.2cm);
\path pic["\small{HDG}",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm] {angle=rumbo--O--NM};
\path pic["$\alpha$",draw=blue,->,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=xpos--O--rumbo};
\end{tikzpicture}
\end{document}
나는 또한 다음을 시도했다이 답변, 그러나 \resizebox가 내 코드를 컴파일하는 것을 허용하지 않는 이유를 찾을 수 없습니다. 운 없이 \graphicx를 사용해 보았고 { 뒤에 %를 추가했습니다. 그리고 \resizebox 없이 이 작업을 수행하려고 하면 수직으로 정렬되지 않고 다음과 같이 끝납니다.
마지막으로 코드(%\captionof{Figure}{$\alpha$=BLA})에서 볼 수 있듯이 \captionof 솔루션을 사용해 보았지만 결국 완전히 이상한 솔루션이 제공되었습니다.
답변1
이미 로드 중이므로 subcaption
사용하고 싶을 수도 있습니다.
\documentclass[a4paper,12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish,es-tabla]{babel}
\usepackage{tikz}
\usepackage{tkz-tab}
\usepackage{caption}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{subcaption}
\usetikzlibrary{quotes,angles,babel}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}{.34\textwidth}
\centering
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (-2,-2) coordinate (rumbo);
\path pic["HDG",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm,pic text options={shift={(+.3cm,0)}}] {angle=rumbo--O--NM};
\path pic["-$\alpha$",draw=blue,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=rumbo--O--xpos};
\end{tikzpicture}
\caption{$\alpha$=BLA}
\end{subfigure}
\hfill
\begin{subfigure}{.34\textwidth}
\centering
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (-2,2) coordinate (rumbo);
\path pic["HDG",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm,pic text options={shift={(0,1.25cm)}}] {angle=rumbo--O--NM};
\path pic["$\alpha$",draw=blue,->,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=xpos--O--rumbo};
\end{tikzpicture}
\caption{$\alpha$=PFT}
\end{subfigure}
\hfill
\begin{subfigure}{.27\textwidth}
\centering
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (2,2) coordinate (rumbo);
\draw [->,>=stealth,thick,white] (O) -- (0,-2.2cm);
\path pic["\small{HDG}",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm] {angle=rumbo--O--NM};
\path pic["$\alpha$",draw=blue,->,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=xpos--O--rumbo};
\end{tikzpicture}
\caption{$\alpha$=BLUB}
\end{subfigure}
\caption{Meow.}
\end{figure}
\end{document}
답변2
이러한 그림을 그림(하위 그림 아님)으로 표시하려면 다음 floatrow
환경을 사용할 수 있습니다.
\documentclass[a4paper,12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish,es-tabla, es-noshorthands]{babel}
\usepackage{tikz}
\usepackage{tkz-tab}
\usepackage{caption}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{subcaption}
\usetikzlibrary{quotes,angles,babel}
\usepackage{floatrow}
\begin{document}
\begin{figure}
\begin{floatrow}[3]
\ffigbox[\FBwidth]{\caption{$\alpha$=BLA}\label{bla}}{%
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (-2,-2) coordinate (rumbo);
\path pic["HDG",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm,pic text options={shift={(+.3cm,0)}}] {angle=rumbo--O--NM};
\path pic["-$\alpha$",draw=blue,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=rumbo--O--xpos};
\end{tikzpicture}}%
%
\ffigbox[\FBwidth]{\caption{$\beta$=BLI}\label{bli}}{%
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (-2,2) coordinate (rumbo);
\path pic["HDG",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm,pic text options={shift={(0,1.25cm)}}] {angle=rumbo--O--NM};
\path pic["$\alpha$",draw=blue,->,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=xpos--O--rumbo};
\end{tikzpicture}}%
%
\ffigbox[\FBwidth]{\caption{$\gamma$=BLO}\label{blo}}{%
\begin{tikzpicture}
\coordinate (O) at (0,0);
\draw [->,>=stealth,thick] (0,0) -- (3,0) coordinate (xpos) node[right, at end] {\large{x}};
\draw [<-,>=stealth,thick] (0,3)coordinate (NM) node[right] {NM} node[left] {y} -- (0,0) coordinate (SM);
\draw [->,>=stealth,thick] (O) -- (2,2) coordinate (rumbo);
\draw [->,>=stealth,thick,white] (O) -- (0,-2.2cm);
\path pic["\small{HDG}",draw=red,<-,>=stealth,thick,angle eccentricity=1.2,angle radius=2cm] {angle=rumbo--O--NM};
\path pic["$\alpha$",draw=blue,->,>=stealth,thick,angle eccentricity=1.2,angle radius=1cm] {angle=xpos--O--rumbo};
\end{tikzpicture}}%
% \hspace{1cm}
\end{floatrow}
\end{figure}
\end{document}