0

As I told in my previous thread, I'm trying to find my way out with the PGFPlots package. The package is installed and I added \usepackage{pgfplots} in the Latex Preamble section. I pressed the TeX box and inserted the following code:

\begin{tikzpicture}
    \begin{axis}
    \end{axis}
\end{tikzpicture}

As shown in the image: (The document contains also some lines written in Hebrew - RTL language)

enter image description here

I compiled the LyX document with pdflatex and it shows an empty page (without any errors). But if I'll compile it with LuaTex it will show the following errors:

enter image description here

And if i'll press show output anyway, it will show the wanted graph (as shown in the image), but it will make the hebrew words reverse.

enter image description here

I prefer to use pdflatex because its the default option (and it keeps the Hebrew words right). How can I make pdflatex accept and show the graphs? I also the other formats but none of them showed the graph.

EDIT: The MWE:

#LyX 2.2 created this file. For more info see http://www.lyx.org/
\lyxformat 508
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass heb-article
\begin_preamble
\usepackage{etex}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\end_preamble
\use_default_options true
\begin_modules
customHeadersFooters
\end_modules
\maintain_unincluded_children false
\language hebrew
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip smallskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
begin{tikzpicture} [scale=1.0] 
\backslash
begin{axis} [xlabel=$x$, ylabel=$f(x)$, width=10cm, grid=major] 
\backslash
addplot [blue, line width = 1, smooth, domain=-2:2] {3*x^2 + 5*x - 2}; 
\backslash
end{axis} 
\backslash
end{tikzpicture}
\end_layout

\end_inset


\end_layout

\end_body
\end_document
  • @Raven thank you for the replay. I have added the MWE with a better example. – vesii Dec 28 '18 at 23:22
  • @scottkosty I added those two lines (although I don't understand how they help). – vesii Dec 29 '18 at 13:41
  • regarding "although I don't understand how they help", did you test your original minimal example? LyX says "not a readable LyX document". Different LyX versions have different file formats since they have different features. When opening a .lyx file, LyX needs to know what format the file is in. In addition, it's useful because it seems you forgot to specify your LyX version. For LyX bugs/questions, please always specify your LyX version. – scottkosty Dec 29 '18 at 21:13
  • Is this issue related to Hebrew? That is, can you reproduce the issue without anything related to Hebrew (e.g., "Hebrew Article" class in your .lyx file)? I suggest you make your MWE as minimal and "vanilla" as possible. I can reproduce your issue with LyX 2.3.2. I don't think this info helps you much, but at least you know that upgrading to newest version of LyX will not fix your issue. I suggest to create a corresponding .tex MWE in LyX by going to File > Export > LaTeX (pdflatex). This will help the LaTeX experts around here help you (most of them do not use LyX). – scottkosty Dec 29 '18 at 21:26

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.