Write like a rocket scientist with Overleaf — the collaborative, online LaTeX editor that anyone can use.
The home of scientific and technical writing
Create complex, beautifully formatted documents with ease.
Collaborate with anyone, work from anywhere.
Get started fast
No downloads, no setup, and no need to know LaTeX before you start.
- Visual Editor and Code Editor
- Thousands of free templates
- Detailed guidance and LaTeX learning
- Stellar support from real-life TeXperts
Write your best work, together
Say goodbye to endless rounds of email feedback.
- Access from anywhere, on any device
- Document sharing
- Simultaneous editing and commenting
- Real-time track changes Premium
- Project history and version control Premium
Use the right tool for your job
Purpose-built for scientific and technical writing. Powered by LaTeX.
- Beautiful formatting
- Clever bibliographies and citations
- Better formulas, figures, and tables
- Built-in templates
- Advanced reference search Premium
Overleaf is indispensable for us. We use it in our research, thesis writing, project proposals, and manuscripts for publication. When it comes to writing, it’s our main tool.
Christopher Collins
Associate Professor and Lab Director, Ontario Tech University
Write like a rocket scientist (without having to be one)
Overleaf is powered by LaTeX—a clever typesetting system that turns even the most complex ideas into flawlessly formatted documents. But you don’t need to know LaTeX to get started.
Choose Visual Editor or Code Editor
Insert figures, create tables, and format your writing without coding using Overleaf’s Visual Editor. Switch seamlessly to Code Editor to see the code behind your creation.
Learn by doing
Start with our example project to get familiar with how LaTeX works.
Explore our resources
With hundreds of articles explaining everything from LaTeX fundamentals to advanced TeX, we’ve got your questions answered.
Thousands of free templates
From publisher-approved research article templates to business proposals, and so much more.
Select from an array of journal templates and submit directly from Overleaf.
Templates for producing project and lab reports, including layout guidelines to help you through the writing process.
Communicate more effectively with our selection of engaging presentation templates.
For everyone, everywhere
Start for free, upgrade when you’re ready
Как сделать содержание в латехе
Чтобы помочь читателю ориентироваться в вашей работе, вы должны разделять ее на главы, разделы и подразделы. L A T E X поддерживает это специальными командами, принимающими в качестве аргумента заголовок раздела. Ваше дело — использовать их в надлежащем порядке.
Класс article включает следующие команды секционирования:
section <. >paragraph <. >
subsection <. >subparagraph <. >
subsubsection <. >appendix
В классах report и book вы можете использовать две дополнительные команды:
Так как глав (chapters) в классе article нет, то статьи довольно легко добавлять в книгу в качестве глав. Интервалы между разделами, нумерация и размер шрифта заголовков устанавливаются L A T E X автоматически.
- Команда part не влияет на последовательность нумерования глав.
- Команда appendix аргумента не имеет. Она просто начинает нумеровать главы 10 буквами вместо цифр.
L A T E X создает оглавление, беря заголовки разделов и номера страниц из предыдущего прохода по документу. Команда
вставляет оглавление в то место, где она вызвана. Чтобы получить правильное оглавление, новый документ должен быть обработан L A T E X дважды. В особых случаях может быть необходим и третий проход. Когда это потребуется, L A T E X вас предупредит.
Все вышеперечисленные команды секционирования существуют также в вариантах со звездочкой. Такой вариант получается добавлением * к имени команды. Они генерируют заголовки разделов, которые не нумеруются и не включаются в оглавление. Например, команда \section становится \section* .
Обычно заголовки разделов появляются в оглавлении точно в том же виде, в каком они вводятся в тексте. Иногда это невозможно из-за того, что заголовок слишком длинен для оглавления. Элемент оглавления может в этом случае указываться необязательным аргументом перед собственно заголовком.
\chapter[Прочтите! Это замечательно] длинный и очень нудный заголовок>
Титульный лист документа в целом генерируется при помощи команды
Его содержимое должно быть определено командами
title <. >, author <. >и date
до момента вызова \maketitle . Аргумент команды authors может содержать несколько имен, разделенных командами and.
Пример некоторых из упомянутых команд может быть найден на иллюстрации.
Помимо описанных выше команд секционирования, L A T E X2 e вводит три дополнительных команды для использования с классом book .
frontmatter, mainmatter и backmatter Они полезны для деления вашей публикации. Команды изменяют заголовки глав и нумерацию страниц так, как это ожидается от книги. 11
Table of contents
To create the table of contents is straightforward, the command \tableofcontents does the job. Sections, subsections and chapters are included in the table of contents. To manually add entries, for example when you want an unnumbered section, use the command \addcontentsline as shown in the following example:
\documentclassarticle> \usepackageblindtext> \usepackagetitlesec> \titleSections and Chapters> \authorGubert Farnsworth> \date > \begindocument> \maketitle \tableofcontents \sectionIntroduction> This is the first section. \blindtext \addcontentslinetoc>section>Unnumbered Section> \section*Unnumbered Section> \blindtext \sectionSecond Section> \blindtext \enddocument>
This example produces the following output:
Change the title of the table of contents
The default title for the table of contents is Contents; it can be changed into whatever you need as the following example demonstrates:
\documentclassarticle> \titleSections and Chapters> \authorGubert Farnsworth> \date > \renewcommand*\contentsnameSummary> \begindocument> \maketitle \tableofcontents \sectionIntroduction> This is the first section. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortisfacilisis sem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdietmi nec ante. Donec ullamcorper, felis non sodales. \addcontentslinetoc>section>Unnumbered Section> \section*Unnumbered Section> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisissem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdiet mi necante. \sectionSecond Section> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisissem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdiet mi necante. \enddocument>
This example produces the following output:
The line \renewcommand*\contentsname will write «Summary» instead of the default value. If you are using the package babel for international language support, the aforementioned command must be placed inside the braces of
\addto\captionsenglish >
Instead of English in \captionenglish write the name of the language you set in babel.
Further reading
For more information see:
- Creating a document in LaTeX
- Bold, italics and underlining
- International language support
- Cross referencing sections and equations
- Indices
- Glossaries
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
- Page numbering
- Single sided and double sided documents
- Multiple columns
- Counters
- Font sizes, families, and styles
- Documentation Home
- Learn LaTeX in 30 minutes
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in L a T e X
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
- Font sizes, families, and styles
- Font typefaces
- Supporting modern fonts with X Ǝ L a T e X
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class
Advanced TeX/LaTeX
Как горизонтально центрировать заголовки в Latex
Оформляю документ в TeXstudio. Заголовки задаю с помощью команды \section, содержание формирую с помощью \tableofcontents. Подскажите, что необходимо прописать, что бы заголовки были по центру, а не по левому краю. Пробовала переопределить команду \renewcommand\section, но в итоге весь текст съезжает. И еще, список литературы вывожу с помощью \begin, но в таком случае он не отображается в содержании. Можно ли его как то вывести?\centering> \centering>
Отслеживать
задан 1 дек 2021 в 11:36
341 3 3 серебряных знака 13 13 бронзовых знаков
1 ответ 1
Сортировка: Сброс на вариант по умолчанию
Вообще, это целых два отдельных вопроса. По первому: мне кажется, будет проще всего использовать пакет titlesec . В нем можно очень подробно указать, как должны формироваться названия отдельных секций. Список допустимых секций определяется классом документа. Я приведу пример для настройки только заголовка разделов \section<> , остальные можно оформить по аналогии.
Команда \titleformat имеет пять обязательных параметров. Думаю, по примеру ее использования будет понятно, что какой параметр означает. Но если кратко: первый — это переопределяемая команда (название секции), второй — задает формат заголовка (выравнивание, шрифт и все такое), третий — задает представление нумерации секции (метку), четвертый — задает отступ заголовка от номера секции (от метки), пятый параметр — может содержать код, который будет выполняться до тела заголовка (обычно не используется). В принципе, есть еще пара необязательных параметров, но о них лучше почитать в документации к пакету — они применяются в довольно экзотических случаях.
Что касается второго вопроса, то нужно просто добавить команду: \addcontentsline перед библиографией. Естественно, это пример для класса документа article . Если нужно использовать класс book , то слово section в команде нужно заменить на chapter (т.е. это определяется классом документа и тем, в какой секции нужно разместить в оглавлении библиографию). Пример использования также прилагаю.
\documentclass[12pt,a4paper] \usepackage[cp1251] \usepackage[T2A] \usepackage[russian] \usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm] \usepackage \usepackage %\titleformat[display]<\normalfont\huge\bfseries> <\Huge>\titleformat<\filcenter\normalfont\Large\bfseries><> %\titleformat<\normalfont\large\bfseries><> %\titleformat<> %\titleformat<\paragraph>[runin]<> %\titleformat[runin]<> \begin \addcontentsline \section* \section[Короткое название первого раздела для оглавления] \lipsum[1-2] \section \lipsum[2-3] \section \lipsum[3-4] \addcontentsline \begin \bibitem C. Petit-Jean-Genaz and J. Poole, ``JACoW, A service to the Accelerator Community,'' EPAC'04, Lucerne, July 2004, THZCH03, p.~249, \texttt \bibitem A. Name and D. Person, Phys. Rev. Lett. 25 (1997) 56. \bibitem A.N. Other, ``A Very Interesting Paper,'' EPAC'96, Sitges, June 1996, MOPCH31, p. 7984 (1996), \texttt \ \bibitem F.E.~Black et al., <\it This is a Very Interesting Book>, (New York: Knopf, 2007), 52. \bibitem G.B.~Smith et al., ``Title of Paper,'' MOXAP07, these proceedings. \end \tableofcontents \end
Пример получившегося заголовка: