Handouts 1 Handouts Week 1: Introduction to LaTeX, Typographical Principles, and Basics of HTML/CSS Introduction to LaTeX: 1. What is LaTex? LaTeX is a typesetting system used for the production of technical and scientific documents. Unlike word processors like Microsoft Word, LaTeX allows users to focus on content rather than formatting. LaTeX documents are created using plain text files containing markup commands that define the structure and formatting of the document. LaTeX automatically handles tasks such as numbering sections, generating tables of contents, and formatting equations, freeing the user from manual formatting tasks. 2. Benefits of Using LaTeX: High-Quality Typesetting: LaTeX produces documents with professionalquality typesetting, resulting in visually appealing and consistent output. Mathematical Notation: LaTeX excels in typesetting mathematical equations, making it indispensable for mathematicians, physicists, and engineers. Cross-Referencing: LaTeX allows for easy cross-referencing of sections, figures, tables, and equations, ensuring consistency and accuracy in document referencing. Consistency and Reproducibility: LaTeX ensures consistency in formatting across documents and facilitates reproducibility by separating content from formatting. 3. LaTeX usage: Handouts 2 Mathematics: LaTeX is widely used in the mathematical community for typesetting mathematical papers, textbooks, and research articles due to its superior equation formatting capabilities. Computer Science: LaTeX is commonly used for writing technical reports, research papers, and documentation in computer science due to its support for code formatting, algorithms, and diagrams. Linguistics: LaTeX is popular among linguists for typesetting linguistic analyses, glosses, and phonological representations using specialized packages like gb4e and tipa. Setting Up Overleaf Accounts: Introduction: Overleaf is a popular online LaTeX editor that allows users to collaborate in real-time, manage version control, and access a wide range of templates for various document types. In this segment, students will learn how to create an Overleaf account and explore its features. 1. Create Overleaf Account (https://www.overleaf.com/) 2. Overleaf Pro (https://www.fi.muni.cz/tech/overleaf.html) 3. Benefits of Using Overleaf: Real-Time Collaboration: Explain how Overleaf allows multiple users to work on the same document simultaneously, facilitating collaboration among team members or co-authors. Version Control: Describe how Overleaf automatically saves document changes and allows users to revert to previous versions, ensuring data integrity and version control. Access to Templates: Highlight Overleaf's extensive collection of templates for various document types, including research papers, presentations, and posters. Mention how templates streamline document creation by providing pre-formatted layouts. For students with a Pro license: Direct them to the manual provided on the university website for activating the Pro license (https://www.fi.muni.cz/tech/overleaf.html). Handouts 3 4. Project Creation (3 minutes): Launch Overleaf and log in to your account to demonstrate the project creation process. Click on the "New Project" button or selecting "Create" from the dashboard. Start from scratch or use a template from the gallery. Basics of LaTeX Document Structure: Two main parts: the preamble and the document environment. Preamble contains document-wide settings and configurations, while the document environment encloses the actual content of the document. Settings and configurations typically included in the preamble are for examples document class selection, package loading, and custom commands. Preamble is where users specify document-wide settings, such as the document class, font size, margins, and packages. Common document classes in LaTeX are \documentclass{article}, \documentclass{report} or \documentclass{book}. Examples of scenarios where each document class might be appropriate are using the "article" class for short papers or reports and the "book" class for longer documents with chapters. Live Demonstration: Open an Overleaf document or LaTeX editor Example Code: \documentclass{article} \usepackage{lipsum} % Package for generating dummy text, re move in actual document \title{Example Document} \author{Author Name} \date{\today} Handouts 4 \begin{document} \maketitle \section{Introduction} \lipsum[1] \section{Main Content} \lipsum[2-3] \section{Conclusion} \lipsum[4] \end{document} In this example, you can see the basic structure of a LaTeX document, including the preamble with document class (\documentclass{article}), packages (\usepackage{lipsum}), and document metadata (\title{}, \author{}, \date{}), as well as the document environment (\begin{document}...\end{document}) containing the actual content of the document. Simple Text Formatting in LaTeX: 1. Typographical Principles: Font Selection: Choose fonts that are legible and appropriate for the document's purpose. For example, serif fonts like Times New Roman are commonly used for printed text, while sans-serif fonts like Arial are preferred for digital screens. Example: In a printed book, a publisher might choose a serif font like Garamond for the main text to enhance readability. For an online article, a website designer might opt for a sans-serif font like Helvetica for better screen legibility. Handouts 5 Font Size: Adjust font size to improve readability and hierarchy within the document. For instance, headings may use larger font sizes for emphasis, while body text typically uses smaller font sizes. Example: In a magazine layout, headlines are often set in larger font sizes to grab readers' attention, while body text is set in smaller font sizes to fit more content on the page. Line Spacing: Optimize line spacing (leading) to enhance readability and aesthetics. Adequate line spacing prevents overcrowding and improves legibility, ensuring comfortable reading. Example: In a printed brochure, designers might increase line spacing between paragraphs to make the text easier to read. On a website, developers might adjust line spacing to ensure text remains legible across different screen sizes. Margins: Set appropriate margins to ensure sufficient white space around the text. Margins help frame the content and improve visual appeal, balancing aesthetics with practicality. Example: In a printed poster, wide margins provide space for additional information or visuals without crowding the text. In a PowerPoint presentation, narrow margins help maximize space for content on each slide. 1. Demonstration of Basic Text Formatting Commands: \textbf{}: Used to make text bold. \textit{}: Used to make text italic. \underline{}: Used to underline text. \fontsize{}{}: Used to set the font size. \selectfont: Used to apply the selected font size. Handouts 6 \linespread{}: Used to set the line spacing. \setlength{\parindent}{0pt}: Used to set the paragraph indentation. \usepackage[margin=1in]{geometry}: Used to set the margins. \documentclass{article} \usepackage{fontspec} % For manual font selection \usepackage{geometry} % For setting margins \setmainfont{Times New Roman} % Manual font selection \begin{document} This is \textbf{bold text}. \\ This is \textit{italic text}. \\ This is \underline{underlined text}. % Applying typographical principles \fontsize{12pt}{15pt}\selectfont % Set font size to 12pt with line spacing of 15pt \setlength{\parindent}{0pt} % Set paragraph indentation to 0p t \linespread{1.5} % Set line spacing to 1.5 \usepackage[margin=1in]{geometry} % Set margins to 1 inch on all sides This is a sample text demonstrating the application of typogr aphical principles. Font size has been set to 12 points with a line spacing of 15 points. Paragraph indentation has been removed to create a block-styl e format. The line spacing has been adjusted to 1.5 times the font siz e. Margins have been set to 1 inch on all sides to provide suffi cient white space around the text. Handouts 7 \end{document} Task 1: Apply text formatting tofollowing text: Example text to format: Computational linguistics is an interdisciplinary field that combines principles from computer science and linguistics to develop algorithms and models for processing natural language. One fundamental task in computational linguistics is natural language processing (NLP), which involves the automatic analysis and understanding of human language by computers. NLP applications range from machine translation and sentiment analysis to information retrieval and speech recognition. One of the key challenges in computational linguistics is dealing with the inherent ambiguity and variability of human language. For example, words can have multiple meanings depending on context, and sentence structures can be highly variable across different languages and dialects. To address these challenges, computational linguists develop algorithms and techniques for tasks such as part-of-speech tagging, syntactic parsing, and semantic analysis. Recent advancements in machine learning and artificial intelligence have greatly impacted the field of computational linguistics. Deep learning models, in particular, have shown promising results in various NLP tasks, achieving state-of-the-art performance in tasks such as language translation and text generation. However, computational linguists continue to explore new approaches and methods to further improve the accuracy and efficiency of natural language processing systems. Clarification and Guidance on Common Formatting Issues: 1. Adjusting Line Spacing: Use the \linespread{} command followed by a factor to adjust line spacing. Handouts 8 Alternatively, utilize commands like \onehalfspacing or \doublespacing from the setspace package. 2. Changing Font Styles: Use commands like \textbf{} , \textit{} , and \underline{} for bold, italic, and underline, respectively. For changing font size or family, employ commands like \fontsize{} and \selectfont . 3. Modifying Margins: Utilize the geometry package to modify margins with commands like \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} . Tips and Best Practices for Achieving Consistent and Professional-looking Research Papers: 1. Use Templates: Employ LaTeX templates provided by journals or academic institutions to ensure adherence to formatting guidelines and consistency. 2. Proofread for Formatting Errors: Thoroughly proofread the document to identify and correct formatting errors such as inconsistent font styles, spacing issues, or misaligned elements. 3. Leverage LaTeX Packages for Advanced Formatting Needs: Explore LaTeX packages like titlesec for customizing section headings and fancyhdr for headers and footers if needed. Avoid overloading the document with unnecessary packages to prevent compatibility issues. TASK 2: Correct the formatting errors using LaTeX commands. Experiment with different font styles and sizes to familiarize yourself with LaTeX's capabilities. Handouts 9 \documentclass{article} \usepackage{lipsum} % Package for generating dummy text \begin{document} \section{\textit{Introduction}} \textsf{This is the introduction section of the document. It contains some text that is supposed to be bold.} \subsection{Background} \textbf{Here is some text in italic font and underlined, whic h is inconsistent with the rest of the document.} \lipsum[1] % Generate dummy text for demonstration \subsection{Methodology} \textsf{The methodology section contains text that is suppose d to be bold and underlined.} \textbf{\underline{Nulla facilisi. Duis feugiat risus at tell us efficitur, sed ultricies est cursus.}} \end{document}