forked from Neehan/book-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
articlestyle.sty
163 lines (143 loc) · 5.4 KB
/
articlestyle.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
% !TEX root = main.tex
% --------------------------------------------------------------
% Article Style
% --------------------------------------------------------------
%% The below setup if From My preambles of main.tex file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% paragraph indent
\setlength{\parindent}{0pt} % https://www.overleaf.com/learn/latex/
% better float management
\RequirePackage{placeins}
\usepackage{float} % https://tex.stackexchange.com/a/8633/114006
% % breakable tables
\RequirePackage{longtable}
% \RequirePackage{docmute}
\RequirePackage{amsmath, amsfonts, amssymb, amsthm}
%\RequirePackage{physics}
\RequirePackage{graphicx}
\RequirePackage{mathtools}
\RequirePackage{extarrows}
% \RequirePackage{enumitem}
\RequirePackage{lipsum}
\RequirePackage{blindtext}
\RequirePackage{mwe}
\RequirePackage[version=4]{mhchem}
\RequirePackage{wrapfig} % https://tex.stackexchange.com/a/56177/114006
\RequirePackage{cprotect} % https://tex.stackexchange.com/a/8814/114006
\RequirePackage[font=footnotesize, justification=centering]{caption}
\RequirePackage[font=footnotesize, justification=centering]{subcaption} % https://tex.stackexchange.com/a/119985/114006
% \setlist[itemize]{label*={\uccoff\fontfamily{lmr}\selectfont\textbullet \uccon}} % due to the Bangla fonts
\RequirePackage[
papersize={5.5in, 8.5in},
% margin=0.8in,
top=0.8in, bottom=0.8in, left=0.6in, right=0.6in,
headheight=15.04721pt
]{geometry}
\linespread{1.15}
% For a bilingual document
\RequirePackage[banglamainfont=Kalpurush,
banglattfont=Kalpurush,
]{latexbangla}
%activate polyglossia
\setdefaultlanguage[numerals=Bengali,
changecounternumbering=true]{bengali}
%number all levels
\setcounter{secnumdepth}{5}
\setotherlanguage{english}
%..............
\RequirePackage{csquotes} % https://tex.stackexchange.com/q/39285/114006
\RequirePackage[dvipsnames,svgnames,x11names,hyperref]{xcolor} % https://tex.stackexchange.com/a/4506/114006
\RequirePackage{hyperref}
\hypersetup{
colorlinks=true, breaklinks,
linkcolor=blue,
filecolor=magenta,
urlcolor=teal,
}
\urlstyle{same}
% Adding header and footer on pages
\RequirePackage{fancyhdr}
\fancypagestyle{plain}{
\fancyhf{} % clear all header and footer fields
\lhead{\href{https://github.com/rafisics/ebook-template}{নিবন্ধ সংকলন}}
% \rhead{\href{https://github.com/rafisics/ebook-template}{মুবতাসিম ফুয়াদ}}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
}
% Adding References
% \RequirePackage[backend=biber, sorting=none, language=english, autolang=other]{biblatex}
% \addbibresource{ref.bib}
% Adding pdf pages
\RequirePackage{pdfpages}
%to allow long align env. to break between pages
\allowdisplaybreaks
% % https://tex.stackexchange.com/a/177179/114006 (need to improve)
% \tolerance=1
% \emergencystretch=\maxdimen
% \hyphenpenalty=10000
% \hbadness=10000
% Path relative to the main .tex file
\graphicspath{ {../img/} }
\pagestyle{plain}
% enlarged first letter
\RequirePackage{lettrine}
\newcommand{\firstword}[2]{\lettrine[lines=3, lraise=0.2, nindent=0pt, findent=2pt]{#1}{#2}}
% new font for quotation
\newfontfamily\quotefont[%
Path=../,
Scale= 1.1,
WordSpace=1.4,
AutoFakeSlant=1.2,
AutoFakeBold=1.2
]{Monotype Corsiva}
% \qtext command for english quote texts
\newcommand\qtext[1]{{\normalfont \uccoff \quotefont #1 \uccon}}
% % \chapquote command for quotes with author or source
% \RequirePackage{xparse} % https://www.texdev.net/2010/05/23/from-newcommand-to-newdocumentcommand/
% \NewDocumentCommand\chapquote{mO{}O{}}{
% \begin{quotation}
% \noindent \itshape{#1}
% \IfValueTF {#2}{
% \vspace*{-0.5\baselineskip}
% \begin{flushright}
% \textemdash \quad \normalfont{#2} \par \footnotesize\itshape{#3}
% \end{flushright}
% }{}
% \end{quotation}
% } % https://tex.stackexchange.com/a/224069/114006
% \quote command for quotes with no author or source
\RenewDocumentCommand\quote{m}{
\begin{quotation}
\noindent \itshape{#1}
\end{quotation}
}
% https://tex.stackexchange.com/a/601754/114006
% \chapquote for quotes
\def\chapquote#1{%
\begin{quotation}
\noindent \itshape{#1}
\futurelet\next\chapquoteA
}
\def\chapquoteA{\ifx\next[\expandafter\chapquoteB\else\expandafter\chapquoteC\fi}
\def\chapquoteB[#1][#2]{%
\vskip.2\baselineskip
\hfill \textemdash \quad
\ifx^#1^\else \normalfont #1\par \hfill \fi
\footnotesize\itshape #2\par
\chapquoteC
}
\def\chapquoteC{\end{quotation}}
% Lists with special labels
\newcommand{\bulletlabel}{\raisebox{0.5pt}{\uccoff\fontfamily{lmr}\selectfont\textbullet\uccon}}
\newcounter{myitemizecounter}
\newenvironment{myitemize}
{\begin{list}{\bulletlabel\;\;}{\labelsep=0em \labelwidth=2em}}{\end{list}}
\newcommand{\diamondlabel}{\raisebox{2.5pt}{\includegraphics[height=8pt, angle=135]{listbullet01}}}
\newcounter{mylistcounter}
\newenvironment{mylist}
{\begin{list}{\diamondlabel\;\;}{\labelsep=0em \labelwidth=2em}}{\end{list}}
% To avoid the problem of nameref and titlesec % https://tex.stackexchange.com/a/603305/114006
\makeatletter
\newcommand\setcurrentname[1]{\def\@currentlabelname{#1}}
\makeatother