[-] quat@lemmy.sdfeu.org 11 points 10 months ago

break a lot of backwards compatibility or radically change the current way of doing things

Plan 9. We can still have textual interfaces without emulating the ancient use of teletypewriters.

[-] quat@lemmy.sdfeu.org 9 points 11 months ago

People use ed because they want an editor. They don't want an emacsitor or vimitor. Those aren't even words.

2
submitted 11 months ago* (last edited 11 months ago) by quat@lemmy.sdfeu.org to c/openbsd@lemmy.ml

I'm trying to figure out if the following happens just to me or for everyone. If you have a file, let's call it "myfile", that you know is encoded in UTF-8, what is your output for:
$ file myfile
?

I have a freshly installed OpenBSD 7.3, where I think I've set the locale to en_US.UTF-8. If I manually make a file with some characters like "åäö", file outputs "ISO-8859 text". If I copy/paste some unicode characters from the web, file outputs "Non-ISO extended-ASCII text". If I send these files to a Linux computer and run file it outputs "UTF-8".

Maybe relevant info:
$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE=en_US.UTF-8
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=

$ env | grep "UTF"
LC_CTYPE=en_US.UTF-8
XTERM_LOCALE=en_US.UTF-8

[-] quat@lemmy.sdfeu.org 13 points 11 months ago

A good act does not wash out the bad, nor a bad act the good. Each should have its own reward.

[-] quat@lemmy.sdfeu.org 68 points 11 months ago

The wave of the reddit protests is over, now lemmy must grow on its own merits rather than being "not reddit".

[-] quat@lemmy.sdfeu.org 40 points 11 months ago

There's an old saying: "Linux users use Linux because they hate Windows. BSD users use BSD because they love Unix." Obviously this is not true for every individual user, but I think it describes a trend or pattern.

[-] quat@lemmy.sdfeu.org 6 points 1 year ago

While I do agree that the website is bad, nowadays the main iso includes non-free firmware, and it's the same installer for all DEs.

[-] quat@lemmy.sdfeu.org 10 points 1 year ago

"Hello, support? How do I get through the Gnomish Mines in Nethack?"

[-] quat@lemmy.sdfeu.org 9 points 1 year ago

People will say "use this editor" or "use that window manager", but honestly it's just personal preference. There's no award for using ed to edit files, and almost anything you can do with one distro you can do with any other distro. You might get an urge to distrohop and compile the kernel, and that's fine, but imho far more useful is to learn how pipes work and what you can do with regular expressions. A tutorial for bash is always useful.

[-] quat@lemmy.sdfeu.org 18 points 1 year ago

Being able to run your own instance with any policies you want is a strength of lemmy.

[-] quat@lemmy.sdfeu.org 12 points 1 year ago

I've started to reconsider how I do things online. For such a long time it's been the norm to expect things for free (gratis), and users became the product. If the choice now is being bombarded with ads or paying for a service, I'd rather pay a reasonable price. If I want online storage to keep my files backed up and available, then a small sum is acceptable to me. The important thing is to choose providers who believe in the open spirit of the internet, using free software, respecting privacy. I've submitted a couple of patches to the operating system I use. Etc. I want the internet to be a cooperative, friendly place.

[-] quat@lemmy.sdfeu.org 15 points 1 year ago

How do you define "stable"?

[-] quat@lemmy.sdfeu.org 6 points 1 year ago

Long time ago, I did several villages where I grew up. This was before satellite images covered that area, so I did it the old fashioned way with a GPS, cycling up and down every single street, writing down name and surface in a notebook. Walked around every field, every patch of forest, creek, etc. It took years, but I've literally been everywhere in those villages. It was fun :) When aerial images came I could do private buildings too.

1
submitted 1 year ago* (last edited 1 year ago) by quat@lemmy.sdfeu.org to c/tex@lemmy.sdfeu.org

OpTeX Tips and tricks section was updated with a macro that automatically makes sure that margin notes don't overlap. It's otherwise a problem when the margin notes are too close.

If you want to do it manually you can use \mnoteskip, but this is an automatic way.

4

Is it for mail, programming, irc, usenet, website, etc? I'm just curious what other people do when they log into sdfeu.

28
submitted 1 year ago by quat@lemmy.sdfeu.org to c/retrocomputing

So, I recently got this C64 for free, and I've been wanting to test it. However, figuring out how to connect a monitor has led me to various forums with home-made adapters that require soldering, a 5-pin DIN to 4xRCA to...? My monitor has VGA and HDMI, etc, the usual modern inputs. Someone claimed that the voltages are different which will lead to artifacts and to put a resistor somewhere. I found some box thing from China that looks promising but it's around 150 usd.

What would you recommend for this? Is the expensive box my best bet?

I have no TV or anything that can input RF, just a computer monitor.

2
submitted 1 year ago* (last edited 1 year ago) by quat@lemmy.sdfeu.org to c/tex@lemmy.sdfeu.org

Orphans and widows. On this subject Tschichold wrote:

"Doubtless all textbooks of typesetting warn that the exit line of a paragraph at the head of a book page must be avoided at all cost. /.../ Is there really nothing we can tighten a little, or space out perhaps? Possibly we can save a line at the beginning of the chapter by moving the first paragraph up? The best method is to simply shorten the preceding page by a line."

Bringhurst wrote:

"Balance facing pages not by adding extra lead or puffing up the word space, but by exporting or importing single lines to and from the preceding or following spreads. The same technique is used to avoid widows, and to extend or shorten any chapters that would otherwise end with a meager few lines on the final page."

In TeX we can set \widowpenalty (and \clubpenalty) to 10000 and if we have vertically stretchable material on the page the type area will get it's height, but lines will not match across the spread. Without strechable material that page will be a line shorter but the spread will be unbalanced in height instead.

So if we want this hands-on method of dealing with widows, we need a macro to carefully extend or shorten pages, preferably without being too intrusive and spread out in the code.

Luckily, Petr Olsak has a macro like this for OpTeX: https://petr.olsak.net/optex/optex-tricks.html#widows

For my purposes, I like the page number to be at a set distance from the type area instead of a set distance from the page bottom, so I could remove some code, and ended up with this example for plain:

% For this example, the document normally has 5 lines per page
\vsize=\topskip \advance\vsize by 4\baselineskip

% Backup original vsize 
\newdimen\originalvsize \originalvsize=\vsize

% Macro that defines another macro on the form \ap:<pageno>, 
% which expands to how many lines should be adjusted.
% Example: \adjustpage{15}{+1} defines \ap:15 which expands to +1.
\def\adjustpage#1#2{%
	\expandafter\xdef\csname ap:#1\endcsname{#2}
	\ifnum #1=1
		\setvsize
	\fi
}

% For use in the output routine
\def\setvsize{%
	\global\vsize=\originalvsize
	\ifcsname ap:\the\pageno\endcsname
		\global\advance \vsize by \csname ap:\the\pageno\endcsname \baselineskip
	\fi
}

% \setvsize needs to be expanded after page number has been incremented, but before the next typeset material.
\output{\plainoutput \setvsize}

%%%%%%%%%%%%%%%%%%%

% No penalty since we're dealing with widows manually now
\widowpenalty=0
\clubpenalty=0

% This adjusts the 2-3 spread to have one extra line on each page
\adjustpage{2}{+1} \adjustpage{3}{+1}

% Test text, some paragraphs of Lorem ipsum
\input lipsum

\bye
1

What's your method for dealing with underfull/overfull \hboxes and unacceptable badness in general?

LaTeX has the \sloppy command which IIRC sets \tolerance to 9999, and \emergencystretch to a large value. But the default \tolerance is 200 (I think), which is a big difference. It's very "either/or" when maybe there's a more optimal way.

For my native language (swedish) I've found that many issues arise because TeX doesn't find all the possible hyphenation points, so I usually spend time adding words to the hyphenation list.

But still, in any longer text there's usually a couple of paragraphs that just won't set right, I'm curious about your tricks or methods for dealing with them.

1

This is a rather interesting presentation by Jean-Luc Doumont about placing content on a grid, or a subset of the grid. He's kind of taking this idea to the extreme.

1

There's this guy called Stephan V. Bechtolsheim who wrote a series of books on TeX called "TeX in Practice". He's really good at the finer details of, well, everything.

In one of the books, he makes a macro to visualize boxes. It's built up over many pages and chapters with lots of small macros as building blocks. Because he's reusing these macros in different places, it makes a lot of sense.

However, when I wanted to use the box visualizing macro, I found that I had to look up and copy a lot of code to make it work. This was no fun, so I re-wrote it in a "flatter" way where it's just regular plain old macros.

I ended up with this:

\newdimen\linethickness \linethickness=0.4pt

\def\boxlines #1{%
    \hbox{%
        % Save original (argument) box
        \setbox0 = #1%
        % Place bullet at baseline and vertical align of the box
        \setbox1 = \hbox{\hskip -2.5pt \lower 2.5pt \hbox{$\circ$}}%
        \ht1=0pt \dp1=0pt \wd1=0pt
        \box1
        % Place a dashed line at baseline
        \setbox2 = \hbox to \wd0{%
            \xleaders\hbox to 4pt{%
                \hskip 1pt
                \vrule depth 0.5\linethickness 
                	   height 0.5\linethickness 
                	   width 2pt
                \hfil
            }%
            \hfil
        }%
        \ht2=0pt \dp2=0pt \wd2=0pt 
        \box2
        % Place frame
        \setbox 3 = \hbox{%         
            \hskip -0.5\linethickness
            \vrule width \linethickness height \ht0 depth \dp0% 
            \hskip \wd0% 
            \hskip -\linethickness
            \vrule width \linethickness height \ht0 depth \dp0% 
            \hskip -\wd0% 
            \hskip -\linethickness
            \dimen0 = \wd0% 
            \advance\dimen0 by \linethickness
            \dimen2 = \ht0% 
            \advance\dimen2 by 0.5\linethickness
            \dimen4 = \ht0% 
            \advance\dimen4 by -0.5\linethickness
            \dimen4 = -\dimen4
            \vrule width \dimen0 height \dimen2 depth \dimen4
            \hskip -\dimen0
            \dimen2 = \dp0% 
            \advance\dimen2 by -0.5\linethickness
            \dimen2 = -\dimen2
            \dimen4 = \dp0% 
            \advance\dimen4 by 0.5\linethickness
            \vrule width \dimen0 height \dimen2 depth \dimen4
        }%
        \ht3=0pt \dp3=0pt \wd3=0pt 
        \box3
        % Place original argument box
        \box0
    }%
}

The macro takes a box as an argument, for example \boxlines{\box0}

It puts lines around the box, and marks out the baseline and the horizontal alignment. The neat thing is that the lines are made so that they don't interfere with the typesetting at all. Everything is placed as it would be without the lines.

If you have something that looks misaligned or strange, like these words:

it can help to visualize the boxes:

2
submitted 1 year ago* (last edited 1 year ago) by quat@lemmy.sdfeu.org to c/tex@lemmy.sdfeu.org

Jan Tschichold and Raul Rosariva independently researched the layout of medieval books, and each came up with a method of construction. Rosarivas version (to the right) lends itself very well to a programmatic approach. We could implement it (in luaTeX) in a few lines like this:

% Page size (proportions 2:3)
\pagewidth=150mm	
\pageheight=225mm

% Undo 1 inch origin (personal preference)
\pdfvariable horigin 0pt
\pdfvariable vorigin 0pt

% Inner margin
\hoffset=\pagewidth
\divide\hoffset by9

% Top margin
\voffset=\pageheight
\divide\voffset by9

% Type area width
\hsize=\pagewidth
\divide\hsize by9
\multiply\hsize by6

% Type area height
\vsize=\pageheight
\divide\vsize by9
\multiply\vsize by6

This is all well and good if we have vertically stretchable material on every page. But... if we want to do grid typesetting, we will quickly run into "Underfull \vbox (badness 10000)".

Let's say we've set \parskip=0pt.

\topskip=10pt and \baselineskip=12pt

\showthe\vsize produced "426.79129pt" in the log.

Right now we have 35 lines: \topskip + 34 \baselineskips, which is 10pt+(34*12pt) = 418pt, i.e. less than \vsize, but there's no room for adding another line.

Something has got to give.

One way is to define \vsize as a set number of lines, and then adjust \baselineskip to be slightly bigger to make \vsize be in accordance with the golden canon.

Either we stay with 35 lines and increase \baselineskip slightly, or we decrease \baselineskip to fit one more line. This is where you have to make a call based on what would make it better as a whole. In this case, I think it wouldn't hurt with a little extra leading, so I'll stick with 1+34 lines and go back and change \vsize:

\vsize=\topskip
\advance\vsize by 34\baselineskip

Now all that is left is to figure out how much to increase \baselineskip. We can leave \topskip as it is, at 10pt, so we're left with 426.79129pt - 10pt = 416.79129pt.

Divide that with 34 lines:

416.79129pt / 34 is approximately 12.2586pt, so we go back and set \baselineskip to that.

\baselineskip=12.2586pt

Now we have something like this (with added guidelines):

Finally, if our goal here is to make a type area rectangle of a certain proportion, it could be argued that the first line should have its x-height touch the upper border of the rectangle. The bulk of a line contributing to color is made up of the lower case letters. In that case we could adjust \voffset:

\advance\voffset by-\topskip
\advance\voffset by 1ex

but then we would also have to compensate the total \vsize and figure out a new \baselineskip.

Disclaimer: I haven't tested the above code, so there could be spelling errors etc, but it's more about the reasoning.

view more: next ›

quat

joined 1 year ago
MODERATOR OF
tex