# Ryan's Blog

## Latex: add date/time to footer

Posted in Uncategorized by ryanlayer on December 31, 2013
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[R]{\today\ \currenttime} %set date/time on right
\fancyfoot[C]{\thepage} % page in center
\renewcommand{\headrulewidth}{0pt} % remove awful top bar


More at here and MORE here.

Tagged with: , ,

## Metapost Graphs

Posted in latex by ryanlayer on October 24, 2009

Data file: data.d

1 4
2 2
3 1
4 2
5 4

Metapost file:

beginfig(1);
draw begingraph(3in,2in);
gdraw “data.d”;
glabel.bot(btex $x$-axis etex, OUT);
glabel.lft(btex $y$-axis etex, OUT);
glabel.top(btex The graph of $y=f(x)$. etex, OUT);
glabel.rt(btex $y={1\over{4-x^2}}$ etex, 2,3);
endgraph;
endfig;

Tagged with: , ,

## Practical Latex and Metapost Tips

Posted in latex by ryanlayer on October 24, 2009

Found what looks like a great collection of practical Latex and Metapost tips.

http://online.redwoods.cc.ca.us/instruct/darnold/staffdev/

Tagged with: ,

## Handy Latex Metapost Bibtex Makefile

Posted in latex by ryanlayer on October 8, 2009

This Makefile is not the most robust thing in the world, but it is generic enough for me to use on almost all of my documents.  The command you want to run is make FILE=<latex file name without extension>.  If your file is doc.tex, then you will run make FILE=doc.  The assumption here is that the tex, mp, and bib files all have matching names (e.g., doc.tex, doc.mp, and doc.bib).  The Makefile checks to see if the metapost file and bibtex file exist before attempting to process them.  The Makefile creates dvi, ps, and pdf files.

NOTE:  You will have to insert tabs to make this work

MPOSTDIR:=./
BIBDIR:=./
LATEX_OPTS:=-halt-on-error
FILE:=$(strip$(wildcard *.tex))
MPOSTFILE:=$(wildcard$(MPOSTDIR)/$(FILE).mp) BIBFILE:=$(wildcard $(BIBDIR)/$(FILE).bib)
all: pdf

pdf: ps
ps2pdf $(FILE).ps ps: dvi dvips -t letter$(FILE).dvi -o $(FILE).ps dvi: mp bib latex$(LATEX_OPTS) $(FILE).tex quick: mp latex$(LATEX_OPTS) $(FILE).tex dvips$(FILE).dvi -o $(FILE).ps bib: ifdef BIBFILE latex$(LATEX_OPTS) $(FILE).tex bibtex$(BIBDIR)/$(FILE) latex$(LATEX_OPTS) $(FILE).tex endif mp: ifdef MPOSTFILE cd$(MPOSTDIR) && \


Note that the decimal point is replaced by the column separator, & and that the @suppresses the intercolumn space

Tagged with: ,