2

I use elsarticle 2 docment page in LyX.

I put figure in left column partion and use

\resizebox{3.4in}{!}{ Figure.png } 

to make it smaller

But I still need to align the figure to left of the page

How to do this in LyX?

1

The resizing can already be done in \includegraphics with the width option. If the figure starts a new paragraph, add \noindent. If there are centering commands before (\centering or environment center), then you might consider removing them. Otherwise it can be put to the left by \hfill\null. The \null prevents that the \hfill is skipped by the paragraph end. A third method uses \leftline (unlike \mbox) it does not switch into horizontal mode).

\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
  \noindent
  \includegraphics[width=3.4in]{Figure}
  \caption{Figure caption}
\end{figure}
\begin{figure}
  \centering
  \includegraphics[width=3.4in]{Figure}\hfill\null
  \caption{Figure caption}
\end{figure}
\begin{figure}
  \centering
  \leftline{%
    \includegraphics[width=3.4in]{Figure}%
  }
  \caption{Figure caption}
\end{figure}
\end{document}

Result

| improve this answer | |
  • adjustbox also provides some keys to align images to the right, left or center. They can be exported for \includegraphics. – Martin Scharrer Sep 11 '12 at 19:42
  • 1
    i don't know how to add this code in lyx, this is the existing code form code viewer but i can't edit it? \begin{figure} \begin{centering} \resizebox{3.4in}{!}{ \includegraphics[clip]{tae1}} \par\end{centering} so how to add the working \includegraphics[width=3.4in]{Figure}\hfill\null – mero Sep 11 '12 at 21:05

Your Answer

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

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