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

Thursday, January 22, 2015

Install latex on Mac Part 2

Do not install latex using
sudo port install texlive-latex-extra
sudo port install texlive +full

Download MacTex.pkg and install it.

But download it from here: http://www.ctan.org/tex-archive/systems/mac/mactex/
Not here: http://www.tug.org/mactex/
Because it is fast for the first link.


After install it, the pdflatex is installed under /usr/texbin/pdflatex

While the port install the latex under /opt/local/bin/pdflatex
libararies /opt/local/share/texmf-texlive/

If we install both, just delete the pdflatex command from /opt/local/bin, then the system will use the pdflatex under /usr/textbin/


Monday, December 2, 2013

compile latex

two ways:
1. use pdflatex: compile latex to pdf
$latexpdf main.tex

this method does not work well with .eps images

2. use latex: compile latex to dvi; then use dvipdfm: compile dvi to pdf
$latex main.tex
$dvipdfm main.dvi

bibtex main.tex generates all of the .bbl. you can manually put it in the main.tex


sample Makefile for method 1
TARGETS = main

LATEX = pdflatex
BIBTEX = bibtex

all:    $(TARGETS) debug

$(TARGETS):
$(LATEX) $@
$(BIBTEX) $@ > $(BIBTEX)_out.log


debug:
-grep Warning *.log
clean:  

rm -f images/*.aux images/*~ images/*.log *.aux *.bbl *.blg *.log *.dvi *.bak *~ $(TARGETS:%=%.pdf)

sample Makefile for method 2
TARGETS = main

LATEX = latex
DVIPDFM = dvipdfm
BIBTEX = bibtex

all:    $(TARGETS) debug

$(TARGETS):
$(LATEX) $@
-$(BIBTEX) $@ > $(BIBTEX)_out.log
$(DVIPDFM) $@

debug:
-grep Warning *.log
clean:  

rm -f *.aux images/*.aux *.bbl *.blg *.log images/*.log *.dvi *.bak *~ $(TARGETS:%=%.pdf)





Monday, July 22, 2013

Tips of bibliography in Latex

include bibliography in main.tex

\bibliographystyle{abbrv}
\bibliographystyle{acm}
\bibliographystyle{plain}
\bibliographystyle{IEEEtran}  

\bibliography{bibliography/biosbib}

URL: 

You can put it in URL field, but it only shows on IEEE format (IEEEtran), it does not show up for other format. You have to move url to HowPublished field.

For example:
\url{www.windbg.org}

Please remember to include \usepackage{url} in the main.tex

Misc:

Sometimes, you don't know the author of the reference, and the author is a group name. In this case, you need to add a curly brace out side of the group name, and the bibtex will not threat it as human names.

For example:
@MISC{tboot,
  author = {{Trust Computing Group}},
  title = {{Trusted Boot}},
  howpublished = {\url{http://www.trustedcomputinggroup.org/resources/trusted_boot}},
  owner = {fengwei},
  timestamp = {2013.05.03}
}

If you don't add curly brace, it will treat the word "group" as the last name, and order the reference based on that.


Thursday, February 7, 2013

Check Mark in Latex


\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont

\verb|\checkmark|: \checkmark \par
\verb|\cmark|: \cmark \par
\verb|\xmark|: \xmark
http://tex.stackexchange.com/questions/42619/x-mark-to-match-checkmark

Monday, January 7, 2013

set axis tick labels in TikZ


xtick={50000,60000,70000,80000,90000,100000,110000,120000,130000,140000}, at axis options

http://tex.stackexchange.com/questions/46793/axis-tick-numbers-overlap-in-tikz

e.g.


\begin{axis}[
height=2in,
width=3in,
xmin=0,
ymin=0,
xlabel={Packet Size / KB},
ylabel={Time / million CPU cycles},
xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},
ytick={20,40,60,80,100,120},
font=\small,
title={},
legend style={at={(0,0)}, anchor=south west}
]

Saturday, November 3, 2012

Draw picture using Tikz package

Example: http://www.texample.net/tikz/examples/
Manual: http://paws.wcu.edu/tsfoguel/tikzpgfmanual.pdf

Latex Basics

http://en.wikibooks.org/wiki/LaTeX/Basics

E.g. documentclass available options:
Document Classes
articlefor articles in scientific journals, presentations, short reports, program documentation, invitations, ...
IEEEtranfor articles with the IEEE Transactions format.
proca class for proceedings based on the article class.
minimalis as small as it can get. It only sets a page size and a base font. It is mainly used for debugging purposes.
reportfor longer reports containing several chapters, small books, thesis, ...
bookfor real books
slidesfor slides. The class uses big sans serif letters.
memoirfor changing sensibly the output of the document. It is based on the book class, but you can create any kind of document with it [1]
letterfor writing letters.
beamerfor writing presentations (see LaTeX/Presentations).

Sunday, August 5, 2012

Latex draw diagram

Use tikz

http://tex.stackexchange.com/questions/8879/draw-image-data-flow


Wednesday, February 1, 2012

comment package cannot be used by latexdiff

main.tex
\usepackage{comment}

background.tex


\begin{comment}

\end{comment}

if run command at article-latexdiff
error message:
File ended while scanning use of \next.

Need to remove

\begin{comment}

\end{comment}



Thursday, December 1, 2011

latexdiff for Paper in PDF

1. Install the latexdiff
http://fengweizhang.blogspot.com/2010/12/subversion-latex.html

2. run: 
$ latexdiff -t CFONT --flatten ../HC-4/main.tex main.tex > doc.tex

-t CFONT: type of latexdiff
--flatten: reversal of directory
../HC-4/main.tex: old version of main.tex of paper
main.tex: new version
doc.tex: output file

3. run: 
$ pdflatex doc.tex 
if reference cannot show, change the makefile from main to doc

compile the tex file and generate the pdf file

Other option(doesn't work on my Mac):
$ latexdiff-vc -t CFONT --fatten --svn -r 7 main.tex --pdf
latexdiff-vc: combine latexdiff and version control
-t CFONT: type
--fatten: reversal of directory
--svn: version control type
-r 7: compare to old version 7
main.tex: current version
--pdf: run pdflatex to generate pdf

more info:
http://helpful.knobs-dials.com/index.php/Latexdiff
http://web.njit.edu/all_topics/Prog_Lang_Docs/pdf/latexdiff/latexdiff-man.pdf

Sunday, November 27, 2011

Latex Table Example

http://en.wikibooks.org/wiki/LaTeX/Tables

Thursday, November 24, 2011

Excel to Latex

http://dataninja.wordpress.com/2006/01/20/excel-to-latex/

1. download add-in, install it in the excel (office 2007 on mac doesn't work, office 2011 works)
Tool-> Add-in

2. select the table, format -> Excel To Latex

3. Copy & paste

Wednesday, November 2, 2011

convert PDF to EPS on Mac

TexShop

  1. Tool in MacTeX.
  2. To convert pdf → eps, open the pdf in TeXShop, choose the "Selection" tool in the Preview window toolbar, select the desired rectangle (or all, either with ⌘-A or manually), choose "Preview>Save Selection to File...", & save as eps

Monday, October 31, 2011

Setup SVN email notification

http://help.joyent.com/index.php?pg=kb.page&id=53

step1:
copy the post-commit.tmpl to file post-commit

step2:
edit post-commit file

comment out
# "$REPOS"/hooks/mailer.py commit "$REPOS" $REV "$REPOS"/mailer.conf

add
/usr/local/bin/svnnotify -r $REV -C -d -H HTML::ColorDiff -p $REPOS -t emailList --from emailList --reply-to emailList

step3:
chomod a+x post-commit

Tuesday, August 30, 2011

latex tip

If there is not make file in the latex directory, use pdflatex tool output PDF from latex.
If it is missing reference, run bibtex tool.

Latex comments: 


1). line comment: %

2). paragraph comment:
add \usepackage{comment} in the main.tex

\begin{comment}

\end{comment}

Sunday, February 13, 2011

latex problems

If you have following problem at ubuntu 10.4

LaTeX Error: File `algorithmic.sty' not found.
 install this:

$sudo apt-get install texlive-science


if you missing:
! LaTeX Error: File `multirow.sty' not found
! LaTeX Error: File `metre.sty' not found


$sudo apt-get install texlive-latex-extra
or
$sudo port install textlive-latex-extra

Tuesday, December 7, 2010

subversion + Latex

subversion repository setup:
Howto: http://fengweizhang.blogspot.com/2011/10/how-to-create-svn-repository.html

remember, you need to set up the ACL permission correctly for your svn repository. so other people could checkout, commit

$svn co svn+ssh://username@servername.com/home/username/svnrepos/file

The idea is setup a projectfile in svn repositary. so memeber could check out the files and write the papers. Then he could commit it.


Latex How-To
Ubuntu: install texlive
$sudo apt-get installl texlive. 

you could use whatever editor you want: Vim
Then find two things:
a tutorail for latex grammer: lshort.pdf
a latex template:

Mac: install latex
sudo port install texlive
OR
install MacTex
http://guides.macrumors.com/Installing_LaTeX_on_a_Mac
or directly download from:
http://www.tug.org/mactex/2011/
But this file is very large.

Updated March 30 2014: 
Install Latex on Mac
1. Go to http://guides.macrumors.com/Installing_LaTeX_on_a_Mac
2. Download MacTeX at http://www.tug.org/mactex/
3. Be Patient, and it is a large file
4. Install it. If you have previous version installed, you can uninstall them by delete /usr/local/texlive
See http://tug.org/mactex/uninstalling.html


CentOS: install tetex
yum install tetex tetex-fonts tetex-dvips tetex-latex ghostscript


EDITOR: You could use VIM, texmaker is good.