From b5ac5e41cf3f7b15f7fb0b34ed50ee72be66996e Mon Sep 17 00:00:00 2001 From: Gerardo Marx Date: Mon, 15 Feb 2021 20:59:15 -0600 Subject: [PATCH 1/3] day 1 issues --- 1_basics/2_example/main.tex | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/1_basics/2_example/main.tex b/1_basics/2_example/main.tex index 5fc31fd..308822f 100644 --- a/1_basics/2_example/main.tex +++ b/1_basics/2_example/main.tex @@ -1,6 +1,10 @@ \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{lipsum} +\usepackage{soul} +\usepackage[htt]{hyphenat} + + \newcommand{\mytext}{Here is my own dummy text command to fill-up space over the document. The text has no sense and you can continue reading, nevertheless, you will not find useful information. Please stop reading.} \title{Font styles and decalrations} \author{Gerardo Marx Chávez-Campos} @@ -47,7 +51,7 @@ Some tiny text. \small{\lipsum[99]} -\normalfont{\lipsum[12]} +\normalsize{\lipsum[12]} \large{\mytext} @@ -58,5 +62,20 @@ Some tiny text. \huge{\mytext} -\Huge{\mytext} +\Huge{\mytext} \normalsize + + + +\section{Day 1 issues} + +Underlined long texts using \texttt{soul package}: + +\ul{Here is my own dummy text command to fill-up space over the document. The text has no sense and you can continue reading, nevertheless, you will not find useful information. Please stop reading.} + +\caps{Here is my own dummy text command to fill-up space over the document. The text has no sense and you can continue reading, nevertheless, you will not find useful information. Please stop reading.} + + +\texttt{Here is my own dummy text command to fill-up space over the document. The text has no sense and you can continue reading, nevertheless, you will not find useful information. Please stop reading.} + + \end{document} \ No newline at end of file -- 2.26.2 From 80280a2b65b921325b1b1e5b661c26609ed3fcee Mon Sep 17 00:00:00 2001 From: Gerardo Marx Date: Mon, 15 Feb 2021 21:59:44 -0600 Subject: [PATCH 2/3] subfigures and matrix --- 3_equ-tab-figs/1_equations/main.tex | 8 ++++++ 3_equ-tab-figs/2_figures/main.tex | 44 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/3_equ-tab-figs/1_equations/main.tex b/3_equ-tab-figs/1_equations/main.tex index 50b8799..4ac346e 100644 --- a/3_equ-tab-figs/1_equations/main.tex +++ b/3_equ-tab-figs/1_equations/main.tex @@ -31,6 +31,14 @@ Previous equations are used to define the Fourier series as: \label{eq:fourier} g(t)=a_0+\sum_{m=1}^{\infty}a_m \cos{\left(\frac{2\pi mt}{T}\right)}++\sum_{m=1}^{\infty}b_n \sin{\left(\frac{2\pi nt}{T}\right)} \end{equation} + +\begin{equation} +A= +\begin{pmatrix} +a & b& c\\ +d & e &f +\end{pmatrix} +\end{equation} \end{document} diff --git a/3_equ-tab-figs/2_figures/main.tex b/3_equ-tab-figs/2_figures/main.tex index 51a2f4e..eb49d45 100644 --- a/3_equ-tab-figs/2_figures/main.tex +++ b/3_equ-tab-figs/2_figures/main.tex @@ -1,6 +1,12 @@ \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} +\usepackage{caption} +\usepackage{subcaption} +%\usepackage{hyperref} +%\captionsetup{subrefformat=parens} +% new suref command +\newcommand{\suref}[2]{\figurename{} \ref{#1}:(\subref{#2})} \begin{document} \section{Simple figures} \label{sec:simple} @@ -12,4 +18,42 @@ This is a simple figure; see \figurename{} \ref{fig:fig-example}. \caption{Figure's caption.} \label{fig:fig-example} \end{figure} + +\section{The subsigures option} +\label{sec:subfigures} +Now we are adding three sub-figure in one figure; see \figurename{} \ref{fig:three graphs}. Notice that in \ref{fig:a} ... or by using \suref{fig:three graphs}{fig:a} ... + +%on body +\begin{figure} + \centering + \begin{subfigure}[t]{0.3\textwidth} + \centering + \includegraphics[width=\textwidth]{example-image-a} + \caption{The image a} + \label{fig:a} + \end{subfigure} + \hfill + \begin{subfigure}[t]{0.3\textwidth} + \centering + \includegraphics[width=\textwidth]{example-image-b} + \caption{The image b} + \label{fig:b} + \end{subfigure} + \hfill + \begin{subfigure}[t]{0.3\textwidth} + \centering + \includegraphics[width=\textwidth]{example-image-c} + \caption{The image c with more text than the other captions} + \label{fig:c} + \end{subfigure} + \caption{Three images together and its large caption} + \label{fig:three graphs} + \end{figure} + +\newpage + +\section{Tables} +\label{sec:tables} + + \end{document} \ No newline at end of file -- 2.26.2 From 2a70301f6198120934d1602f17f1a52c27e39082 Mon Sep 17 00:00:00 2001 From: Gerardo Marx Date: Wed, 17 Feb 2021 22:35:32 -0600 Subject: [PATCH 3/3] day 4 --- 3_equ-tab-figs/1_equations/main.tex | 10 +- 4_pgfplots/data.csv | 12 +++ 4_pgfplots/main.tex | 153 ++++++++++++++++++++++++++++ webinar.org | 33 +++++- 4 files changed, 202 insertions(+), 6 deletions(-) create mode 100644 4_pgfplots/data.csv create mode 100644 4_pgfplots/main.tex diff --git a/3_equ-tab-figs/1_equations/main.tex b/3_equ-tab-figs/1_equations/main.tex index 4ac346e..331e205 100644 --- a/3_equ-tab-figs/1_equations/main.tex +++ b/3_equ-tab-figs/1_equations/main.tex @@ -20,11 +20,11 @@ Here we can find a way to write long equations like \eqref{eq:fraction}: \noindent here $t$ is time in seconds. More complex equations can be written using symbols and commands from math-mode. An example is the Fourier coefficients equations \eqref{eq:a0},\eqref{eq:an} and \eqref{eq:bn}: -\begin{eqnarray} - a_0=\frac{1}{T}\int_0^T f(t)dt \label{eq:a0}\\ - a_n=\frac{2}{T}\int_0^T f(t)\cdot \cos{\left(\frac{2\pi nt}{T}\right)}dt \label{eq:an}\\ - b_n=\frac{2}{T}\int_0^T f(t)\cdot \sin{\left(\frac{2\pi nt}{T}\right)}dt \label{eq:bn} -\end{eqnarray} +\begin{align} + a_0&=\frac{1}{T}\int_0^T f(t)dt \label{eq:a0}\\ + a_n&=\frac{2}{T}\int_0^T f(t)\cdot \cos{\left(\frac{2\pi nt}{T}\right)}dt \label{eq:an}\\ + b_n&=\frac{2}{T}\int_0^T f(t)\cdot \sin{\left(\frac{2\pi nt}{T}\right)}dt \label{eq:bn} +\end{align} Previous equations are used to define the Fourier series as: \begin{equation} diff --git a/4_pgfplots/data.csv b/4_pgfplots/data.csv new file mode 100644 index 0000000..06e79a2 --- /dev/null +++ b/4_pgfplots/data.csv @@ -0,0 +1,12 @@ +time, voltage, current +0, 1, 3 +1, 1.3, 3.1 +2, 1.1, 3.5 +3, 1.01,3.8 +4, 1.0, 3.6 +5, 1.7, 4 +6, 2.5, 6 +7,3.3, 9 +8, 3.8, 10 +9, 3.9, 12 +10, 4.5, 15 \ No newline at end of file diff --git a/4_pgfplots/main.tex b/4_pgfplots/main.tex new file mode 100644 index 0000000..af5cd14 --- /dev/null +++ b/4_pgfplots/main.tex @@ -0,0 +1,153 @@ +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage{tikz} +\usepackage{pgfplots} +%\usepackage{pgf-pie} +\pgfplotsset{colormap/jet,width=3.5in,compat=1.16} +\title{pgfplots} +\author{Gerardo Marx Chávez-Campos} +\date{February 2021} + +\begin{document} + +\maketitle + +\section{\LaTeX{} as calculator} +This is an example to insert plots computed by \LaTeX{}: + +\begin{figure}[!htb] + \centering + \begin{tikzpicture} + \begin{axis} + \addplot{3*x+5}; + \addlegendentry{$f(x)$} + \addplot{x^2+5}; + \addlegendentry{$g(x)$} + \end{axis} + \end{tikzpicture} + \caption{Caption} + \label{fig:my_label} +\end{figure} + +\newpage +\section{Bar plots} +\begin{figure}[!htb] + \centering + \begin{tikzpicture} + \begin{axis}[ + xlabel=Groups, + ylabel= Counts, + symbolic x coords={Group1, Group2, Group3}, + ybar,nodes near coords, + enlarge x limits = 0.15, + xtick=data + ] + \addplot coordinates{ + (Group1,3) + (Group2,4) + (Group3,2) + }; + \addplot coordinates{ + (Group1,2) + (Group2,4) + (Group3,1) + }; + \legend{MacOs, Windows} + \end{axis} + \end{tikzpicture} + \caption{Caption} + \label{fig:my_label} +\end{figure} + + +%\section{Pie charts} +%\begin{figure} +% \centering +% \begin{tikzpicture} +%\pie{22.97/Los Angeles Lakers, +% 22.97/Boston Celtics, +% 8.11/Golden State Warriors, +% 8.11/Chicago Bulls, +% 6.76/San Antonio Spurs, +% 31.07/Other Teams} +%\end{tikzpicture} +% \caption{Caption} +% \label{fig:my_label} +%\end{figure} + + +\section{Reading data from CSV files} +\begin{tikzpicture} + \begin{semilogyaxis}[ + legend pos=north west, + %ylabel style={rotate =-90}, + xlabel=x, + ylabel=y] + \addplot[color=black, mark=*, line width=1pt] table[x=time, y=voltage, col sep=comma]{data.csv}; + \addlegendentry{voltage} + \addplot table[x=time, y=current, col sep=comma]{data.csv}; + \addlegendentry{current} + \end{semilogyaxis} + \end{tikzpicture} + +\section{3D Plots} +\begin{figure}[!htb] + \centering + \begin{tikzpicture} + \begin{axis} + \addplot3[ + mesh, + samples=50, + domain=-10:9 + ] + {sin(deg(sqrt(x^2+y^2)))/sqrt(x^2+y^2)}; + \addlegendentry{$f(x)$} + \end{axis} + \end{tikzpicture} + \caption{The Mexican hat} + \label{fig:my_label} +\end{figure} + + + + + +\section{How to configure PGFPlots} +\begin{figure}[!h] + \centering +% \includegraphics{} + \begin{tikzpicture} + \begin{axis}[ + xlabel=time $t$, + mark size =2.5pt, + ylabel= $f(t)$ + legend pos=north west, + ymajorgrids=true, + grid style=dashed, + ] + \addplot[ + dashed, + domain=-3:3, + samples=20, + mark=*, + color=black, + line width=1pt, + ] + {x^2+9}; + \addlegendentry{Eq1} + \addplot[ + dotted, + mark options={solid}, + domain=-3:3, + samples=20, + mark=o, + line width=1pt, + color=black!40!white] + {20*sin(2*x*20)}; + \addlegendentry{$\sin(40x)$} + \end{axis} + \end{tikzpicture} + \caption{Caption} + \label{fig:my_label} +\end{figure} +\end{document} \ No newline at end of file diff --git a/webinar.org b/webinar.org index d93510f..bf962f2 100644 --- a/webinar.org +++ b/webinar.org @@ -3,7 +3,38 @@ * First day ** Hello world ** Fonts and styles -** Geometry and space +** DONE Geometry and space - The total allowable width of the text area is 6.5 inches wide by 8.75 inches high. The top margin on each page should be 1.2 inches from the top edge of the page. The left margin should be 0.9 inch from the left edge. The footer with page number should be at the bottom of the text area. - + +* DONE Second day +* TODO Third day: Equations, Figures and Tables [78%] + :LOGBOOK: + :END: +- [X] The basic document +- [X] The thesis structure (file organization):(https://www.overleaf.com/read/mbsctvpssghf) +- [X] Inline equations +- [X] Enumerated equations and no enumerated equations +- [X] Three equations *eqnarray* +- [X] _Fourier challenge_ +- [ ] Matrices +- [X] Figures +- [X] Upload a figure +- [X] Subfigures +- [X] Cross-references +- [ ] my own command +- [X] Tables (booktabs) +- [ ] Subtables +* TODO Fourth day: PGFPlots and other things[0%] +- [ ] Matrices +- [ ] My own command example +- [ ] Plotting an equation +- [ ] Scatter plots +- [ ] Pie plots +- [ ] Bar plots +- [ ] Setting label, markers and colors +- [ ] Creating a data file (CSV) +- [ ] Plotting data from a CSV file +- [ ] How to install LaTeX +- [ ] GNUPlots -- 2.26.2