Skip to content

Instantly share code, notes, and snippets.

@FdelMazo
Last active July 11, 2023 17:22
Show Gist options
  • Save FdelMazo/9f24a7dc9764e0353cec7d60f944a69b to your computer and use it in GitHub Desktop.
Save FdelMazo/9f24a7dc9764e0353cec7d60f944a69b to your computer and use it in GitHub Desktop.
pandoc header.yaml README.md --output informe.pdf

TP1

Introducción

Lorem

ipsum
---
title: |
| ![](https://user-images.githubusercontent.com/25667102/252742149-1a2fb639-e595-4bb5-b49a-01db2ac8376d.png){ width=2.2in }
|
| Trabajo Práctico
subtitle: |
| Facultad de Ingeniería, Universidad de Buenos Aires
| [XX.XX] Materia
date: Fecha
author: Federico del Mazo - 100029
# Multiples autores
# author: |
# | Grupo "x"
# |
# | \texttt{100029} \hspace{37px} del Mazo, Federico
# | \texttt{XXXXXX} \hspace{73px} Otro, Capo
geometry: margin=2.5cm
titlepage: true
toc: true
toc-title: "Índice"
colorlinks: true
urlcolor: RoyalBlue
# 1. Set-up header/footer
# 2. Avoid the 'Figure 1: <Caption>' and just be caption
# 3. Make `text` be in magenta
# 4. Force all images to be placed [h] (avoid blank spaces)
header-includes: |
\usepackage{fancyhdr, xcolor, listings, framed, fvextra, caption, float}
\pagestyle{fancy}
\fancyhead[L]{[XX.XX] Materia \\ del Mazo}
\fancyhead[R]{TP \\ 20XXCX}
\captionsetup[figure]{labelformat=empty}
\let\OldTexttt\texttt
\renewcommand{\texttt}[1]{\OldTexttt{\color{magenta}{#1}}}
\let\origfigure\figure
\let\endorigfigure\endfigure
\renewenvironment{figure}[1][2] {
\expandafter\origfigure\expandafter[H]
} {
\endorigfigure
}
# Make ```lang and >quote be wrapped, with a nice left bar, etc
include-before: |
include-before: |
\newenvironment{leftbar_mod}[1]{
\def\FrameCommand{{\color{#1}\vrule width 1pt} \hspace{10pt}}
\MakeFramed {\advance\hsize-\width \FrameRestore}}
{\endMakeFramed}
\ifcsname Shaded\endcsname
\let\oldshaded\Shaded
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,commandchars=\\\{\}}
\renewenvironment{Shaded}{\begin{leftbar_mod}{magenta}\begin{oldshaded}}{\end{oldshaded}\end{leftbar_mod}}
\else \fi
\let\oldquote\quote
\renewenvironment{quote}{\begin{leftbar_mod}{gray}\begin{oldquote}}{\end{oldquote}\end{leftbar_mod}}
---
informe:
docker run --rm --user="`id -u`:`id -g`" -v `pwd`:/pandoc dalibo/pandocker header.yaml README.md --output informe.pdf
.PHONY: informe
# sudo apt install entr
loop:
ls README.md header.yaml | entr make informe
.PHONY: loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment