Why is there an automatically inserted space before percent sign (%) when it's
used for commenting? This can be really problematic (e.g. when commenting out
the end of a line just to put a footnote in the next) and very annoying. Is
there a way to disable/prevent this behaviour except deleting the space every
time?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
there is no space in front of the percent charatcer here ...
so, what tmx version, what os ?
And what key replacements are definde on your system (Options/Shortcuts
Editor/key replacements (in the table))
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the default configuration "%" is replaced by " %" after a word, but you can
disable this replacement in the key replacement options.
However, I think it is annoying if there is no space added, because if you
have two lines
hello
world
and add a comment after hello without space, it creates a single, misspelled
word helloworld in the pdf.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for late reply. It's TMX 1.9.9a, on Debian. OK, I followed the
instruction and disabled replacement key.
benibela, your argument is valid, although I don't agree for this being
default behaviour. People usually use % on purpose knowing what its use will
cause, and one of the first thing it's used for is to actually remove the
space created by new line (as in footnotes in the next line or multiline
command definitions for which this default behaviour could even lead to
errors).
However, while it's easy to change the default behaviour, it's fine with me.
Thanks for the tip, I missed key replacement completely.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please, would you be kind and remind me how to do this change in TeXStudio
2.2, since there is no replacement key entry anymore in Options > Configure TS
Shortcuts (and I really do not have any need for "before" and "after" word
key replacement in User Tags). Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But why didn't you then leave the percent sign to do what it should: type in
"%" without space, as anyone would expect, and put those two as optional
entries in User Tags if anyone actually needed them? I really don't want to
hunt down and delete spaces every time I type "%", nor do I want to use
shortcuts for something that should be done by default, with its original
intended key.
Is there any other key that inserts additional characters/symbols by default?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd like to ask you, guys, to give us, the users, an option to disable the
current default behaviour of "%" (like "key replacement option" in previous
versions of TMX). I'm using a huge number of custom commands in my daily work,
which means extensive use of "%" key, and default "space before %" is turning
out as a real issue (and, beside that, I'm using User Tags for other things).
I don't mind changing an option in a config file, if there's a problem
implementing the feature in GUI way.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm still not following. "User" is not one of my main level menu items. I can only find the following "Tools\User" but there is nothing in that menu. I can only find the expression "Key replacement %" under "Macros". I would also like to remove the space inserted before the "%".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Go to ~/.config/texstudio/macro and find file Macro_1.txsMacro
It's content is
{"abbrev":"","description":[""],"formatVersion":2,"menu":"","name":"Key replacement: % after word","shortcut":"","tag":[" %%"],"trigger":"(?language:latex)(?<=\\S)%","type":"Snippet"}
Change " %%" to "%%". Save and exit.
The other way to do this is through the TeXstudio menu "Macros / Edit Macros". Find the one called "Key replacement: % after word" and again, change %% to %%
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Why is there an automatically inserted space before percent sign (%) when it's
used for commenting? This can be really problematic (e.g. when commenting out
the end of a line just to put a footnote in the next) and very annoying. Is
there a way to disable/prevent this behaviour except deleting the space every
time?
there is no space in front of the percent charatcer here ...
so, what tmx version, what os ?
And what key replacements are definde on your system (Options/Shortcuts
Editor/key replacements (in the table))
In the default configuration "%" is replaced by " %" after a word, but you can
disable this replacement in the key replacement options.
However, I think it is annoying if there is no space added, because if you
have two lines
hello
world
and add a comment after hello without space, it creates a single, misspelled
word helloworld in the pdf.
Hi,
Sorry for late reply. It's TMX 1.9.9a, on Debian. OK, I followed the
instruction and disabled replacement key.
benibela, your argument is valid, although I don't agree for this being
default behaviour. People usually use % on purpose knowing what its use will
cause, and one of the first thing it's used for is to actually remove the
space created by new line (as in footnotes in the next line or multiline
command definitions for which this default behaviour could even lead to
errors).
However, while it's easy to change the default behaviour, it's fine with me.
Thanks for the tip, I missed key replacement completely.
Please, would you be kind and remind me how to do this change in TeXStudio
2.2, since there is no replacement key entry anymore in Options > Configure TS
only way to do it is via the user tags. It should be automatically set
already. Any changes need to applied there.
But why didn't you then leave the percent sign to do what it should: type in
"%" without space, as anyone would expect, and put those two as optional
entries in User Tags if anyone actually needed them? I really don't want to
hunt down and delete spaces every time I type "%", nor do I want to use
shortcuts for something that should be done by default, with its original
intended key.
Is there any other key that inserts additional characters/symbols by default?
Hi,
Where exactly can the default behavior be changed in version 2.3 (windows xp)?
In the list Options -> Configure -> Shortcuts -> Editor is only Basic Key
Mapping, nothing else...
User\User Macros\Edit User Macros
Do you mean User\User Commands\Edit User Commands?
What exactly does one have to enter to prevent the %-key from inserting an
additional blank character?
User\User Tags\Edit User Tags?
Remove there what you don't need
Found it. It works.
Thank you.
I'd like to ask you, guys, to give us, the users, an option to disable the
current default behaviour of "%" (like "key replacement option" in previous
versions of TMX). I'm using a huge number of custom commands in my daily work,
which means extensive use of "%" key, and default "space before %" is turning
out as a real issue (and, beside that, I'm using User Tags for other things).
I don't mind changing an option in a config file, if there's a problem
implementing the feature in GUI way.
as stated before, you just have to remove the user tags:
User\User Tags\Edit User Tags -> remove the ones "Key replacement %:"...
Great! Now I know the reason to have a blank space between two % signs.
I removed mine too.
Thanks.
I'm still not following. "User" is not one of my main level menu items. I can only find the following "Tools\User" but there is nothing in that menu. I can only find the expression "Key replacement %" under "Macros". I would also like to remove the space inserted before the "%".
"User\User Tags\Edit User Tags" has been renamed to "Macros\Edit Macros"
(this here is an very old topic)
Got it. Thanks!
Update for Linux Mint, June 2024:
Go to ~/.config/texstudio/macro and find file Macro_1.txsMacro
It's content is
Change
" %%"
to"%%"
. Save and exit.The other way to do this is through the TeXstudio menu "Macros / Edit Macros". Find the one called "Key replacement: % after word" and again, change
%%
to%%