Showing posts with label latex. Show all posts
Showing posts with label latex. Show all posts

Thursday, October 18, 2012

latexdiff - diff latex files

http://www.pppl.gov/~hammett/comp/tex/latexdiff.html

http://packages.ubuntu.com/lucid/latexdiff

$ sudo apt-get install latexdiff

~/bin/latexdiff old.tex new.tex > diff.tex
 
Git commands
 
# get version from 10 commits ago 
git show HEAD~10:chapter1_de.tex > chapter1_de_v1.tex
git diff HEAD HEAD@{10} chapter1_de.tex > diff-head-head10.txt 

Thursday, September 15, 2011

Options for collaborating with LaTeX

http://tex.stackexchange.com/questions/4489/what-is-a-good-strategy-for-obtaining-comments-on-a-latex-document-from-non-latex
http://stackoverflow.com/questions/539791/tips-for-collaboratively-editing-a-latex-document
http://luca.cse.ucsc.edu/Style_guidelines_for_student_co-authors

- use latex2rtf to export it to an rtf file which can be opened in word
- export to PDF and have the PDF edited using Acrobat Pro
- add line numbers, manual e-mail of revisions

both will need some manual editing to apply changes back to latex :(

- or do everything in word first, then make the final submission in latex?

Thursday, April 14, 2011

Metric (TFM) file not found

I tried to use \usepackage{times} to set my document in the times font, I get an error message: "! Font OT1/ptm/m/n/10=ptmr7t at 10.0pt not loadable: Metric (TFM) file not found" Why doesn't it work?

install packages

texlive-fonts-recommended
latex-xtf-fonts
ttf-symbol-replacement

Tuesday, November 9, 2010

Online LaTeX editor

http://www.codecogs.com/latex/eqneditor.php

score = \sum\limits_{i=0}^{o,s,it,d}w_i \cdot \sum\limits_{j=0}^{n_i}(\frac{v_j}{w_j})

Friday, October 22, 2010

LaTeX, Sweave, R

\usepackage{hyperref}
\usepackage{tabularx}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{url}
\usepackage{cite}


$ R CMD Sweave foo.Rnw ; texi2pdf foo.tex

http://www.stat.umn.edu/~charlie/Sweave/
http://www.stat.umn.edu/~charlie/Sweave/foo.pdf
http://www.stat.umn.edu/~charlie/Sweave/foo.Rnw

\pagebreak[3]
\verb@Sweave@

\begin{verbatim}
latex foo
\end{verbatim}


Figure~\ref{fig:one} (p.~\pageref{fig:one})


<>=
plot(x, y)
abline(out1)
@


\begin{figure}
\begin{center}
<>=
<>
@
\end{center}
\caption{Scatter Plot with Regression Line}
\label{fig:one}
\end{figure}



<>=
n <- 50
x <- seq(1, n)
a.true <- 3
b.true <- 1.5
y.true <- a.true + b.true * x
s.true <- 17.3
y <- y.true + s.true * rnorm(n)
out1 <- lm(y ~ x)
summary(out1)
@





The commands in package lattice have different behavior than the standard plot commands in
the base package: lattice commands return an object of class "trellis", the actual plotting is
performed by the print method for the class. Encapsulating calls to lattice functions in print()
statements should do the trick, e.g.:
<>=
library(lattice)
print(bwplot(1:10))
@



BibTeX and bibliography styles

http://amath.colorado.edu/documentation/LaTeX/reference/faq/bibstyles.html

The two Latex editors that I found most useful are:
 1. Texmaker - lightweight, spell-check, have to press F1 and F3 to generate a PDF, need to click on the log window a lot
 2. Kile - nicer, but I couldn't get syntax coloring to work for Sweave, spell-check, one-click gets you a PDF


Trick
- if you rename your '.Rnw' to '.tex' as a work around, it plays nicely with the editors
- then once all formatting is done, copy '.tex' to '.Rnw' and run the command
- or just create a tex symlink to Rnw!   ln -s mydoc.Rnw mydoc.tex

R CMD Sweave mydoc.Rnw && texi2pdf mydoc.tex && evince mydoc.pdf

In R, call
> Stangle(file='foo.Rnw')
to extract the R code, WARNING: this will overwrite 'foo.R'!!!!!