1

On the table of contents it's all right, but in the document, not so good..

Here's my code:

\title{Lab Eletrônicos I - Relatório Cap 1}

% essa 1a parte vc nao precisa saber, só copiar e colar


\documentclass[12pt,twoside]{article}
\usepackage{tabto}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{ae}
\usepackage{float}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\renewcommand{\rmdefault}{phv} % Arial
\usepackage{setspace}
\renewcommand{\baselinestretch}{1.5}
\usepackage[num]{abntex2cite}
\usepackage{booktabs}
\setlength{\parindent}{1cm}
\usepackage{siunitx}
\usepackage[portuguese]{babel}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{caption}
\usepackage{pdfpages}
\usepackage{enumitem}
\usepackage{flafter}
\raggedbottom

\fancypagestyle{plain}{%
    \fancyhf{}
    \fancyhead[R]{\thepage}
    \renewcommand{\headrulewidth}{0pt}
}
\usepackage{titletoc}
\usepackage{indentfirst}
\usepackage[top = 3cm, bottom = 2cm, left = 3cm, right = 2cm,asymmetric]{geometry}
\AtBeginDocument{\renewcommand{\contentsname}{\centerline{Sumário}}}
\AtBeginDocument{\renewcommand{\bibname}{Referências Bibliográficas}}
\usepackage{titletoc}
\usepackage{titlesec}
\titleformat{\chapter}
{\normalfont \titlefont \bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\dottedcontents{chapter}[1.5em]{\bfseries}{1.3em}{.6em}
\dottedcontents{section}[1.5em]{\bfseries}{1.3em}{.6em}
\usepackage[num]{abntex2cite}
\citebrackets[]
\newcommand{\titlefont}{\fontsize{14}{20}}
\newcommand{\sectionfont}{\fontsize{12}{20}}
\titleformat{\section}
{\normalfont \sectionfont \bfseries}{\thesection}{1em}{}
\dottedcontents{section}[3.3em]{\bfseries}{2em}{.6em}
\renewcommand{\figurename}{Figura}
\renewcommand{\tablename}{Tabela}
\usepackage{chngcntr}
%\counterwithout{figure}{chapter}
%\counterwithout{table}{chapter}
\usepackage{multirow}
\usepackage{titlesec}
\usepackage{multirow}
\providecommand{\keywords}[1]{\textbf{{Keywords:}} #1}
\providecommand{\palavraschave}[1]{\textbf{{Palavras-chave:}} #1}
\usepackage[normalem]{ulem}
\useunder{\uline}{\ul}{}

%\input setbmp

%começa de verdade aqui



\begin{document}
    \begin{titlepage}
        \center
        {\large UNIVERSIDADE DE SÃO PAULO}\\ \large ESCOLA DE ENGENHARIA DE SÃO CARLOS\\DEPARTAMENTO DE ENGENHARIA ELÉTRICA\\%[2cm]

\\

        {\Large \bf RELATÓRIO - CAPÍTULO I}\\
        {\large \bf SEL 0316 - Laboratório de Circuitos Eletrônicos I}\\[8cm]
        São Carlos\\
        2017    
    \end{titlepage}

\newpage

\tableofcontents 
\listoffigures
\listoftables
\newpage

\section{Introdução}
Introdução que vc queria

\section{Resultados e Discussões}

\subsection{Circuitos Retificadores}

\subsubsection{Circuito Retificador de Meia Onda}


Foi construído o circuito retificador, mostrado na figura:

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{fig15.png}
\caption{Circuito Retificador de Meia Onda}
\end{figure}

Aplicando na entrada um sinal senoidal com tensões de pico iguais a 0.5 V e 5 V, foi observado os seguintes comportamento na saída:

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{1_1_500_mV.png}
\caption{Sinal de saída com 0.5 Vp na entrada}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{1-1_5V.png}
\caption{Sinal de saída com 5 Vp na entrada}
\end{figure}


\subsubsection{Retificador de meia onda com transformador na entrada}

Foi montado o circuito da figura abaixo:

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{fig8.png}
\caption{Retificador de onda completa usando transformador com derivação central \it(“center tap”)}
\end{figure}

Tendo a saída do transformador um valor RMS de 12 V\textsubscript{RMS}. Variando o valor da resistência R\textsubscript{L}, foram obtidas as seguintes formas de onda na saída do retificador:


\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{1-2_-_50.png}
\caption{Sinal de saída para R\textsubscript{L} = 50 $\Omega$}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{1-2_-_100.png}
\caption{Sinal de saída para R\textsubscript{L} = 100 $\Omega$}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{1-2_-_220.png}
\caption{Sinal de saída para R\textsubscript{L} = 220 $\Omega$}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{1-2_-_470.png}
\caption{Sinal de saída para R\textsubscript{L} = 470 $\Omega$}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{1-2_-_1K.png}
\caption{Sinal de saída para R\textsubscript{L} = 1 k$\Omega$}
\end{figure}

Para cada um dos casos em questão foram medidas as componentes CC e CA do sinal de saída, mostradas na tabela abaixo:

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
% \usepackage{graphicx}
\begin{table}[H]
\centering
\resizebox{0.7\textwidth}{!}{%
\begin{tabular}{@{}|c|c|c|@{}}
\toprule
\textbf{R\textsubscript{L} [$\Omega$]} & \textbf{Componente CC {[}V{]}} & \textbf{Componente CA {[}V\textsubscript{RMS}  {]}} \\ \midrule
\textbf{50} & 5,6 & 6,8 \\ \midrule
\textbf{100} & 5,9 & 7,3 \\ \midrule
\textbf{220} & 6,0 & 7,4 \\ \midrule
\textbf{470} & 6,1 & 7,5 \\ \midrule
\textbf{1000} & 6,1 & 7,5 \\ \bottomrule
\end{tabular}%
}
\caption{Componentes CC e CA do sinal de saída}
\label{my-label}
\end{table}

A mesma montagem do circuito foi utilizada, agora com capacitores na saída, a fim de que seja observada a influência deste no sinal. Foram utilizados os resistores de 100 $\Omega$ e de 1 k$\Omega$.

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_100_-_47.png}
\caption{Sinal de saída para R\textsubscript{L} = 100 $\Omega$, C = 47 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_100_-_100.png}
\caption{Sinal de saída para R\textsubscript{L} = 100 $\Omega$, C = 100 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_100_-_220.png}
\caption{Sinal de saída para R\textsubscript{L} = 100 $\Omega$, C = 220 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_100_-_470.png}
\caption{Sinal de saída para R\textsubscript{L} = 100 $\Omega$, C = 470 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_100_-_1000.png}
\caption{Sinal de saída para R\textsubscript{L} = 100 $\Omega$, C = 1000 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_1k_-_47.png}
\caption{Sinal de saída para R\textsubscript{L} = 1 k$\Omega$, C = 47 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_1k_-_100.png}
\caption{Sinal de saída para R\textsubscript{L} = 1 k$\Omega$, C = 100 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_1k_-_220.png}
\caption{Sinal de saída para R\textsubscript{L} = 1 k$\Omega$, C = 220 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_1k_-_470.png}
\caption{Sinal de saída para R\textsubscript{L} = 1 k$\Omega$, C = 470 nF}
\end{figure}

\begin{figure}[H]
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth]{124_-_1k_-_1000.png}
\caption{Sinal de saída para R\textsubscript{L} = 1 k$\Omega$, C = 1000 nF}
\end{figure}



\subsubsection{Retificador de onda completa com transformador na entrada}

\subsection{Reguladores de Tensão e Dobrador de Tensão}

\subsubsection{Regulador com diodo Zener}

\subsubsection{Dobrador de tensão}

\subsubsection{Regulador de Tensão Empregando Circuitos Integrados LM78XX}

\section{Conclusão}

\end{document}
  • 5
    I just noticed you use article and formating the chapter. Articles does not have a chapter... So, I think you copied a code for a purpose from a book or something but using it with inapropriate way... What if you remove all code from first titleformat to first \usepackage after first \titleformat and without the \usepackage command? – koleygr Aug 19 '17 at 3:20
  • 2
    Ok. A point I think I have to add is to read the errors and warnings. You have multiple times called the same command in preamble (for example \usepackage{titletoc} or multirow and may be others) This probably causes latex to throw warnings that package is already loaded... You have to pay attention in warnings because it is a way to avoid errors and to laern debuging your code. – koleygr Aug 19 '17 at 13:09
  • 1
    Might I suggest that @koleygr or the OP turns the comment(s) into an answer. Otherwise this question will end up in the unanswered queue. – gebruiker Aug 19 '17 at 15:04
  • 1
    Off-topic: Using \renewcommand{\baselinestretch}{…} isn't recommended at all (because outdated), but makes no sense after loading setspace. Please read the setspace manual. Font package ae is outdated. Please read l2tabu. phv is not Arial but Helvetica. Generally it would be better to load a package like helvet and change \familydefault instead of setting \rmdefault to a non-rm-font. hyperref should be loaded as late as possible. – Schweinebacke Aug 19 '17 at 15:31
  • 1
    Off-topic: I opened a discussion here: tex.meta.stackexchange.com/questions/7391/… and have this question as an example... I hope OP will not find it aggressive or something. I think that my request there will help improving the community functionality and this post just helps to explain my point there. – koleygr Aug 19 '17 at 15:52
2

@Schweinebacke's comment for this kind of mistakes: If you have a problem, always minimize your code. This will show you, where the problem stays and often also which preamble code can be removed without worsening the result and sometimes even which code should be removed because this will improve the result and already would be the solution.

My comment: I don't think this answer will help anyone else. It is just a common mistake of some new latex users (to copy-paste code that doesn't really know what it does) and the answer is not really related with the title of the question for other users.

The solution was to remove lines:

\titleformat{\chapter}
{\normalfont \titlefont \bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\dottedcontents{chapter}[1.5em]{\bfseries}{1.3em}{.6em}
\dottedcontents{section}[1.5em]{\bfseries}{1.3em}{.6em}
\usepackage[num]{abntex2cite}
\citebrackets[]
\newcommand{\titlefont}{\fontsize{14}{20}}
\newcommand{\sectionfont}{\fontsize{12}{20}}
\titleformat{\section}
{\normalfont \sectionfont \bfseries}{\thesection}{1em}{}
\dottedcontents{section}[3.3em]{\bfseries}{2em}{.6em}

since there was not reason to be there (it was just an unneeded copy-paste).

The code has also many multiple called \usepackage with the same package that probably return some warnings that the OP has to pay attention.

  • 5
    +1 Or to say it shorter: Remove every code from the preamble you do not know, what is does, why you have added it or how it works. – Schweinebacke Aug 19 '17 at 15:25
  • 1
    @Schweinebacke A good way for the why you have added it is commenting (but usually people who starts latex codind want just a result and not really respect comments.) I don't really agree with your "how it works" because most of us don't really know how most of things works (we have a limited depth of this knowledge) and because such a request make almost all users to not use letex. I mean all of us have used code that not really understand or not understand perfectly... We can not ask from others not to do it because latex users will disappear :P – koleygr Aug 19 '17 at 15:32
  • 3
    "How it works" and "How it works in detail" are not the same. You don't need to know in detail how something work, but you should know the basic function, e.g., to adapt the change of \chapter and \section of a book or report into the change of \section and \subsection of an article. I show new users for more than 25 years how to use LaTeX. Using it without basic knowledge is a frustrating way. Quick start but low success. Learning some basics and reading manuals (not always complete but partly) only seem to be a hard way but mostly it is a successful and satisfying way. – Schweinebacke Aug 19 '17 at 15:35
  • 1
    @Schweinebacke... I agree (I just added the detail when was writing the comment but was not exactly what I had in mind). What was in my mind is that if we ask the users of this community if they really understand the commands of the solution they took, the most of them will answer "No, but it works". For example I used \expandafter before I really understand even "it's English"... My point is that we can not expect from users to understand "how it works" every part of their code. They always can use code they don't understand at all but as you mentioned they have to know why they used it. – koleygr Aug 19 '17 at 15:44
  • 2
    OK. I can say it a little bit weaker: If you have a problem, always minimize your code. This will show you, where the problem stays and often also which preamble code can be removed without worsening the result and sometimes even which code should be removed because this will improve the result and already would be the solution. ;-) – Schweinebacke Aug 19 '17 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.