3

I am having an itemize inside and enumerate. I wanted to make the items of enumerate to be bold. But, while using itemize inside the enumerate, I am getting the items of the itemize also bold. I am not able to get the reason why this is happenning!!!

Code:

\documentclass[12 pt, a4paper]{book}
\usepackage{multicol}
\usepackage{geometry}
\geometry{a4paper,
          total={170 mm,257 mm}
          left=20 mm,
          top=20 mm,
         }
\usepackage{amsmath,bm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{soul}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage{palatino}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{arydshln}
\usepackage{calc}
\usepackage{float}

\setlength{\parindent}{2em}

\newcommand{\wt}[2]{\underset{\substack{\textstyle\uparrow\\\hidewidth\mathstrut#2\hidewidth}}{#1}}
\definecolor{mygray}{gray}{0.6}

\floatstyle{plain}
\newfloat{example}{h}{loc}[chapter]
\floatname{example}{Example}

\begin{document}
 
\begin{enumerate}[left=1\parindent]\bfseries
    \item \textbf{Enumerate 1 :-}
    \begin{itemize}
        \renewcommand{\labelitemi}{$\rightarrow$}
        \item Item 1
        \item \textit{Item 2}
    \end{itemize}
\end{enumerate}

\end{document}

Output:

Output Obtained

Can anyone help me with this?

1
  • 1
    Have you tried removing \bfseries after \begin{enumerate}[left=1\parindent]?
    – Mico
    Commented Sep 14, 2020 at 14:15

2 Answers 2

3

I've modified your code slightly, and the modified MWE is:

\documentclass[12 pt, a4paper]{book}
\usepackage{multicol}
\usepackage{geometry}
%\geometry{a4paper,total={170mm,257mm}left=20mm,top=20mm}
\usepackage{amsmath,bm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{soul}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage{palatino}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{arydshln}
\usepackage{calc}
\usepackage{float}

\setlength{\parindent}{2em}

\newcommand{\wt}[2]{\underset{\substack{\textstyle\uparrow\\\hidewidth\mathstrut#2\hidewidth}}{#1}}
\definecolor{mygray}{gray}{0.6}

\floatstyle{plain}
\newfloat{example}{h}{loc}[chapter]
\floatname{example}{Example}

\begin{document}

\setlist[enumerate,1]{}%
 
\begin{enumerate}[left=1\parindent,label=\textbf{\arabic*.}]
    \item \textbf{Enumerate 1 :-}
    \begin{itemize}
        \renewcommand{\labelitemi}{$\rightarrow$}
        \item Item 1
        \item \textit{Item 2}
    \end{itemize}
\end{enumerate}

\end{document}

Note that some error in \geometry{a4paper,total={170mm,257mm}left=20mm,top=20mm}, so I just removed it...

1
  • Thank for helping...It is working fine. Commented Sep 14, 2020 at 14:21
4

Adding font=\bfseries in the enumerate environment gives what you want. Here is your corrected code

\documentclass[12 pt, a4paper]{book}
\usepackage{multicol}
\usepackage{geometry}
\geometry{a4paper,
          total={170 mm,257 mm},
          left=20 mm,
          top=20 mm,
         }
\usepackage{amsmath,bm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{soul}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage{palatino}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{arydshln}
\usepackage{calc}
\usepackage{float}

\setlength{\parindent}{2em}

\newcommand{\wt}[2]{\underset{\substack{\textstyle\uparrow\\\hidewidth\mathstrut#2\hidewidth}}{#1}}
\definecolor{mygray}{gray}{0.6}

\floatstyle{plain}
\newfloat{example}{h}{loc}[chapter]
\floatname{example}{Example}

\begin{document}
 
\begin{enumerate}[left=1\parindent,font=\bfseries]
    \item \textbf{Enumerate 1 :-}
    \begin{itemize}
        \renewcommand{\labelitemi}{$\rightarrow$}
        \item Item 1
        \item \textit{Item 2}
    \end{itemize}
\end{enumerate}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .