LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Content-Type: text/plain; charset=iso-8859-15
Date: Mon, 26 Jan 2015 10:55:17 +0100
Content-Disposition: inline
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
From: Alexander Grahn <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments: text/plain (34 lines)
Good morning,

I have just noticed that \box_resize_to_ht:Nn forces the given box
into a square instead of scaling the width appropriately. The other,
\box_resize_to_wd:Nn works as expected as it preserves the original
aspect ratio:

  \documentclass{article}
  \usepackage{expl3}
  \usepackage{graphicx}
  \usepackage{mwe}
  
  \begin{document}
  \newsavebox\picbox
  \savebox\picbox{\includegraphics{example-image-a}}
  
  \typeout{orig. size: \the\wd\picbox\space X \the\ht\picbox}
  
  \ExplSyntaxOn
  \box_resize_to_ht:Nn\picbox{60pt}
  \ExplSyntaxOff
  \typeout{\string\box_resize_to_ht:Nn \the\wd\picbox\space X \the\ht\picbox}
  
  \savebox\picbox{\includegraphics{example-image-a}}
  \ExplSyntaxOn
  \box_resize_to_wd:Nn\picbox{60pt}
  \ExplSyntaxOff
  \typeout{\string\box_resize_to_wd:Nn \the\wd\picbox\space X \the\ht\picbox}
  
  \end{document}

Kind regards,
Alexander

ATOM RSS1 RSS2