Skip to content

Instantly share code, notes, and snippets.

View Ondiz's full-sized avatar

Ondiz Ondiz

View GitHub Profile
@Ondiz
Ondiz / mac.m
Created September 20, 2016 15:10
Pintar matrices MAC en Matlab
function mac(xls,virtualLab)
% Create MAC matrix from data exported to excel
%
% xls: file name
% Xls file shape:
% - 1st row: "Experimental" - 1st column: "Simulation"
% - 2nd row: experimental frequencies - 2nd column: simulation frequencies
% - 3rd row and on: MAC values - 3rd column and on: MAC values
%
@Ondiz
Ondiz / barra.el
Created May 18, 2016 15:33
Barra que marca el ancho de columna en emacs
;; Barra para marcar ancho de columna
(require 'fill-column-indicator) ; cargar paquete
(setq fci-rule-column 80) ; establecer ancho a 80 caracteres
(add-hook 'markdown-mode-hook 'fci-mode) ; cargarlo con el modo markdown
@Ondiz
Ondiz / formato.el
Created May 16, 2016 15:42
Modo de emacs para formato personalizado
(define-derived-mode formato-mode markdown-mode "Formato"
"Modo para formato para personalizado"
;; 2 espacios en lugar de tab
(setq-default indent-tabs-mode nil)
(setq tab-width 2)
;; Líneas de 80 caracteres (79 + \n)
(add-hook 'formato-mode-hook 'turn-on-auto-fill)
(add-hook 'formato-mode-hook
\documentclass[preprint,12pt]{elsarticle}
\usepackage{amssymb,amsmath}
\usepackage{hyperref}
\usepackage{longtable,booktabs}
\usepackage{graphicx,grffile}
\usepackage[utf8]{inputenc}
\usepackage{epstopdf} % convert eps images to pdf
@Ondiz
Ondiz / Makefile
Created April 19, 2016 08:27
Makefile for scientific paper with Markdown
# Markdown files in order of appearance
FILES = paper.md
# Crossref must be before citeproc
all:
pandoc \
--natbib \
@Ondiz
Ondiz / .emacs
Created April 18, 2016 08:16
Modificación al archivo de configuración de Emacs para asignar extensiones a modo concreto
;; Asignar los archivos .latex al modo LaTex
(add-to-list 'auto-mode-alist '("\\.latex\\'" . LaTeX-mode))
@Ondiz
Ondiz / zoomSubplot.m
Last active April 15, 2016 13:36
Apply same zoom to all subplots in Matlab
function zoomSubplot(figNum,r,c,axis,lim1,lim2)
% Same zoom into all subplots:
%
% figNum: number of the figure with subplots
% f: number of rows
% c: number of columns
% axis: axis to synchronise 'x', 'y' or 'xy'
% lim1: limit to axis if single
% lim2: limits to second axis (x and then y)
@Ondiz
Ondiz / toPdf.m
Created April 14, 2016 10:48
Matlab function to export all files in folder to pdf without opening
function toPdf(inputFolder, outputFolder)
% Export all files in folder to pdf without opening
%
% - inputFolder: complete path to folder where fig figures stand
% - outputFolder: complete path to folder to where pdfs should be exported
cd(inputFolder)
files = ls(inputFolder);
@Ondiz
Ondiz / escribir.el
Created March 18, 2016 08:57
Archivo de configuración para escribir en emacs
;; Añadir path
(add-to-list 'load-path "<PATH>")
;; Cargar modo Markdown al inicio
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
@Ondiz
Ondiz / automayuscula.el
Last active March 10, 2016 14:37
Mayúsculas automáticas en emacs
;; Añadir path de los paquetes (si no está ya)
(add-to-list 'load-path "<PATH>")
; Escribir en mayúscula después de punto
(autoload 'auto-capitalize-mode "auto-capitalize"
"Toggle `auto-capitalize' minor mode in this buffer." t)
(autoload 'turn-on-auto-capitalize-mode "auto-capitalize"
"Turn on `auto-capitalize' minor mode in this buffer." t)
(autoload 'enable-auto-capitalize-mode "auto-capitalize"
"Enable `auto-capitalize' minor mode in this buffer." t)