emacs-orgmode
[Top][All Lists]
Advanced

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

Re: basic org questions


From: Tim Cross
Subject: Re: basic org questions
Date: Wed, 16 Sep 2020 10:04:53 +1000
User-agent: mu4e 1.5.5; emacs 27.1.50

Emanuel Berg via General discussions about Org-mode. <emacs-orgmode@gnu.org> 
writes:

> 1) How do I make a region italic?
>
> This does not fontify and does not show up as
> italic type:
>
> /En gång i tiden var även Spanien täckt av skog.
> En gammal berättelse menar att man i norra Spanien
> kunde hoppa upp på en apas rygg och ta sig ner till
> södra Spanien utan att klättra av en enda gång. Apan,
> underförstått, kunde hoppa från gren till gren genom
> hela halvön. Flyger man över Spanien idag ser man att
> det har gått åt ett och annat träd sen dess./
>
> /This/ works tho.
>
> 2) How do I have tables not appear centered
> by default, but left-aligned?
>
> 3) How do I have a new paragraph, as indicated by
>
> p1
>
> p2
>
> appear w/o indentation, but with a blank line between
> p1 and p2 (yes, exactly as stated, really).
>

It is important to understand the org mode architecture in order to
understand how/where to try and change/fix things to get specific
results. It is also very important to be clear about this architecture
when asking questions so that you can include the most relevant
information. 

Org has a multi-layered architecture. At the top is the org buffer where
you put your org text. This text supports markup and other text with
special  meaning which the Emacs editor will display in specific ways
using colours, fonts, overlays etc.

When you export an org file, the contents of the org file is
extracted and markup, options, 'special' text etc is mapped to the
equivalent 'concept' in the back end format. Sometimes, this translation
might involve multiple steps (e.g. for PDF the org text is translated
into Latex, which is then translated into pdf). Understanding this is
critical as all back ends are not the same and sometimes, the changes
you need to make need to be performed at the back end rather than within
the org file itself. For example, sometimes, a quick and easy change can
be achieved by manually editing the *.tex file generated when doing a
PDF export and other times, it may be necessary to define a whole new
document class in order to achieve the result you want (for example, I
defined a new entry for org-latex-classes called 'work' which added
additional Latex classes and macro definitions needed to support the
format documents had to have for my employer).  

All this means that you need to be explicit when asking a question
whether what you want is for the org buffer/file, the exported file and
what the exported format is.

As with many questions involving technology, you are often better off
explaining what your specific outcome is rather than on how to do
something as the latter is often asking how to do something to implement
what you think is the right solution when in fact a completely different
solution might be easier.

As an example, with your question about how to make a paragraph italic.
Do you want the text to appear italic in the org buffer or do you want
the PDF text which results from the export to be italic? Is it actually
critical that it is italic or do you just want to make sure that text is
rendered in such a way as to make it emphasised or stand out in the
final exported output?

If it is the latter, I would actually take a completely different
approach. Rather than trying to mark the whole paragraph as italic, I
would create a quoted block using #+begin_quote/#+end_quote. Each back
end will interpret this quoted block in its own way and render it
accordingly.

Another approach would be to use embedded latex in your document and
render the paragraph as a latex block using

\begin{em}
\end{em}

or

\begin{it}
\end{it}

The disadvantage of this approach is that your being very back end
specific in your org-file, so exporting to other formats may not work
well.

With respect to your question regarding table placement in your PDF,
have a look at the manual section on exporting and in particular, Latex
export options. There are a number of options you can add to your table
definition which will affect how the table is rendered or where it is
placed within the document. Note that Latex is a VERY powerful document
formatting system and it is VERY opinionated. Unlike MS Word and other
word processing systems, with Latex derived formatting, your almost
always better off leaving Latex to decide how to do things. With Latex,
you select a document style and run with that. Tables are notoriously
complex to get right and while you can achieve what you want, you will
likely need to read up on Latex and how it processes tables and you may
need to add or tweak the latex packages included by Org when it
generates the output in order to get the precise result you are after.
In your current case, you will likely be able to achieve your desired
result just using the ':float' or ':placement' commands (see the org
manual section on latex export).

With respect to your final question on paragraph indent for first line -
this is the default style for Latex documents. Different Latex document
styles have different paragraph styles, some of which do not indent the
first line. You can change the document style by adding a new latex
class. For example, many people prefer the Korma Article class for
documents over the default Latex Article class. You can change the class
in a number of ways including by adding a #+latex_class: header to the
org file. e.g.

#+latex_class: korma-article

Another alternative is to add an additional latex header argument. For
example, this may work to disable paragraph indentation

#+latex_header:  \setlength{\parindent}{0pt}

You can also prevent indentation of a specific paragraph by using the
latext

\noindent

command.

Note that the above is specific to exports based on Latex (such as PDF
export) and will not have effect on other export types.

If you really must heavily customise the PDF format, you have the power.
However, you will likely need to read up on Latex and the latex to pdf
process to understand how that works and then go back to the org manual
to work out the best ways to customise org to use the setting you want.
The key to success IMO is to be conservative here. Lots of research into
typography, text formatting etc has gone into the TeX/LaTeX system and
your generally best off going with their style decisions. Look for
alternative high-level document styles (such as the Korma, HiTech and
other styles) rather than try hacking existing styles as it will be
easier and give better results in the long term.

HTH

Tim

-- 
Tim Cross



reply via email to

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