Gradient symbols and letter f mtpro2
Clash Royale CLAN TAG#URR8PPP
up vote
7
down vote
favorite
So I notice that the spacing between nabla
and f
in math mode when using mtpro2 is really wide (for me, at least). Here is the result of typing nabla f
with mtpro2.
I wonder if there is a way we can adjust the symbol nabla
based on the next non-space letter, say:
- If the next non-space letter is
f
, then executekern -0.2 em f
, - else, stay at usual.
I have been looking around, but could not find a satisfying solution. Any help
is highly appreciated.
spacing letterspacing mtpro gradient
add a comment |Â
up vote
7
down vote
favorite
So I notice that the spacing between nabla
and f
in math mode when using mtpro2 is really wide (for me, at least). Here is the result of typing nabla f
with mtpro2.
I wonder if there is a way we can adjust the symbol nabla
based on the next non-space letter, say:
- If the next non-space letter is
f
, then executekern -0.2 em f
, - else, stay at usual.
I have been looking around, but could not find a satisfying solution. Any help
is highly appreciated.
spacing letterspacing mtpro gradient
Can I ask a question please?
â Sebastiano
Sep 9 at 8:21
add a comment |Â
up vote
7
down vote
favorite
up vote
7
down vote
favorite
So I notice that the spacing between nabla
and f
in math mode when using mtpro2 is really wide (for me, at least). Here is the result of typing nabla f
with mtpro2.
I wonder if there is a way we can adjust the symbol nabla
based on the next non-space letter, say:
- If the next non-space letter is
f
, then executekern -0.2 em f
, - else, stay at usual.
I have been looking around, but could not find a satisfying solution. Any help
is highly appreciated.
spacing letterspacing mtpro gradient
So I notice that the spacing between nabla
and f
in math mode when using mtpro2 is really wide (for me, at least). Here is the result of typing nabla f
with mtpro2.
I wonder if there is a way we can adjust the symbol nabla
based on the next non-space letter, say:
- If the next non-space letter is
f
, then executekern -0.2 em f
, - else, stay at usual.
I have been looking around, but could not find a satisfying solution. Any help
is highly appreciated.
spacing letterspacing mtpro gradient
spacing letterspacing mtpro gradient
asked Sep 8 at 23:03
weirdo
604
604
Can I ask a question please?
â Sebastiano
Sep 9 at 8:21
add a comment |Â
Can I ask a question please?
â Sebastiano
Sep 9 at 8:21
Can I ask a question please?
â Sebastiano
Sep 9 at 8:21
Can I ask a question please?
â Sebastiano
Sep 9 at 8:21
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
8
down vote
accepted
Here's a LuaLaTeX-based solution. It sets up a Lua function called nabla_f
that does most of the work, and it assigns this function to the process_input_buffer
callback, making it operate on all inputs before TeX starts is usual processing.
% !TEX TS-program = lualatex
documentclassarticle
usepackagetimes,mtpro2 % text and math fonts
usepackageluacode
beginluacode
function nabla_f ( s )
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
end
endluacode
directlualuatexbase.add_to_callback("process_input_buffer", nabla_f , "nablaf" )
begindocument
$nablaf$ $nabla f$ $nabla h$ $nabla k$
enddocument
Addendum: If you also want to change the amount of whitespace between partial
and f
, while keeping the instruction to change the distance between nabla
and f
, I suggest you replace
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
with
s = s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" )
s = s:gsub ( "\partial%s*f", "\partial\mkern-4mu f" )
return s
Of course, you can (and should) change the new instance of -4mu
to whatever the optimal adjustment amount may be.
1
so I guess this works for other things likepartial f
by replacingnabla
withpartial
? I am excited about this :)
â weirdo
Sep 8 at 23:51
1
@weirdo - Indeed, the code can be modified to allow further types of adjustments. I posted an addendum to show how this might be done for the case ofpartial
andf
.
â Mico
Sep 9 at 4:52
1
works like a charm for me :)
â weirdo
Sep 9 at 16:25
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
8
down vote
accepted
Here's a LuaLaTeX-based solution. It sets up a Lua function called nabla_f
that does most of the work, and it assigns this function to the process_input_buffer
callback, making it operate on all inputs before TeX starts is usual processing.
% !TEX TS-program = lualatex
documentclassarticle
usepackagetimes,mtpro2 % text and math fonts
usepackageluacode
beginluacode
function nabla_f ( s )
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
end
endluacode
directlualuatexbase.add_to_callback("process_input_buffer", nabla_f , "nablaf" )
begindocument
$nablaf$ $nabla f$ $nabla h$ $nabla k$
enddocument
Addendum: If you also want to change the amount of whitespace between partial
and f
, while keeping the instruction to change the distance between nabla
and f
, I suggest you replace
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
with
s = s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" )
s = s:gsub ( "\partial%s*f", "\partial\mkern-4mu f" )
return s
Of course, you can (and should) change the new instance of -4mu
to whatever the optimal adjustment amount may be.
1
so I guess this works for other things likepartial f
by replacingnabla
withpartial
? I am excited about this :)
â weirdo
Sep 8 at 23:51
1
@weirdo - Indeed, the code can be modified to allow further types of adjustments. I posted an addendum to show how this might be done for the case ofpartial
andf
.
â Mico
Sep 9 at 4:52
1
works like a charm for me :)
â weirdo
Sep 9 at 16:25
add a comment |Â
up vote
8
down vote
accepted
Here's a LuaLaTeX-based solution. It sets up a Lua function called nabla_f
that does most of the work, and it assigns this function to the process_input_buffer
callback, making it operate on all inputs before TeX starts is usual processing.
% !TEX TS-program = lualatex
documentclassarticle
usepackagetimes,mtpro2 % text and math fonts
usepackageluacode
beginluacode
function nabla_f ( s )
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
end
endluacode
directlualuatexbase.add_to_callback("process_input_buffer", nabla_f , "nablaf" )
begindocument
$nablaf$ $nabla f$ $nabla h$ $nabla k$
enddocument
Addendum: If you also want to change the amount of whitespace between partial
and f
, while keeping the instruction to change the distance between nabla
and f
, I suggest you replace
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
with
s = s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" )
s = s:gsub ( "\partial%s*f", "\partial\mkern-4mu f" )
return s
Of course, you can (and should) change the new instance of -4mu
to whatever the optimal adjustment amount may be.
1
so I guess this works for other things likepartial f
by replacingnabla
withpartial
? I am excited about this :)
â weirdo
Sep 8 at 23:51
1
@weirdo - Indeed, the code can be modified to allow further types of adjustments. I posted an addendum to show how this might be done for the case ofpartial
andf
.
â Mico
Sep 9 at 4:52
1
works like a charm for me :)
â weirdo
Sep 9 at 16:25
add a comment |Â
up vote
8
down vote
accepted
up vote
8
down vote
accepted
Here's a LuaLaTeX-based solution. It sets up a Lua function called nabla_f
that does most of the work, and it assigns this function to the process_input_buffer
callback, making it operate on all inputs before TeX starts is usual processing.
% !TEX TS-program = lualatex
documentclassarticle
usepackagetimes,mtpro2 % text and math fonts
usepackageluacode
beginluacode
function nabla_f ( s )
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
end
endluacode
directlualuatexbase.add_to_callback("process_input_buffer", nabla_f , "nablaf" )
begindocument
$nablaf$ $nabla f$ $nabla h$ $nabla k$
enddocument
Addendum: If you also want to change the amount of whitespace between partial
and f
, while keeping the instruction to change the distance between nabla
and f
, I suggest you replace
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
with
s = s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" )
s = s:gsub ( "\partial%s*f", "\partial\mkern-4mu f" )
return s
Of course, you can (and should) change the new instance of -4mu
to whatever the optimal adjustment amount may be.
Here's a LuaLaTeX-based solution. It sets up a Lua function called nabla_f
that does most of the work, and it assigns this function to the process_input_buffer
callback, making it operate on all inputs before TeX starts is usual processing.
% !TEX TS-program = lualatex
documentclassarticle
usepackagetimes,mtpro2 % text and math fonts
usepackageluacode
beginluacode
function nabla_f ( s )
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
end
endluacode
directlualuatexbase.add_to_callback("process_input_buffer", nabla_f , "nablaf" )
begindocument
$nablaf$ $nabla f$ $nabla h$ $nabla k$
enddocument
Addendum: If you also want to change the amount of whitespace between partial
and f
, while keeping the instruction to change the distance between nabla
and f
, I suggest you replace
return ( s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" ) )
with
s = s:gsub ( "\nabla%s*f" , "\nabla\mkern-4mu f" )
s = s:gsub ( "\partial%s*f", "\partial\mkern-4mu f" )
return s
Of course, you can (and should) change the new instance of -4mu
to whatever the optimal adjustment amount may be.
edited Sep 9 at 4:56
answered Sep 8 at 23:26
Mico
263k30355731
263k30355731
1
so I guess this works for other things likepartial f
by replacingnabla
withpartial
? I am excited about this :)
â weirdo
Sep 8 at 23:51
1
@weirdo - Indeed, the code can be modified to allow further types of adjustments. I posted an addendum to show how this might be done for the case ofpartial
andf
.
â Mico
Sep 9 at 4:52
1
works like a charm for me :)
â weirdo
Sep 9 at 16:25
add a comment |Â
1
so I guess this works for other things likepartial f
by replacingnabla
withpartial
? I am excited about this :)
â weirdo
Sep 8 at 23:51
1
@weirdo - Indeed, the code can be modified to allow further types of adjustments. I posted an addendum to show how this might be done for the case ofpartial
andf
.
â Mico
Sep 9 at 4:52
1
works like a charm for me :)
â weirdo
Sep 9 at 16:25
1
1
so I guess this works for other things like
partial f
by replacing nabla
with partial
? I am excited about this :)â weirdo
Sep 8 at 23:51
so I guess this works for other things like
partial f
by replacing nabla
with partial
? I am excited about this :)â weirdo
Sep 8 at 23:51
1
1
@weirdo - Indeed, the code can be modified to allow further types of adjustments. I posted an addendum to show how this might be done for the case of
partial
and f
.â Mico
Sep 9 at 4:52
@weirdo - Indeed, the code can be modified to allow further types of adjustments. I posted an addendum to show how this might be done for the case of
partial
and f
.â Mico
Sep 9 at 4:52
1
1
works like a charm for me :)
â weirdo
Sep 9 at 16:25
works like a charm for me :)
â weirdo
Sep 9 at 16:25
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f450042%2fgradient-symbols-and-letter-f-mtpro2%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Can I ask a question please?
â Sebastiano
Sep 9 at 8:21