Graphics, Figures & Tablesfigure in example box

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
surjective
Posts: 9
Joined: Sun Nov 04, 2012 3:30 pm

figure in example box

Post by surjective »

Hello,

I've been trying to include a figure in my example box, but I keep getting errors. Could someone please assist me?

Here is the code:

Code: Select all

Code, edit and compile here:
\documentclass[14pt]{article}
\renewcommand{\baselinestretch}{1.05}
\usepackage{amsmath,amsthm,verbatim,amssymb,amsfonts,amscd, graphicx}
\usepackage{graphics}
\usepackage{xlop}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage[margin=1in]{geometry}
\usepackage{lipsum}
\usepackage{mdframed}
\usepackage{wasysym}
\usepackage{sectsty}
\chapterfont{\color{blue}} % sets colour of chapters
\sectionfont{\color{blue}} % sets colour of sections
\usepackage{tabu,mathtools}
\setlength\parindent{0pt}
\tabulinesep=_20pt
\usepackage[svgnames]{xcolor}
\usepackage[most]{tcolorbox}
\newcounter{exa}
\tcbset{
myexample/.style={
enhanced,
colback=yellow!10!white,
colframe=red!50!black,
fonttitle=\scshape,
titlerule=0pt,
title={\refstepcounter{exa}eksempel~\theexa.},
title style={fill=yellow!10!white},
coltitle=red!50!black,
drop shadow,
highlight math style={reset,colback=LightBlue!50!white,colframe=Navy}
}
}
\newtcolorbox{texample}{my example}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

figure in example box

Post by Johannes_B »

Just get rid of the figure environment.


I see you are a member here for three years. Unfortunately, you never seem to have read some introductory material. Please do so.

Would you like to here some issues with your current code? Possible things to make better in the future?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
surjective
Posts: 9
Joined: Sun Nov 04, 2012 3:30 pm

Re: figure in example box

Post by surjective »

Thanks for the reply,

How do I include my picture if I get rid of the figure?

Yes I would like that very much.

Thank you.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

figure in example box

Post by Johannes_B »

Still inconsistent, but a first step:

Code: Select all

Code, edit and compile here:
\documentclass[14pt,%article does not have this option
%demo]{article}%extarticle can have that point size
demo]{scrartcl}%scrartcl can have that point size
\renewcommand{\baselinestretch}{1.05}
%\usepackage{amsmath,amsthm,verbatim,amssymb,amsfonts,amscd, graphicx}
\usepackage{graphicx}% Use graphicx instead of graphics
\usepackage{xlop}
\usepackage[utf8]{inputenc}
\usepackage{tabu,mathtools}% moved earlier in the preamble
%\usepackage{xcolor}
\usepackage[margin=1in]{geometry}
\usepackage{lipsum}
\usepackage{showframe}
%\usepackage{mdframed}%why mdframed if tcb is in use?
\usepackage{wasysym}
%\usepackage{sectsty}
%\chapterfont{\color{blue}}%articles don't have chapters
%\sectionfont{\color{blue}} % sets colour of sections
\addtokomafont{disposition}{\color{blue}}
%\setlength\parindent{0pt}
\KOMAoption{parskip}{half}
\KOMAoption{DIV}{16}
\tabulinesep=_20pt
%\usepackage[svgnames]{xcolor}% the package was loaded earlier, this lead to an option clash
\usepackage[most]{tcolorbox}
\newcounter{exa}
\tcbset{
myexample/.style={
enhanced,
colback=yellow!10!white,
colframe=red!50!black,
fonttitle=\scshape,
titlerule=0pt,
title={\refstepcounter{exa}eksempel~\theexa.},
title style={fill=yellow!10!white},
coltitle=red!50!black,
drop shadow,
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply