emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] exporting to latex and docx not honouring carriage returns to ta


From: Tim Cross
Subject: Re: [O] exporting to latex and docx not honouring carriage returns to tabbing
Date: Wed, 10 Oct 2018 08:31:21 +1100
User-agent: mu4e 0.9.18; emacs 26.1

Sharon Kimble <address@hidden> writes:

> Eric S Fraga <address@hidden> writes:
>
>> On Tuesday,  9 Oct 2018 at 12:06, Sharon Kimble wrote:
>>> Brilliant, thanks very much Robert, you've saved the project as I didn't
>>> fancy having to work with the document in LibreOffice. These are the
>>> settings that I've finally gone with -
>>>
>>> #+LaTeX_Header: \parskip=0pt
>>> #+LaTeX_Header: \parindent=2em
>>
>> This is close to the default behaviour for the LaTeX article class.  Did you 
>> have something setting these to different values?
>
> Yes, I have a custom class called 'my-report' which has no packages
> outlined in it, here it is.
>
> --8<---------------cut here---------------start------------->8---
> #+begin_src emacs-lisp
> (with-eval-after-load 'ox-latex
> (add-to-list 'org-latex-classes
>              '("my-report" "\\documentclass{report}
>                [NO-DEFAULT-PACKAGES]"
>                ;;[EXTRA]"
>                ;;("\\part{%s}" . "\\part*{%s}")
>                ("\\chapter{%s}" . "\\chapter*{%s}")
>                ("\\section{%s}" . "\\section*{%s}")
>                ("\\subsection{%s}" . "\\subsection*{%s}")
>                ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>                ("\\paragraph{%s}" . "\\paragraph*{%s}")
>                ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
>               (custom-set-variables '(org-export-allow-bind-keywords t))
> #+end_src
> [2016-04-14 Thu 08:47]
> [2016-09-09 Fri 00:54]
> [2017-01-17 Tue 13:17]
> http://orgmode.org/worg/org-tutorials/org-latex-export.html
> --8<---------------cut here---------------end--------------->8---
>
>
>>> except for the first paragraph in a new chapter.
>>
>> Yes, the first paragraph after any heading will not be indented.  That is 
>> also default and is actually what most books use.
>
> Yes, I'm learning, and checking with the book that I'm currently reading :)
>
> Thanks
> Sharon.

While Eric and Robert have provided some really useful tips on some
ad-hoc tweaks you can make to latex/pdf output, I would also encourage
you to look at the many other document styles. As Eric points out, the
tweaks look to be changing the 'report' class to be more like the
'article' class. Have you tried just using the article class instead of
report? Note also there is a 'book' class as well, which may well
produce something more in line with what your after if you are wanting
output which looks more like a published book. Then there are all the
other 'publishers' styles to consider as well as other style packages
like KomaScript, HiTec etc. 

While these tweaks are often very useful, they really should be used
sparingly as they can have unforeseen consequences, especially when you
begin to use other packages. It is important to remember that some org
features rely on some of these additional packages to produce good
export results. Once you start 'tweaking' the output, it can quickly
spiral out of control. You fix one thing only to create two new issues.

One of the most common mistakes I see when people start using latex as
the basis for document generation is ad hoc tweaking of the style. This
is an unfortunate consequence of most of us being exposed to traditional
word processors such as MS Word or Libre Office. Producing good quality
documents is a very complex topic and Donald Knuth spent a lot of time
researching all the aspects of type setting and layout to produce a
consistently good and reliable system with TeX. Things have evolved and
we have new requirements (such as on-line documents which are read
electronically and not printed in hard copy). Additional packages have
been added to address these types of enhancements. 

The real trick with TeX/LaTeX is to work with the system and not against
it. If you find it necessary to constantly tweak indent, paragraph
spacing, line height, line breaks,  etc, then you are probably using the
wrong document style. Try other styles and look for one which meets the
majority of your requirements and only then consider tweaking it. As you
will probably need more than one, you will likely end up with a number
of custom definitions in addition to 'my-report'. I have around 5 base
ones as well as a handful of ones specific to particular jobs/clients
(e.g. include logos, custom headers/footers, title pages etc).

The bad news is that this will probably be somewhat time consuming
initially (there is a huge number of document styles and packages out
there). The good news is that once you have the basic definitions, you
probably won't have to think about this again for ages (my definitions
have been in place for years now).

good luck

Tim




--
Tim Cross



reply via email to

[Prev in Thread] Current Thread [Next in Thread]