#3 day-3

Merged
gmarx merged 3 commits from day-3 into master 2 years ago
  1. +21
    -2
      1_basics/2_example/main.tex
  2. +13
    -5
      3_equ-tab-figs/1_equations/main.tex
  3. +44
    -0
      3_equ-tab-figs/2_figures/main.tex
  4. +12
    -0
      4_pgfplots/data.csv
  5. +153
    -0
      4_pgfplots/main.tex
  6. +32
    -1
      webinar.org

+ 21
- 2
1_basics/2_example/main.tex View File

@ -1,6 +1,10 @@
\documentclass{article} \documentclass{article}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage{lipsum} \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.} \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} \title{Font styles and decalrations}
\author{Gerardo Marx Chávez-Campos} \author{Gerardo Marx Chávez-Campos}
@ -47,7 +51,7 @@ Some tiny text.
\small{\lipsum[99]} \small{\lipsum[99]}
\normalfont{\lipsum[12]}
\normalsize{\lipsum[12]}
\large{\mytext} \large{\mytext}
@ -58,5 +62,20 @@ Some tiny text.
\huge{\mytext} \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} \end{document}

+ 13
- 5
3_equ-tab-figs/1_equations/main.tex View File

@ -20,17 +20,25 @@ Here we can find a way to write long equations like \eqref{eq:fraction}:
\noindent here $t$ is time in seconds. \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}: 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: Previous equations are used to define the Fourier series as:
\begin{equation} \begin{equation}
\label{eq:fourier} \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)} 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} \end{equation}
\begin{equation}
A=
\begin{pmatrix}
a & b& c\\
d & e &f
\end{pmatrix}
\end{equation}
\end{document} \end{document}


+ 44
- 0
3_equ-tab-figs/2_figures/main.tex View File

@ -1,6 +1,12 @@
\documentclass{article} \documentclass{article}
\usepackage{amsmath} \usepackage{amsmath}
\usepackage{graphicx} \usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
%\usepackage{hyperref}
%\captionsetup{subrefformat=parens}
% new suref command
\newcommand{\suref}[2]{\figurename{} \ref{#1}:(\subref{#2})}
\begin{document} \begin{document}
\section{Simple figures} \section{Simple figures}
\label{sec:simple} \label{sec:simple}
@ -12,4 +18,42 @@ This is a simple figure; see \figurename{} \ref{fig:fig-example}.
\caption{Figure's caption.} \caption{Figure's caption.}
\label{fig:fig-example} \label{fig:fig-example}
\end{figure} \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} \end{document}

+ 12
- 0
4_pgfplots/data.csv View File

@ -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

+ 153
- 0
4_pgfplots/main.tex View File

@ -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}

+ 32
- 1
webinar.org View File

@ -3,7 +3,38 @@
* First day * First day
** Hello world ** Hello world
** Fonts and styles ** 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. - 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

Loading…
Cancel
Save