|
| 1 | +--- |
| 2 | +id: 109 |
| 3 | +title: Makefile LaTeX |
| 4 | +date: 2005-06-19T19:43:48+00:00 |
| 5 | +author: Régis |
| 6 | +excerpt: "J'ai retrouvé mon Makefile qui permet de produire rapidement des documents écrits en LaTeX." |
| 7 | +layout: post |
| 8 | +guid: http://regis.decamps.free.fr/wordpress/?p=109 |
| 9 | +permalink: /2005/06/makefile-latex/ |
| 10 | +tmac_last_id: |
| 11 | + - "" |
| 12 | +dsq_thread_id: |
| 13 | + - "671540774" |
| 14 | +categories: |
| 15 | + - Informatique |
| 16 | + - Programmation |
| 17 | +--- |
| 18 | +* \`make\` construit le Postscript (Requires latex, glosstex, bibtex, makeindex). |
| 19 | + |
| 20 | +* \`make pdf\` construit le PDF (il est possible de préciser make nomdefichier.pdf) (Also requires For PDF, also requires pstopdf, thumbpdf.) |
| 21 | + |
| 22 | +* \`make pub\` construit le PDF et le copie (avec \`scp\`) sur un répertoire distant. (For publication, requires scp and the corresponnding RSA key for total comfort) |
| 23 | + |
| 24 | +<pre># Makefile for latex project, with glossary, index, and bibliography. |
| 25 | + # Use this Makefile with GNU make to build your PS/PDF document from |
| 26 | + # .tex sources. See bellow for details. |
| 27 | + |
| 28 | + # |
| 29 | + # This program is free software; you can redistribute it and/or |
| 30 | + # modify it under the terms of the GNU General Public License |
| 31 | + # as published by the Free Software Foundation; either version 2 |
| 32 | + # of the License, or (at your option) any later version. |
| 33 | + # |
| 34 | + # This program is distributed in the hope that it will be useful, |
| 35 | + # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 36 | + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 37 | + # GNU General Public License for more details. |
| 38 | + # |
| 39 | + # You should have received a copy of the GNU General Public License |
| 40 | + # along with this program; if not, write to the Free Software |
| 41 | + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 42 | + # |
| 43 | + # Copyright (C) 2003 - Regis Decamps <decamps @ users.sf.net> |
| 44 | + |
| 45 | + ## SYNOPSIS. |
| 46 | + # You sources must compile with latex. |
| 47 | + # Namely, all graphics must be in PS/EPS format. |
| 48 | + # |
| 49 | + # =make= build the PS. |
| 50 | + # =make pdf= builds the PDF. |
| 51 | + # =make pub= builds the PDF and copies the PDF to you remote directory |
| 52 | + # |
| 53 | + # Requires latex, glosstex, bibtex, makeindex. |
| 54 | + # For PDF, also requires pstopdf, thumbpdf. |
| 55 | + # For publication, requires scp. |
| 56 | + |
| 57 | + |
| 58 | + # This is the name of the project (i.e. the source is PROJECT.tex |
| 59 | + # and the PS will be called PROJECT.ps |
| 60 | + # If you don't define this, you can still use =make report.pdf= for instance |
| 61 | + PROJECT= report |
| 62 | + # Where the PDF should be copied with =make pub= |
| 63 | + PUBLISH= rs0.cs.man.ac.uk:public_html/pub |
| 64 | + |
| 65 | + |
| 66 | + # Defines commands. You don't need to change this on a standard Unix |
| 67 | + # distribution. |
| 68 | + LATEX= latex |
| 69 | + DVI2PS= dvips -Ppdf -G0 |
| 70 | + PS2PDF= ps2pdf -dPDFsettings=/prepress |
| 71 | + GLOSSTEX= glosstex |
| 72 | + MAKEINDEX= makeindex |
| 73 | + BIBTEX= bibtex |
| 74 | + THUMBPDF=thumbpdf |
| 75 | + |
| 76 | + ## You don't need to look what's further. |
| 77 | + TEXAUX = *.out *.aux *.lof *.lot *.log *.toc *.glo |
| 78 | + GLOSSTEXAUX = *.gxs *.gxg |
| 79 | + MAKEINDEXAUX = *.glg *.glx *.ilg *.ind *.idx |
| 80 | + BIBTEXAUX = *.bbl *.blg |
| 81 | + THUMBPDFAUX = *.tpt |
| 82 | + |
| 83 | + all: ${PROJECT}.ps |
| 84 | + ps: ${REPORT}.ps |
| 85 | + pdf: ${REPORT}.pdf |
| 86 | + |
| 87 | + clean: |
| 88 | + rm ${TEXAUX} ${GLOSSTEXAUX} ${MAKEINDEXAUX} ${PROJECT}.ps ${REPORT}.pdf ${BIBTEXAUX} ${THUMBPDFAUX} *.dvi *~ |
| 89 | + |
| 90 | + |
| 91 | + # We build a x.pdf file out of the source x.tex |
| 92 | + %.dvi: %.tex %.gdf %.bib *.tex *.bib *.sty |
| 93 | + ${LATEX} $* |
| 94 | + ${BIBTEX} $* |
| 95 | + $(GLOSSTEX) $*.aux $*.gdf |
| 96 | + $(MAKEINDEX) $*.gxs -o $*.glx -s glosstex.ist -t $*.glg |
| 97 | + $(LATEX) $* |
| 98 | + # $(GLOSSTEX) $*.aux $*.gdf |
| 99 | + # $(MAKEINDEX) $*.gxs -o $*.glx -s glosstex.ist -t $*.glg |
| 100 | + $(LATEX) $* |
| 101 | + |
| 102 | + # We build the PS from the DVI |
| 103 | + %.ps: %.dvi *.tex *.bib *.sty |
| 104 | + $(DVI2PS) $*.dvi -o $*.ps |
| 105 | + |
| 106 | + # We build the PDF from the PS |
| 107 | + %.pdf: %.ps *.tex *.bib *.sty |
| 108 | + $(PS2PDF) $*.ps $*.pdf |
| 109 | + ${THUMBPDF} $*.pdf |
| 110 | + |
| 111 | + pub: ${PROJECT}.pdf |
| 112 | + scp ${PROJECT}.pdf ${PUBLISH} |
| 113 | +</pre> |
0 commit comments