Как я могу редактировать несколько текстовых файлов как один виртуальный документ?

628
TeXnewbie

Моя главная цель - иметь возможность постоянно отслеживать количество отдельных фрагментов текста и символов и одновременно читать весь длинный документ целиком.

11
Основываясь на перефразированном вопросе, вы можете попробовать любой конструктор GUI на основе форм - один из таких примеров - форма Microsoft Access. По сути, вы должны создавать текстовые поля или текстовые области, в которые вы вводите свой пользовательский текст, а затем с небольшим количеством кода Visual Basic объединять их все вместе в выводе, и вы можете разместить все это на одном экране. Это было бы довольно легко реализовать, в зависимости от того, насколько вы хотели сделать это. Horn OK Please 10 лет назад 1

2 ответа на вопрос

6
Journeyman Geek

As I discussed on Root Access, the broad class of tool you're looking at is an outline text editor. Outline editors let you work in blocks of texts, treat them as discrete units, and link them together, perfect for your use case.

As far as ANYONE I have talked to who needs/has used one has told me, literature and latte's scrivener is the program to beat, though this answer on Ask Ubuntu suggests a few alternatives.

Я только что пролистал этот вопрос АС, и [Kabikaboo] (https://launchpad.net/kabikaboo) кажется отличным выбором для ОП (в том смысле, что весь текст остается как можно более неформатированным, но при этом сохраняет преимущества древовидного макета). Отличная находка; просто обратите внимание, что некоторые из этих программ не будут сохранять отдельные фрагменты текста в разных * файлах *, которые можно редактировать вручную (конечно, многие редакторы текстового контура позволяют импортировать и экспортировать вручную, но они обычно сохраняют само текстовое дерево контуров в другой формат для быстрой загрузки / сохранения). Breakthrough 10 лет назад 1
да уж. Я на самом деле говорил об этом в чате и предложил это. Размещено здесь в основном в качестве ссылки. Я говорил с достаточным количеством пользователей Schievener, что это первое, что пришло в голову - я откопал ссылку AU, потому что OP запрашивал бесплатные альтернативы. Я еще не углубился в них, я искал что-то подобное, чтобы заменить мое стадо статей и тетрадей; p Journeyman Geek 10 лет назад 0
3
Breakthrough

If you're willing to consider a bit more than plain-text, then this is very possible. Two such ways are using Markdown (which doesn't have native include support, but several document processors do) or LaTeX.


Markdown

With minimal markup, the Pandoc route may be what you want, since your text fragments just need to be written as Markdown documents (which, without using any additional features, are still just plain-text documents; this is the formatting system used here on Super User and the other Stack Exchange websites). Inspired by this SO question, let's say the text fragments are in the current working directory:

01_introduction.md 02_examples.md 03_discussion.md 04_conclusion.md 

These can be merged & rendered as a single file with Pandoc using the command:

pandoc *.md > merged.html 

Pandoc is also compatible with the LaTeX format which may also serve your needs, although there are indeed several other LaTeX document editors/compilers which might be better suited to the task.


LaTeX

Consider creating a rather simple LaTeX document, and place your plain-text files into several other files. You can then use the LaTeX \input command (or \include if you need that functionality) in the parent document to join and render all of the individual text fragments as a singular document.

So, you might want to create a parent .tex document to wrap all of your sub-.tex files (which just contain plain-text; LaTeX's \include works similar to that of the C/C++ programming languages). So let's say you have the same Markdown files as before, but renamed from .md to .tex (e.g. now you have 01_introduction.tex, 02_examples.tex, ...).

You can then make another file to compile (e.g. 00_parent.tex), which just contains the following (see this article for more advanced ways to set up a LaTeX document):

\documentclass \begin \input \input \input \input \end 

You can then compile the 00_parent.tex file with your favourite LaTeX editor (like TeXWorks) or just compile it from a terminal using the native LaTeX tools or any others you might like (Pandoc also seems to support LateX).

Благодарю. Хотя я уделил немного внимания LaTeX, я не думал о Markdown, чтобы решить эту проблему. Оба они выглядят очень хорошо, но после того, как я использовал Scrivener в течение дня или двух, я совершенно поражен тем, насколько это лучше, чем все остальное, о чем я знаю. Безусловно, лучший аспект Scrivener для меня - это режим «[Scrivenings] (http://www.literatureandlatte.com/scrivener.php?show=features)», который трудно объяснить в предоставленном пространстве, но он _perfectly_ соответствует моя потребность Большое спасибо всем за вашу помощь. TeXnewbie 10 лет назад 0