I tried to add a caption in a figure with tikZ in a margin note but LaTeX show many errors when compiling but this no occurs with i setup a document with English language and i need setup with Spanish.
Code: Select all
\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[paperwidth=8.5in, paperheight=11in]{geometry}
\geometry{top=0.75in,left=0.9in,bottom=0.75in,textwidth=5in, marginparsep=0.3in,marginparwidth=2in}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{marginnote}
\begin{document}
\marginnote{
\begin{tikzpicture}[scale=2]
\draw [thick](0,0) -- (1.75,1.75);
\draw[red,very thick,->,>=latex] (0,0) -- (.75,.75)node[below=3pt] {$-F$};
\draw[red,very thick,<-,>=latex] (1,1)node[anchor=west] {$F$} -- (1.75,1.75);
\draw [|<-,>=latex] (-0.2,0.2) -- (0.55,.95);
\draw [->|,>=latex](.75,1.15) -- (1.55,1.95) ;
\shade[ball color=green] (0,0) circle (.05cm) node[below=3pt] {$M$} ;
\shade[ball color=green] (1.75,1.75) circle (.05cm) node[right=3pt,anchor=west] {$m$} ;
\coordinate [label=left:{$r$}] (A) at (.75,1.1);
\end{tikzpicture}
\captionof{figure}{text example}
}
\end{document}