TeX - LaTeX Asked by PARTH KHAMAR on June 20, 2021
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{textstyleuparrowhidewidthmathstrut#2hidewidth}}{#1}}
definecolor{mygray}{gray}{0.6}
floatstyle{plain}
newfloat{example}{h}{loc}[chapter]
floatname{example}{Example}
begin{document}
begin{enumerate}[left=1parindent]bfseries
item textbf{Enumerate 1 :-}
begin{itemize}
renewcommand{labelitemi}{$rightarrow$}
item Item 1
item textit{Item 2}
end{itemize}
end{enumerate}
end{document}
Output:
Can anyone help me with this?
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{textstyleuparrowhidewidthmathstrut#2hidewidth}}{#1}}
definecolor{mygray}{gray}{0.6}
floatstyle{plain}
newfloat{example}{h}{loc}[chapter]
floatname{example}{Example}
begin{document}
setlist[enumerate,1]{}%
begin{enumerate}[left=1parindent,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...
Correct answer by MadyYuvi on June 20, 2021
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{textstyleuparrowhidewidthmathstrut#2hidewidth}}{#1}}
definecolor{mygray}{gray}{0.6}
floatstyle{plain}
newfloat{example}{h}{loc}[chapter]
floatname{example}{Example}
begin{document}
begin{enumerate}[left=1parindent,font=bfseries]
item textbf{Enumerate 1 :-}
begin{itemize}
renewcommand{labelitemi}{$rightarrow$}
item Item 1
item textit{Item 2}
end{itemize}
end{enumerate}
end{document}
Answered by Tanvir on June 20, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP