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 really hate to post "what's wrong with my code" questions, but I'm a bit clueless and couldn't find a good guide about it.

Anyway, I'm trying to add a figure which was created by TikZ to my document. I'm trying this code, which gives me a blank page:

\documentclass[english,hebrew,fleqn]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9,utf8x]{inputenc}
\usepackage{tikz}
\usepackage{babel}
\begin{document}
טקסט לפני תמונה
\begin{tikzpicture}[scale=1]
\draw (0,0) -- (1,1);
\end{tikzpicture}
טקסט אחרי תמונה
\end{document}

(I put down some Hebrew because the document is in Hebrew; I don't know if it matters)

Anyhow, I want to be able to put figures "inline", like in the example above, and in a different file, that is making the figure in a different file and loading it to my document.

Thanks for all replies!

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Here, Hebrew matters. If you would temporarily switch to English, the image would appear.

\documentclass[english,fleqn]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9,utf8x]{inputenc}
\usepackage{tikz}
\usepackage[english,hebrew]{babel}
\begin{document}
טקסט לפני תמונה

\begin{otherlanguage}{english}
\begin{tikzpicture}[scale=1]
\draw (0,0) -- (1,1);
\end{tikzpicture}
\end{otherlanguage}

טקסט אחרי תמונה
\end{document}

tikz picture in hebrew text

share|improve this answer
    
Why is this? Does hebrew change catcodes needed by TikZ? –  Martin Scharrer Dec 17 '11 at 11:38
    
Ah, I don't know how I missed that... Thank you! I can now also use \input{myfigure.tikz}. Is it possible to somehow modify some parameters in the document (and not in the .tikz file) to affect the size of the figure? –  Shmuel Dec 17 '11 at 11:38
2  
Maybe \begin{otherlanguage*}{english}...\end{otherlanguage*}? This would make the document cleaner, IMO. –  egreg Dec 17 '11 at 11:39
    
@egreg Good idea! However, it doesn't work with the starred version. I changed to otherlanguage as suggested. –  Stefan Kottwitz Dec 17 '11 at 11:43
    
@Shmuel For follow-up questions, which are different, please post a new question. It usually cannot be handled in comments, and it fits better to the Q&A site. –  Stefan Kottwitz Dec 17 '11 at 11:44

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.