Skip to content

TeXstudio and highlighting of units syntax (ex, em, mm, cm, pt, ...) #3587

Closed Answered by JosephHallenbeck
JosephHallenbeck asked this question in Q&A
Discussion options

You must be logged in to vote

I found the solution which is ok to me. It is adding the custom syntax color for length units (pt, em, mm, cm, pt,...) but also for number in front of the unit. This code needs to be added to the tex.qnfa file:

	<list id="keywords/single" format="verbatim">
		<word>[-+.0-9@]+pt+</word>
		<word>[-+.0-9@]+mm+</word>
		<word>[-+.0-9@]+cm+</word>
		<word>[-+.0-9@]+in+</word>
		<word>[-+.0-9@]+ex+</word>
		<word>[-+.0-9@]+em+</word>
		<word>[-+.0-9@]+mu+</word>
		<word>[-+.0-9@]+sp+</word>
	</list>

the color of the syntax is linked to the verbatim environment color.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@JosephHallenbeck
Comment options

@dbitouze
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by JosephHallenbeck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants