Wednesday, November 30, 2022

Insert Image LaTeX


Package yang digunakan:

\usepackage{graphicx}
\usepackage{wrapfig,lipsum}

%--------------------------------

\begin{figure}[h] 
\centering
\includegraphics[scale=0.5]{ESP32.jpg}
\caption{ESP32}
\label{fig: ESP32} 
\end{figure}
%---------------------------------

atau

\includegraphics[width=0.5\textwidth]{ESP32.jpg}


extensi dari file bisa juga tidak perlu disertakan.

Teks dan Gambar Bersisian

%------------------------------------------------

\begin{wrapfigure}{l}{0.25\textwidth}
\includegraphics[width=0.9\linewidth]{ttgo} 
\caption{Caption1}
\label{fig:wrapfig}
\end{wrapfigure}

%------------------------------------------------




Saturday, November 26, 2022

My LaTex for Report

 \documentclass[12pt,a4paper]{report}
%--------------------------------------------------------------------- 
%agar chapter ada di center
\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\centering}{\centering\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter} 
  {0pt}{50pt}{40pt}
 %-------------------------------------------------------------------  
\usepackage{setspace}\onehalfspacing
\usepackage[utf8]{inputenc}
\usepackage[bahasai]{babel} %package bahasa indonesia
\usepackage{amsmath} % \usepackage is a command that allows you to add functionality to your LaTeX code
\usepackage{authblk} % banyak author
\usepackage[T1]{fontenc}
\usepackage{titlesec}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\pagenumbering{gobble}
\usepackage{verbatim} %menulis listing source code
\usepackage{listings} %menulis listing source code
%\usepackage[backend=bibtex,style=alphabetic,]{biblatex}
\usepackage[backend=bibtex,style=ieee,]{biblatex}
\addbibresource{references.bib}
\usepackage{graphicx}
\usepackage{verbatim} %menulis sourcecode
\usepackage{listings} %menulis sourcecode
\usepackage{xcolor}%menulis sourcecode
\graphicspath{ {../gambar/} }
%package untuk tabel
\usepackage{tabularx}
\usepackage{array}
\usepackage{multirow}
\usepackage{booktabs}
%\usepackage{float} %agar posisi tdk eror
%\restylefloat{table}
%end
\usepackage{csquotes}
\usepackage{geometry}
 \geometry{
 a4paper,
 total={170mm,257mm},
 left=35mm,
 top=30mm,
 bottom=30mm,
 right=30mm
 }
 %=========
 \definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
%===
\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}
\lstset{style=mystyle}
 
 %=========
\title{PROPOSAL Penelitian PNBP 2023 }
\author{Lalu Ahmad S. Irfan Akbar}
\affil{Teknik Elektro Universitas Mataram}
\date{\today}
\begin{document}
\pagenumbering{roman} %memulai dengan page i, ii
\maketitle
  
\setcounter{tocdepth}{2}
\tableofcontents
\listoffigures
\listoftables
 
 \addcontentsline{toc}{chapter}{Ringkasan}
 \begin{abstract}  
Pada tahun 2020 GSM.\\
Keywords : Internet of Things; LoRa; blank spot\\
\end{abstract} \hspace{8pt}
%TC:ignore
%\keywords{Internet of Things, LoRa, blank spot}
%\newpage
\pagenumbering{arabic}  %merubah halaman dari roman ke 1,2 dst
\chapter{PENDAHULUAN}
\section{Latar Belakang}

\section{Perumusan Masalah}

\section{Tujuan dan Manfaat Penelitian}

\section{Urgensi Penelitian}

\newpage

\chapter{TINJAUAN PUSTAKA}
\section{State of The Art Penelitian Terkait}
\subsection{LoRa dan Lorawan}
\subsection{Narrowband-IoT (NB-IoT) }

\subsection{ESP32}
\subsection{Arduino}
\subsection{GSM (Global system for Mobile)}

\subsection{Penelitian Terkait Lora}
\section{Peta Jalan (Road Map) Penelitian}
 
\newpage
\chapter{METODOLOGI PENELITIAN}
\section{Bagan Alir Penelitian }
\subsection{Studi Literatur}
\subsection{Perancangan Perangkat Keras}
\subsection{Perancangan Perangkat Lunak}
\subsection{Analisis Parameter Pengiriman Data}
\section{Lokasi Penelitian }


\newpage
\chapter{PEMBAHASAN}

\section{Perangkat Keras}
\begin{table}[h!]
\centering
\caption{Komponen perangkat IOT}
\begin{tabularx}{0.7\textwidth} { 
  | >{\raggedright\arraybackslash}X 
  | >{\centering\arraybackslash}X 
  | >{\raggedleft\arraybackslash}X | }
 \hline
 \textit{\textbf{Device}} & \textit{\textbf{Model}} \\
 \hline
 LoRa  & SX1276 \\
\hline
Node MCU & ESP32 WROOM 32 \\
\hline
Antena & Omni directional 3 dBi \\
\hline
Screen & SSD1306 0.96 inch I2C OLED \\
\hline
Interface & Android Smart phone \\
\hline
\end{tabularx}
\label{table:1}
\end{table}


\section{interface/antarmuka Smartphone Android dan Perangkat Lora }

gambar \ref{fig: connect} menunjukkan rangkaian modul LoRa sx1276 dan ESP32 pada \emph{bread board}

\begin{figure}[h] 
\centering
\includegraphics[scale=0.6]{connect-sx1276-esp32small.jpg}
\caption{Menghubungkan Modul IOT}
\label{fig: connect} 
\end{figure}

%#############
\section{Program Pengirim data teks}
\subsection{ESP32 Sebagai Wifi Access Point}
%######

\begin{lstlisting}[language=C, caption=ESP32 sebagai Acces Point]
#include <WiFi.h> 
const char* ssid = "blackspot.net";      // Nama AP/Hotspot
const char* password = "12345";    // Password AP/Hotspot
 
WiFiServer server(80);
void setup() {
  Serial.begin(115200);
  delay(10);
  
// Mengatur WiFi -----------------------------------------------------

  Serial.println();
  Serial.print("Configuring access point...");
   
  WiFi.mode(WIFI_AP);             // Mode AP/Hotspot
  WiFi.softAP(ssid, password);
  
// Start the server -------------------------------------------------- server.begin();
  Serial.println("Server dijalankan");
  
 // Print the IP address ----------------------------------------------
  Serial.println(WiFi.localIP());
 } 
void loop() {
 }
\end{lstlisting}




\subsection{ESP32 Sebagai Web Server}
%#####################
\section{Jangkauan Pengiriman Data Pada Daerah Blank SPot}
\chapter{KESIMPULAN}
\newpage
\printbibliography %Prints bibliography
         
\end{document}

Center Chapter in Latex

 \documentclass[12pt,letterpaper,twoside]{book}
%------------------------------------------------------------------ 
%agar chapter ada di center
\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries\centering}{\centering\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter} {0pt}{50pt}{40pt}
%------------------------------------------------------------------ 

\ begin{document}
\tableofcontents
\addcontentsline{toc}{chapter}{Chap 1.}
\chapter*{CHAP 1}
\chapter{CHAP 2}
\appendix
\chapter{Test appendix}
\ end{document}