我有一张想要添加到我的乳胶文件中的图像:
这是我的 MWE:
\usepackage{graphicx}
\usepackage{amssymb,amsthm}
\usepackage{natbib}
\bibpunct{(}{)}{;}{;}{,}{,}
\usepackage{xr-hyper}
\usepackage[
colorlinks=true,
citecolor=blue,
urlcolor=blue,
linkcolor=blue
]{hyperref}
\usepackage{bm}
\usepackage{fullpage}
\usepackage{ amssymb }
\pagestyle{plain}
\setlength{\parskip}{\baselineskip}
\setlength{\parindent}{0pt}
\setcounter{secnumdepth}{2}
\allowdisplaybreaks[4]
% Commenting/debugging
\let\IG\iffalse
\let\ENDIG\fi
%% Shortcuts
\newcommand{\td}[2]{\dfrac{d #1}{d #2}}
\newcommand{\std}[2]{\dfrac{d^2 #1}{d {#2}^2}}
\newcommand{\ctd}[3]{\dfrac{d^2 #1}{d #2 d #3}}
\newcommand{\pd}[2]{\dfrac{\partial #1}{\partial #2}}
\newcommand{\spd}[2]{\dfrac{\partial^2 #1}{\partial {#2}^2}}
\newcommand{\cpd}[3]{\dfrac{\partial^2 #1}{\partial #2 \partial #3}}
\newcommand{\pdi}[2]{\partial #1/\partial #2}
\newcommand{\LR}{\Leftrightarrow}
\newcommand{\Lg}{\mathcal{L}}
\newcommand{\half}{\tfrac{1}{2}}
\newcommand{\eqp}{\phantom{=}}
\newcommand{\eqs}{\buildrel s \over =}
\begin{document}
\end{document}
我也想给该图贴上标签。
答案1
添加\usepackage{tikz}
到你的序言中。
然后在您想要的图形处插入以下代码。
\begin{figure}
\begin{tikzpicture}
%axis
\draw (12,0) -- (0,0)--(0,10);
% Blue lines
\draw[blue] (0,9)node[left]{\color{black}20} -- (11,0)node[below]{\color{ black}12}node[near end,right]{\color{black}$MC_2$};
\draw[blue] (0,9) -- (9,0)node[below]{\color{black}10}node[near end,left]{ \color{black}$MC_1$};
% Red lines
\draw[red] (0,1) -- (5,10)node[near end,right]{\color{black}$MB_1$};
\draw[red] (0,0.5) -- (8,10)node[near end,right]{\color{black}$MB_2$};
% Dotted lines
\draw[dotted,thick] (2.85,0)node[below]{$I^*$} -- (2.85,6.1)--(0,6.1)node[ left]{$U(I^*)$};
\draw[dotted,thick] (4.25,0)node[below]{$I$} -- (4.25,5.53)--(0,5.53)node[ left]{$U(I)$};
\draw (0,0)node[below]{0}node[left]{0};
\end{tikzpicture}
%Figure caption
\caption{Demo of TikZ Figure}
\end{figure}
制作下面的图形