I want to include a figure from Pdf file to a LaTeX document, which I have done before by using    \includegraphics{42.pdf}   But today I want to write a paper using latex so I change my document class to  \documentclass[twoside]{article}   then I try to add Pdf figure, then the problem stat, when I try compiling this the document compiles and there is no error in the code, but no figure shows up in Pdf  here is my code     \documentclass[twoside]{article} \usepackage{authblk} \usepackage{graphicx} \usepackage{caption} \usepackage{titletoc} \usepackage[sc]{mathpazo} \usepackage[T1]{fontenc} \usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry} \usepackage[font=it]{caption} \usepackage{multicol} \usepackage{lettrine} \usepackage{abstract}     \renewcommand{\abstractnamefont}{\normalfont\bfseries}     \renewcommand{\abstracttextfont}{\normalfont\small\itshape} \usepackage{titlesec}  \title{\vspace{-15mm} \fontsize{24pt}{8pt}\selectfont \textbf{Test latex file}}    \author[1,*]{Andreas} \author[2,**]{Lulu}  \affil[1]{\normalsize Department of Physics and Astronomy, College of Science} \affil[2]{\normalsize Department of Physics, College of Science} \affil[*,**]{a@gmail.com ,s@gmail.com} \vspace{-5mm} \date{May 2015}    %%%%%%%%%%%%%%%%%%%%%%%% \begin{document}  \maketitle   \begin{abstract} \noindent In quantum optics \end{abstract}   \begin{multicols}{2}  \section{Introduction}  test test test  test test test  test test test  test test test  \begin{figure}[ht] \centering \includegraphics[width=8cm]{42.pdf} \caption{{\protect\footnotesize Test.}} \end{figure}  \section{Conclusion} test test test  test test test  test test test  test test test   \end{multicols}  \end{document}
121168
I am trying to insert a figure with a caption into a multicol article. When the figure was inserted on its own, it was fine: includegraphics[width=0.5cm]{image}  However, when I tried to insert the caption [see below], the caption did not appear anywhere in the article and the figure disappeared.  \documentclass{article} \usepackage[hmarginratio=1:1,top=30 mm,columnsep=20pt,hmargin=2.5cm]{geometry} \usepackage[font=it]{caption} \usepackage{paralist} \usepackage{multicol} \usepackage{setspace} \usepackage{graphicx}  \begin{document} \begin{multicols}{2} text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text  \begin{figure}[h!]  \caption{Fig.1 xxxxx} \includegraphics[width=0.5cm]{image} \end{figure}  text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text  \end{multicols} \end{document}   What might be the issue and how could I fix it?
47149
I'm working on my thesis, and I've realized that, any time I try to use \( \)-type inline delimiters in captions, that pdflatex breaks. While I can weasel out of actually \needing\ math in my captions, it's very inconvenient. I'm pretty perplexed.  Here's a (relatively) minimal example that breaks for me:  \documentclass{uafthesis}  \usepackage{amsmath} \usepackage{graphicx} % Graphics stuff  \begin{document}  \listoffigures  \begin{figure}[h] \centering \includegraphics[width=0.3\textwidth]{angle.png} \caption{\(\theta \)} \end{figure}   \end{document}   Here's a sample of the output:     ! LaTeX Error: Bad math environment delimiter.      See the LaTeX manual or LaTeX Companion for explanation.   Type  H   for immediate help.    ...                                                    l.1 ...k or  to continue without it.}}}{2}      ?    ! Extra }, or forgotten $.    ...r  to continue without it.}}      l.1 ...k or  to continue without it.}}}{2}      ?    Some things:   uafthesis is the unofficial official document class for my university. It has been written mostly by physics grad students by hacking at other document classes. My fork is . This only happens if I include amsmath. The minimal example and the resulting log file are gisted .   I'm defending tomorrow, and I have to turn in my thesis pretty soon, so hopefully we can figure this out within a day or so! If not, I understand, and thanks anyway.
111196
I am embedding a PDF file inside my LaTeX-generated PDF file using embedfile:  \usepackage{embedfile} \embedfile{myfile.pdf}   I would like to also insert a link that the user can click on to open the attachment.  Is there any way to do that?
47891
Is there a way to copy from a PDF to a LaTeX document? Whenever I do it, it copies in with weird symbols in the place of LaTeX commands for example:  $$f:\mathbb{R}\rightarrow \mathbb{R}$$   copies in as     f : R ! R;   I did a quick search and I couldn't really find anything (some sort of PDF to LaTeX converter that worked well)  Am I missing something obvious or can this not be done (for some reason)?
19308
I need to convert my LaTeX documents into PNG. The problem is, I also need the resulting image to be as short as possible (height-wise). I've tried latex followed by dvipng, but the result is always the size of a page. For instance, take a .tex file containing:  \documentclass{article}   \begin{document}   Hello. This is a test. \begin{equation}   L = 2                                                                      \end{equation}   \end{document}   If I compile it with latex, and then run dvipng, I get a PNG file that's the size of a full page. What I need is for the PNG file to be only as tall as needed for everything to fit. So the image would end immediately after the equation. The image still needs to have full width (because of the equation numbering).  Is there a way to achieve that?
75264
I am using pandoc to convert markdown to pdf, but I need to place some figures with more formating than the     ![Alt text](image.png)   so I use something like this:    # Document with figures    This document have figures but they appear before the title    \begin{figure}   \centering   {\includegraphics[width=2.5in]{some_figure.png}}   \caption{Comparing Dq from different p-model}   \end{figure}   and then I use the following command:   pandoc -H test_fig.sty test_fig.md -o test_fig.pdf   and test_fig.sty have:   \usepackage{graphicx}   the resulting pdf have first the figure and then the title.
35806
What are the benefits of using tools like pgfplots or tikz directly in LaTeX compared to importing PDF/PGF generated by say matplotlib?   believed that the main reason is to match the plots with the rest of the document. It also mentioned that no other plotting packages from R or python can generate graphs that have the same high image quality as those generated by pgfplots in LaTeX directly, but no examples or reasons were given. Is there evidence to back up this claim?    Another related question is that, is there any reason for exporting a plot to PGF instead of PDF?  said that the reason is PGF will generate the whole graph in LaTeX while importing to PDF even with  will only use LaTeX for the text part of the graph. But if the main reason for plotting in LaTeX is that we can match the plots with the rest of the text document, usetex exactly does that.  My current adopted approach to producing PDF documents with graphs is (i) generate graphs using tools like matplotlib or other plotting packages in a scientific programming language so that I can do computations before plotting or plot repetitive graphs; (ii) export to PDF files and use usetex if I want to match the font with my document; (iii) import the PDF files using \includegraphics and make final adjustments.  This seems to work out just fine and I didn't notice any image quality issues or graph not matching with the rest of the document.   So are there any other reasons to use native plotting utilities like pgfplots in LaTeX that I overlooked?
119334
I have an article with the following figure (there are 2 small charts near each other, horizontally):  \begin{figure}[h]   \centering   \includegraphics{left-graph}   \includegraphics{right-graph}   \caption{My caption}\label{mylabel} \end{figure}   I reference the figure with:  Figure~\ref{fig:result} shows bla-bla-bla.   The rendered PDF shows ?? instead of the figure number. I tried with the reference occurring both before and after the figure (in the LaTeX source), but it didn't make a difference.  The relevant packages I'm using are below (those removed are for titling).  \usepackage[english]{babel} \usepackage{graphicx} \usepackage[letterpaper]{geometry} \geometry{top=1.0in, bottom=1.0in, left=1.5in, right=1.0in} \usepackage{flafter} % make sure figures do not appear before their text \usepackage{sidecap} % use side captions for floats \usepackage{subfig} % subfloats   I'm not sure what's wrong here, advice is appreciated. I'm using MiKTeX 2.8.  Thank you!
45823
I have a rather large project, from which I select portions based on needs. This selection is done using a complex system of \include and \input commands. I would like to generate a list of figures and a list of tables for the output, but in the case there are no figures the list of figures should not appear. The same should happen with tables.  Here is a MWE:   \documentclass[10pt,twocolumn]{article} \usepackage{lipsum} \usepackage[margin=0.75in]{geometry} \usepackage{float} \floatstyle{boxed}   \restylefloat{figure} \restylefloat{table}  \def\ignoreTable#1\end{table}{} \def\ignoreFigure#1\end{figure}{} \begin{document}  \tableofcontents \addcontentsline{toc}{section}{List of Figures} \listoffigures \addcontentsline{toc}{section}{List of Table} \listoftables  \section{First section} \lipsum[\inputlineno] \ignoreFigure \begin{figure}[H]\centering \LaTeX\LaTeX \caption{my figure} \end{figure} \lipsum[\inputlineno] \begin{figure}[H]\centering \LaTeX\TeX \caption{another figure} \end{figure} \section{Second section} \lipsum[\inputlineno] \ignoreTable \begin{table}[H]\centering \TeX\LaTeX \caption{my table} \end{table} \lipsum[\inputlineno] \ignoreTable \begin{table}[H]\centering \TeX\TeX \caption{another table} \end{table} \lipsum[\inputlineno] \end{document}     Where if I write   \def\ignoreTable{\relax} \def\ignoreFigure{\relax}   just after \begin{document} the output is:      Ideally, there would be an "elegant" macro or package, that would eliminate the list of tables, including its entry in the TOC, if there are not tables.
77114
this is my first time here but I will try to do my best. My document stopped compiling and I was able to boil it down to the following MWE. Basically I need chemnum (and therefore auto-pst-pdf) to replace temporary markers in my chemical schemes (all .eps files). Chemmacros seems to break this because if I comment it out, the document compiles just fine. \documentclass{article}  \usepackage{graphicx} \usepackage{chemnum} \usepackage{auto-pst-pdf} %\usepackage{chemmacros}  \begin{document}  Hello World...      \begin{figure}         \includegraphics{picture.eps}     \end{figure}          \begin{figure}         \includegraphics{picture2.png}     \end{figure}   \end{document}  From the log: ------------------------------------------------- auto-pst-pdf: Auxiliary LaTeX compilation ------------------------------------------------- This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=latex) entering extended mode system returned with code 256   Package auto-pst-pdf Warning:      Creation of 00_preamble-autopp.dvi failed. This warning occured on input line 128.   Package auto-pst-pdf Warning:      Could not create 00_preamble-pics.pdf. Auxiliary files not deleted. This warning occured on input line 128.  ------------------------------------------------- auto-pst-pdf: End auxiliary LaTeX compilation -------------------------------------------------  I think it has something to do with ghostscript or related. This was tested on a fresh install on Xubuntu. I can supply log files of a failed and of a working compilation. If anything is needed, please tell me and I will try to provide. Best regards, Phil PS: I was able to reproduce the error with these files:
68897
How do I create a file in windows from where LaTex can extract the pdf or Jpg file I want to insert in my document? In other words I need an example of inserting either images or pdf files in my document Here's the image I want to insert    The Image will be placed center to the page just beneath this codes  \[ \overline \rho = \overline P + 0.645 \Big (\frac { \overline P}{K}\Big) ^{\frac {3}{4}} \tag { Tazkera} \]
45076
I am giving a presentation and therefore I am using the  class. I have included some figures and it works, but there is no number after "Figure".  My code:  \documentclass{beamer}  \usepackage{graphicx} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{listings} \usepackage{xcolor} \usepackage{eso-pic} \usepackage{mathrsfs} \usepackage{url} \usepackage{amssymb} \usepackage{amsmath} \usepackage{multirow} \usepackage{hyperref} \usepackage{booktabs} \usepackage{wallpaper} \usepackage{bbm} \usepackage{cooltooltips} \usepackage{eso-pic} \usepackage{everyshi} \usepackage{calc} \usepackage{graphicx} \usepackage{ifthen} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{animate} \usepackage[singlespacing]{setspace} \usepackage[absolute,overlay]{textpos} \usepackage{enumerate} \usepackage{hyperref} \newenvironment{changemargin}[2]{%   \begin{list}{}{%     \setlength{\topsep}{0pt}%     \setlength{\leftmargin}{#1}%     \setlength{\rightmargin}{#2}%     \setlength{\listparindent}{\parindent}%     \setlength{\itemindent}{\parindent}%     \setlength{\parsep}{\parskip}%   }%   \item[]}{\end{list}}  \setbeamercolor{frametitle}{fg=red,bg=white}  \hypersetup{pdfpagemode=FullScreen} \renewcommand*{\UrlFont}{\normalfont}  \usetheme{Goettingen} \useinnertheme{circles} \beamertemplatenavigationsymbolsempty  \setbeamerfont{page number in head/foot}{size=\large} \setbeamertemplate{footline}[frame number]   %%% \begin{document}  \frame[plain]{ \titlepage }  \setbeamertemplate{background canvas}[default]  \frame{ \frametitle{}  \begin{figure} \begin{center} \includegraphics[scale=0.2]{varweakness} \caption{VaR as a quantile} \end{center} \end{figure}  }   \end{document}   Which gives the following frame with the figure:    (I am not sure what is causing the problem, therefore I did not delete any package.)  How can I get a number, e.g. Figure 1:?
43541
I would like to place the figures as illustrated in the figure below.  The below code can place three figures side by side, but the third one on the right hand side becomes 1c (instead of 2). Any suggestions? Thank you in advance.  \begin{figure*}[tp!]   \centering   \begin{minipage}{.315\linewidth}     \centering     \subcaptionbox{\footnotesize 1a. \label{fig:1a} }     {\includegraphics[width=\textwidth]{figures/1a.pdf}}   \end{minipage}\quad   \begin{minipage}{.315\linewidth}     \centering     \subcaptionbox{\footnotesize 1b. \label{fig:1b}}     {\includegraphics[width=\textwidth]{figures/1b.pdf}}   \end{minipage}\quad   \begin{minipage}{.315\linewidth}     \centering     \subcaptionbox{\footnotesize 2. \label{fig:2}}     {\includegraphics[width=\textwidth]{figures/2.pdf}}   \end{minipage}   \caption{\footnotesize Main caption here. }   \label{fig:main} \end{figure*}
7552
Is there a converter that will convert LaTeX to HTML? I have tried several services but the LaTeX diagrams and some of the maths came out weird.  I actually converted the Latex to PDF without a problem. Then I used  to convert from PDF to HTML. The square root signs did not appear properly and some of the Cartesian coordinate plane diagrams had nothing on them except the grid.   \documentclass[12pt,a4paper]{report} \usepackage{amssymb} \usepackage{amsthm} \usepackage{amsmath} \usepackage{pstricks,pst-plot} \usepackage{pst-eucl} \addtolength{\hoffset}{0.2cm} \addtolength{\textwidth}{1.1cm} \addtolength{\textheight}{1.0cm} \addtolength{\voffset}{-0.7cm} \linespread{1.3} \begin{document}  If $x$ is non-positive then $x \leq -\sqrt{\frac{1}{2}}$     $\hspace{30 mm} $     (6)\\  (4) and (6) tell us that\\  (4)  $-1 \leq x \leq 0$  \\  (6)  If $x$ is non-positive then $x \leq -\sqrt{\frac{1}{2}}$\\  Therefore $-1 \leq x \leq -\sqrt{\frac{1}{2}}$\\  \vspace{50 mm}  \begin{align*} \psgrid[unit=2cm](0,0)(-2,-2)(2,2) \pnode(-1.8,.87){b}\uput[50](b){b} \pnode(-1.8,1.8){a}\uput[50](a){a} \psset{linecolor=green} \psline[linewidth=1pt](-1.8, 0)(-1.8,4) \psset{linecolor=green} \psline[linewidth=1pt](-1.8, 0)(-1.8,-4) \psset{linecolor=blue} \psellipticarc(0,0)(2,2){0}{180} \psset{linecolor=red} \psline[linewidth=1pt,linestyle=dashed,dash=2pt](-2,2)(-1.41,1.41) \psset{linecolor=red} \psline[linewidth=1pt](-1.41,1.41) \psset{linecolor=red} \psline[linewidth=1pt]{-&gt;}(4,-4) \psset{linecolor=red} \psline[linewidth=1pt]{-&gt;}(-2,2)(-4,4) \end{align*}  \end{document}   PDF output:    PDF->HTML output:
31098
I have tried  \includegraphics{http://www.site.com/path/to/figure.png}   But this returns the error   ERROR: Package pdftex.def Error: File `http://www.website.com/path/to/figure.png' not found.    Are there other options?
36649
I'm trying to plot an image file in a pdfplots axis. This is a minimal example (the files fig2a.eps and fig2a.png both contain the image that should be plotted):   \documentclass{standalone} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot graphics[xmin=-0.15, xmax=0.15, ymin=0.0, ymax=0.2] {fig2a}; \end{axis} \end{tikzpicture} \end{document}   When compiling with pdflatex, I get exactly what I want. With latex (producing a dvi file), the tick labels are all on top of each other inside the image, so something goes wrong with the positioning.  I suppose version information is useful in this case -- from the output to the screen I have this when running both latex and pdflatex:  This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)   What am I doing wrong?
46958
I need to copy a table from a pdf file to my LaTeX document. I know I have to do it by hand but still don't understand how to create a table with LaTeX.