Created
February 13, 2026 10:04
-
-
Save santhoshtr/935c0b0f9ca78edbd9cbbc69f845237d to your computer and use it in GitHub Desktop.
Untitled Metapost Sample #metapost-sandbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| verbatimtex | |
| \documentclass{minimal} | |
| \begin{document} | |
| etex | |
| beginfig(2); | |
| % Store the text in a picture variable | |
| picture p; | |
| p := thelabel("Another example", origin); | |
| % Draw the text picture | |
| draw p; | |
| % Get the text's dimensions | |
| w := xpart urcorner p - xpart llcorner p; | |
| h := ypart urcorner p - ypart llcorner p; | |
| % Draw a line across the center of the text | |
| draw (llcorner p + (0, 0.5h)) -- (urcorner p - (0, 0.5h)); | |
| endfig; | |
| verbatimtex | |
| \end{document} | |
| etex | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment