1

I would like to draw the following picture: enter image description here

But, I would like to label the sides as $8.5$ and $11$ so that they are a standard sheet of paper. How would I do this in TikZ?

1 Answer 1

4

​Maybe this is what you're looking for. You have to set the variable \y to the value that gives the best result. \y has to vary between \h and \l. If you want a smaller picture, divide all the coordinates by a scale factor.

enter image description here

\documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \pgfmathsetmacro\y{9.5} \pgfmathsetmacro\l{8.5} \pgfmathsetmacro\h{11} \pgfmathsetmacro\a{sqrt(\y*\y-\l*\l)} \pgfmathsetmacro\b{\y-\a} \pgfmathsetmacro\x{\y*(\y-\a)/\l} \draw (\l-\x,0)--(0,0)--(0,\h)--(\l,\h)--(\l,\y); \draw[dotted] (\l,\y)--(\l,0)--(\l-\x,0); \draw (\l-\x,0)--(0,\b)--(\l,\y)--cycle; \node[below] at(\l/2,0){$\l$}; \node[above] at(\l/2,\h){$\l$}; \node[left] at(0,\h/2){$\h$}; \node[right] at(\l,\h/2){$\h$}; \end{tikzpicture} \end{document} 
1
  • Welcome to TeX.SX! Thank you for your answer! Commented Dec 1, 2016 at 17:51

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.