LaTeX forum ⇒ Graphics, Figures & Tablesusepackage graphicx error

Information and discussion about graphics, figures & tables in LaTeX documents.
guven
Posts: 1
Joined: Mon Feb 13, 2017 8:13 am

usepackage graphicx error

Postby guven » Mon Feb 13, 2017 8:21 am

Dear Community members,

I get this error

[5] <img/MLC.png, id=55, 449.42906pt x 395.97937pt> <use img/MLC.png>
! Too many }'s.
\color@endbox ->\color@endgroup \egroup

l.81 \end{figure}

I googled and most say I need to add \usepackage{graphicx} which I already have. Here is my code

  1. \documentclass[11pt]{report} %font must be 10pt or larger
  2. \special{papersize=8.5in,11in}
  3. \usepackage[showframe=false,left=1.5in,right=1in,top=1in,bottom=1in]{geometry}
  4. \setlength{\footskip}{0.5in} % distance between the text block and your page number
  5. \input{preambles/packages}
  6. \input{preambles/commands}
  7.  
  8. %--------------------------------------------------------------
  9.  
  10. \newenvironment{remark}[1][Remark]{\begin{trivlist}
  11. \item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
  12.  
  13. %--------------------------------------------------------------
  14. \setlength{\abovecaptionskip}{0.3cm}
  15. \setcounter{secnumdepth}{3}
  16.  
  17. \begin{document}
  18.  
  19. \input{frontmatter/frontmatter}
  20. \doublespacing
  21.  
  22. \pagenumbering{roman}
  23. \setcounter{page}{9} %check to make sure the page number is set properly
  24.  
  25. \pagenumbering{arabic}
  26. \setcounter{page}{1}
  27.  
  28. %chap1: introduction
  29. \input{chap1.tex}
  30.  
  31. \end{document}


\input{preambles/packages} is:

  1. % -------- Fonts ---------------------------------------------------
  2.  
  3. \usepackage{lmodern}
  4. \usepackage[T1]{fontenc}
  5. \usepackage{setspace}
  6. \usepackage{indentfirst}
  7. % -------- Math and Graphics stuff ----------------------------
  8. \usepackage{amsmath}
  9. \usepackage{latexsym}
  10. \usepackage{amssymb}
  11. \usepackage{amsfonts}
  12. \usepackage{amsthm}
  13. \usepackage{graphicx}
  14. \usepackage{afterpage}
  15.  
  16. \usepackage{rotating}
  17. \usepackage[labelfont=bf, font=small]{caption}
  18. \usepackage{mdwlist,paralist}
  19. \usepackage{algorithmic}
  20. %\usepackage{algpascal}
  21. %\usepackage{algpseudocode}
  22. \usepackage{algorithm}
  23. \usepackage{subfigure}
  24. \usepackage{mathrsfs}
  25. \usepackage{dsfont}
  26. \usepackage{color}
  27. \usepackage{setspace}
  28. \usepackage{appendix}
  29. \usepackage[compact]{titlesec}
  30. \usepackage{epsfig} % for postscript graphics files
  31. \usepackage{epstopdf}
  32. \usepackage{enumitem}
  33.  
  34. % -------- table packages ----------------------------
  35. \usepackage{booktabs}
  36. \usepackage{multirow}
  37. \usepackage{colortbl}
  38. \usepackage{array, supertabular}
  39. \usepackage{tocbibind}
  40. \usepackage[subfigure]{tocloft}
  41. \renewcommand{\cftfigfont}{Figure }
  42. \renewcommand{\cfttabfont}{Table }
  43. \renewcommand{\cftchappresnum}{Chapter }
  44. \renewcommand{\cftchapnumwidth}{6em}
  45. %------------ Chapter ------------------------------------
  46. \usepackage{titlesec}
  47.  
  48. \titleformat{\chapter}[display]{\normalfont\large\bfseries}{\chaptertitlename ~\thechapter}{-1pt}{\large}
  49. %\titleformat{\section}{\bfseries\sffamily\large}{\thesection.}{\hspace{1cm}}{}%
  50. \titlespacing*{\chapter}{0pt}{-8mm}{0pt}
  51.  
  52. % ---- section --------------------------------------------
  53. \usepackage{sectsty}
  54.  
  55.  
  56.  
  57. \sectionfont{\large\bfseries}
  58. \subsectionfont{\large\bfseries}
  59. \subsubsectionfont{\normalsize\itshape}
  60. \chapterfont{\LARGE}
  61. \chaptertitlefont{\LARGE}
  62. %\uppercase
  63. % ---------------------------------------------------------------
  64.  
  65. %\usepackage{hyperref} %hyper links references in text



\input{chap1.tex} is:

  1. \titleformat{\chapter}[display]{\normalfont\large\bfseries}{\chaptertitlename~\thechapter}{-1pt}{\large}
  2. %\titleformat{\section}{\bfseries\sffamily\large}{\thesection.}{\hspace{1cm}}{}%
  3. \titlespacing*{\chapter}{0pt}{-8mm}{0pt}
  4. \chapter{Introduction}
  5. \label{chap:Intro}
  6. %\vspace{-15mm}
  7. \section{Background}
  8. \vspace{-4mm}
  9.  
  10. \vspace{-4mm}
  11. \section{Healthcare Delivery}
  12. \vspace{-4mm}
  13.  
  14.  
  15.  
  16. \begin{figure}[!h]
  17. \begin{center}
  18. \includegraphics[scale=0.3]{img/MLC.png}
  19. \end{center}
  20. \caption{A multi-leaf collimator \cite{bortfeld2006imrt}}
  21. \label{MLC}
  22. \end{figure}


ALL HELP IS GREATLY APPRECIATED

User avatar
Johannes_B
Site Moderator
Posts: 3355
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Feb 13, 2017 9:20 am

We would appreaciate a minimal working example.

From a first glance, you are doing many strange things in your code.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8075
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Feb 13, 2017 5:00 pm

Hi Guven,

welcome to the forum!

Generally, please try to provide a small single document code (based on your code) that brings the error. Her it would be like making a copy, putting document and preamble.tex and chap1.tex into a single file for testing, removing not relevant code, then posting here. Link for getting perfect help: Infominimal working example.

In all the code above there is no real issue, at least no cause for that error. So I think, the cause is in the file preambles/commands.tex. It could be a float redefinition.

Please post commands.tex here.

Stefan
Site admin


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests