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

Monday, June 23, 2014

latex resizebox in a minipage for tabular with a caption

We can put tabular to resizebox to easily resize a table in latex. 

If it's in a minipage environment, we might need caption package to add captions. 

Thursday, March 6, 2014

backref put page number in the reference list

\usepackage[pagebackref]{hyperref}

Sunday, July 3, 2011

obtain a figure file list from a tex file using grep and sed: new version

#!/bin/bash 

# to get a list of pdf files included in a tex file 
# echo "Usage: $0 {file.name}" 
# echo "Processing file $1"


EXPECTED_ARGS=1
E_BADARGS=65

if [ $# -ne $EXPECTED_ARGS ]
then
  echo "Usage: `basename $0` {tex.file}"
  exit $E_BADARGS
fi

tmpfile=`mktemp -p . exttmp.XXXX`

grep includegraphics $1 > $tmpfile
# sed -e 's/includegraphics/  /' -e 's/[\\{}]//g' -e 's/\[.*\]//g' -e 's/[^ ]\+//' -e 's/^ \+//' < $tmpfile 

# this one is much better than the above 
sed -e 's/.*{\(.*\.pdf\)}.*/\1/' < $tmpfile

if [ -f "$tmpfile" ]
then
    rm "$tmpfile"
fi

tmpfile=`mktemp -p . exttmp.XXXX`

grep includegraphics $1 > $tmpfile
sed -e 's/includegraphics/  /' -e 's/[\\{}]//g' -e 's/\[.*\]//g' -e 's/[^ ]\+//' -e 's/^ \+//' < $tmpfile

if [ -f "$tmpfile" ]
then
    rm "$tmpfile"
fi

#
# the includegraphics must be at the same line with the pdf or other figure files included. 

Wednesday, January 12, 2011

pdfcrop2 absolute mode

using pdfcrop2 under absolute mode,
you can crop from any rectangular area from a pdf file: paper size - margins  

Tuesday, December 28, 2010

beamer bullets for table of contents

%\setbeamertemplate{sections/subsections in toc}[ball]
\setbeamertemplate{subsection in toc}[ball]
%ref: beamer class user guide

beamer is not good in the sense that it took me quite a long to figure
out how to put some bullets in the table of contents.

beamer installation place on ubuntu

/usr/share/texmf/tex/latex/beamer

it might be help when we need to know where beamer and other classes
files are located.


and use
texhash
mktexlsr

to remake the indices for texlive

Saturday, October 9, 2010

Tuesday, September 16, 2008

LaTeX -- pdfcrop

TeX/LateX and related tips
1. Using pdfcrop to crop pdf so that some figures of pdf format can be
included with appropriate margins

Usage:
pdfcrop --margins 10 input.pdf output.pdf
pdfcrop --margins '5 10 5 20' --clip input.pdf output.pd

--TeX file--
\includegraphics{a.pdf}