How to include a .bmp image in XeTex using plain TeX source file The Next CEO of Stack OverflowHow to get hanging hyphenation?Producing arXiv-submittable documents with figures using plain TeXWhy is LyX trying to convert every image into eps?Anybody ever encountered “arithmetic: number too big” when importing an image?Attaching files using plain TeX (pdfTeX)moving from old plain TeX to XeTeXPlain TeX and XeTeXUsing Xetex to Include bmp file into document using Plain TeXHow to save a bmp image from the internet for use in XeTeXHow to integrate my macros in ProTEXT

Traduction de « Life is a roller coaster »

Why don't programming languages automatically manage the synchronous/asynchronous problem?

Can this note be analyzed as a non-chord tone?

Does destroying a Lich's phylactery destroy the soul within it?

what's the use of '% to gdp' type of variables?

"Eavesdropping" vs "Listen in on"

Reference request: Grassmannian and Plucker coordinates in type B, C, D

Getting Stale Gas Out of a Gas Tank w/out Dropping the Tank

What was Carter Burkes job for "the company" in "Aliens"?

In the "Harry Potter and the Order of the Phoenix" videogame, what potion is used to sabotage Umbridge's Speakers?

Defamation due to breach of confidentiality

Are the names of these months realistic?

Lucky Feat: How can "more than one creature spend a luck point to influence the outcome of a roll"?

Easy to read palindrome checker

Is there a way to save my career from absolute disaster?

Audio Conversion With ADS1243

Purpose of level-shifter with same in and out voltages

Towers in the ocean; How deep can they be built?

What flight has the highest ratio of timezone difference to flight time?

Why doesn't UK go for the same deal Japan has with EU to resolve Brexit?

How to use ReplaceAll on an expression that contains a rule

Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico

Strength of face-nailed connection for stair steps

Is there a reasonable and studied concept of reduction between regular languages?



How to include a .bmp image in XeTex using plain TeX source file



The Next CEO of Stack OverflowHow to get hanging hyphenation?Producing arXiv-submittable documents with figures using plain TeXWhy is LyX trying to convert every image into eps?Anybody ever encountered “arithmetic: number too big” when importing an image?Attaching files using plain TeX (pdfTeX)moving from old plain TeX to XeTeXPlain TeX and XeTeXUsing Xetex to Include bmp file into document using Plain TeXHow to save a bmp image from the internet for use in XeTeXHow to integrate my macros in ProTEXT










2















Using XeTeX, I would like to insert a bitmap image file which is in .bmp format, or alternatively, the same image in a .jpg format. I am using plain TeX, not LaTeX.



Using PCTeX version 6,



specialbmp:nhsealBW.bmp x=1in y=1in


puts the .bmp image at the current location.



With pdfTeX I was using a set of pdfTeX special commands which are not available in XeTeX:



newboxstateseal

setboxstatesealhboxpdfximage height 1in width 1in nhsealbw.jpg
pdfrefximagepdflastximage


Puts the .jpg image into the box and



copystateseal


inserts it at the current location.



How do I do that in XeTeX?










share|improve this question
























  • Please use 4 spaces to indent code blocks and back ticks for inline code. For blocks, you can highlight them and then click the button or ctrl+k.

    – cfr
    May 1 '16 at 23:54











  • Have you looked at PGF/TikZ? Although it recommends graphicx where that's an option (obviously not here), it also have image inclusion capabilities. You just have to declare the image first, if I remember rightly.

    – cfr
    May 2 '16 at 0:08











  • What would that look like in plain TeX source file? And where does PGF/TikZ come from? Thank you.

    – GAS4
    May 2 '16 at 0:30











  • What do you mean where does it come from? It is part of all standard TeX distributions, like other packages.

    – cfr
    May 2 '16 at 0:44






  • 1





    See section 105 of the manual. Actually, it won't help as you are using XeTeX. If pdfTeX is an option, you can use PGF image declaration and inclusion with plain TeX. Otherwise, it only works with the LaTeX format, apparently.

    – cfr
    May 2 '16 at 0:55
















2















Using XeTeX, I would like to insert a bitmap image file which is in .bmp format, or alternatively, the same image in a .jpg format. I am using plain TeX, not LaTeX.



Using PCTeX version 6,



specialbmp:nhsealBW.bmp x=1in y=1in


puts the .bmp image at the current location.



With pdfTeX I was using a set of pdfTeX special commands which are not available in XeTeX:



newboxstateseal

setboxstatesealhboxpdfximage height 1in width 1in nhsealbw.jpg
pdfrefximagepdflastximage


Puts the .jpg image into the box and



copystateseal


inserts it at the current location.



How do I do that in XeTeX?










share|improve this question
























  • Please use 4 spaces to indent code blocks and back ticks for inline code. For blocks, you can highlight them and then click the button or ctrl+k.

    – cfr
    May 1 '16 at 23:54











  • Have you looked at PGF/TikZ? Although it recommends graphicx where that's an option (obviously not here), it also have image inclusion capabilities. You just have to declare the image first, if I remember rightly.

    – cfr
    May 2 '16 at 0:08











  • What would that look like in plain TeX source file? And where does PGF/TikZ come from? Thank you.

    – GAS4
    May 2 '16 at 0:30











  • What do you mean where does it come from? It is part of all standard TeX distributions, like other packages.

    – cfr
    May 2 '16 at 0:44






  • 1





    See section 105 of the manual. Actually, it won't help as you are using XeTeX. If pdfTeX is an option, you can use PGF image declaration and inclusion with plain TeX. Otherwise, it only works with the LaTeX format, apparently.

    – cfr
    May 2 '16 at 0:55














2












2








2








Using XeTeX, I would like to insert a bitmap image file which is in .bmp format, or alternatively, the same image in a .jpg format. I am using plain TeX, not LaTeX.



Using PCTeX version 6,



specialbmp:nhsealBW.bmp x=1in y=1in


puts the .bmp image at the current location.



With pdfTeX I was using a set of pdfTeX special commands which are not available in XeTeX:



newboxstateseal

setboxstatesealhboxpdfximage height 1in width 1in nhsealbw.jpg
pdfrefximagepdflastximage


Puts the .jpg image into the box and



copystateseal


inserts it at the current location.



How do I do that in XeTeX?










share|improve this question
















Using XeTeX, I would like to insert a bitmap image file which is in .bmp format, or alternatively, the same image in a .jpg format. I am using plain TeX, not LaTeX.



Using PCTeX version 6,



specialbmp:nhsealBW.bmp x=1in y=1in


puts the .bmp image at the current location.



With pdfTeX I was using a set of pdfTeX special commands which are not available in XeTeX:



newboxstateseal

setboxstatesealhboxpdfximage height 1in width 1in nhsealbw.jpg
pdfrefximagepdflastximage


Puts the .jpg image into the box and



copystateseal


inserts it at the current location.



How do I do that in XeTeX?







graphics xetex plain-tex jpeg bitmap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 2 '16 at 4:14









A Feldman

2,5281744




2,5281744










asked May 1 '16 at 23:02









GAS4GAS4

647




647












  • Please use 4 spaces to indent code blocks and back ticks for inline code. For blocks, you can highlight them and then click the button or ctrl+k.

    – cfr
    May 1 '16 at 23:54











  • Have you looked at PGF/TikZ? Although it recommends graphicx where that's an option (obviously not here), it also have image inclusion capabilities. You just have to declare the image first, if I remember rightly.

    – cfr
    May 2 '16 at 0:08











  • What would that look like in plain TeX source file? And where does PGF/TikZ come from? Thank you.

    – GAS4
    May 2 '16 at 0:30











  • What do you mean where does it come from? It is part of all standard TeX distributions, like other packages.

    – cfr
    May 2 '16 at 0:44






  • 1





    See section 105 of the manual. Actually, it won't help as you are using XeTeX. If pdfTeX is an option, you can use PGF image declaration and inclusion with plain TeX. Otherwise, it only works with the LaTeX format, apparently.

    – cfr
    May 2 '16 at 0:55


















  • Please use 4 spaces to indent code blocks and back ticks for inline code. For blocks, you can highlight them and then click the button or ctrl+k.

    – cfr
    May 1 '16 at 23:54











  • Have you looked at PGF/TikZ? Although it recommends graphicx where that's an option (obviously not here), it also have image inclusion capabilities. You just have to declare the image first, if I remember rightly.

    – cfr
    May 2 '16 at 0:08











  • What would that look like in plain TeX source file? And where does PGF/TikZ come from? Thank you.

    – GAS4
    May 2 '16 at 0:30











  • What do you mean where does it come from? It is part of all standard TeX distributions, like other packages.

    – cfr
    May 2 '16 at 0:44






  • 1





    See section 105 of the manual. Actually, it won't help as you are using XeTeX. If pdfTeX is an option, you can use PGF image declaration and inclusion with plain TeX. Otherwise, it only works with the LaTeX format, apparently.

    – cfr
    May 2 '16 at 0:55

















Please use 4 spaces to indent code blocks and back ticks for inline code. For blocks, you can highlight them and then click the button or ctrl+k.

– cfr
May 1 '16 at 23:54





Please use 4 spaces to indent code blocks and back ticks for inline code. For blocks, you can highlight them and then click the button or ctrl+k.

– cfr
May 1 '16 at 23:54













Have you looked at PGF/TikZ? Although it recommends graphicx where that's an option (obviously not here), it also have image inclusion capabilities. You just have to declare the image first, if I remember rightly.

– cfr
May 2 '16 at 0:08





Have you looked at PGF/TikZ? Although it recommends graphicx where that's an option (obviously not here), it also have image inclusion capabilities. You just have to declare the image first, if I remember rightly.

– cfr
May 2 '16 at 0:08













What would that look like in plain TeX source file? And where does PGF/TikZ come from? Thank you.

– GAS4
May 2 '16 at 0:30





What would that look like in plain TeX source file? And where does PGF/TikZ come from? Thank you.

– GAS4
May 2 '16 at 0:30













What do you mean where does it come from? It is part of all standard TeX distributions, like other packages.

– cfr
May 2 '16 at 0:44





What do you mean where does it come from? It is part of all standard TeX distributions, like other packages.

– cfr
May 2 '16 at 0:44




1




1





See section 105 of the manual. Actually, it won't help as you are using XeTeX. If pdfTeX is an option, you can use PGF image declaration and inclusion with plain TeX. Otherwise, it only works with the LaTeX format, apparently.

– cfr
May 2 '16 at 0:55






See section 105 of the manual. Actually, it won't help as you are using XeTeX. If pdfTeX is an option, you can use PGF image declaration and inclusion with plain TeX. Otherwise, it only works with the LaTeX format, apparently.

– cfr
May 2 '16 at 0:55











2 Answers
2






active

oldest

votes


















5














It is possible to use the XeTeX primitives to query the image size and specify the image inclusion to xdvipdfmx driver, but even in plain TeX using system-specific special is painful and makes switching tex engines or drivers more complicated than need be.



You can use the same driver independent image inclusion macros as latex, which are already set up to do the right thing for bmp files with xetex.



enter image description here



from the plain xetex file



input graphicx


a work of art:


includegraphicsman.bmp


bye


where man.bmp is



enter image description here






share|improve this answer























  • But is it a your picture with your hands:-)? +1.

    – Sebastiano
    Aug 25 '18 at 21:27












  • I need to query the image size so I can position the image without trial & error. Using Xetex primitives, can you demonstrate with your example please? Thank you.

    – GAS4
    Sep 12 '18 at 10:44












  • @GAS4 easiest is to use box0hboxincludegraphicsman then use ht0 and wd0 for the height and width. and finally box0 to use the image

    – David Carlisle
    Sep 12 '18 at 12:06












  • @GAS4 I guess you figured it out, but for any future readers, my comment above should start setbox0 not box0

    – David Carlisle
    Sep 12 '18 at 18:01


















0














The simplest way is to:



  1. Convert image_01.bmp to image_01.eps [the imagemagik suite will do this.


  2. Use the following PSTRICKS command
    centerlineepsfysize = 5.0truecmepsfboximage_01.eps


[see do-it-yourself-tex on CTAN for the import PSTRICKS commands, etc]





share























    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',
    autoActivateHeartbeat: false,
    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%2f307370%2fhow-to-include-a-bmp-image-in-xetex-using-plain-tex-source-file%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5














    It is possible to use the XeTeX primitives to query the image size and specify the image inclusion to xdvipdfmx driver, but even in plain TeX using system-specific special is painful and makes switching tex engines or drivers more complicated than need be.



    You can use the same driver independent image inclusion macros as latex, which are already set up to do the right thing for bmp files with xetex.



    enter image description here



    from the plain xetex file



    input graphicx


    a work of art:


    includegraphicsman.bmp


    bye


    where man.bmp is



    enter image description here






    share|improve this answer























    • But is it a your picture with your hands:-)? +1.

      – Sebastiano
      Aug 25 '18 at 21:27












    • I need to query the image size so I can position the image without trial & error. Using Xetex primitives, can you demonstrate with your example please? Thank you.

      – GAS4
      Sep 12 '18 at 10:44












    • @GAS4 easiest is to use box0hboxincludegraphicsman then use ht0 and wd0 for the height and width. and finally box0 to use the image

      – David Carlisle
      Sep 12 '18 at 12:06












    • @GAS4 I guess you figured it out, but for any future readers, my comment above should start setbox0 not box0

      – David Carlisle
      Sep 12 '18 at 18:01















    5














    It is possible to use the XeTeX primitives to query the image size and specify the image inclusion to xdvipdfmx driver, but even in plain TeX using system-specific special is painful and makes switching tex engines or drivers more complicated than need be.



    You can use the same driver independent image inclusion macros as latex, which are already set up to do the right thing for bmp files with xetex.



    enter image description here



    from the plain xetex file



    input graphicx


    a work of art:


    includegraphicsman.bmp


    bye


    where man.bmp is



    enter image description here






    share|improve this answer























    • But is it a your picture with your hands:-)? +1.

      – Sebastiano
      Aug 25 '18 at 21:27












    • I need to query the image size so I can position the image without trial & error. Using Xetex primitives, can you demonstrate with your example please? Thank you.

      – GAS4
      Sep 12 '18 at 10:44












    • @GAS4 easiest is to use box0hboxincludegraphicsman then use ht0 and wd0 for the height and width. and finally box0 to use the image

      – David Carlisle
      Sep 12 '18 at 12:06












    • @GAS4 I guess you figured it out, but for any future readers, my comment above should start setbox0 not box0

      – David Carlisle
      Sep 12 '18 at 18:01













    5












    5








    5







    It is possible to use the XeTeX primitives to query the image size and specify the image inclusion to xdvipdfmx driver, but even in plain TeX using system-specific special is painful and makes switching tex engines or drivers more complicated than need be.



    You can use the same driver independent image inclusion macros as latex, which are already set up to do the right thing for bmp files with xetex.



    enter image description here



    from the plain xetex file



    input graphicx


    a work of art:


    includegraphicsman.bmp


    bye


    where man.bmp is



    enter image description here






    share|improve this answer













    It is possible to use the XeTeX primitives to query the image size and specify the image inclusion to xdvipdfmx driver, but even in plain TeX using system-specific special is painful and makes switching tex engines or drivers more complicated than need be.



    You can use the same driver independent image inclusion macros as latex, which are already set up to do the right thing for bmp files with xetex.



    enter image description here



    from the plain xetex file



    input graphicx


    a work of art:


    includegraphicsman.bmp


    bye


    where man.bmp is



    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Aug 25 '18 at 21:07









    David CarlisleDavid Carlisle

    497k4111441890




    497k4111441890












    • But is it a your picture with your hands:-)? +1.

      – Sebastiano
      Aug 25 '18 at 21:27












    • I need to query the image size so I can position the image without trial & error. Using Xetex primitives, can you demonstrate with your example please? Thank you.

      – GAS4
      Sep 12 '18 at 10:44












    • @GAS4 easiest is to use box0hboxincludegraphicsman then use ht0 and wd0 for the height and width. and finally box0 to use the image

      – David Carlisle
      Sep 12 '18 at 12:06












    • @GAS4 I guess you figured it out, but for any future readers, my comment above should start setbox0 not box0

      – David Carlisle
      Sep 12 '18 at 18:01

















    • But is it a your picture with your hands:-)? +1.

      – Sebastiano
      Aug 25 '18 at 21:27












    • I need to query the image size so I can position the image without trial & error. Using Xetex primitives, can you demonstrate with your example please? Thank you.

      – GAS4
      Sep 12 '18 at 10:44












    • @GAS4 easiest is to use box0hboxincludegraphicsman then use ht0 and wd0 for the height and width. and finally box0 to use the image

      – David Carlisle
      Sep 12 '18 at 12:06












    • @GAS4 I guess you figured it out, but for any future readers, my comment above should start setbox0 not box0

      – David Carlisle
      Sep 12 '18 at 18:01
















    But is it a your picture with your hands:-)? +1.

    – Sebastiano
    Aug 25 '18 at 21:27






    But is it a your picture with your hands:-)? +1.

    – Sebastiano
    Aug 25 '18 at 21:27














    I need to query the image size so I can position the image without trial & error. Using Xetex primitives, can you demonstrate with your example please? Thank you.

    – GAS4
    Sep 12 '18 at 10:44






    I need to query the image size so I can position the image without trial & error. Using Xetex primitives, can you demonstrate with your example please? Thank you.

    – GAS4
    Sep 12 '18 at 10:44














    @GAS4 easiest is to use box0hboxincludegraphicsman then use ht0 and wd0 for the height and width. and finally box0 to use the image

    – David Carlisle
    Sep 12 '18 at 12:06






    @GAS4 easiest is to use box0hboxincludegraphicsman then use ht0 and wd0 for the height and width. and finally box0 to use the image

    – David Carlisle
    Sep 12 '18 at 12:06














    @GAS4 I guess you figured it out, but for any future readers, my comment above should start setbox0 not box0

    – David Carlisle
    Sep 12 '18 at 18:01





    @GAS4 I guess you figured it out, but for any future readers, my comment above should start setbox0 not box0

    – David Carlisle
    Sep 12 '18 at 18:01











    0














    The simplest way is to:



    1. Convert image_01.bmp to image_01.eps [the imagemagik suite will do this.


    2. Use the following PSTRICKS command
      centerlineepsfysize = 5.0truecmepsfboximage_01.eps


    [see do-it-yourself-tex on CTAN for the import PSTRICKS commands, etc]





    share



























      0














      The simplest way is to:



      1. Convert image_01.bmp to image_01.eps [the imagemagik suite will do this.


      2. Use the following PSTRICKS command
        centerlineepsfysize = 5.0truecmepsfboximage_01.eps


      [see do-it-yourself-tex on CTAN for the import PSTRICKS commands, etc]





      share

























        0












        0








        0







        The simplest way is to:



        1. Convert image_01.bmp to image_01.eps [the imagemagik suite will do this.


        2. Use the following PSTRICKS command
          centerlineepsfysize = 5.0truecmepsfboximage_01.eps


        [see do-it-yourself-tex on CTAN for the import PSTRICKS commands, etc]





        share













        The simplest way is to:



        1. Convert image_01.bmp to image_01.eps [the imagemagik suite will do this.


        2. Use the following PSTRICKS command
          centerlineepsfysize = 5.0truecmepsfboximage_01.eps


        [see do-it-yourself-tex on CTAN for the import PSTRICKS commands, etc]






        share











        share


        share










        answered 8 mins ago









        morris rogermorris roger

        715




        715



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f307370%2fhow-to-include-a-bmp-image-in-xetex-using-plain-tex-source-file%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

            acmart: Multiple authors: all with same affiliation, one author an additional affiliationHow to Write Names of Multiple Authors with Shared Affiliation in ACM 2017 Template?Multiple authors with different primary affiliation, but same additional affiliationSame affiliation for all authors without extra packagesIOS-Book-Article.cls: one author with multiple affiliationacmart: Shared Author AffiliationMultiple authors with different primary affiliation, but same additional affiliationAuthor affiliation with only 1 authorAdding Multiple Authors with Different Affiliation in LaTeX ArticleLaTeX: Multiple authors stays on same lineHow to Label Multiple Authors with Same DescriptionHow to make two authors use the same affiliationTwo authors with same affiliation on finished front page

            How to write “ä” and other umlauts and accented letters in bibliography?Accents in BibTeXSorting references with special characters alphabeticallyUse ae ligature in bibliographyEastern European nameInverted circumflex in BibTexBibTex, non-ascii initials and nameptr fproblems with accent in LatexHow to add a Ø to my bibliography from Jabref?References without accentsTroubles when trying to cite St“omer-Verlet in ”title" field of a bib entryComprehensive list of accented charactersHow to type the letter “i” with two dots (diaeresis) in math mode?Problem with glossary text and accented lettersSpecial character in bibliographyAccented letters, Unicode and LaTeX accentsHow to stop natbib from modifying bibliography styleCitation of a paper with non-standard characters by BibtexWrite accented characters to file using writeHow to group the bibliography alphabetically, if some surnames start with “accented” characters?How can I automatically capitalize significant words in my bibliography?

            How to force a table into page width?How to make table spanning textwidthMaking table width fit into text widthTable with tabular, column type p grabbing available spaceMaking widths of tables equal to width of textblocklatex tabular width the same as the textwidthMake tabular span textwidth exactlySet width of table to be the whole line or a given portion of itIs the tabu package obsolete?What is the difference between tabular, tabular* and tabularx environments?How can i set the width of a table?Making table width fit into text widthTabular and grid typesettingMake table use page widthTable exceeds page widthtable width automatically to page widthHow to shrink table to page widthForce table column to be zero widthTable width exceeds the page widthTable extending beyond the page widthforce longtable to text width