Why custom TEX command for labels does not work in MetaPost?











up vote
2
down vote

favorite












I'm trying to use text labels in MetaPost with TeX. The problem is that -tex=... option of MetaPost does not work.



This example works with mpost test.mp:



prologues := 3;
beginfig(1);
label.lrt("e", (0,0));
endfig;
end


This example does not work with mpost -tex=csplain test.mp:



prologues := 3;
beginfig(1);
label.lrt("é", (0,0));
endfig;
end


(csplain is provided by texlive-lang-czechslovak package)



Why -tex=... option of MetaPost does not work?










share|improve this question






















  • Use btex é etex or see 8.2 “Font Map Files” of the manual.
    – Henri Menke
    yesterday












  • @HenriMenke btex ... etex works. Is it possible to use pk fonts? (I get this warning: Warning: font lhr10 cannot be found in any fontmapfile!)
    – Igor Liferenko
    yesterday










  • I'm not a font expert but don't pk fonts only have 128 slots? I don't think they have é encoded. Also if you're not using btex ... etex MetaPost does not need a TeX engine and the parameter -tex=csplain is ignored.
    – Henri Menke
    yesterday












  • @HenriMenke pk fonts can use 256 slots; for example, to use pk-variant of é, run csplain test.tex + dvips test with the following ~/.dvipsrc: p /dev/null
    – Igor Liferenko
    yesterday










  • @HenriMenke The number of slots is just a function of the encoding. T1 has 256. OT1 has 128. (Just examples.) That's just the TFM stuff. What kind of thing tells TeX what goes in the boxes the TFM describes is another matter.
    – cfr
    19 hours ago















up vote
2
down vote

favorite












I'm trying to use text labels in MetaPost with TeX. The problem is that -tex=... option of MetaPost does not work.



This example works with mpost test.mp:



prologues := 3;
beginfig(1);
label.lrt("e", (0,0));
endfig;
end


This example does not work with mpost -tex=csplain test.mp:



prologues := 3;
beginfig(1);
label.lrt("é", (0,0));
endfig;
end


(csplain is provided by texlive-lang-czechslovak package)



Why -tex=... option of MetaPost does not work?










share|improve this question






















  • Use btex é etex or see 8.2 “Font Map Files” of the manual.
    – Henri Menke
    yesterday












  • @HenriMenke btex ... etex works. Is it possible to use pk fonts? (I get this warning: Warning: font lhr10 cannot be found in any fontmapfile!)
    – Igor Liferenko
    yesterday










  • I'm not a font expert but don't pk fonts only have 128 slots? I don't think they have é encoded. Also if you're not using btex ... etex MetaPost does not need a TeX engine and the parameter -tex=csplain is ignored.
    – Henri Menke
    yesterday












  • @HenriMenke pk fonts can use 256 slots; for example, to use pk-variant of é, run csplain test.tex + dvips test with the following ~/.dvipsrc: p /dev/null
    – Igor Liferenko
    yesterday










  • @HenriMenke The number of slots is just a function of the encoding. T1 has 256. OT1 has 128. (Just examples.) That's just the TFM stuff. What kind of thing tells TeX what goes in the boxes the TFM describes is another matter.
    – cfr
    19 hours ago













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I'm trying to use text labels in MetaPost with TeX. The problem is that -tex=... option of MetaPost does not work.



This example works with mpost test.mp:



prologues := 3;
beginfig(1);
label.lrt("e", (0,0));
endfig;
end


This example does not work with mpost -tex=csplain test.mp:



prologues := 3;
beginfig(1);
label.lrt("é", (0,0));
endfig;
end


(csplain is provided by texlive-lang-czechslovak package)



Why -tex=... option of MetaPost does not work?










share|improve this question













I'm trying to use text labels in MetaPost with TeX. The problem is that -tex=... option of MetaPost does not work.



This example works with mpost test.mp:



prologues := 3;
beginfig(1);
label.lrt("e", (0,0));
endfig;
end


This example does not work with mpost -tex=csplain test.mp:



prologues := 3;
beginfig(1);
label.lrt("é", (0,0));
endfig;
end


(csplain is provided by texlive-lang-czechslovak package)



Why -tex=... option of MetaPost does not work?







metapost






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









Igor Liferenko

2,025729




2,025729












  • Use btex é etex or see 8.2 “Font Map Files” of the manual.
    – Henri Menke
    yesterday












  • @HenriMenke btex ... etex works. Is it possible to use pk fonts? (I get this warning: Warning: font lhr10 cannot be found in any fontmapfile!)
    – Igor Liferenko
    yesterday










  • I'm not a font expert but don't pk fonts only have 128 slots? I don't think they have é encoded. Also if you're not using btex ... etex MetaPost does not need a TeX engine and the parameter -tex=csplain is ignored.
    – Henri Menke
    yesterday












  • @HenriMenke pk fonts can use 256 slots; for example, to use pk-variant of é, run csplain test.tex + dvips test with the following ~/.dvipsrc: p /dev/null
    – Igor Liferenko
    yesterday










  • @HenriMenke The number of slots is just a function of the encoding. T1 has 256. OT1 has 128. (Just examples.) That's just the TFM stuff. What kind of thing tells TeX what goes in the boxes the TFM describes is another matter.
    – cfr
    19 hours ago


















  • Use btex é etex or see 8.2 “Font Map Files” of the manual.
    – Henri Menke
    yesterday












  • @HenriMenke btex ... etex works. Is it possible to use pk fonts? (I get this warning: Warning: font lhr10 cannot be found in any fontmapfile!)
    – Igor Liferenko
    yesterday










  • I'm not a font expert but don't pk fonts only have 128 slots? I don't think they have é encoded. Also if you're not using btex ... etex MetaPost does not need a TeX engine and the parameter -tex=csplain is ignored.
    – Henri Menke
    yesterday












  • @HenriMenke pk fonts can use 256 slots; for example, to use pk-variant of é, run csplain test.tex + dvips test with the following ~/.dvipsrc: p /dev/null
    – Igor Liferenko
    yesterday










  • @HenriMenke The number of slots is just a function of the encoding. T1 has 256. OT1 has 128. (Just examples.) That's just the TFM stuff. What kind of thing tells TeX what goes in the boxes the TFM describes is another matter.
    – cfr
    19 hours ago
















Use btex é etex or see 8.2 “Font Map Files” of the manual.
– Henri Menke
yesterday






Use btex é etex or see 8.2 “Font Map Files” of the manual.
– Henri Menke
yesterday














@HenriMenke btex ... etex works. Is it possible to use pk fonts? (I get this warning: Warning: font lhr10 cannot be found in any fontmapfile!)
– Igor Liferenko
yesterday




@HenriMenke btex ... etex works. Is it possible to use pk fonts? (I get this warning: Warning: font lhr10 cannot be found in any fontmapfile!)
– Igor Liferenko
yesterday












I'm not a font expert but don't pk fonts only have 128 slots? I don't think they have é encoded. Also if you're not using btex ... etex MetaPost does not need a TeX engine and the parameter -tex=csplain is ignored.
– Henri Menke
yesterday






I'm not a font expert but don't pk fonts only have 128 slots? I don't think they have é encoded. Also if you're not using btex ... etex MetaPost does not need a TeX engine and the parameter -tex=csplain is ignored.
– Henri Menke
yesterday














@HenriMenke pk fonts can use 256 slots; for example, to use pk-variant of é, run csplain test.tex + dvips test with the following ~/.dvipsrc: p /dev/null
– Igor Liferenko
yesterday




@HenriMenke pk fonts can use 256 slots; for example, to use pk-variant of é, run csplain test.tex + dvips test with the following ~/.dvipsrc: p /dev/null
– Igor Liferenko
yesterday












@HenriMenke The number of slots is just a function of the encoding. T1 has 256. OT1 has 128. (Just examples.) That's just the TFM stuff. What kind of thing tells TeX what goes in the boxes the TFM describes is another matter.
– cfr
19 hours ago




@HenriMenke The number of slots is just a function of the encoding. T1 has 256. OT1 has 128. (Just examples.) That's just the TFM stuff. What kind of thing tells TeX what goes in the boxes the TFM describes is another matter.
– cfr
19 hours ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










If you don't want to escape to TeX you have to use a font which has this glyph, e.g. texnansi-lmr10. It is important that the input file is encoded in ISO Latin 1.



prologues := 3;
defaultfont := "texnansi-lmr10";
beginfig(1);
label.lrt("é", (0,0));
endfig;
end


It is probably easier to just typeset the labels with TeX by using (as you showed in the question) mpost -tex=csplain test.mp. In this case the file must be encoded in UTF-8.



prologues := 3;
beginfig(1);
label.lrt(btex é etex, (0,0));
endfig;
end


For more info see chapter 9 “Traditional labels and annotations” of Toby Thurston's excellent “Drawing with MetaPost” (PDF).






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460225%2fwhy-custom-tex-command-for-labels-does-not-work-in-metapost%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    If you don't want to escape to TeX you have to use a font which has this glyph, e.g. texnansi-lmr10. It is important that the input file is encoded in ISO Latin 1.



    prologues := 3;
    defaultfont := "texnansi-lmr10";
    beginfig(1);
    label.lrt("é", (0,0));
    endfig;
    end


    It is probably easier to just typeset the labels with TeX by using (as you showed in the question) mpost -tex=csplain test.mp. In this case the file must be encoded in UTF-8.



    prologues := 3;
    beginfig(1);
    label.lrt(btex é etex, (0,0));
    endfig;
    end


    For more info see chapter 9 “Traditional labels and annotations” of Toby Thurston's excellent “Drawing with MetaPost” (PDF).






    share|improve this answer

























      up vote
      3
      down vote



      accepted










      If you don't want to escape to TeX you have to use a font which has this glyph, e.g. texnansi-lmr10. It is important that the input file is encoded in ISO Latin 1.



      prologues := 3;
      defaultfont := "texnansi-lmr10";
      beginfig(1);
      label.lrt("é", (0,0));
      endfig;
      end


      It is probably easier to just typeset the labels with TeX by using (as you showed in the question) mpost -tex=csplain test.mp. In this case the file must be encoded in UTF-8.



      prologues := 3;
      beginfig(1);
      label.lrt(btex é etex, (0,0));
      endfig;
      end


      For more info see chapter 9 “Traditional labels and annotations” of Toby Thurston's excellent “Drawing with MetaPost” (PDF).






      share|improve this answer























        up vote
        3
        down vote



        accepted







        up vote
        3
        down vote



        accepted






        If you don't want to escape to TeX you have to use a font which has this glyph, e.g. texnansi-lmr10. It is important that the input file is encoded in ISO Latin 1.



        prologues := 3;
        defaultfont := "texnansi-lmr10";
        beginfig(1);
        label.lrt("é", (0,0));
        endfig;
        end


        It is probably easier to just typeset the labels with TeX by using (as you showed in the question) mpost -tex=csplain test.mp. In this case the file must be encoded in UTF-8.



        prologues := 3;
        beginfig(1);
        label.lrt(btex é etex, (0,0));
        endfig;
        end


        For more info see chapter 9 “Traditional labels and annotations” of Toby Thurston's excellent “Drawing with MetaPost” (PDF).






        share|improve this answer












        If you don't want to escape to TeX you have to use a font which has this glyph, e.g. texnansi-lmr10. It is important that the input file is encoded in ISO Latin 1.



        prologues := 3;
        defaultfont := "texnansi-lmr10";
        beginfig(1);
        label.lrt("é", (0,0));
        endfig;
        end


        It is probably easier to just typeset the labels with TeX by using (as you showed in the question) mpost -tex=csplain test.mp. In this case the file must be encoded in UTF-8.



        prologues := 3;
        beginfig(1);
        label.lrt(btex é etex, (0,0));
        endfig;
        end


        For more info see chapter 9 “Traditional labels and annotations” of Toby Thurston's excellent “Drawing with MetaPost” (PDF).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        Henri Menke

        67k7148255




        67k7148255






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460225%2fwhy-custom-tex-command-for-labels-does-not-work-in-metapost%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            サソリ

            広島県道265号伴広島線

            Setup Asymptote in Texstudio