1

I'm going to take part in this conference and editing the paper using the recommended package and template which you can download from the same page (see Submission Instruction)

Here's the problem:

When I try to put my graph on like this:

\begin{figure}
  \centering
  \includegraphics[width=\linewidth]{check.png} 
  \caption{this is a test}
  \label{test}
\end{figure}

enter image description here

the error message comes up.

cannot determine size of graphics (no bounding box)

I looked for the solution and found out that adding this might solve the problem:

\usepackage[dvipdfmx]{graphicx}

But now another error appears:

option clash for package graphicx

I know I should comment out the original one, but I cannot find where the original code is written.

Please give me any tips for it. Thank you


For your information, my environment on Mac is like this, Distribution: TeX Live, Editor: VS code, Compilation: latexmk.

SpaceTAKA
  • 149
  • Hard to tell without your image. However, you lost the caption element. I.e. I don‘t know if \label, stand alone, causes these errors. Suggestion: try again with a complete figure environment. // See e.g. here, almost at the end „Labels and cross-references“ https://www.overleaf.com/learn/latex/Inserting_Images – MS-SPO Nov 24 '23 at 10:26
  • what exactly is your tool chain here? Most people use pdflatex or similar which can handle png files. You chain seems to involve latex and perhaps dvipdfmx – daleif Nov 24 '23 at 10:32
  • 1
    f you really have to use latex/dvips you can not include png files, save the image as eps, or use pdflatex not latex – David Carlisle Nov 24 '23 at 10:32
  • 1
    Use may need to use \RequirePackage[dvipdfmx]{graphicx} before \documentclass as the class used alredy loads graphicx – daleif Nov 24 '23 at 10:33
  • 1
    only use dvipdfmx option if you plan to use dvipdfmx dvi driver (which you can do, but isn't the usual option) – David Carlisle Nov 24 '23 at 10:34
  • I tried to reproduce the issue with the template file l4dc2024-sample.tex from your link and a random png file, and it worked without problems. I didn't change or add any \usepackage statements, I just put \includegraphics[width=\linewidth]{myfile.png} in the document body. Could you try if that works for you as well, i.e., use the template and change nothing except for the png? If yes, then you probably added something somewhere that causes the problem (such as another \usepackage{graphicx} call with different options) that is causing the issue, and removing that will solve the issue. – Marijn Nov 24 '23 at 15:33
  • 1
    If the problem persists, then it can be that your version of the base class jmlr.cls is somehow broken, try to find if there is a modified version in the LaTeX path that takes precendence over the originally installed one and/or reinstall it from https://ctan.org/pkg/jmlr. It can also be that your particular PNG image is broken (for example that it is not a real PNG), you could try with another image to see if that works. – Marijn Nov 24 '23 at 15:35
  • 1
    @Margin As you say my jmlr.cls is maybe broken cuz the error happens even if I do not change anything – SpaceTAKA Nov 25 '23 at 02:10
  • @Marijn But where can I find the jmlr.cls? It doesn't belong to the file downloaded from the link – SpaceTAKA Nov 25 '23 at 02:11
  • 1
    @MS-SPO Unfortunately, adding a caption didn't solve the problem – SpaceTAKA Nov 25 '23 at 02:13
  • @daleif I use VScode with MacTex, and \RequirePackage[dvipdfmx]before the \documentclass didnt work due to the same error message – SpaceTAKA Nov 25 '23 at 03:29
  • @Marijn How can I check the difference from your environment? I use VS code on Mac and it perfectly works with other papers – SpaceTAKA Nov 25 '23 at 03:51
  • @daleif Correction: I use latexmk – SpaceTAKA Nov 25 '23 at 04:44
  • @Marijn My environment on Mac is like this, Distribution: TeX Live, Editor: VS code, Compilation: latexmk. – SpaceTAKA Nov 25 '23 at 07:08

1 Answers1

1

For reference, I obtain the same result as Marijn reorted in comment 1 and comment 2 on Windows with Texmaker+pdflatex. What I did:

  • created a folder confPaper
  • copied l4dc2024.cls and l4dc2024-sample.tex there (i.e. avoided a regular install)
  • compiled the sample file
  • MikTex-console complained jmlr.cls is missing in my installation
  • allowed its installation
  • compile finished successfully

Next I copied your image and your code snippet into the sample file as a new \section{Drawings}: it compiled without problems. So, without further checks, package graphicx must be included already.

Suggestion: Check, remove or update jmlr.cls on your system. This package is available via ctan.

BTW: class jmlr.cls is loaded in line 18 \LoadClass[pmlr]{jmlr} inside of l4dc2024.cls.

result

\documentclass{l4dc2024}

% The following packages will be automatically loaded: % amsmath, amssymb, natbib, graphicx, url, algorithm2e

\title[Short Title]{Full Title of Article} \usepackage{times} % Use \Name{Author Name} to specify the name. % If the surname contains spaces, enclose the surname % in braces, e.g. \Name{John {Smith Jones}} similarly % if the name has a "von" part, e.g \Name{Jane {de Winter}}. % If the first letter in the forenames is a diacritic % enclose the diacritic in braces, e.g. \Name{{'E}louise Smith}

% Two authors with the same address % \coltauthor{\Name{Author Name1} \Email{abc@sample.com}\and % \Name{Author Name2} \Email{xyz@sample.com}\ % \addr Address}

% Three or more authors with the same address: % \coltauthor{\Name{Author Name1} \Email{an1@sample.com}\ % \Name{Author Name2} \Email{an2@sample.com}\ % \Name{Author Name3} \Email{an3@sample.com}\ % \addr Address}

% Authors with different addresses: \author{% \Name{Author Name1} \Email{abc@sample.com}\ \addr Address 1 \AND \Name{Author Name2} \Email{xyz@sample.com}\ \addr Address 2% }

\begin{document}

\maketitle

\begin{abstract}% An abstract would go here.% \end{abstract}

\begin{keywords}% List of keywords% \end{keywords}

\section{Introduction}

\begin{itemize} \item Limit the main text (not counting references) to 10 PMLR-formatted pages, using this template. \item Include {\em in the main text} enough details, including proof details, to convince the reviewers of the contribution, novelty and significance of the submissions. \end{itemize}

\section{Drawings} % <<< only new section here \begin{figure} \centering \includegraphics[width=\linewidth]{check.png} \caption{this is a test} \label{test} \end{figure}

\acks{We thank a bunch of people.}

\bibliography{yourbibfile}

\end{document}

P.S.

A few words about accessing and working with the jmlr.cls class.

The best way of course is always to use the installation process supported by the Latex distribution used. However, as the comments suggest, this isn't always easy to do. So here's a kind of bypass solution.

Obtaining the class

You can find it on ctan here. While you could read the .pdf from there, here probably the .zip file is more interesting:

ctan page

Once you downloaded (just click on said link) and opened the zip file, it shows the typical TDS-structure. I.e. you'd copy each directory (i.e. its contents) to the appropriate directories on your system, AND most likely have to tell your distribution to update its database (so it really can find it).

Bypass

Without having tried it, this should work for you:

  • open the zip file
  • move to /tex/latex/jmlr
  • copy the 3 files to the same directory of your conferencePaper.tex

jmlr.cls

When you now compile your conference-paper, it will look first locally (and happily finds the requested class), and via its database of Latex-packages elsewhere in the TDS-tree, if it doesn't find it locally.

Caveat

Please be aware that jmlr.cls loads more classes or packages. So you may end up with a very crowded conference-folder ... but it should work, at least.

However, with a few extra folders, e.g. /img for your images, a final release to the conference should still be "easy" to do.

Files

For your reference, this is the content in my confPaper folder (while the jmlr.cls is certainly loaded from the MixTex installation; I think I just put it there for inspection).

files

MS-SPO
  • 11,519
  • 1
    Thank you for your time. I completely did what you did with my jmlr.cls removed. Once I do your code, the same error "cannot determine size of graphics (no bounding box) " appears. – SpaceTAKA Nov 25 '23 at 13:18
  • my VS code didnt complain anything...but jmlr is probably still missing. And I could not find the jmlr.cls in the file downloaded from the link. – SpaceTAKA Nov 25 '23 at 13:21
  • 1
    @SpaceTAKA, the jmlr.cls is NOT in the download. Instead it‘s expected to be on your system. The downloaded class calls it, see line 18 as indicated. // To move on: do you have an account on overleaf, just to get your paper done? – MS-SPO Nov 25 '23 at 16:34
  • Where can I get the jmlr.cls? And no, I do not have an account on overleaf – SpaceTAKA Nov 25 '23 at 16:37
  • Did you mean the jmlr.cls will be automatically downloaded? If yes, I could not find jmlr.cls downloaded in my Mac – SpaceTAKA Nov 26 '23 at 14:24
  • I observe jmlr.dtx and jmlr.ins instead – SpaceTAKA Nov 26 '23 at 14:28
  • Automatic download depends on your Latex distribution. E.g. for my MikTex distribution I can set it to "Ask before install", but it could also be set automatic. Please check your MAC distribution for this purpose. // Well, Overleaf accounts are for free and you can do most thinkgs you need to. https://www.overleaf.com/user/subscription/plans This may be a useful occasion to keep you going with your paper and solve the MAC issue at a better time. – MS-SPO Nov 26 '23 at 14:30
  • Editing your answer to add the cls would also work :) – SpaceTAKA Nov 26 '23 at 15:57
  • Hi: I added a P.S. section describing a bypass solution, which hopefully works for you. – MS-SPO Nov 26 '23 at 16:25
  • Thank you for everything, now my folder of ConfPaper includes, [sample.tex/ sample.synctex.gz/ sample.dvi/ l4dc2024.cls/ jmlr.cls/ jmlrbook.cls/ jmlrutils.sty/ sample.pdf/ check.png]. Is this the same content to you? Unfortunately the error “cannot determine size of graphics (no bounding box) " still appears. – SpaceTAKA Nov 27 '23 at 06:17
  • Almost, see end of my answer. No, I don't have any dvi-files, as others already remarked, too. Can this be a problem from your compiler setup? // As the conference requires .pdf files to be submitted, you can also stop using the .png route, and include the .pdf generated from your drawings as an alternative. See my answer https://tex.stackexchange.com/a/702173/245790, which shows how to include a Tikz drawing as pdf, separately compiled with a different documentclass. // Did you have a look into your .log file? – MS-SPO Nov 27 '23 at 08:17