[texshop] Line numbers in the edit window

Claus Gerhardt gerhardt at icloud.com
Tue Oct 18 12:22:11 CEST 2022


The option "pagewise" has of course to be omitted.

Claus




Using the package

\usepackage[pagewise]{lineno}
\linenumbers

will add line numbers to the preview window which will be magnified according to the chosen magnification. Syncing then might help finding the corresponding line in the edit window.

Claus

On 17. Oct 2022, at 19:39, Bruno Voisin via texshop <texshop at tug.org> wrote:

> On 17 Oct 2022, at 12:23, Bruno Voisin <bvoisin at icloud.com> wrote:
> 
> Looking at TeXShop's source, the line number code
> 
> NoodleLineNumberMarker.h
> NoodleLineNumberMarker.m
> NoodleLineNumberView.h
> NoodleLineNumberView.m
> 
> [...]
> 
> Maybe there's a way to modify this code so that the line numbers grow with the text size?

I'll probably be making an utter fool of myself, but this might be a matter of modifying line 104 of NoodleLineNumberView.m

return [NSFont labelFontOfSize:[NSFont systemFontSizeForControlSize:NSMiniControlSize]];

so as to replace NSMiniControlSize by the size of DocumentFontKey. But I have not the faintest idea of how to do this.

And this is assuming that the above wouldn't break the rest of the code there, which calculates the width of the line number column, the width of the "text" part of the Source window, and the resulting line breaks.

Bruno Voisin




More information about the texshop mailing list.