Hacker News new | ask | show | jobs
by adrianmsmith 2856 days ago
The thing I love most about LyX is the "outline" view. Editing plain text e.g. in "vi" has nothing comparable, but neither does Word, or Google Docs, etc., in my opinion.

In the screenshot here https://pauljmiller.files.wordpress.com/2015/05/lyx-main-scr... you can see there is a pane on the left with the document structure. At the bottom of that pane, there are four buttons, the right of which are an up and down button. Those four buttons (left, right, up, down) allow you to take a section of the document and move it around. The up/down change its position relative to other sections, and left/right promote/indent the section (e.g. change heading to sub-heading, or vice versa).

When editing large documents (e.g. > 100 pages), I find this invaluable if I wish to restructure the document.

7 comments

> neither does Word

MS Word has an interactive draggable outline view with the promote/demote/drag features ("View"|"Outline"), it also has a navbar outline view ("View"|"Navigation Pane" checkbox). You can use both combined.

The "move heading up/down" don't work as well as LyX.

On Word, if you move a heading up/down with the buttons (in "View"|"Outline") the heading moves but the text and sub-sections underneath it don't move.

Before:

    MY HEADING
    Some text
       SUB-HEADING
       Text about the sub-heading
       SUB-HEADING 2
       More text
If you take "SUB-HEADING 2" and click "move up", the document is now:

    MY HEADING
    Some text
       SUB-HEADING
       SUB-HEADING 2
       Text about the sub-heading
       More text
What you want, when you move a heading, is not only to move the heading, but to really move the whole section, including: the heading, its text, and sub-headings, the text under the sub-headings, etc.

LyX moves the sections around, Word only moves the headings.

I'll concede that dragging in Word does give the desired effect (I admit I never tried drag before you mentioned it, despite having used Word for 25 years and always wishing for that feature. I assumed dragging did the same as the buttons.) And the indent/outdent buttons do work take their contents with them as well.

What is your text is not related to the heading? In Word just select everything you want to move, then move it all together.

Also Ctrl-Alt-arrow moves the sections around.

Why would your text be unrelated to the header?

In an editor with first-class outlining support, the document is usually composed with the outline view in play, so essentially you’re always adding text and headers to a “node” rather than to the document as a whole. You then place the node in the outline, rather than placing text in a linear document that happens to (sometimes) reflect a valid outline.

It’s less comparable to Word, and more comparable to editing .rtf files and placing them into a flow in Desktop Publishing software. The content (the .rtf file) and the document (the flow-boxes) are separate, and can be modified separately without knowledge of how the other side has been modified.

(This workflow also being the original TeX workflow, just replacing “.rtf files” with individual .tex content files, and “the layout” with a structural .tex file that imports those content files.)

Because a writing app supports the act of writing. Once you’re done writing, you don’t need the app anymore. And when you’re in the act of writing, things are often not linear. You might come up with headers first, and fragments of text, usually in the order they pop into your head, not the order they need to be in the final copy. Then you wordsmith and reorder things to get them into a progression.

And in Word you can always collapse the section and then move it around with all of the text.

MS Word's outlining feature was there in Word for Windows 1.0 at the latest, which makes it close to 30 years old.
Org-Mode and Leo Editor have a collapsible outline view like that, but while you can use them to author documents, it's obviously hard to compare them to LyX.
> it's obviously hard to compare them to LyX.

Org-mode is certainly not directly comparable. But the output you get from Org-mode is comparable. Org-mode has excellent support for seamless export to LaTeX and LaTeX-generated-PDF, and many use it for writing, e.g., academic papers. Output is as beautiful as any other LaTeX tool, depends on the styling you build in. Here, e.g., is someone who modified LaTeX output to have an "Edward Tufte" look, once you incorporate the mods n your Emacs init file, conversion to this output happens automatically from the plain text Org file export: https://damitr.org/2014/01/09/latex-tufte-class-in-org-mode/

If you use Emacs, AuCTeX provides this type of functionality
+ outline-minor-mode
FWIW, Google Docs has an outline view.
I don't remember it allowing you to re-order sections, though.
That's kind of the (almost) whole point of Scrivener.

Also, I've seen this recently: https://innovationdilation.com/ but there are many many more like that.

This functionality is kind of huge for me though. I'm getting sick of Apple quality control problems, and have been thinking of bailing to a pixelbook with crostini. Scrivener is one of the few apps that makes me reluctant to pull the trigger; if lyx can replace it then...
That support article only states that Google Docs can display headings.

LyX can not only do that, it can also move the sections around (with left/right/up/down buttons). This moves the heading, plus all text under the heading, any sub-sections including their text, etc. It's very useful for restructuring the document.

:g/^#/p

for markdown at least.

If you put a #after the p you'll get the line numbers of the instances too, and you can jump to them with :num.

So for LaTeX if I do...

    :g/^\\\(sub\)*section/p#
I get...

     35 \section{Introduction}
     37 \section{Setup}
     39 \subsection{CSS Setup}
     66 \subsection{JS Setup}
     74 \subsection{HTML Setup}
     92 \subsection{React setup}
    113 \section{Components}
    261 \subsection{Card Box}
    541 \section{Old Chunks}
    562 \section{Index}
    566 \section{Code Chunks}
and...

    :92
Takes me to the React Setup subsection.