I am going back and forth between LaTeX and LyX.
I use TeXworks on WIndows 10 and have LyX 2.3 installed.
The major problem stems from using Figure and Subfigure (please see the codes below).
I tried everything to eliminate any extra packages that would make this conversion unnecessarily burdensome.
But I still have one problem with Figures and Subfigures.
When I export a LyX file to LaTeX(pdflatex), I get an error message here when compiling on TeXWorks:
\begin{figure}[hp] \centering \captionsetup{justification=centering} \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=1\linewidth,bb = 0 0 200 100, draft, type=eps]{sample.png}
So what I do is get rid of the following,
,bb = 0 0 200 100, draft, type=eps
And, I run the following, and it compiles on TeXworks fine.
\begin{figure}[hp] \centering \captionsetup{justification=centering} \begin{subfigure}{.5\textwidth} \centering \includegraphics[width=1\linewidth]{sample.png}
Question (1) Why do I need to do this every time I export from LyX to LaTeX(pdflatex)? Is there a way around this?
I have one other question when I do vice versa. Now, I am trying to import a TeXworks file to LyX, but I also have a trouble with a similar Figure and Subfigure set-up.
The error message I get in LyX is:
LaTeX Error: Cannot determine size of graphic in sample.png (no spe...)
So, when I trace back to where this code is in Texworks file, I notice I coded as:
\begin{figure}[hp] \centering \captionsetup{justification=centering} \begin{subfigure}{.5\textwidth} \centering \captionsetup{justification=centering} \includegraphics[width=1\linewidth]{sample1.jpg} \caption{sample1} \label{fig:sapmle1} \end{subfigure}\begin{subfigure}{.5\textwidth} \centering \captionsetup{justification=centering} \includegraphics[width=1\linewidth]{sample.png} \caption{sample} \label{fig:sample} \end{subfigure}\caption{sample 1 and sample} \label{fig:samples} \end{figure}
I do not understand why this is giving the size problem in LyX when I import this.
Question (2) Can someone help me this issue when I import a LaTeX file to LyX? I import as LaTeX(plain).
Thanks!