SlideShare a Scribd company logo
1 of 4
Class file in LaTex
© Sarita Bopalkar
What is class file?
© Sarita Bopalkar
• In LaTex tex file, we write
– documentclass{article}
– It includes the class file article.cls
– Defines all the commands like section,title which
go into structuring your document
Setting up own class file
• All class files should start with
• First commands tells the complier about the version of LaTex package
– Here it is LaTeX2e
• ProvidesClass command gives the compiler some information
about your package
– The first argument should match the filename of your class file and
tells LaTeX what your package is called
– The second argument is optional and provides a description of your
class. The description must begin with a date in exactly the format
above
© Sarita Bopalkar
NeedsTeXFormat{LaTeX2e}
ProvidesClass{my_class}[2019/07/13 My custom class file]
Thank you
© Sarita Bopalkar

More Related Content

Similar to 11-Class file in LaTex

latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. AlrshahAbdulazim N.Elaati
 
Introduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptIntroduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptrajinooka
 
Introduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptIntroduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptanandmaheshwari15
 
Introduction to LaTeX:for begi nners to
Introduction  to LaTeX:for begi nners toIntroduction  to LaTeX:for begi nners to
Introduction to LaTeX:for begi nners toPoojaAnupGarg
 
Introduction to LaTeX - Dumitrescu.ppt - It is a slide on the internet explai...
Introduction to LaTeX - Dumitrescu.ppt - It is a slide on the internet explai...Introduction to LaTeX - Dumitrescu.ppt - It is a slide on the internet explai...
Introduction to LaTeX - Dumitrescu.ppt - It is a slide on the internet explai...akuysal1
 
Introduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptIntroduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptTaraLeander
 
Introduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptIntroduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptGhufranKhan42
 
Introduction to LaTeX - Dumitrescu (1).ppt
Introduction to LaTeX - Dumitrescu (1).pptIntroduction to LaTeX - Dumitrescu (1).ppt
Introduction to LaTeX - Dumitrescu (1).pptAmit Bairwa
 
latex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Techlatex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.TechSandhya Gandham
 
Algorithm2e package for Latex
Algorithm2e package for LatexAlgorithm2e package for Latex
Algorithm2e package for LatexChris Lee
 

Similar to 11-Class file in LaTex (20)

LaTeX Survival Guide
LaTeX Survival Guide LaTeX Survival Guide
LaTeX Survival Guide
 
Keeping Up! with LaTeX
Keeping Up! with LaTeXKeeping Up! with LaTeX
Keeping Up! with LaTeX
 
latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshah
 
Introduction to LaTeX
Introduction to LaTeXIntroduction to LaTeX
Introduction to LaTeX
 
Introduction to Latex
Introduction to LatexIntroduction to Latex
Introduction to Latex
 
Introduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptIntroduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.ppt
 
Introduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptIntroduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.ppt
 
Introduction to LaTeX:for begi nners to
Introduction  to LaTeX:for begi nners toIntroduction  to LaTeX:for begi nners to
Introduction to LaTeX:for begi nners to
 
LaTeX for Engineer.ppt
LaTeX for Engineer.pptLaTeX for Engineer.ppt
LaTeX for Engineer.ppt
 
Introduction to LaTeX - Dumitrescu.ppt - It is a slide on the internet explai...
Introduction to LaTeX - Dumitrescu.ppt - It is a slide on the internet explai...Introduction to LaTeX - Dumitrescu.ppt - It is a slide on the internet explai...
Introduction to LaTeX - Dumitrescu.ppt - It is a slide on the internet explai...
 
Introduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptIntroduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.ppt
 
Introduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.pptIntroduction to LaTeX - Dumitrescu.ppt
Introduction to LaTeX - Dumitrescu.ppt
 
Introduction to LaTeX - Dumitrescu (1).ppt
Introduction to LaTeX - Dumitrescu (1).pptIntroduction to LaTeX - Dumitrescu (1).ppt
Introduction to LaTeX - Dumitrescu (1).ppt
 
Inroduction to Latex
Inroduction to LatexInroduction to Latex
Inroduction to Latex
 
latex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Techlatex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Tech
 
Algorithm2e package for Latex
Algorithm2e package for LatexAlgorithm2e package for Latex
Algorithm2e package for Latex
 
Chap03 scr
Chap03 scrChap03 scr
Chap03 scr
 
Example
ExampleExample
Example
 
example.pdf
example.pdfexample.pdf
example.pdf
 
Example
ExampleExample
Example
 

More from SaritaBopalkar

10-Bibliography in LaTex
10-Bibliography in LaTex10-Bibliography in LaTex
10-Bibliography in LaTexSaritaBopalkar
 
8-Array and Equation environment
8-Array and Equation environment8-Array and Equation environment
8-Array and Equation environmentSaritaBopalkar
 
6.Making Tables in LaTex
6.Making Tables in LaTex6.Making Tables in LaTex
6.Making Tables in LaTexSaritaBopalkar
 
4 basic document formatting
4 basic document formatting4 basic document formatting
4 basic document formattingSaritaBopalkar
 

More from SaritaBopalkar (8)

10-Bibliography in LaTex
10-Bibliography in LaTex10-Bibliography in LaTex
10-Bibliography in LaTex
 
9-Figures in LaTex
9-Figures in LaTex9-Figures in LaTex
9-Figures in LaTex
 
8-Array and Equation environment
8-Array and Equation environment8-Array and Equation environment
8-Array and Equation environment
 
6.Making Tables in LaTex
6.Making Tables in LaTex6.Making Tables in LaTex
6.Making Tables in LaTex
 
7-Math mode in latex
7-Math mode in latex7-Math mode in latex
7-Math mode in latex
 
6 list in LaTex
6 list in LaTex 6 list in LaTex
6 list in LaTex
 
4 basic document formatting
4 basic document formatting4 basic document formatting
4 basic document formatting
 
2 LaTex Installation
2 LaTex Installation2 LaTex Installation
2 LaTex Installation
 

Recently uploaded

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptxMichaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptxRugvedSathawane
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Celine George
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsPallavi Parmar
 

Recently uploaded (20)

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptxMichaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell Tolls
 

11-Class file in LaTex

  • 1. Class file in LaTex © Sarita Bopalkar
  • 2. What is class file? © Sarita Bopalkar • In LaTex tex file, we write – documentclass{article} – It includes the class file article.cls – Defines all the commands like section,title which go into structuring your document
  • 3. Setting up own class file • All class files should start with • First commands tells the complier about the version of LaTex package – Here it is LaTeX2e • ProvidesClass command gives the compiler some information about your package – The first argument should match the filename of your class file and tells LaTeX what your package is called – The second argument is optional and provides a description of your class. The description must begin with a date in exactly the format above © Sarita Bopalkar NeedsTeXFormat{LaTeX2e} ProvidesClass{my_class}[2019/07/13 My custom class file]

Editor's Notes

  1. The first thing to do before coding a new class is to determine whether you really need a new class or not. It's recommended to search on CTAN (Comprehensive TEX Archive Network) and see if someone already created something similar to the document class you need
  2. All class files should start with two lines similar to the following The \NeedsTeXFormat commands tells the compiler which version of LaTeX the package is for. The current version of LaTeX is LaTeX2e and almost all distributions use this. The \ProvidesClass command gives the compiler some information about your package. The first argument should match the filename of your class file and tells LaTeX what your package is called. The second argument is optional and provides a description of your class which will appear in the log and other places. The description must begin with a date in exactly the format above and it should be the date the package was last modified. This can be used when including the class to check that you have a recent enough version of it. For example if you include it via \documentclass{my_cv}[2012/01/01] with a date which is newer than the date in the class description then a warning will be shown saying that the class is outdated.
  3. The standard article section headings don't really suit a CV so we'd like to replace them with something neater. To do this, we can redefine the \section command to output a custom header Fortunately there is already an excellent package called titlesec which provides an easy way to customise our header styles. Include this in your class file with: \RequirePackage{titlesec The titlesec package provides the command \titleformat which lets us customise our section headings.
  4. You should try out some of the formatting options available to see what you like: \bfseries, \itshape: make the heading bold or italic; \scshape:small capitals; \small, \normalsize, \large, \Large, \LARGE, \huge, \Huge: set the font size; \rmfamily, \sffamily, \ttfamily: set the font type to serifed, sans serifed or typewriter respectively.
  5. We can define some new commands which let us include dates in our section headings. Include the following in your class file \newcommand{\datedsection}[2]{% \section[#1]{#1 \hfill #2}% } \newcommand{\datedsubsection}[2]{% \subsection[#1]{#1 \hfill #2}% } This defines two new commands \datedsection and \datedsubsection which take two arguments: the section name as before, and a date which will be typeset on the right-hand side of the page. The \hfill command tells LaTeX to fill as much space as possible and so pushes the second argument (#2) to the right of the page. Modify cv.tex to use these commands:
  6. \documentclass{my_cv}   \begin{document}   \section{Education} \datedsubsection{University of Nowhere}{2004--2008} I attended the University of Nowhere from 2004 to 2008.   \section{Work} \datedsubsection{ABC Limited.}{2008--Now} I have worked at ABC Limited from 2008 onwards.   \end{document} ​
  7. \documentclass{my_cv}   \begin{document}   \section{Education} \datedsubsection{University of Nowhere}{2004--2008} I attended the University of Nowhere from 2004 to 2008.   \section{Work} \datedsubsection{ABC Limited.}{2008--Now} I have worked at ABC Limited from 2008 onwards.   \end{document} ​