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

Комментарии • 62

  • @user-fo7ol8qg8y
    @user-fo7ol8qg8y 6 месяцев назад

    Thank you, Dr. Chandra. Excellent videos.

  • @DrIlyas-sq7pz
    @DrIlyas-sq7pz 3 года назад

    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.

  • @TejasGaga
    @TejasGaga 3 года назад

    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 ?

  • @sovankumardas5200
    @sovankumardas5200 3 года назад

    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

  • @prateekbhadauria7004
    @prateekbhadauria7004 3 года назад

    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

  • @jerkorulez
    @jerkorulez 7 лет назад

    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

  • @Lucelot008
    @Lucelot008 6 лет назад

    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.

    • @Lucelot008
      @Lucelot008 6 лет назад

      i tried and it worked, thank you so much!!!!!!!!!!!!!! through the whole internet you helped me the most!

    • @chandrahashbti
      @chandrahashbti  6 лет назад +1

      Pleased to hear that this tutorial helped you.

  • @elnumeral6341
    @elnumeral6341 4 года назад

    how to make a circle vertex with a node inside? using graphics&graphtex?

  • @aswathys7148
    @aswathys7148 3 года назад

    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

    • @chandrahashbti
      @chandrahashbti  3 года назад

      Sometimes, it's very difficult to place the float at exactly the same place.

  • @constanzazavalabravo6469
    @constanzazavalabravo6469 Год назад

    Thank you to make this video! is very useful

  • @elinoirsmythe224
    @elinoirsmythe224 3 года назад

    This is amazing, thank you for helping us with your videos!

  • @ajinkyabhosale784
    @ajinkyabhosale784 6 лет назад +1

    Hi sir, i have 10 images and i want to add 2 images per page.please help me

  • @tabishwahidi2265
    @tabishwahidi2265 3 года назад

    An informative video for beginners. Great effort. How to decrease the vertical distance between subfigures (say u have two figs. above and two below)?

    • @chandrahashbti
      @chandrahashbti  3 года назад

      You can use vskip or vspace command after adding two subfigs.

  • @nahlamahmoud6854
    @nahlamahmoud6854 4 года назад

    my project doesn't work please help me if you can

  • @nahlamahmoud6854
    @nahlamahmoud6854 4 года назад

    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

    • @chandrahashbti
      @chandrahashbti  4 года назад

      MikTeX is a tex/latex distributor. Graphicx is a package that you need to load in your main tex file. Please follow the tutorial.

  • @rambabug5189
    @rambabug5189 7 лет назад

    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..

    • @chandrahashbti
      @chandrahashbti  7 лет назад +1

      I think you are using basic MikTeX. Download 'graphicx' package from ctan website and save it in your working folder.

  • @dipeshsharma7869
    @dipeshsharma7869 4 года назад

    Thank you for nice tutorial !!

  • @tianlongsong8716
    @tianlongsong8716 7 лет назад

    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?

    • @chandrahashbti
      @chandrahashbti  7 лет назад

      Use 'sidecap' package with 'leftcaption' option in the preamble.
      \usepackage[leftcaption]{sidecap}

    • @tianlongsong8716
      @tianlongsong8716 7 лет назад

      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!

    • @chandrahashbti
      @chandrahashbti  7 лет назад +2

      \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}

    • @tianlongsong8716
      @tianlongsong8716 7 лет назад +1

      Perfect! Thanks for your kindness in helping me out! Greatly appreciate it!

  • @TejasGaga
    @TejasGaga 3 года назад

    sir, images apni jagah se doosri jagah chali jaati...usko apni hi jagah pe kese rakhe

    • @chandrahashbti
      @chandrahashbti  3 года назад +1

      Use 'h! ' specifier and also make sure that there should be sufficient space for the image.

    • @TejasGaga
      @TejasGaga 3 года назад

      @@chandrahashbti Thank you very much sir.

    • @TejasGaga
      @TejasGaga 3 года назад

      @@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.

    • @chandrahashbti
      @chandrahashbti  3 года назад +1

      @@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.

    • @TejasGaga
      @TejasGaga 3 года назад

      @@chandrahashbti thank you much sir for ur reply so quicky..thank you sir.

  • @samirpatel1182
    @samirpatel1182 3 года назад

    Plz how to copy

  • @MrTeddyfab
    @MrTeddyfab 4 года назад

    Perfect ! Thank you sir.

  • @allawadiarvind
    @allawadiarvind 7 лет назад

    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.

    • @chandrahashbti
      @chandrahashbti  7 лет назад

      I will have to see the code.

    • @allawadiarvind
      @allawadiarvind 7 лет назад

      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

    • @allawadiarvind
      @allawadiarvind 7 лет назад

      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."!!

    • @chandrahashbti
      @chandrahashbti  7 лет назад

      Will have to check the preamble.

    • @allawadiarvind
      @allawadiarvind 7 лет назад

      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}

  • @saritabhatt8448
    @saritabhatt8448 3 года назад

    sir, how to increase height of sub figures ..please can you explain?

    • @chandrahashbti
      @chandrahashbti  3 года назад +1

      You canuse \includegraphics[width=0.45\linewidth, height=0.45\textheight]{fig}

  • @prithvitipirneni9435
    @prithvitipirneni9435 6 лет назад

    Thanks, very helpful

  • @amilcarodrigues
    @amilcarodrigues 7 лет назад

    Thank You very much. :)

  • @MarkMarconi
    @MarkMarconi 6 лет назад

    i need subfigure on multiple pages, trying it for 4 hours now

    • @chandrahashbti
      @chandrahashbti  4 года назад

      Here is the solution: ruclips.net/video/Kjlc8F6qb8E/видео.html

  • @nahlamahmoud6854
    @nahlamahmoud6854 4 года назад

    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

  • @huehue5286
    @huehue5286 7 лет назад

    using latex on windows, ROOOOOOOOOOOOOOOOOOOOOO