Questions tagged [dimension-expressions]
37 questions
5
votes
4 answers
Add values stored in an array
\documentclass[a4paper,10pt]{article}
\usepackage{arrayjob}
\begin{document}
\newarray\cws
\cws(0)=3pt
\cws(1)=4pt
\let\a\dimexpr\cws(0)+\cws(1)\relax
\a
\end{document}
Error: ! You can't use `\dimexpr' in horizontal mode.
This doesn't work…
nagylzs
- 1,225
4
votes
1 answer
Why we used \number in Latex?
Here is my code:
\documentclass{article}
\makeatletter
\def\Printdimen#1#2{\strip@pt \dimexpr #2 *65526 /\number\dimexpr 1#1}
\makeatother
\begin{document}
\Printdimen{mm}{\hsize} mm
\end{document}
enadul shaheen
- 349
1
vote
1 answer
Can I change font based on predicted width
Is it possible to define a macro that changes font based on width that a box "would be"?
I'd like to define a LaTeX macro that does something like:
\newcommand{\mylabel}[1] {
\if\latexMagicWidthOf{\labelfont #1}>2em
{\labelfont #1}
…
user3486184
- 287
1
vote
1 answer
Is `\strip@pt` removing the hundreds as well as the `pt`?
I was getting some strange results trying to position things in beamer, and I realised that \strip@pt was removing not only the pt, but also the hundreds from the number.
Here's my MWE:
\documentclass[]{beamer}…
craq
- 371
1
vote
1 answer
Predefined lengths in \put
This works:
\documentclass{article}
\usepackage{eso-pic}
\begin{document}
\AddToShipoutPictureBG*
{
\setlength{\unitlength}{1 mm}
\put(52, 240){Text}
}
Some more text
\end{document}
EDIT: I realize I was a bit too quick when first…
user44413
- 601