Figures and Subfigures in LaTeX (Latex Basic Tutorial-08)
HTML-код
- Опубликовано: 15 сен 2024
- This tutorial includes:
1. Use of graphicx, caption, subcaption, and sidecap packages,
2. Single graphics addition,
3. Graphics side by side,
4. Table side by side
----------------------------------------------------
Subfigure codes:
\begin{figure}[ht]
\centering
\begin{subfigure}[b]{0.45\linewidth}
\includegraphics[width=\linewidth]{img13.jpg}
\caption{Description of the graphics will come here...}
\label{fig:img112}
\end{subfigure}
\quad %\qquad, \hfill
\begin{subfigure}[b]{0.45\linewidth}
\includegraphics[width=\linewidth]{img15}
\caption{Description of the graphics will come here...}
\label{fig:img11}
\end{subfigure}
\caption{Global caption will come here...}
\label{fig:global fig}
\end{figure}
----------------------------------------------------
►Simple and fancy table:
• Simple and Fancy Table...
----------------------------------------------------
If this worked and helped you
► Do not forget to Like, Comment, and Subscribe !
=================================================
► To Watch all our videos, click here - goo.gl/aCCrzi
► Subscribe to our channel, click here - goo.gl/9QCQhC
Thank you, Dr. Chandra. Excellent videos.
Most welcome
Thank you sir. Sometimes there is a white space around the figure. How to clip that.
I am drawing a curve and using 'controls', it gets misaligned with other parts of the diagram and giving white spaces above and below.
I am using \clip () rectangle ();
but it's giving error.
Any solution about removing the white space would be much appreciated.
Sir, facing one issue while using eps images in latex, it shows error (failure eps to pdf not converted) and in the output blank image appears.
Kindly help how can i insert .eps extension images in latex successfully ?
Where the path of image....
It's given than that file not find...so to give that path where the picture is save or do I anything else
how could we change the figure no like figure no 1 in place of a b, kindly provide the script for that , thank you in advance
Hi Chandra, I will like to ask your opinion on using minipage to include graphics on latex. Do u think it s a good practice? What do u think are the pro and cons? To me, it seems to be a very good way to control the position the graphics and probably tables. But I am not proficient in latex. Thanks. Felipe
thank you very much, i didnt try it out yet, but it seems you got the point!
very well explained and thanks for telling finally that fkng subfig/subfigure is out of date.
i tried and it worked, thank you so much!!!!!!!!!!!!!! through the whole internet you helped me the most!
Pleased to hear that this tutorial helped you.
how to make a circle vertex with a node inside? using graphics&graphtex?
Thank u sir. But I do the same as in the video but image in between the theorems. Not in the place where I want to insert.pls help
Sometimes, it's very difficult to place the float at exactly the same place.
Thank you to make this video! is very useful
Glad to know that it worked for you.
This is amazing, thank you for helping us with your videos!
Thanks for the comment.
Hi sir, i have 10 images and i want to add 2 images per page.please help me
Facing same problem
An informative video for beginners. Great effort. How to decrease the vertical distance between subfigures (say u have two figs. above and two below)?
You can use vskip or vspace command after adding two subfigs.
my project doesn't work please help me if you can
hello I have a problem especially in figures can I write it and you help me to solve it. by the way, I use Miktex not graphics
MikTeX is a tex/latex distributor. Graphicx is a package that you need to load in your main tex file. Please follow the tutorial.
sir, when I used package graphicx.. it repeatedly asking to install software every time I running it .. please help me to resolve this problem sir..
I think you are using basic MikTeX. Download 'graphicx' package from ctan website and save it in your working folder.
Thank you for nice tutorial !!
Most welcome.
That is very useful. Do you know how to put the main caption (not subcaptions) on the left side of two subfigures instead of below the subfigures?
Use 'sidecap' package with 'leftcaption' option in the preamble.
\usepackage[leftcaption]{sidecap}
Thanks for your quick reply! I gave it a try, but it seemed still not working. Do you have a minimum working example for sidecap with subfigures? Greatly appreciate it!
\usepackage[leftcaption]{sidecap}
\usepackage{subcaption}
---------------------
\begin{SCfigure}
\begin{subfigure}[b]{0.4\linewidth}
\includegraphics[width=\linewidth]{img1}
\caption{}
\end{subfigure}%
~
\begin{subfigure}[b]{0.4\linewidth}
\includegraphics[width=\linewidth]{img2}
\caption{}
\end{subfigure}
\caption{Caption in the left side}
\end{SCfigure}
Perfect! Thanks for your kindness in helping me out! Greatly appreciate it!
sir, images apni jagah se doosri jagah chali jaati...usko apni hi jagah pe kese rakhe
Use 'h! ' specifier and also make sure that there should be sufficient space for the image.
@@chandrahashbti Thank you very much sir.
@@chandrahashbti Sir, in research papers, how to get high resolution images , for example output from MATLAB plot. so that it appears clearly in research paper..tried jpg and png but didnt get clearity.
is some syntax missing in its use, usually includegraphics command is used in latex. or some other image format to be used.
Kindly help.
@@TejasGagaAgar MATALAB use kar rahe hai to EPS ya PDF format me image ko export kare| Vahi sabse best hota hai aur poor quality ka issue nahi aata hai. PNG ya JPG scientific work ke liye sahi nahi mana jata hai. Ye dono hi format agar kisi 📷camera se liye gaye hai to usi format me add kar sakte hai latex me.
@@chandrahashbti thank you much sir for ur reply so quicky..thank you sir.
Plz how to copy
Perfect ! Thank you sir.
Most welcome.
its not working, My ieee bare file, has included subfigure; when I use the code suggested by you I get a compiler error: Envirnment subfigure undefined! Any solutions sir. Thanks. Video is very helpful tho.
I will have to see the code.
I appreciate your quick response. Please review my code ASAP: I have a deadline to my paper; and I am totally new to Latex:
%subfigures environment
\begin{figure}[ht]
\centering
\begin{subfigure} {0.45\linewidth}
\includegraphics[width=\linewidth]{fig/coil}
\caption{Magnetic Field Channel.} \label{fig.coil}
\end{subfigure}
\begin{subfigure} {0.45\linewidth}
\includegraphics[width=\linewidth]{fig/smartphone}
\caption{Magnetic Field Channel.} \label{fig.smartphone}
\end{subfigure}
\begin{subfigure} {0.45\linewidth}
\includegraphics[width=\linewidth]{fig/smartphone}
\caption{Magnetic Field Channel.} \label{fig.smartphone}
\end{subfigure}
\begin{subfigure} {0.45\linewidth}
\includegraphics[width=\linewidth]{fig/card}
\caption{Magnetic Field Channel.} \label{fig.card}
\end{subfigure}
\end{figure}
%end subfigures
2nd point: I am not including \usepackage{subcaption} if I try doing that it says, "! Package subcaption Error: This package can't be used in cooperation
(subcaption) with the subfig package."!!
Will have to check the preamble.
Yea, cool, I get it, my bad. Its a big one, cuz I am using bare_conf.tex by Micheal Shell:
%% bare_conf.tex
%% V1.4b
%% 2015/08/26
%% by Michael Shell
%% See:
%% www.michaelshell.org/
%% for current contact information.
%%
%% This is a skeleton file demonstrating the use of IEEEtran.cls
%% (requires IEEEtran.cls version 1.8b or later) with an IEEE
%% conference paper.
%%
%% Support sites:
%% www.michaelshell.org/tex/ieeetran/
%% www.ctan.org/pkg/ieeetran
%% and
%% www.ieee.org/
\documentclass[conference]{IEEEtran}
\usepackage{float}
\ifCLASSOPTIONcompsoc
\usepackage[caption=false,font=normalsize,labelfon
t=sf,textfont=sf]{subfig} \else
\usepackage[caption=false,font=footnotesize]{subfi
g} \fi
\usepackage{mdwmath}
\usepackage{mdwtab}
\usepackage{multirow}
\usepackage[ruled,vlined]{algorithm2e}
\usepackage{graphicx}
\usepackage{epstopdf}
ewcommand{\figwidth}{0.75\linewidth}
ewcommand{\figwidthsmall}{0.5\linewidth}
ewcommand{\figwidtha}{0.7\linewidth}
ewcommand{\figwidthb}{0.80\linewidth}
ewcommand{\figwidthdouble}{0.5\linewidth}
ewcommand{\figwidthtriple}{0.32\linewidth}
\def\figref#1{Fig.~
ef{#1}}
\def\secref#1{Section~
ef{#1}}
\def\tabref#1{Table~
ef{#1}}
\DeclareMathOperator{\trace}{trace}
\hyphenation{op-tical net-works semi-conduc-tor}
\begin{document}
sir, how to increase height of sub figures ..please can you explain?
You canuse \includegraphics[width=0.45\linewidth, height=0.45\textheight]{fig}
Thanks, very helpful
Most welcome.
Thank You very much. :)
ANYTIME.
i need subfigure on multiple pages, trying it for 4 hours now
Here is the solution: ruclips.net/video/Kjlc8F6qb8E/видео.html
dear chandra i've a problem in latex ,can you help me to find what is the problem if you never mind send me your email to solve it
using latex on windows, ROOOOOOOOOOOOOOOOOOOOOO