0

I am having difficulties inserting captions for my figures in my LaTeX article. I need each caption to be placed right below an image.

Here is my code:

\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\usepackage[top=2cm, bottom=2cm, outer=0cm, inner=0cm, left=1.5cm, right=1.5cm]{geometry}
\usepackage{fontspec}
\setmainfont{Garamond}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage{mwe}

\setlength{\parindent}{0em}

\begin{document}

    \tikz[remember picture,overlay] \node[opacity=2,inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{lol.jpg}};
    \thispagestyle{empty}
    \newpage

    \begin{titlepage}

        \textnormal{}\\\\\\\\
        \hrule
        {\fontsize{50}{60}\selectfont \begin{center}
                \textbf{APARTHEID}  \end{center}}
        \hrule  
        \textnormal{}\\\\\\\\\\     

        \begin{center}
                 {\LARGE An article on Racial Discrimination}
        \end{center}        


        \textnormal{}\\\\\\\\\\\\\\\\\\\\\\\\\\ 

        \begin{center}
            {\Large Ramai Alejandria - 5I}
        \end{center}

        \thispagestyle{empty}

    \end{titlepage}

    \newpage

    \tableofcontents
    \thispagestyle{empty}

    \newpage

    \section{Introduction}
    \textnormal{}
    \subsection{What is Racism?}

    Racism is usually defined as a collection of views, practices and actions reflecting the belief that humanity is divided into distinct biological groups called "Races" and that members of a certain race  share specific attributes which make that group less desirable, more desirable, inferior or superior.\\

    The dictionary defines this term as a belief or doctrine that inherent differences among the various human racial groups determined cultural or individual achievement, usually involving the idea that one's own race is superior and has the right to dominate others or that a particular racial group is inferior to the others.\\

    Prejudice, discrimination and antagonism directed against someone of a different race is based on the belief that one's own race is superior. This can lead to several detrimental consequences wherein which a person or a group of people are abused physically, emotionally and mentally because of their race, nationality, beliefs, skin color and ethnic origin. A person who believes in racism is called \textbf{racist}.\\

    \subsection{Types of Racism}

    There are three types or forms of racism namely:

    \begin{itemize}

        \item \textbf{Individual racism}: It refers to any attitude or action whether intentional or unintentional, conscious or unconscious, which subordinates a person or a group of people because of their skin color.

        \item \textbf{Institutional racism}: It refers to any institutional policies, practices and structures in governments, businesses, unions, schools, churches, courts and law enforcement entities by which decisions are made as to unfairly subordinate persons of color while allowing other groups to profit from such actions. E.g. Housing patterns, segregated schools, discriminatory employment and promotion policies, inequities in health care, segregated churches and educational curriculum which ignore the history of minorities.   

        \item \textbf{Cultural racism}: It relates to the individual and institutional expression of the superiority of one group's cultural heritage over another (arts, crafts, language, traditions, beliefs and values). \\

    \end{itemize}

        \begin{figure}[h]

            \fbox{\includegraphics[width=5cm, height=5cm]{pictures/1}}
            \hspace{1cm}
            \fbox{\includegraphics[width=5cm, height=5cm]{pictures/2}}
            \hspace{1cm}
            \fbox{\includegraphics[width=5cm, height=5cm]{pictures/3}}
            \caption{Individual Racism}\label{fig:1}
            \caption{Institutional Racism}\label{fig:2}

        \end{figure} 

Here is the output i get:

enter image description here

This is the output i would like to get: enter image description here

Furthermore, i am also wondering if there is something i can do to remove those image borders.

Please, Help me! Thanks a lot

  • 2
    you still have \textnormal{}\\\\\\\\ ??? also don't use both width= and height= otherwise (as can be seen in your images above) you will distort the image, just use height or width. – David Carlisle Dec 15 '18 at 11:46
  • 1
    You explicitly ask LaTeX to add image borders by using fbox. – TeXnician Dec 15 '18 at 11:46
  • the image borders are the \fbox{..} in your source, just remove fbox. – David Carlisle Dec 15 '18 at 11:46
  • @DavidCarlisle what should i add to create whitespace instead of using \textnormal? – alex108 Dec 15 '18 at 11:50
  • the \textnormal{} (as I said on your last question) does exactly nothing at all, so I can not even guess what the intended use is, sorry you could delete it without making any difference. It is almost always wrong to use \\ in text (away from tables, wher it ends a row) and always an error to use them at the start or end of a paragraph or consecutively. perhaps you are looking for \vspace{1cm} ? – David Carlisle Dec 15 '18 at 11:56
1

Welcome TSE.

Unfortunately, your question is somehow unclear to me, but you can simply use minipage and divide the text to put your pictures or use some packages like subfig. If you search TSE, you will find many examples depicting the usage.

\documentclass{article}
%\usepackage{graphicx}
\usepackage{mwe}
\usepackage{subfig}

\begin{document}


\begin{figure}[htb]
\subfloat[Individual racism][Individual racism\label{fig:1}]
    {\includegraphics[width=5cm, height=5cm]{example-image}}
\hfill
\subfloat[Institutional Racism][Institutional Racism\label{fig:2}]
    {\includegraphics[width=5cm, height=5cm]{example-image}}
\caption{Main caption}    
\end{figure} 

\begin{figure}[htb]
\begin{minipage}{.4\textwidth}
    \centering
    {\includegraphics[width=5cm, height=5cm]{example-image}}
    Individual racism\label{fig:1}
\end{minipage}    
\hfill
\begin{minipage}{.4\textwidth}
    \centering
    {\includegraphics[width=5cm, height=5cm]{example-image}}
    Institutional Racism\label{fig:2}
\end{minipage}        
\caption{Main caption}    
\end{figure} 

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.