Use pelican page/static linking

This commit is contained in:
2019-04-24 22:09:24 +05:30
parent bea42a917b
commit 93d25adb20
10 changed files with 12 additions and 12 deletions

View File

@ -32,14 +32,14 @@ De plus, certaines polices (comme
Mais inkscape peut toujours nous servir pour supprimer ces publicités dérangeantes!
En effet, parmi les informations que ce dernier fournit, il donne la position et les dimensions de ces publicités, comme illustré ci-dessous (cliquez pour agrandir):
[![Inkscape pour repérer les dimensions](/examples/inkscape-adblock.png)](/examples/inkscape-adblock.png)
[![Inkscape pour repérer les dimensions]({static}/examples/inkscape-adblock.png)]({static}/examples/inkscape-adblock.png)
**Explications**:
Après avoir ouvert le pdf, on commence par sélectionner la publicité (<span style="color:#8b0074">en violet</span>), il se peut quon ait besoin de dégrouper les objets (ctrl+maj+g).
Ensuite, on fixe les dimensions dans notre unité de mesure favorite, par exemple en cm (<span style="color:#0000ff">en bleu</span>), et finalement noter les dimensions du cadre de la publicité en question (<span style="color:#ff0000">en rouge</span>).
Ensuite, il nous suffit dutiliser LaTeX pour recouvrir la publicité dun voile blanc (ou nimporte quelle couleur de fond, je laisse au lecteur le soin de découvrir comment LaTeX permet dimporter nimporte quellle couleur RGB à laide du paquet [xcolor](https://www.ctan.org/pkg/xcolor)).
Jai déjà utilisé le paquet [wallpaper](https://www.ctan.org/pkg/wallpaper) dans un [autre billet](latex-letterhead.html), mais celui-ci souffre de quelques limitations: il ne permet pas dimporter plusieurs pages (comme sur un billet aller-retour), et tikz interagit mal avec la géométrie de la page induite par wallpaper (ne me demandez pas pourquoi).
Jai déjà utilisé le paquet [wallpaper](https://www.ctan.org/pkg/wallpaper) dans un [autre billet]({filename}latex-letterhead-fr.md), mais celui-ci souffre de quelques limitations: il ne permet pas dimporter plusieurs pages (comme sur un billet aller-retour), et tikz interagit mal avec la géométrie de la page induite par wallpaper (ne me demandez pas pourquoi).
Je me suis donc inspiré de cette [réponse sur stackexchange](https://tex.stackexchange.com/questions/12838/can-i-add-tikzpictures-to-pages-included-with-pdfpages) pour arriver à mes fins.
Pour faire simple, on utilise le package [pdfpages](https://ctan.org/pkg/pdfpages) avec ses options `pages={-}` pour inclure toutes les pages, et `pagecommand` pour inclure rectangle blanc avec les bons positionnements et dimensions `X`, `Y`, `L`, `H`.

View File

@ -26,12 +26,12 @@ Yet more elegant, this approach still has a serious drawback: it breaks the font
But inkscape can still be of use in order to remove those ads.
Indeed, it allows finding the coordinates and the dimensions of those ads as illustrated in the following (click to zoom):
[![Inkscape ad dimensions](/examples/inkscape-adblock.png)](/examples/inkscape-adblock.png)
[![Inkscape ad dimensions]({static}/examples/inkscape-adblock.png)]({static}/examples/inkscape-adblock.png)
**Explanations:** After opening your pdf file, start by selecting the ad (<span style="color:#8b0074">purple</span>), you may have to ungroup elements (`ctrl+shift+g`), then set the dimensions in cm or your favourite length unit (<span style="color:#0000ff">blue</span>) and finally note the dimensions of the ad (<span style="color:#ff0000">red</span>).
Then we just use LaTeX to add a white (or any background color, I let you devise it by yourself, you can use RGB codes with [xcolor](https://www.ctan.org/pkg/xcolor)) rectangle in front of the ad.
I already used the [wallpaper](https://www.ctan.org/pkg/wallpaper) package in [another post](latex-letterhead.html), but it has some limitations: it doesn't allow us to import multiple pages (such as a round-trip ticket), and tikz doesn't interact well with the induced page geometry.
I already used the [wallpaper](https://www.ctan.org/pkg/wallpaper) package in [another post]({filename}latex-letterhead.md), but it has some limitations: it doesn't allow us to import multiple pages (such as a round-trip ticket), and tikz doesn't interact well with the induced page geometry.
Thus, I used this [answer on stackexchange](https://tex.stackexchange.com/questions/12838/can-i-add-tikzpictures-to-pages-included-with-pdfpages).
To put it short, we use the package [pdfpages](https://ctan.org/pkg/pdfpages) with its options `pages={-}` to include every page, and the option `pagecommand` to include the rectangle overlay with the right dimensions `X`, `Y`, `L`, `H`.

View File

@ -20,7 +20,7 @@ Avant de commencer, il faudra trouver une version pdf des modèles de letters. P
Ceci fait, tout repose maintenant sur le paquet [wallpaper](https://www.ctan.org/pkg/wallpaper) pour inclure le modèle de lettre comme font de page, et ensuite jouer avec les [marges](https://ctan.org/pkg/geometry) pour ajuster le tout.
Ainsi voici un exemple minimal avec la [sortie correspondante](examples/background-latex.pdf).
Ainsi voici un exemple minimal avec la [sortie correspondante]({static}/examples/background-latex.pdf).
Bien entendu, remplacez `fond.pdf` par votre fond de page.
Cela peut aussi être adapté à dautres classes, comme [`lettre.cls`](https://ctan.org/pkg/lettre).

View File

@ -19,7 +19,7 @@ As a preliminary, you have to obtain a pdf version of the letterhead (to do so,
Once this is done, the core of this method is to use the [wallpaper](https://www.ctan.org/pkg/wallpaper) package to embed the letterhead as a background image, and then play with margins to make it look nice.
Here follows a minimal example with the [corresponding output](examples/background-latex.pdf). Replace `background.pdf` with your (empty) letterhead of course.
Here follows a minimal example with the [corresponding output]({static}/examples/background-latex.pdf). Replace `background.pdf` with your (empty) letterhead of course.
This can also be adapted to other classes, such as [`letter.cls`](https://ctan.org/pkg/letter).
```tex