Zim

how set tab stops

Asked by alienheartbeat

One area in which I am having a bit of frustration is setting tab stops, so that text is aligned.

I have set an editor (kwrite) and a font (liberations sans 8)
but the tab stops set in the editor are not being used when I edit pages in zim.

Where do I specify the tab stops for zim?

Looking forward to enlightenment!

thanks
mc

Question information

Language:
English Edit question
Status:
Solved
For:
Zim Edit question
Assignee:
No assignee Edit question
Solved by:
alienheartbeat
Solved:
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
alienheartbeat (reckless-symmetry) said :
#2

No answer received yet - pls do not expire.

Launchpad Janitor wrote:
> Your question #78799 on Zim changed:
> https://answers.launchpad.net/zim/+question/78799
>
> Status: Open => Expired
>
> Launchpad Janitor expired the question:
> This question was expired because it remained in the 'Open' state
> without activity for the last 15 days.
>
>

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#3

The current version of zim does not allow configuration for the tab stops. Please file a feature request in the bug tracker with a bit of context of how you use this feature in other editors.

Revision history for this message
alienheartbeat (reckless-symmetry) said :
#4

Jaap

I am not trying to create a new feature - I just want to understand how the present implementation works.

I'll give 2 examples:
a. I create a document in Zim. I use tabs to align the tables and the indented paragraphs.
I then sync the document to another machine also running Zim (with the same OS, same version etc).
Now, everything is out of alignment, because the tab stops are set differently.

b. I create a page in kwrite, which I have set as my text editor in edit/preferences/text editor.
 I use tabs to align the tables and the indented paragraphs.
I then import the document to an existing Zim wiki.
Now, everything is out of alignment, because the tab stops are set differently.

Everytime this happens I bang my head against the wall
and my wife is complaining my forehead is becoming flat.

The problem is I cannot work out how Zim sets it's tab stops
(ie the distance between tabs).
For example in kwrite you set distance between tabs in
settings/configure editor/editing/Tab width.

What I think happens, but I am not sure,
is that Zim sets its tab stops when it is installed
and sets them to whatever the default editor (in this case kwrite)
has them set to to at that time.

So what I am asking is
"where does Zim get its tab stops from?"

If I knew this I could find a way to work with it to spare my forehead further flattening.

I hope I have explained more clearly now.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#5

On Tue, Aug 18, 2009 at 5:00 AM, undecidable <
<email address hidden>> wrote:

> What I think happens, but I am not sure,
> is that Zim sets its tab stops when it is installed
> and sets them to whatever the default editor (in this case kwrite)
> has them set to to at that time.
>

Well, in fact zim doesn't set tab stops at all. It uses whatever is the
default tab distance for your gtk installation. Not sure why this different
when you sync to another computer, might be the font size or theme having an
impact on that.

For sure we do not look at another editor for the tab stops, since we would
have to write custom code for every editor out there.

Of course we can make it so that you can set the tabs stops and you could
set them the same as kwrite. However that is not possible at the moment
(unless you hack into the code), so it needs improvement.

Regards,

Jaap

Revision history for this message
alienheartbeat (reckless-symmetry) said :
#6

Jaap

thanks very much. I am using the same font and font size everywhere.

Where does it find the "default tab distance for your gtk installation" ?

I use kde (kubuntu) so I usually do not have many gtk libraries & config files installed - maybe this is the problem.
Maybe I can create the necessary config file and put it where Zim is expecting to find it?
Or if it is there already (maybe because I installed Firefox) perhaps I can edit it.

Also, does it look at these settings every time it is started, or just when it is installed?

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#7

I'm sorry, but I do not have an answer to these questions. As said, zim does
not touch these settings at the moment at all.

-- Jaap

Revision history for this message
alienheartbeat (reckless-symmetry) said :
#8

OK thanks.
I don't use gtk so I don't know where these come from either.
So it may be best if I file a bug under something like
"Zim tab stops may be different between different machines. "
I will also mention that the problem may only happen under KDE.
I will wait a few days just in case, with all the information above,
someone thinks of the answer.

Revision history for this message
alienheartbeat (reckless-symmetry) said :
#9

Found the answer !!

Zim sets tab stops from /usr/share/default.style
and ~/.local/share/zim/default.style
in the lines:
   [TextView]
   tabs = 40

The 40 simply needs to be changed to match the tab distance being used in the kde text editors (kwrite, kate).
In my case I am using 16 in kwrite, and so setting:
  tabs=64
caused their tab distances to match.
(why 64:16 ie 4:1 I have no idea.)

My zim wikis now transport between 8.04 and 9.04, and between dual screen desktops and small screen netbooks
and look substantially the same on each.

Of course fonts and appearance settings need to be the same.

Hope this helps someone.