TEXT FOR FILES by Richard Baron Version 1.5, 31 May 2023 This file is freely available at http://www.rbphilo.com/authors.html The file contains text that can be copied and pasted into various files that may be needed when writing using LaTeX. The files covered, and the file paths given, are ones that would fit the writing system available at the above web page. But they can of course be adapted as required. Each entry starts with a row of x's. There is then a brief explanation of the file, followed by a row of y's. Then there is the text to be copied and pasted, followed by a row of z's. xxxxxxxxxxxxxxxxxxxx MAIN FILE. This is a file that can use to pull in a .sty file and chapter files (including in this case a bibliography file, which we assume is to be compiled by hand: you would need extra commands if your references and bibliography were to be generated automatically). You can compile this file to produce a complete document, or comment out chapter lines when you do not want all chapters to be compiled. You can also uncomment the openup line when you want a compilation with wide linespacing. yyyyyyyyyyyyyyyyyyyy \documentclass[12pt,openright,twoside]{book} \usepackage{../../standing/latextstyles/bookstyle} \title{This Book} \author{Firstname Lastname} \begin{document} % \openup 0.5em \frontmatter \input{../chapters/prelims} \mainmatter \input{../chapters/introduction} \input{../chapters/somechapter} \input{../chapters/anotherchapter} \input{../chapters/bibliography} \end{document} zzzzzzzzzzzzzzzzzzzz xxxxxxxxxxxxxxxxxxxx CHAPTER FILE. This is an example of a chapter file to use with a main file of the type shown above. yyyyyyyyyyyyyyyyyyyy \chapter{Some Chapter} \label{somechapter} Section and subsection headings and text go in here in the ordinary way. Note that there are no commands to begin or end the chapter, because the begin and end document commands are in the main file. zzzzzzzzzzzzzzzzzzzz xxxxxxxxxxxxxxxxxxxx STYLE FILE. This is an example of a .sty file you could use with a main file of the type shown above. yyyyyyyyyyyyyyyyyyyy % The first lines below (usepackage geometry and special papersize) fix the paper size and margins. The inner and outer margins have been set the same, at 2.5cm, so that when someone scrolls down the PDF on screen, the text does not jump about from left to right. But for a printed book, the inner margin will need to be larger than the outer margin. Change the numbers as required, but remember that if you increase the inner margin, you will need to decrease the outer margin by the same amount unless you want to change the width of the text on the page. \usepackage[paperwidth=156mm, paperheight=234mm, top=25mm, bottom=25mm, inner=2.5cm, outer=2.5cm]{geometry} \special{papersize=156mm,234mm} \usepackage[resetfonts]{cmap} \usepackage{fixltx2e} \usepackage[utf8]{inputenc} \usepackage[bottom]{footmisc} \usepackage{times} % The next line allows us to use the \begin{comment} and \end{comment} commands to comment out large chunks of text in one go, rather than having to comment out paragraphs one by one. \usepackage{comment} % The next line turns off justification in chapter, section and so on headings, so that words in them do not get hyphenated. \usepackage[raggedright]{titlesec} % The next line allows us to set up space between one paragraph and the next, which we shall do below. \usepackage{parskip} % The next few lines set up the headers and footers. \usepackage{fancyhdr} \setlength{\headheight}{18pt} \pagestyle{fancy} \fancyhead{} \fancyfoot{} \renewcommand{\chaptermark}[1]{\markboth{\thechapter\ #1}{}} \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} \fancyhf{} \fancyhead[CO]{\nouppercase{\itshape\rightmark}} \fancyhead[CE]{\nouppercase{\itshape\leftmark}} \fancyfoot[CE,CO]{\thepage} \renewcommand{\headrulewidth}{0.5pt} \renewcommand{\footrulewidth}{0pt} \addtolength{\headheight}{0.5pt} \fancypagestyle{plain}{ \fancyhead{} \renewcommand{\headrulewidth}{0pt} } % The next block of commented out lines, from \makeatletter to (and including) \makeatother, can be uncommented to produce an alternative style of chapter heading. Instead of Chapter 1, followed by the chapter title on a new line, you should get, on a single line, 1. Title %\makeatletter %\def\@makechapterhead#1{ % \vspace*{50\p@} % {\parindent \z@ \raggedright \normalfont % \interlinepenalty\@M % \Huge\bfseries \thechapter.\quad #1\par\nobreak % \vskip 40\p@ % }} % \makeatother % The next line makes links and internal cross-references clickable, and sets their colour. It works well on screen, but if a book is to be printed, you may need to use black or not use the hyperref package at all, commenting out the whole line by putting a % sign at the start (although if not using hyperref does seem to be a good option, you should check what it does to the appearance of links before sending anything to print). \usepackage[colorlinks=true, linkcolor=blue, citecolor=blue, filecolor=blue, urlcolor=blue]{hyperref} %The next line ensures that URLs are in the same font as the rest of the text \urlstyle{same} \providecommand\phantomsection{} \usepackage[french,german,UKenglish]{babel} \usepackage[UKenglish]{isodate} \usepackage[T1]{fontenc} \usepackage{lmodern} % The alternative Babel languages are mainly there for hyphenation rules. % For short passages use \foreignlanguage{french}{Text in French}. % For longer texts use: % \begin{otherlanguage}{french} % Text in French. This environment switches all language-related definitions, like the language specific names for figures, tables etc. to the other language. % \end{otherlanguage} % The next line makes sure that three levels below the chapter level get numbered (chapter 1, section 1.1, subsection 1.1.1, subsubsection 1.1.1.1) \setcounter{secnumdepth}{3} % The next line makes the contents list show chapters and sections (1 = one layer below chapter). If you want it to show subsections as well, use 2. To go down to subsubsections in the contents list, use 3. \setcounter{tocdepth}{1} % If the next line were not commented out it would ensure that when you used maketitle, a date would not appear. If you do not want a date to appear, just remove the % sign and following space at the start of the line. % \date{} % The next line ensures that spare space on a page appears at the bottom, not around headings elsewhere on the page. \raggedbottom % The next line ensures that you get just one normal space after each full stop. \frenchspacing % The next two lines make sure that there is no indenting of the first lines of paragraphs and a 1 em gap between paragraphs. \setlength{\parindent}{0em} \setlength{\parskip}{1em} % The next two lines reduce the numbers of single lines at the bottoms and tops of pages. Increase the numbers to get fewer of them, but at the cost of leaving more blank spaces at the bottoms of pages. \widowpenalty=1000 \clubpenalty=1000 % The next two lines affect the trade-off between hyphenating words and stretching the spaces between words. Adjust the numbers to taste. Higher numbers mean less hyphenation. \hyphenpenalty=2000 \tolerance=2000 zzzzzzzzzzzzzzzzzzzz xxxxxxxxxxxxxxxxxxxx GITIGNORE FILE. If you use the Git version control system, you may well want Git to ignore all or most of the extra files that are generated when you use LaTeX to compile a PDF. And there are other files you may also want Git to ignore. You can achieve the desired result by setting up a .gitignore file. Here is a list of entries you might wish to make in such a file. yyyyyyyyyyyyyyyyyyyy *.acn *.acr *.alg *.aux *.backup *.bbl *.blg *.dvi *.fdb_latexmk *.fls *.glg *.glo *.gls *.idx *.ilg *.ind *.ist *.lof *.log *.lot *.maf *.mtc *.mtc1 *.out # You might wish to take pdf out of your list, depending on the uses you are making of Git. For example, you might take it out if you are using Git to control an Obsidian vault in which you include attachments. We show this line commented out, so you would need to remove the commenting hash in order to bring it into effect. # *.pdf *.run.xml *.synctex.gz *.tex.bak *.toc # You might wish to take the image file types pdf out of your list, depending on the uses you are making of Git. For example, you might take them out if you are using Git to control an Obsidian vault in which you include attachments. We show these lines commented out, so you would need to remove the commenting hashes in order to bring them into effect. # *.png # *.PNG # *.Png # *.jpeg # *.JPEG # *.Jpeg # *.jpg # *.JPG # *.Jpg # *.xcf *.doc *.dot *.docx *.docm *.dotx *.dotm *.docb *.xls *.xlt *.xlm *.xlsx *.xlsm *.xltx *.xltm *.xlsb *.xla *.xlam *.xll *.xlw *.ppt *.pot *.pps *.pptx *.pptm *.potx *.potm *.ppam *.ppsx *.ppsm *.sldx *.sldm *.adn *.accdb *.accdr *.accdt *.accda *.mdw *.accde *.mam *.maq *.mar *.mat *.maf *.laccdb *.ade *.adp *.mdb *.cdb *.mda *.mdn *.mdt *.mdf *.mde *.ldb *.pub *.odt *.ott *.odm *.oth *.ods *.ots *.odg *.otg *.odp *.otp *.odf *.odb *.oxt *.fodt *.fods *.fodp *.fodg *.zim *.o *~ # The next entry allows you to end any name of a file you do not want tracked with foo.txt. You might for example use such names for files that received the output of git diff. *foo.txt zzzzzzzzzzzzzzzzzzzz