Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I draw a graph in Latex but I'm having a problem in placing the caption of the graph since I want it be exactly below my graph at the left side of the page but it's always in the center regardless to whatever I do in order to bringin it to the left side , I'm using picture enviroment . I also looked at the similar problems but the solution did not work . this is the code which I'm using . which changes should I make in order to solve this problem? ‎here I put 2 codes one of them is when i'm not using English and all the commands will work but the second one is when I'm using Farsi language where this problem remains :

\documentclass[a4]‎{‎book‎}‎‎ 
‎‎
‎\usepackage{color}‎
\usepackage{graphicx}‎
\usepackage{pict2e} ‎‎‎‎
‎\textwidth =12cm‎ 
‎\textheight =19cm‎
‎\usepackage{amsmath,amssymb}‎‎ 
‎\usepackage{pict2e}‎
‎‎ ‎ ‎
‎‎
‎\begin{document}‎‎
‎‎‎‎‎‎
‎\begin{figure}‎[htp!]‎
‎\setlength{‎\‎unitlength}{0.‎1c‎m}‎
\linethickness{0.3mm}‎‎ ‎‎‎‎‎
‎\begin{picture}(‎0‎‎‎,‎2‎0‎)‎
‎\put(‎0‎‎,0){\vector(1,0){40}}‎‎
\put(42,0){‎$‎x$}‎
\put(‎0,‎‎0){\vector(0,1){‎3‎0}}‎
\put(0,‎3‎2){‎$‎y$}‎‎
‎\put(0,0){\color{red}\vector(2,1){30}‎} ‎‎
\put(30‎‎,‎1‎6‎){‎$‎(‎‎x,y)$} ‎‎
\put(‎29‎,-‎4‎){‎$‎x‎$‎}‎
\put(-‎4‎,16){‎$‎y$}‎
‎\put(‎9‎‎‎,‎1‎‎‎){‎$‎\theta‎$}‎
\put(‎1‎4‎,‎10‎‎){‎$‎r‎$‎}
\multiput(0,‎15‎‎)‎(‎0.‎8‎‎‎,0‎)‎{‎38‎‎‎‎‎‎}‎{\line(1,0){‎0.‎3}}‎‎ 
\multiput(‎29.5‎‎‎,0‎‎‎)‎(‎0‎‎‎‎,0‎.8‎‎)‎{‎20‎‎‎‎‎‎‎‎}‎{\line(‎0‎,‎1‎){‎0.‎3}}‎‎‎‎‎
\end{picture}‎‎‎‎‎ 
‎\caption{ I‎‎‎‎‎‎‎‎ ‎want ‎name ‎below‎ ‎gragh‎  }‎
‎\end{figure}‎ 
\end{document}‎

the Second one : ‎

\documentclass[a4]‎{‎book‎}‎‎ 
‎
\usepackage{caption}‎‎
‎\usepackage{color}‎
\usepackage{graphicx}‎
\usepackage{pict2e} ‎‎‎‎
‎\textwidth =12cm‎ 
‎\textheight =19cm‎
‎\usepackage{amsmath,amssymb}‎‎ 
‎\usepackage{pict2e} ‎‎
‎\usepackage{xepersian}‎
‎\settextfont[Scale=1]{XB Zar}‎
‎\setdigitfont[Scale=1]{XB Zar}‎‎ 
\begin{document}‎
‎\begin{figure}‎[‎!‎hb‎‎]‎‎‎
‎\setlength{‎\‎unitlength}{0.‎1c‎m}‎
\linethickness{0.3mm}‎‎ ‎‎
\begin{LTR}‎
‎\begin{picture}(‎0‎‎‎,‎2‎0‎)‎
‎\put(‎0‎‎,0){\vector(1,0){40}}‎‎
\put(42,0){‎$‎x$}‎
\put(‎0,‎‎0){\vector(0,1){‎3‎0}}‎
\put(0,‎3‎2){‎$‎y$}‎‎
‎\put(0,0){\color{red}\vector(2,1){30}‎} ‎‎
\put(30‎‎,‎1‎6‎){‎$‎(‎‎x,y)$} ‎‎
\put(‎29‎,-‎4‎){‎$‎x‎$‎}‎
\put(-‎4‎,16){‎$‎y$}‎
‎\put(‎9‎‎‎,‎1‎‎‎){‎$‎\theta‎$}‎
\put(‎1‎4‎,‎10‎‎){‎$‎r‎$‎}
\multiput(0,‎15‎‎)‎(‎0.‎8‎‎‎,0‎)‎{‎38‎‎‎‎‎‎}‎{\line(1,0){‎0.‎3}}‎‎ 
\multiput(‎29.5‎‎‎,0‎‎‎)‎(‎0‎‎‎‎,0‎.8‎‎)‎{‎20‎‎‎‎‎‎‎‎}‎{\line(‎0‎,‎1‎){‎0.‎3}}‎‎‎‎‎
\end{picture}‎‎ ‎‎‎
\end{LTR}‎
\captionsetup{singlelinecheck=false}‎‎
‎\caption ‎‎{‎نمایشِ قطبیِ یک نقطه‎}‎ 
‎\end{figure}‎‎
‎\end{document}‎‎
share|improve this question
2  
You can use the caption package to control the placement of the caption, as described in the answer to How can I left-align a caption?. If this solves your problem, please us know, so this question can be closed as a duplicate. Otherwise, please edit your question with more detail about what doesn't work. –  Jake Jul 10 '11 at 6:53
    
thank you very much but as I said before this does not solve my problem since : 1- I have so many graphs and I mentioned just one as an example ,as I don't want all of them have captions at left I cannot use this package because it makes all the captions at left 2- the language which I'm using is farsi so it turns the caption at the right side and I cannot solve the problem . –  Negin Jul 10 '11 at 8:18
2  
It's better to edit your question to add more information like that code sample. –  Jake Jul 10 '11 at 8:36

2 Answers 2

you can setup the captionformat for such an image:

\documentclass{book}
\usepackage{caption}
\usepackage{color}
\usepackage{graphicx}
\usepackage{pict2e}
\textwidth=12cm
\textheight=19cm
\usepackage{amsmath,amssymb}
\usepackage{pict2e}
\begin{document}
\begin{figure}[htp!]
\setlength{\unitlength}{0.1cm}
\linethickness{0.3mm}
\begin{picture}(0,20)
\put(0,0){\vector(1,0){40}}
\put(42,0){$x$}
\put(0,0){\vector(0,1){30}}
\put(0,32){$y$}
\put(0,0){\color{red}\vector(2,1){30}}
\put(30,16){$(x,y)$}
\put(29,-4){$x$}
\put(-4,16){$y$}
\put(9,1){$\theta$}
\put(14,10){$r$}
\multiput(0,15)(0.8,0){38}{\line(1,0){0.3}}
\multiput(29.5,0)(0,08){20}{\line(0,1){0.3}}
\end{picture} 
\captionsetup{singlelinecheck=false}
\caption{ I want name below graph}
\end{figure}

\end{document}

enter image description here

share|improve this answer
    
But it doesn't work when I change the language into Persian , I've just added the code which I already use with the suggested commands and it shows the caption at the right side of the page not the left ! –  Negin Jul 10 '11 at 12:32
    
@negin: then put the \captionsetup and \caption also into the LTR environment –  Herbert Jul 10 '11 at 13:37
    
what exactly do you want? all captions left aligned? –  Herbert Jul 10 '11 at 14:00
    
I did it but again I did encounter another problem , The label of caption is Farsi every where in this article I mean the part which is shown as figure 1.1 in English , it is شکل1-1 for example , but if I put it in the LTR environment it would be just like what is in english (figure1.1) is there any way to still keep the caption's label like what is in farsi while it is at the left side under the figure? –  Negin Jul 10 '11 at 18:17
    
no I don't want all the captions be at the left side and i do want just this caption so I omit the caption options in the package and instead use the \captionsetup which you did recommend and that was useful but still strugelling with the problem above –  Negin Jul 10 '11 at 18:21
up vote 1 down vote accepted

thank you very much guys , my problem have just been solved by usind this code : ‎

\documentclass[a4]{book}‎ 

‎\usepackage{caption}‎
‎\usepackage{color}‎
‎\usepackage{graphicx}‎
‎\usepackage{pict2e}‎ 
‎\textwidth =12cm‎ 
‎\textheight =19cm‎
‎\usepackage{amsmath,amssymb}‎ 
‎\usepackage{pict2e}‎ 
‎\usepackage{xepersian}‎
‎\settextfont[Scale=1]{XB Zar}‎
‎\setdigitfont[Scale=1]{XB Zar}‎ 
‎\begin{document}‎
‎\begin{figure}[!hb]‎
‎\setlength{\unitlength}{0.1cm}‎
‎\linethickness{0.3mm}‎ 
‎\begin{LTR}‎
‎\begin{picture}(0,‎0‎)‎
‎\put(0,0){\vector(1,0){40}}‎
‎\put(42,0){$x$}‎
‎\put(0,0){\vector(0,1){30}}‎
‎\put(0,32){$y$}‎
‎\put(0,0){\color{red}\vector(2,1){30}}‎ 
‎\put(30,16){$(x,y)$}‎ 
‎\put(29,-4){$x$}‎
‎\put(-4,16){$y$}‎
‎\put(9,1){$\theta$}‎
‎\put(14,10){$r$}‎
‎\multiput(0,15)(0.8,0){38}{\line(1,0){0.3}}‎ 
‎\multiput(29.5,0)(0,0.8){20}{\line(0,1){0.3}}‎
‎\end{picture}‎ 
‎\end{LTR}‎‎
‎\captionsetup‎{singlelinecheck=off , ‎format=hang,justification=raggedright‎‎}‎ 
‎‎\caption‎{نمایشِ قطبیِ یک نقطه}‎‎‎‎‎‎‎‎
‎\end{figure}‎
‎\end{document} 

so the only change was

 ‎\captionsetup‎{singlelinecheck=off , ‎format=hang,justification=raggedright‎‎}‎ 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.