Affichage des articles dont le libellé est latex. Afficher tous les articles
Affichage des articles dont le libellé est latex. Afficher tous les articles

dimanche 27 janvier 2013

PDF reduce size of file


Pour réduire la taille d'un pdf, en utilisant ghostscript :

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=OUT.pdf CV.pdf
 
 
Source : http://www.fiat-tux.fr/fr/2010/12/reduire-la-taille-dun-pdf/ 

vendredi 30 novembre 2012

LaTeX tip & tricks

I recently discovered the "trim" option of the includegraphics command :
\includegraphics[trim=Wcm Xcm Ycm Zcm]{image-file}
%left bottom right top
Will remove Wcm on the left, Xon the bottom side, Ycm on the right side, and Zcm on the top side. Be careful when trim AND angle are used at the same time !

LaTeX template pour document littéraire

Having to edit a document of a friend studying "art history" and "english language", I created this LaTeX template after some research on the bibliography styles needed for those fields. The bib style needed was : MLA. The default MLA install of LaTeX didn't match what was expected, and I found mla-good.bst. You can download it here : http://www.reed.edu/cis/help/latex/images/mla-good.bst.zip or here : http://pastebin.com/bBg7CUkM (and others styles : http://www.reed.edu/cis/help/latex/bibtexstyles.html).
%% LaTeX Template for littérature student, using article class and mla-good.bst 
%% by : Corentin Mehat (30 Novembre 2012)

%% compile it using :
%%    "rubber -d "
%% or "pdflatex ; bibtex ; pdflatex "

\documentclass[12pt, a4paper]{article}%  font, a4paper : paper size
\usepackage{fullpage} % reduce the default margin

\usepackage[utf8]{inputenc} % encoding : UTF8
\usepackage[T1]{fontenc} % fonts
\usepackage{lmodern} % to avoid the use of bitmap fonts.
\usepackage{amsmath} % math for "XV$^{ème}$ siècle"
\usepackage{amssymb} % math

\usepackage{graphicx} % Deal with external images (cf. template code at the end)

%\usepackage{setspace} % spacing lines
%\doublespacing
%\onehalfspacing
%\setstretch{baselinestretch}



\usepackage[english]{babel} % English hyphenation
%\usepackage[french]{babel} % French hyphenation

\usepackage[round, authoryear, sectionbib]{natbib} % Deal with the references & Bibliography

% To generate the bib file on the first compilation of this file. Run BibLaTeX over it after, and recompile
%code in the next begin/end must be a well formed bibtex file
\begin{filecontents}{outputed-biblio-file.bib}
\end{filecontents}


% For  "TODO" notes : \todo{...} or \todo[inline]{...}
\usepackage[disable]{todonotes} %disable
%\usepackage[french,colorinlistoftodos]{todonotes} %enable


%
\usepackage[a4paper,colorlinks,plainpages=false,pdftex,backref]{hyperref}
 \hypersetup{
     unicode=false,          % non-Latin characters in Acrobat’s bookmarks
     pdftoolbar=true,        % show Acrobat’s toolbar?
     pdfmenubar=true,        % show Acrobat’s menu?
     pdffitwindow=true,      % page fit to window when opened
     colorlinks=true,        % false: boxed links; true: colored links
     linkcolor=blue,         % color of internal links
     citecolor=green,        % color of links to bibliography
     filecolor=magenta,      % color of file links
     urlcolor=cyan,          % color of external links
     linktocpage=true,       % make page number, not text, be link in TOC, LOF and LOT
     breaklinks=true,        % allow links to break over lines
     pdfkeywords={keywork1, keyword2}, % list of keywords
     pdftitle={Document Title (not printed, but in the pdf file)},
     pdfauthor={Author of the document (not printed, but in the pdf file)},
     pdfsubject={Subject of the document (not printed, but in the pdf file)}
 }

\title{Title}
\author{author}
\date{\today} %

% % % % % % %%% BEGIN DOCUMENT
\begin{document}

%\newcommand{\test}{THIS IS A TEST} %macro/command example


\maketitle
%\tableofcontents
\begin{abstract}
You can write your introduction / Abstract / Résumé of the doc here.
\end{abstract}

Write your document here

% Organise your document with : (put the section title into the '{}' )
%\section*{} % will not be numbered
%\section{} % will be numbered
%\subsection*{}
%\subsubsection{}



\begin{figure}
\begin{center}
%\includegraphics*[trim= 0cm 0cm 0cm 0cm, angle=0,scale=0.45]{file-name}
\caption{cartel of the image}
\label{fig:a-unique-name} %in the text : \ref{fig:a-unique-name}
\end{center}
\end{figure}

% % % % BIBLIOGRAPHY
\newpage 

\renewcommand\refname{Bibliography} % Change the bibliography heading title

% Use the "mla-good.bst" style file for bibliography (same directory, or installed where it should)
\bibliographystyle{mla-good} % for MLA bibliography style
\bibliography{outputed-biblio-file} % Use the outputted file for the ref.

\nocite{*} %include all refs from the file (not only the one \citeX{key}

\end{document}

mardi 22 juin 2010

snippets latex beamer (by Tom P.)


\mode
% Par opposition au mode article qui permet de faire des notes de lectures à
partir d'une présentation



\usepackage{comment}
% Purpose:
% selectively in/exclude pieces of text: the user can define new
% comment versions, and each is controlled separately.
% Special comments can be defined where the user specifies the
% action that is to be taken with each comment line.



\usepackage{colortbl}
% The colortbl package:
% Add colour to LaTeX tables. Requires array and color packages.
% Process colortbl.ins to produce the package file colortbl.sty.
% Process colortbl.dtx to get the documentation (this requires
% longtable hhline and dcolumn from the standard `tools'
% distribution.)



\selectcolormodel{gray}
% Mettre les slides en nuances de gris
\usepackage{pgfpages}
% package nécessaire pour mettre plusieurs slides par pages
\pgfpagesuselayout{8 on 1}[a4paper,border shrink=5mm]
% Combien de slides par page
\pgfpageslogicalpageoptions{1}{border
code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
\pgfpageslogicalpageoptions{2}{border
code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
\pgfpageslogicalpageoptions{3}{border
code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
\pgfpageslogicalpageoptions{4}{border
code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
\pgfpageslogicalpageoptions{5}{border
code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
\pgfpageslogicalpageoptions{6}{border
code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
\pgfpageslogicalpageoptions{7}{border
code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
\pgfpageslogicalpageoptions{8}{border
code=\pgfsetlinewidth{1.5bp}\pgfusepath{stroke},corner width=4mm}
% Mettre des cadres autour des slides et un petit coin noir



\PrerenderUnicode{é}
\PrerenderUnicode{à}
\PrerenderUnicode{œ}
% Pour avoir ces caractères unicode dans les titres des slides sans refaire
une passe latex supplémentaire



\bsc
%babel propose la commande \bsc pour placer un bout de texte en petites
%capitales. Cela peut être pratique pour les acronymes, siglaisons et les noms
%propres.



% Macro de A. Kassi (alain.kessi@psi.ch)
\makeatletter
\def\hlinewd#1{%
\noalign{\ifnum0=`}\fi\hrule \@height #1 %
\futurelet\reserved@a\@xhline
}
\makeatother
% modifie l'épaisseur d'un trait dans un tableau
%Exemple :
%\begin{tabular}{|l|r|} \hline
% premier & 1 \\ \hline
% second & 2 \\ \hlinewd{5pt}
% total & 3 \\ \hline
%\end{tabular}
%%%% fin exemple %%%%




Enjoy :)

Tom

vendredi 23 avril 2010

LaTeX et .bib (fichiers de bibliographie)

Le code LaTeX à utiliser


Dans l'entête :




% \usepackage{natbib} % pour changer l'affichage des citations
% \usepackage[fixlanguage]{babelbib} % biblio FR
% \selectbiblanguage{french} % biblio FR


Là où l'on souhaite intégrer la bibliographie



Dans le document (note que comme d'hab en LaTeX tu n'as pas besoin de
mettre l'exention du fichier, en l'occurence tu auras typiquement
"fichier.bib" à la place de "bibtexfile"


% \bibliographystyle{unsrt} % biblio style classique
% \bibliographystyle{babplain-lf} % Biblio FR
% \bibliography{bibtexfile} % Chemin vers la base de citations


Un peu de doc (entre autre) :
http://www.ctan.org/tex-archive/macros/latex/contrib/natbib/



Logiciels pour gérer la biblio



Il y en a de nombreux dont un en java qui marche pas trop mal mais dont le nom m'échappe.

J'utilise pybliographer / pybliographic , qui a le mérite de permettre l'édition native des .bib directement.

mardi 2 juin 2009

Rubber : a LaTeX processing tool

I still have to test it with other .tex files, but I just discovered and tried "rubber", and LaTeX compilation seems to be pretty fast (for an 8 pages document).


It seems that it proposes a tool that compiles and analyses the LaTeX source file to generate either a ps, pdf or dvi, and to run the needed tools : makeindex, bibtex, etc. and all by itself without having to write a complicated makefile.



From "rubber" man pages :

NAME
rubber - a building system for LaTeX documents

SYNOPSIS
rubber [options] sources ...
rubber-pipe [options]

DESCRIPTION
Rubber is a wrapper for LaTeX and companion programs. Its purpose is,
given a LaTeX source to process, to compile it enough times to resolve
all references, possibly running satellite programs such as BibTeX,
makeindex, Metapost, etc. to produce appropriate data files.

The command rubber builds the specified documents completely. The
source files may be either LaTeX sources (in which case the suffix .tex
may be omitted) or documents in a format Rubber knows how to translate
into LaTeX (this currently means CWEB or Literate Haskell documents).
If one compilation fails, the whole process stops, including the compi‐
lation of the next documents on the command line, and rubber returns a
non-zero exit code.


Some Links :

lundi 21 mai 2007

Truander les citations...

Truander les citations

c'est a dire faire apparaître toutes les citations presentes dans votre bib file, qu'elles soient utilisées ou non.

grep -e @[A-Za-z]*{ biblio.bib | awk -F '{' '{print $2}' \
| awk -F ',' '{print "\\nocite{" $1"}" }'
Il est possible qu'il faille enlever la première référence. Un conseil : ne pas utiliser l'option "backpageref" du package hyperref si l'on ne souhaite pas indiquer que certains papiers référencés ne sont en fait pas cités.