Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
fichiers:postscript:afficher_la_sortie_de_metapost_dans_ghostscript [2018/05/24 17:11] – joseph.wright | 5_fichiers:postscript:afficher_la_sortie_de_metapost_dans_ghostscript [2023/12/28 20:18] (Version actuelle) – Remise en forme. jejust | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | --- | + | ====== Displaying MetaPost output in “ghostscript” ====== |
- | section: Graphics | + | |
- | permalink: / | + | |
- | date: 2014-06-10 | + | |
- | --- | + | |
- | # Displaying MetaPost output in `ghostscript` | ||
MetaPost ordinarily expects its output to be included in some context | MetaPost ordinarily expects its output to be included in some context | ||
- | where the '' | + | where the "standard" |
- | defined& | + | defined |
- | debugging your MetaPost code, you may want to view it in a | + | your MetaPost code, you may want to view it in a |
- | [`ghostscript`](http:// | + | '' |
other PostScript) previewer, but note that viewers (even | other PostScript) previewer, but note that viewers (even | ||
- | [`ghostscript`](http:// | + | '' |
- | _don't_ ordinarily have the fonts loaded, and you'll experience | + | have the fonts loaded, and you'll experience an error such as |
- | an error such as | + | < |
- | ```latex | + | |
Error: /undefined in cmmi10 | Error: /undefined in cmmi10 | ||
- | ``` | + | </ |
There is provision in MetaPost for avoiding this problem: issue the | There is provision in MetaPost for avoiding this problem: issue the | ||
- | command | + | command |
Unfortunately, | Unfortunately, | ||
following this command, is incompatible with ordinary use of the | following this command, is incompatible with ordinary use of the | ||
PostScript in inclusions into (La)TeX documents, so it's best to | PostScript in inclusions into (La)TeX documents, so it's best to | ||
- | make the `prologues` command optional. | + | make the '' |
very simple-minded approach to font encoding: since TeX font | very simple-minded approach to font encoding: since TeX font | ||
encodings are anything but simple, encoding of text in diagrams are | encodings are anything but simple, encoding of text in diagrams are | ||
Ligne 31: | Ligne 26: | ||
symptom is that | symptom is that | ||
characters disappear, or are wrongly presented) the solution is | characters disappear, or are wrongly presented) the solution is | ||
- | to view the '' | + | to view the "original" |
- | LaTeX and `dvips`. | + | LaTeX and '' |
- | Conditional compilation may be done either | + | Conditional compilation may be done either by inputting |
- | by inputting | + | indirectly from a simple wrapper |
- | `MyFigureDisplay.mp`: | + | |
- | ```latex | + | < |
prologues := 2; | prologues := 2; | ||
input MyFigure | input MyFigure | ||
- | ``` | + | </ |
or by issuing a shell command such as | or by issuing a shell command such as | ||
- | ```latex | + | |
- | mp '' | + | <code bash> |
- | ``` | + | mp "\prologues: |
- | (which will work without the quote marks if you're not using a Unix | + | </ |
- | shell). | + | (which will work without the quote marks if you're not using a Unix shell). |
A suitable LaTeX route would involve processing | A suitable LaTeX route would involve processing | ||
- | `MyFigure.tex`, which contains: | + | '' |
- | ```latex | + | |
+ | < | ||
\documentclass{article} | \documentclass{article} | ||
\usepackage{graphicx} | \usepackage{graphicx} | ||
Ligne 57: | Ligne 53: | ||
\includegraphics{MyFigure.1} | \includegraphics{MyFigure.1} | ||
\end{document} | \end{document} | ||
- | ``` | + | </ |
- | Processing the resulting DVI file with the `dvips` | + | |
- | command | + | Processing the resulting DVI file with the '' |
- | ```latex | + | <code bash> |
dvips -E -o MyFigure.eps MyFigure | dvips -E -o MyFigure.eps MyFigure | ||
- | ``` | + | </ |
would then give a satisfactory Encapsulated PostScript file. This | would then give a satisfactory Encapsulated PostScript file. This | ||
- | procedure may be automated using the `Perl` script | + | procedure may be automated using the Perl script |
- | `mps2eps`, thus saving a certain amount of tedium. | + | thus saving a certain amount of tedium. |
The Plain TeX user may use an adaptation, by | The Plain TeX user may use an adaptation, by | ||
Dan Luecking, of a jiffy of Knuth' | Dan Luecking, of a jiffy of Knuth' | ||
- | [`mpsproof.tex`](https:// | + | [[ctanpkg> |
- | TeX to produce a DVI file for use with `dvips`, or | + | TeX to produce a DVI file for use with '' |
under pdfTeX to produce a PDF file, direct. | under pdfTeX to produce a PDF file, direct. | ||
set up to look like a proof sheet. | set up to look like a proof sheet. | ||
- | A script application, | + | A script application, |
(La)TeX distributions: | (La)TeX distributions: | ||
PDF from MetaPost, so may reasonably be considered an answer to | PDF from MetaPost, so may reasonably be considered an answer to | ||
- | the question& | + | the question... |
+ | |||
+ | |||
+ | ----- | ||
+ | //Source:// [[faquk> | ||
+ | {{htmlmetatags> | ||
+ | metatag-og: | ||
+ | metatag-og: | ||
+ | }} | ||