texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.76k stars 343 forks source link

Completions of `width=` and `height=` #2022

Closed dbitouze closed 2 years ago

dbitouze commented 2 years ago

Environment

Description

The graphicx.cwl file contains the following lines:

width=##L
height=##L
totalheight=##L

Hence, in \includegraphics[keyvals]{imagefile}, the completions of both width= and height= are both \linewidth and \textheight.

IMO, except maybe in the case of rotated images:

sunderme commented 2 years ago

there seem to miss more declared length definitions.

dbitouze commented 2 years ago

there seem to miss more declared length definitions.

And they shouldn't be all blindly proposed for all the lengths.

sunderme commented 2 years ago

txs classifies length, it does not distinguish between height and width. Assuming that the user has a basic idea what he/she is doing, they can select the correct one from a list of 4 entries.

added textwidth and made columnwidth more easily accessible. (More lengths are available under "all" tab)

dbitouze commented 2 years ago

txs classifies length, it does not distinguish between height and width. Assuming that the user has a basic idea what he/she is doing, they can select the correct one from a list of 4 entries.

Why not something like:

width=#\linewidth,\textwidth,\columnwidth,\paperwidth
height=#\textheight,\paperheight
totalheight=#\textheight,\paperheight

instead of the blind:

width=##L
height=##L
totalheight=##L
sunderme commented 2 years ago

inflexible solution. People may want to define their own lengths ... And there are more places where width can be set, should we go through all of them. Again, adults can chose from four options, not worth the effort.