-1

I have this code and this result. But I need the "Введение" to be in the middle and the line "Каждый из нас" to have a similar indentation as the "Целью реферата". how can this be done?

\section*{Введение}\addcontentsline{toc}{section}{Введение}

Каждый из нас ежедневно решает задачи различной сложности: как быстрее добраться в школу или на работу в условиях нехватки времени; в каком порядке выполнить дела, намеченные на текущий день, и т.д. Некоторые задачи настолько сложны, что требуют длительных размышлений для нахождения решения, другие задачи мы решаем автоматически, так как выполняем их ежедневно на протяжении многих лет. Но в любом случае решение каждой задачи можно подразделить на простые этапы.

Целью реферата является раскрытие базовых знаний об элементах теории алгоритмов.

Для решения поставленной цели необходимо выполнить следующие задачи:

enter image description here

Ty for answer. I used this but I lost the numbering of the section and subsection. How do I get the numbering back?

\usepackage{titlesec}

\titleformat{\section}[block]{\Large\bfseries\filcenter}{}{1em}{}

\titleformat{\subsection}[hang]{\large\bfseries\filcenter}{}{1em}{}

guys please tell me how do I return the numbering of y section id subsection and that the list of references is displayed in the content

leandriis
  • 62,593
  • Welcome to TeX.SX! To center the section titles, you could use the titlesec package as for example shown here: https://tex.stackexchange.com/a/8547/134144 Regarding the second half of the question: Using the indentfirst package might hep. For some more alternative approaches, see also: No indent in the first paragraph in a section? – leandriis Dec 18 '20 at 13:14
  • Ty for answer. I used this but I lost the numbering of the section and subsection. How do I get the numbering back? – Артём Макшаев Dec 18 '20 at 13:44
  • @leandriis Hello. Сan you tell me what i need to add to make the numbering appear again? – Артём Макшаев Dec 18 '20 at 17:07
  • 1
    For numbering of section and subsection you should not use stared version of those commands. Just \section{...} and \subsection{...}. In this case \addcontentsline{toc}{section}{Введение} is redudant. – Zarko Dec 19 '20 at 09:22
  • @Zarko. If i use just section and subsection, then they are on the left and i need to move them to the center. – Артём Макшаев Dec 19 '20 at 10:41
  • Regarding your recent update: How is this related to the list of references? Please clarify. Also, please spacify how subsection titles should look like. Do you also want them centered? – leandriis Dec 19 '20 at 10:51
  • 1
    I doubt in this. Positioning of \section{...} and \section*{} should be the same. SInce we don't know anything about your document preamble we can only guess. Please provide an example of small document which reproduce your problem. – Zarko Dec 19 '20 at 10:54
  • @leandriis. About the list of references. I need it to be displayed in the content. – Артём Макшаев Dec 19 '20 at 11:04
  • Without knowing how you create your list of references, it is impossible to tell you how you can include it in the table of contents, I assume, this is what you refer to with "displayed in the contents". Since this is also not related to the horizontal alignment of section headers, I suggest, you "ask a new question" specifially on that topic. Please also prepare a minimal working example (MWE) and include it in your question.It is a lot easier to help if you provide a complete, small example document. – leandriis Dec 19 '20 at 11:09

1 Answers1

0

In its current state, your question is quite unclear. However, the following might get you started:

enter image description here

\documentclass{article}
\usepackage{indentfirst}

\usepackage{titlesec} \titleformat{\section}{\Large\bfseries\filcenter} \titleformat{\subsection}{\large\bfseries\filcenter} %remove to get left aligned subsection headers

\usepackage{lipsum} % For dummy text. Do not use in actual document \begin{document}

\tableofcontents

\section{section}

\lipsum[4]

\lipsum[4]

\subsection{subsection title}

\lipsum[4]

\end{document}

leandriis
  • 62,593