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

2018-10-11 Thread Tim Cross


Sharon Kimble  writes:

> The first distro that I used was Red Hat, and I bought a copy as that
> was the only way in which you could get hold of it, and a couple of days
> before I was going to install it, Red Hat made it free to download and
> use! And that did not help my mood at all! But I've been trying to find
> what year that was, can anyone tell me please, as I can't find a date
> for it?
>

I started with Slackware in 1994 and then moved to RedHat in 1996
because of RPM and the benefits it provided over Slackware, which at the
time really just had tar.gz archives. The first really popular RedHat
release was probably Vanderbuilt (1997). Zoot (2000) was the first
release to offer ftp download of ISO images. I switched to Debian in
2001 because deb packages had better dependency handling than RPM (at
the time). In about 2010 I swapped to Ubuntu, mainly because I was no
longer that interested in distros and just wanted a system which
worked. I still prefer deb over rpm.

My first latex document was in 1988/1989. Back then it was a DOS
distribution and a pain to get working well! There use to be DOS
sotfware (name I cannot remember) which you installed to give you a
'Unix' like environment - back then, most of my work was on
mainframe/mins (Dec 20/Ultrix, SunOS/Solaris, OSF/Tru64). 

I also do all my work in org and don't write 'native' latex anymore. All
the info I provided before was from the perspective of using org to
generate Latex and then pdf. My setup and document classes are all
defined within org mode configuration options. I run emacs on OSX for
work and Linux at home. The last time I used MS was Windows 3.1 and I
know little about modern MS platforms. MS Office just make me shudder!


-- 
Tim Cross



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

2018-10-11 Thread Sharon Kimble
Tim Cross  writes:

> Sharon Kimble  writes:
>
>> Eric S Fraga  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

Thanks Tim, but I've been using Linux since sometime in 2003, and have
moved on from writing various things in 'pure' latex (meaning that it
wasn't exported into latex as it was already there!) to my current state
o

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

2018-10-10 Thread Tim Cross


Eric S Fraga  writes:

> On Wednesday, 10 Oct 2018 at 08:31, Tim Cross wrote:
>
> [...]
[...]
>
>
> And I highly recommend the koma-script classes as opposed to the default 
> LaTeX ones.  For Sharon, the scrreprt class may be what you want.

Yes, koma-script has been my default as well for some time now. I also
use the hitec style, which seems to go down well with the 'tech' crowd.

Around 80% of the time, people look at my documents and are blown away
because of how good they look (content, unfortunately, can vary
significantly!). The only time things become problematic is when a
decision is made to work on a document collaboratively and they want to
use 'track changes'. At this point, I try to convince them to just work
in plain text or org files and I take on the responsibility of
incorporating their changes. This works OK provided they are able to
just work with the org file (either as an org file or as just plain
text) and not get caught up in formatting etc, in which case I can
extract their changes with diff. However, too often, they just don't get
it or cannot resist and insist on changing the formatting without
changing the content, so diffs become less useful.

Tim

-- 
Tim Cross



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

2018-10-10 Thread Eric S Fraga
On Wednesday, 10 Oct 2018 at 08:31, Tim Cross wrote:

[...]

> 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.

I agree with everything you said in your post.  

The first thing I tell my students when they start working in my group (i.e., 
after telling them that I expect all writing to be done in LaTeX...) is "to go 
with the flow" and not try to fight the system.  LaTeX know better than them 
what is a good layout for text.  Their concern should be the content.

Most listen but there's always one that insists that they have a better idea of 
what looks good... and you can imagine the result. ;-)

So, yes, my advice as well is to find a LaTeX document class that does what you 
want and go with it.  Minor tweaks are of course always possible but anything 
else should be avoided except for very special cases.  YMMV, of course.

And I highly recommend the koma-script classes as opposed to the default LaTeX 
ones.  For Sharon, the scrreprt class may be what you want.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.11-620-ga548e4



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

2018-10-09 Thread Tim Cross


Sharon Kimble  writes:

> Eric S Fraga  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



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

2018-10-09 Thread Sharon Kimble
Eric S Fraga  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.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 9.4, fluxbox 1.3.7, emacs 25.3.4, org 9.1.14


signature.asc
Description: PGP signature


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

2018-10-09 Thread Eric S Fraga
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?

> 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.

-- 

Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-783-g97fac4



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

2018-10-09 Thread Sharon Kimble
Robert Klein  writes:

> On Mon, 08 Oct 2018 16:54:39 +0100
> Eric S Fraga  wrote:
>
>> On Monday,  8 Oct 2018 at 10:56, Sharon Kimble wrote:
>> > My finished output in the pdf will have every line indented/tabbed
>> > to 4 spaces and have a carriage-return at the end of each
>> > paragraph, with no spacings in between paragraphs.
>> >
>> > I can get it how I want in org-mode, but when its exported to latex
>> > and converted into a pdf file, the whole section comes out in one
>> > block of text!  
>> 
>> Both LaTeX and org define new paragraphs by a blank line.   Spaces at
>> the start of a line only have meaning, in org, if the lines are part
>> of a list (and never mean anything in LaTeX).
>> 
>> I am not sure exactly what you want to achieve so it is difficult to
>> suggest anything.  Try separating your paragraphs with empty lines to
>> see how much closer this gets you to what you want.
>> 
>
> What Eric says.
>
> Then try to add to the org-file a line
>
> #+LaTeX_Header: \parskip=0pt
>
> so the spacing between paragraphs is 0.  Then add
>
> #+LaTeX_Header: \parindent=0pt
>
> so the first line of a paragraph isn't indented.
>
> If you want to get /all/ the text indented by “4 spaces”, put a line
>
> #+LaTeX: \setlength{\leftskip}{2em}
>
> at the top of your document.
>
>
> If you want only parts indented, put the line before the beginning of
> the part to be indented and put this line after it:
>
> #+LaTeX: \setlength{\leftskip}{0em}
>
> Does this help?

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 -

--8<---cut here---start->8---
#+LaTeX_Header: \parskip=0pt
#+LaTeX_Header: \parindent=2em
--8<---cut here---end--->8---

and I've found that having that parindent of 2em gives a very close
approximation of each paragraph beginning with four spaces, except for
the first paragraph in a new chapter. Weird, but true! Just part of what
my finished document has to look like, open any fiction book and you see
what its supposed to look like. When it works right, its beautiful, but
when its wrong, its a right mare!

Thank you very much, and now I've learnt how to do it, it'll make the
whole thing much easier.

Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 9.4, fluxbox 1.3.7, emacs 25.3.4, org 9.1.14


signature.asc
Description: PGP signature


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

2018-10-08 Thread Robert Klein
On Mon, 08 Oct 2018 16:54:39 +0100
Eric S Fraga  wrote:

> On Monday,  8 Oct 2018 at 10:56, Sharon Kimble wrote:
> > My finished output in the pdf will have every line indented/tabbed
> > to 4 spaces and have a carriage-return at the end of each
> > paragraph, with no spacings in between paragraphs.
> >
> > I can get it how I want in org-mode, but when its exported to latex
> > and converted into a pdf file, the whole section comes out in one
> > block of text!  
> 
> Both LaTeX and org define new paragraphs by a blank line.   Spaces at
> the start of a line only have meaning, in org, if the lines are part
> of a list (and never mean anything in LaTeX).
> 
> I am not sure exactly what you want to achieve so it is difficult to
> suggest anything.  Try separating your paragraphs with empty lines to
> see how much closer this gets you to what you want.
> 

What Eric says.

Then try to add to the org-file a line

#+LaTeX_Header: \parskip=0pt

so the spacing between paragraphs is 0.  Then add

#+LaTeX_Header: \parindent=0pt

so the first line of a paragraph isn't indented.

If you want to get /all/ the text indented by “4 spaces”, put a line

#+LaTeX: \setlength{\leftskip}{2em}

at the top of your document.


If you want only parts indented, put the line before the beginning of
the part to be indented and put this line after it:

#+LaTeX: \setlength{\leftskip}{0em}


Does this help?

Best regards
Robert




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

2018-10-08 Thread Eric S Fraga
On Monday,  8 Oct 2018 at 10:56, Sharon Kimble wrote:
> My finished output in the pdf will have every line indented/tabbed to 4
> spaces and have a carriage-return at the end of each paragraph, with no
> spacings in between paragraphs.
>
> I can get it how I want in org-mode, but when its exported to latex and
> converted into a pdf file, the whole section comes out in one block of
> text!

Both LaTeX and org define new paragraphs by a blank line.   Spaces at the start 
of a line only have meaning, in org, if the lines are part of a list (and never 
mean anything in LaTeX).

I am not sure exactly what you want to achieve so it is difficult to suggest 
anything.  Try separating your paragraphs with empty lines to see how much 
closer this gets you to what you want.

-- 

Eric S Fraga via Emacs 27.0.50, Org release_9.1.13-894-gf79545



[O] exporting to latex and docx not honouring carriage returns to tabbing

2018-10-08 Thread Sharon Kimble

I have a problem in an org-mode file which is then exported to latex and
then converted into a pdf. And the file is the draft of my fiction book.

My finished output in the pdf will have every line indented/tabbed to 4
spaces and have a carriage-return at the end of each paragraph, with no
spacings in between paragraphs.

I can get it how I want in org-mode, but when its exported to latex and
converted into a pdf file, the whole section comes out in one block of
text!

Its as if something isn't honouring a carriage return and neither
recognising the 4 spaces!

So how can I achieve my goal please?

I've tried manually doing a return and then deleting the space it
creates for the next line to then have its obligatory 4 spaces of
indentation but its not working as I want, so how can I do it please?

I've also tried exporting the file to docx using pandoc, and its not
recognising any carriage-returns in its output either.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 9.4, fluxbox 1.3.7, emacs 25.3.4, org 9.1.14


signature.asc
Description: PGP signature