Skip to content

Instantly share code, notes, and snippets.

View FedericoTartarini's full-sized avatar

Federico Tartarini FedericoTartarini

View GitHub Profile
@FedericoTartarini
FedericoTartarini / Count Word Macro.text
Created March 8, 2023 07:06
Macro to count words in each heading in Microsoft Word
Sub CountHeadingSpanText()
Application.ScreenUpdating = False
Dim RngHd As Range, h As Long, strOut As String
' h = CLng(InputBox("Input the Heading level (e.g. 1) for the heading spans to count", "Heading Span Word Counter", 1))
' If (h < 1) Or (h > 9) Then Exit Sub
h = 1
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
@FedericoTartarini
FedericoTartarini / flowchart in latex.tex
Created June 26, 2022 10:33
How to create a beautiful flowchart in LaTeX using TikZ.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,arrows.meta}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\begin{document}
\tikzstyle{diam} = [diamond, aspect=2, draw, fill=red!40, text width=6em,text centered ]
@FedericoTartarini
FedericoTartarini / main.tex
Created June 19, 2022 15:02
Create an exam with LaTeX using the exam class
\documentclass[addpoints]{exam}
\usepackage{hyperref}
\usepackage{graphicx}
\pagestyle{headandfoot}
\runningheadrule
\firstpageheader{\includegraphics[width=2cm]{LaTeX_logo.png}}
{First Exam}
{June 19, 2022}
@FedericoTartarini
FedericoTartarini / main.tex
Created June 14, 2022 15:23
How to use the siunitx LaTeX package
\documentclass[12pt]{article}
\usepackage{booktabs}
\usepackage{siunitx}
\sisetup{locale = DE, per-mode = symbol, range-phrase=--, range-units=single, product-units=single}
\begin{document}
\section*{siunitx package}
@FedericoTartarini
FedericoTartarini / main.tex
Created June 14, 2022 15:12
YouTube tutorial on how to draw diagrams (linguistic trees) using LaTeX
\documentclass{article}
\usepackage{forest}
\begin{document}
\pgfmathsetseed{14285}
\begin{center}
\begin{forest}
@FedericoTartarini
FedericoTartarini / latexdiff.md
Last active November 14, 2023 13:57
latexdiff commands YouTube video

Commands shown in the video

latexdiff -h

latexdiff main.tex revision.tex > diff.tex

latexdiff --flatten main.tex revision.tex > diff.tex

latexdiff --flatten -t CTRADITIONAL main.tex revision.tex > diff.tex

@FedericoTartarini
FedericoTartarini / main.tex
Created November 18, 2021 12:36
Curriculum Vitae LaTeX template
\documentclass[a4paper,11pt]{article}
\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage[pdftex]{hyperref}
@FedericoTartarini
FedericoTartarini / plot psycrometric chart.py
Last active September 5, 2023 10:45
how to plot a psychrometric chart using Python
# plot a simple psychrometric chart
import psychrolib
import matplotlib.pyplot as plt
import numpy as np
psychrolib.SetUnitSystem(psychrolib.SI)
pressure = 101325
t_array = np.arange(5, 45, 0.1)
\begin{verbatim}
from pythermalcomfort.models import pmv_ppd
from pythermalcomfort.psychrometrics import v_relative
from pythermalcomfort.utilities import met_typical_tasks
from pythermalcomfort.utilities import clo_individual_garments
# input variables
tdb = 27 # dry-bulb air temperature, [$^{\circ}$C]
tr = 25 # mean radiant temperature, [$^{\circ}$C]
v = 0.1 # average air velocity, [m/s]
@FedericoTartarini
FedericoTartarini / embed_video.tex
Created September 19, 2021 02:29
Embed a video into LaTeX wihout using Flash
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \embedvideo{<poster or text>}{<video file (MP4+H264)>}
% \embedvideo*{...}{...} % auto-play
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[bigfiles]{pdfbase}
\ExplSyntaxOn
\NewDocumentCommand\embedvideo{smm}{
\group_begin:
\leavevmode