Skip to content

Instantly share code, notes, and snippets.

View arthurlevy's full-sized avatar

Arthur Levy arthurlevy

  • Laboratoire de Thermique et Energie de Nantes
  • Nantes, France
View GitHub Profile
@arthurlevy
arthurlevy / makefile
Last active November 27, 2015 13:39
makefile for articles written in LaTeX with LyX
#Name of the main lyx and tex file
ARTICLE = article
#name of the bibliography
BIBLIO = biblio
#path to the mendeley bibliography where it comes from
MENDELEY_DATABASE = ../Bibtex\ Databases/thermostamping.bib
#path to LyX application
@arthurlevy
arthurlevy / graffle2eps.scpt
Created September 17, 2015 12:11
this is an applescript that converts each canvas of an Omnigraffle file into an eps file. Useful for latex integration. Each eps file name is the canvas name. Based on an original idea by Stephen Millard http://www.thoughtasylum.com/blog/2014/4/30/export-all-canvases-in-omnigraffle.html
on run argv
set input to item 1 of argv
--Choose the output folder. Script ends if cancelled
set cwd to do shell script "pwd"
set strOutputDirectory to (get POSIX file (cwd) as string)
set strOutputDirectory to strOutputDirectory & ":"
set fullinput to strOutputDirectory & input
--Drop the file extension
# Replace "search" with "replacement" in "input" (all text)
on replace_string(input, search, replacement)
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to search
set textItems to every text item of input
set AppleScript's text item delimiters to replacement
set res to textItems as string
set AppleScript's text item delimiters to oldDelim
return res
@arthurlevy
arthurlevy / gmsh2pdetoolbox.m
Created April 17, 2014 19:19
converts gmsh mesh to matlab pde toolbox syntax
%GMSH2PDETOOLBOX Reads a mesh in msh format, version 1 or 2 and returns the
%arrays p, e and t according to the MATLAB pde toolbox syntax. Filename
%refers to the .msh file. Note that only triangular 2D mesh are processed
%since these are the only elements allowed in pde toolbox.
%
%SEE ALSO load_gmsh load_gmsh4 initmesh
%
% Copyright (C) 2014 Arthur Levy. https://github.com/arthurlevy/
%
% This fucntion uses the routine load_gmsh4 in load_gmsh2.m: Copyright (C)
% Preview source code
%% LyX 2.0.7 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[3p, review,preprint]{elsarticle}
\usepackage{units}
\usepackage{graphicx}
\makeatletter
The really important git commands:
git init
git add
git commit
git log
git status
git tag
git checkout
git checkout .
@arthurlevy
arthurlevy / gist:9470214
Last active June 18, 2024 17:15
compares two latex files and produces a pdf with differences markup
cp paper.tex new_file.tex
git checkout v1 -- paper.tex
cp paper.tex old_file.tex
latexdiff -t CULINECHBAR --append-safecmd="vect,tens,moy,norm" old_file.tex new_file.tex > diff.tex
latex diff.tex
bibtex diff.aux
latex diff.tex
dvipdfmx -o diff.pdf diff.dvi