Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Hi Andras, Andras Major writes: > - If, in the source, the "." precedes a double space " " or a newline, > use ". ". > > - In any other case, use ".\ ". I wonder how such a function would look like. Does anyone wants to try to write it? Even pseudo-code would be fine at this stage. > The reason this would work is the Emacs convention of writing ASCII > such that there is at least one more space (at least two) between > sentences. I believe that the Emacs fill-* functions also make use of > this convention. C-h v sentence-end TAB gives several variable that let the user change the number of spaces after a sentence. So I guess this is not really "Emacs convention of writing ASCII", but a more general American convention. Would the values of sentence-end* be taken into account by the feature you describe above? -- Bastien
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Hi all, András Major wrote: >> > I'm fully aware of that, but that also messes up the spacing between >> > sentences. My proposed solution should be robust enough to be >> > more-or-less foolproof yet produce nice-looking output. >> >> What is nice-looking is a matter of personal taste. Personally, I tend >> to prefer everything close-set, as with \frenchspacing, although that > > For that, you can use \frenchspacing in the latex header. > >> If you _do_ want to keep the wider inter-sentence spacing, then you >> also need to worry about sentences that end with upper-case letters. > > True, but that is, in my experience, a very rare thing to happen. In > all the years of writing documents in (La)TeX, I don't think I've had > a single occurrence of this case. You can, of course, make the export > code even more sophisticated and check for this case and adapt the > output accordingly. Then the only rule for the user to remember would > be as simple as this: single space in org maps to inter-word space in > the output, double space maps to inter-sentence space. The problem is that this rule can be true, and certainly is, in English. But French typing conventions require those space before/after punctuation symbols: | symobl | before | after | |++---| | , | 0 | 1 | | . | 0 | 1 | | : | 1 | 1 | | ! | 1 | 2 | | ? | 1 | 2 | for the most commons. Hence, in French, there is never a double space inserted after a sentence period -- well for exclamation or interrogation marks. Best regards, Seb -- Sebastien Vauban
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Andras Major writes: > Hi, > > in TeX and LaTeX, the width of the glue (blank space) after a "." can > be one of two different values, depending on the context. There is > always a longer space between sentences than after a "." that doesn't > mark the end of a sentence (abbreviations, dates, etc.). Since > TeX/LaTeX usually can't recognize the latter case by itself, one can > help out by writing ".\ " or ".~" explicitly to enforce a short space. > Without these hints, printed output will look typographically wrong. > > Org-mode export doesn't allow me to easily include these hints without > affecting readability and export to other formats. Therefore I ask > that LaTeX export places ". " or ".\ " in the output automatically > depending on the context: Org-mode has a straightforward way to include these hints that makes it possible to take care of export to other formats: org-entities-user is a variable defined in `org-entities.el'. Its value is nil Documentation: User-defined entities used in Org-mode to produce special characters. Each entry in this list is a list of strings. It associates the name of the entity that can be inserted into an Org file as \name with the appropriate replacements for the different export backends. The order of the fields is the following name As a string, without the leading backslash LaTeX replacementIn ready LaTeX, no further processing will take place LaTeX mathp A Boolean, either t or nil. t if this entity needs to be in math mode. HTML replacement In ready HTML, no further processing will take place. Usually this will be an &...; entity. ASCII replacementPlain ASCII, no extensions. Symbols that cannot be represented will be left as they are, but see the. variable `org-entities-ascii-explanatory'. Latin1 replacement Use the special characters available in latin1. utf-8 replacementUse the special characters available in utf-8. If you define new entities here that require specific LaTeX packages to be loaded, add these packages to `org-export-latex-packages-alist'. An example due to Lawrence Mitchell is here: http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-10-1 With some care, it is possible to keep readability fairly close to what it is in LaTeX markup. hth, Tom > > - If, in the source, the "." precedes a double space " " or a newline, > use ". ". > > - In any other case, use ".\ ". > > The reason this would work is the Emacs convention of writing ASCII > such that there is at least one more space (at least two) between > sentences. I believe that the Emacs fill-* functions also make use of > this convention. > > Thanks, > > András > > -- Thomas S. Dye http://www.tsdye.com
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Hi Will, > > I'm fully aware of that, but that also messes up the spacing between > > sentences. My proposed solution should be robust enough to be > > more-or-less foolproof yet produce nice-looking output. > > What is nice-looking is a matter of personal taste. Personally, I tend > to prefer everything close-set, as with \frenchspacing, although that For that, you can use \frenchspacing in the latex header. > If you _do_ want to keep the wider inter-sentence spacing, then you > also need to worry about sentences that end with upper-case letters. True, but that is, in my experience, a very rare thing to happen. In all the years of writing documents in (La)TeX, I don't think I've had a single occurrence of this case. You can, of course, make the export code even more sophisticated and check for this case and adapt the output accordingly. Then the only rule for the user to remember would be as simple as this: single space in org maps to inter-word space in the output, double space maps to inter-sentence space. > If you are going to go this way, I think it should be optional. Not > everyone uses double spaces between sentences in their ascii text. I think that the same people wouldn't mind slightly wrong spacing in the printed output either. András
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
On Fri, Aug 19, 2011 at 4:55 PM, Rasmus wrote: > Andras Major writes: > >> Org-mode export doesn't allow me to easily include these hints without >> affecting readability and export to other formats. Therefore I ask >> that LaTeX export places ". " or ".\ " in the output automatically >> depending on the context: > > I would like something like this too. Actually, what I would prefer even > more would be to stop Org from interpreting '{', '}', '\' and other common > TeX symbols. More often than not I will want to use '\' as an escape > character. > My latex/org knowledge is not great but if your use for braces is for superscripts and subscripts, I believe you can have fair bit of control with the option ^:{}. I think what is required here is a stable escaping convention within org. > —Rasmus > -- Suvayu Open source is the future. It sets us free.
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Andras Major writes: > Org-mode export doesn't allow me to easily include these hints without > affecting readability and export to other formats. Therefore I ask > that LaTeX export places ". " or ".\ " in the output automatically > depending on the context: I would like something like this too. Actually, what I would prefer even more would be to stop Org from interpreting '{', '}', '\' and other common TeX symbols. More often than not I will want to use '\' as an escape character. —Rasmus -- Sent from my Emacs
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Hi András 2011/8/19 András Major : >> > There is always a longer space between sentences than after a "." >> > that doesn't mark the end of a sentence >> >> This could easily be turned off with the use of a single \frenchspacing >> in the preamble (or in the document; you may switch between the two in >> the document as often as you like; e.g. \frenchspacing is active >> starting from the point TeX reads the macro until it is set back to >> \nonfrenchspacing). > > I'm fully aware of that, but that also messes up the spacing between > sentences. My proposed solution should be robust enough to be > more-or-less foolproof yet produce nice-looking output. > What is nice-looking is a matter of personal taste. Personally, I tend to prefer everything close-set, as with \frenchspacing, although that is mainly because it is very easy to screw up with LaTeX's default spacing, and then things look terrible. There is an interesting discussion at http://en.wikipedia.org/wiki/History_of_sentence_spacing If you _do_ want to keep the wider inter-sentence spacing, then you also need to worry about sentences that end with upper-case letters. For instance, in LaTeX you should write: "The paper by A. Major et~al.\ was discussed by the General Assembly of the UN\@." Without the "\@" LaTeX would not recognize the period following "UN" to be sentence-ending. Note that there is no need to do anything special after the "A." If you are going to go this way, I think it should be optional. Not everyone uses double spaces between sentences in their ascii text. Cheers Will -- Dr William Henney, Centro de Radioastronomía y Astrofísica, Universidad Nacional Autónoma de México, Campus Morelia
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
On Aug 19, 2011, at 8:50 AM, Andras Major wrote: > Hi, > > in TeX and LaTeX, the width of the glue (blank space) after a "." can > be one of two different values, depending on the context. There is > always a longer space between sentences than after a "." that doesn't > mark the end of a sentence (abbreviations, dates, etc.). Since > TeX/LaTeX usually can't recognize the latter case by itself, one can > help out by writing ".\ " or ".~" explicitly to enforce a short space. > Without these hints, printed output will look typographically wrong. > > Org-mode export doesn't allow me to easily include these hints without > affecting readability and export to other formats. Therefore I ask > that LaTeX export places ". " or ".\ " in the output automatically > depending on the context: > > - If, in the source, the "." precedes a double space " " or a newline, > use ". ". > > - In any other case, use ".\ ". > > The reason this would work is the Emacs convention of writing ASCII > such that there is at least one more space (at least two) between > sentences. I believe that the Emacs fill-* functions also make use of > this convention. +1 I do like this idea. I am a big fan of the Emacs convention to use two spaces after a sentence - such a big fan that I have trouble reading ascii text where this convention is not used. - Carsten
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
> > There is always a longer space between sentences than after a "." > > that doesn't mark the end of a sentence > > This could easily be turned off with the use of a single \frenchspacing > in the preamble (or in the document; you may switch between the two in > the document as often as you like; e.g. \frenchspacing is active > starting from the point TeX reads the macro until it is set back to > \nonfrenchspacing). I'm fully aware of that, but that also messes up the spacing between sentences. My proposed solution should be robust enough to be more-or-less foolproof yet produce nice-looking output. András
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Andras Major writes: > Hi, > in TeX and LaTeX, the width of the glue (blank space) after a "." can > be one of two different values, depending on the context. And depending on the use of \nonfrenchspacing and \frenchspacing. > There is always a longer space between sentences than after a "." > that doesn't mark the end of a sentence This could easily be turned off with the use of a single \frenchspacing in the preamble (or in the document; you may switch between the two in the document as often as you like; e.g. \frenchspacing is active starting from the point TeX reads the macro until it is set back to \nonfrenchspacing). -- Until the next mail..., Stefan. pgpk9oKN0N7KA.pgp Description: PGP signature
Re: [O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Hi, I'd like to note, that ".~" would lead to a hard space, that disallows a line break, so I think only ".\ " is correct, although Emacs M-q does not break after ". " with a single space, too, to be able to detect sentence ends. Daniel Am Freitag, 19. August 2011, 08:50:52 schrieb Andras Major: > in TeX and LaTeX, the width of the glue (blank space) after a "." can > be one of two different values, depending on the context. There is > always a longer space between sentences than after a "." that doesn't > mark the end of a sentence (abbreviations, dates, etc.). Since > TeX/LaTeX usually can't recognize the latter case by itself, one can > help out by writing ".\ " or ".~" explicitly to enforce a short space. > Without these hints, printed output will look typographically wrong. > > Org-mode export doesn't allow me to easily include these hints without > affecting readability and export to other formats. Therefore I ask > that LaTeX export places ". " or ".\ " in the output automatically > depending on the context: > > - If, in the source, the "." precedes a double space " " or a newline, > use ". ". > > - In any other case, use ".\ ". > > The reason this would work is the Emacs convention of writing ASCII > such that there is at least one more space (at least two) between > sentences. I believe that the Emacs fill-* functions also make use of > this convention. > > Thanks, > > András
[O] Wishlist: LaTeX export: automatically append backslash to "." unless at end of sentence
Hi, in TeX and LaTeX, the width of the glue (blank space) after a "." can be one of two different values, depending on the context. There is always a longer space between sentences than after a "." that doesn't mark the end of a sentence (abbreviations, dates, etc.). Since TeX/LaTeX usually can't recognize the latter case by itself, one can help out by writing ".\ " or ".~" explicitly to enforce a short space. Without these hints, printed output will look typographically wrong. Org-mode export doesn't allow me to easily include these hints without affecting readability and export to other formats. Therefore I ask that LaTeX export places ". " or ".\ " in the output automatically depending on the context: - If, in the source, the "." precedes a double space " " or a newline, use ". ". - In any other case, use ".\ ". The reason this would work is the Emacs convention of writing ASCII such that there is at least one more space (at least two) between sentences. I believe that the Emacs fill-* functions also make use of this convention. Thanks, András