Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2019-07-29 Thread Gustavo Barros



On Mon, Jul 29 2019, Gustavo Barros wrote:



But the ability to have line breaks is a clear edge
of soul, and the reason of the original request which started this
thread.



I must correct myself, the difference between ulem and soul is not that 
one allows line breaks while the other does not.  More precisely, both 
handle line breaks, but soul is able to honor hyphenation patterns, 
while ulem is not.  If one wants a (underlined/stricken-through) word to 
break with ulem, the hyphenation has to be done manually.


Best,
Gustavo.



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2019-07-29 Thread Gustavo Barros


Hi all,

On Fri, Jun 14 2013, Nicolas Goaziou wrote:

 Nicolas Goaziou  writes:
>   1. Does \underline{中文测试} work properly (notwithstanding the line
>  breaks)?

 \underline can show chinese, but the command can't resolve lines
 breaking properly.

>   2. Does \uline from "ulem" package handle it correctly, including the
>  line breaks?

 \uline seem to work properly.
>>>
>>> Then, the best solution seems to add "ulem" package to
>>> `org-latex-default-packages-alist' and use \ulem for underline. "soul"
>>> will only be used for strike-through.
>>>
>>> Is there any objection to this change?
>>
>> May be \ulem should be used for strike-through too!
>
> Done.
>

I know this is a very old thread, and that perhaps this boat has sailed
definitely.

But it seems to me that the attempt to use soul back then eventually
backfired because soul does not handle utf8 properly, as Feng Shu’s
issue demonstrated.  Indeed it does not.  But there is a patch to soul,
by Heiko Oberdiek, to handle this precise issue, and it is the package
soulutf8.

I’ve checked the commit history around the time of this thread, and it
seems soul, rather than soulutf8, was the attempt
(https://code.orgmode.org/bzg/org-mode/commit/95eeefa9bca1b6c57fe62c248a0a35302cd7374d).

Neither soul nor ulem is very active nowadays, but are used quite
extensively, as far as I know (from following TeX.SX).  And both have
their limitations.  But the ability to have line breaks is a clear edge
of soul, and the reason of the original request which started this
thread.

So, if the only reason to prefer ulem back in 2013 was utf8 support,
perhaps soulutf8 might be worthy of your reconsideration.


Best regards,
Gustavo Barros.



Re: [O] org mode latex export excude title

2016-12-30 Thread Charles C. Berry

On Fri, 30 Dec 2016, Ken Mankoff wrote:


(setq-local org-latex-title-command "")

Can be set as a buffer local variable.



True, but not relevant to the OPs query:


Is there any way to excude the empty `\title{}` command?


And if you browse thru org-latex-template, you will see that

 "\\title{%s%s}\n"

is hard coded.  The value of org-latex-title-command has no effect on that 
part of the template.


So, the OP can either use a filter as I suggested or write a derived 
backend supplying a different template transcoder that drops the string 
quoted above.


Chuck



Re: [O] org mode latex export excude title

2016-12-30 Thread Ken Mankoff
(setq-local org-latex-title-command "")

Can be set as a buffer local variable.

  -k.

On Fri, Dec 30, 2016 at 12:26 PM, Charles C. Berry  wrote:

> On Fri, 30 Dec 2016, Fanpeng Kong wrote:
>
> I am trying to use org mode to write a paper. The latex template of the
>> journal restricts the location of `\title{}` command to be after the
>> `\begin{document}`. While by leaving `#+TITLE:` empty and specify
>> `#+OPTIONS: title:nil` in my org file, I can remove the `\maketitle`
>> command in the
>> latex export. However, and empty title `\title{}` is still exported
>> prior to the `\begin{document}`. And it causes problem for the template
>> I am using.
>>
>> Following is an minimal example of the org mode latex export. Is there
>> any way to excude the empty `\title{}` command?
>>
>
> [example deleted]
>
> Any suggestion will be appreciated. And of course, Happy New Year!
>>
>
> Use a filter to comment it out:
>
>
>
> #+OPTIONS: title:nil toc:nil
> #+BIND: org-export-filter-final-output-functions (comment-out-title-line)
>
> #+BEGIN_SRC emacs-lisp :exports results :results none
>   (defun comment-out-title-line (doc  bk info)
> (replace-regexp-in-string "title" "%% \\title" doc nil t ))
>   (setq-local org-export-allow-bind-keywords t)
> #+END_SRC
>
>
>
> * section 1
>
> ...
>
> HTH,
>
> Chuck
>
>


Re: [O] org mode latex export excude title

2016-12-30 Thread Charles C. Berry

On Fri, 30 Dec 2016, Fanpeng Kong wrote:


I am trying to use org mode to write a paper. The latex template of the
journal restricts the location of `\title{}` command to be after the
`\begin{document}`. While by leaving `#+TITLE:` empty and specify
`#+OPTIONS: title:nil` in my org file, I can remove the `\maketitle` command in 
the
latex export. However, and empty title `\title{}` is still exported
prior to the `\begin{document}`. And it causes problem for the template
I am using.

Following is an minimal example of the org mode latex export. Is there
any way to excude the empty `\title{}` command?


[example deleted]


Any suggestion will be appreciated. And of course, Happy New Year!


Use a filter to comment it out:



#+OPTIONS: title:nil toc:nil
#+BIND: org-export-filter-final-output-functions (comment-out-title-line)

#+BEGIN_SRC emacs-lisp :exports results :results none
  (defun comment-out-title-line (doc  bk info)
(replace-regexp-in-string "title" "%% \\title" doc nil t ))
  (setq-local org-export-allow-bind-keywords t)
#+END_SRC



* section 1

...

HTH,

Chuck



[O] org mode latex export excude title

2016-12-30 Thread Fanpeng Kong
I am trying to use org mode to write a paper. The latex template of the
journal restricts the location of `\title{}` command to be after the
`\begin{document}`. While by leaving `#+TITLE:` empty and specify
`#+OPTIONS: title:nil` in my org file, I can remove the `\maketitle` command in 
the
latex export. However, and empty title `\title{}` is still exported
prior to the `\begin{document}`. And it causes problem for the template
I am using.

Following is an minimal example of the org mode latex export. Is there
any way to excude the empty `\title{}` command?

\documentclass[10pt]{article}
\usepackage{}
...
\usepackage{}

\date{}
\title{}

\hypersetup{
}

\begin{document}
...
\end{document}

Any suggestion will be appreciated. And of course, Happy New Year!

Cheers
Fanpeng



Re: [O] org-mode latex export - Links in multi-document files

2016-11-27 Thread Nicolas Goaziou
Hello,

mcg  writes:

> I sometimes make references to other sections which are in another
> section and document.
> In order to not compile all the document (3 minutes +) every time
> I just comment out all the documents I do not need to.
> If table and figure links are missing it exports fine (getting
> question marks in the pdf). However, the section links cause the
> compilation to stop entirely. Is there any workaround for that? Can
> I tell the exporter to ignore such minor missing crossreferences?

See `org-export-with-broken-links' (org 9.0).

Regards,

-- 
Nicolas Goaziou



[O] org-mode latex export - Links in multi-document files

2016-11-26 Thread mcg

Hello,

I have my PhD thesis divided into several documents (Intro, M, 
Results, Discussion...).

The document setup and the #+INCLUDE: commands are in my master file.

I sometimes make references to other sections which are in another 
section and document.
In order to not compile all the document (3 minutes +) every time I just 
comment out all the documents I do not need to.
If table and figure links are missing it exports fine (getting question 
marks in the pdf). However, the section links cause the compilation to 
stop entirely. Is there any workaround for that? Can I tell the exporter 
to ignore such minor missing crossreferences?






[O] org-mode -> latex

2016-04-10 Thread Sharon Kimble
For a long time I've wanted to write in org-mode and export it to latex,
but I've never been successful until now. So here is a yasnippet that
allows you to do it -

--8<---cut here---start->8---
# -*- mode: snippet -*-
# name: org2latex
# key: org2latex
# --
#+TITLE: foobar
#+LaTeX_HEADER: \usepackage[utf8]{inputenc}
#+LaTeX_HEADER: \usepackage[T1]{fontenc} 
#+LaTeX_HEADER: \usepackage{palatino}
#+LaTeX_HEADER: \usepackage{fixltx2e}
#+latex_header: 
\usepackage[backend=biber,style=philosophy-modern,doi=true,hyperref=true,backref=true,backrefstyle=two,date=year,maxcitenames=3]{biblatex}
#+LATEX_HEADER: \addbibresource{~/foo/foo/foo.bib}
#+LATEX_HEADER: \usepackage{makeidx}
#+latex_header: \makeindex
#+latex_header: \usepackage[acronym]{glossaries}
#+latex_header: \makeglossaries
#+latex_header: \usepackage[unhide]{todo}
#+latex_header: \usepackage{everypage}
#+latex_header: \usepackage{draftwatermark}
#+latex_header: \usepackage{hyperref}
#+latex_header: 
\hypersetup{colorlinks,linkcolor={red},citecolor={magenta},urlcolor={blue}}
# #+options: num:nil

#+OPTIONS: toc:2

\clearpage
\renewcommand{\thesection}{}
\renewcommand{\thesubsection}{}
\renewcommand{\thesubsubsection}{}

\input{foo.glos}
\input{foo.acro}

/foo/ Your main text goes here /foo/

'glos' is your glossary file, and 'acro' is your acronyms file, and 'bib' is 
your biblatex references.

'foo.glos' ;; needs to be a proper latex glossary file
'foo.acro' ;; needs to be a proper latex acronym file
'foo.bib' ;; needs to be a proper latex bib file, I'm using 'JabRef' for it.

This file will accept a 'cite:foo' for biblatex references, and also 
'\gls{foo}' for glossary and
acronym entries, and '\index{foo}' for index entries.

You *must* give the complete path of your 'foo.bib' file as it sets up where 
every other file can be
found.

This works with a complete setup of 'TexLive 2015'. 

\todo{This is how your 'TODO' items should appear}


\clearpage

\addcontentsline{toc}{chapter}{Glossary}

\printglossaries


\clearpage

\addcontentsline{toc}{chapter}{References}


\printbibliography



\clearpage

\addcontentsline{toc}{chapter}{Index}

\printindex

\todos

\end{document}
--8<---cut here---end--->8---

If you don't like something, then comment it out and do a rebuild to see
if your modification works.

To use -
a - 'C-c C-e l l' to get a latex tex file
b - Then use your favourite tex command to build it into a PDF file. I
use my 'pdfbuild' file which I've uploaded to my blog "A taste of linux".

The above template will give you a nice PDF file with a table of
contents, every page with a watermark on saying 'DRAFT', the ability to
put '\todo{comments}' in to show you what needs to be done at that
point. And if you've set them up, a bibliography, glossary and acronyms
and an index.

As they say in Parliament "I commend it to the house." :)

And I hope its useful for you?

Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.0.92


signature.asc
Description: PGP signature


Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-14 Thread Nicolas Goaziou
Hello,

Feng Shu tuma...@gmail.com writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:

 Feng Shu tuma...@gmail.com writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:
   1. Does \underline{中文测试} work properly (notwithstanding the line
  breaks)?

 \underline can show chinese, but the command can't resolve lines
 breaking properly.

   2. Does \uline from ulem package handle it correctly, including the
  line breaks?

 \uline seem to work properly.

 Then, the best solution seems to add ulem package to
 `org-latex-default-packages-alist' and use \ulem for underline. soul
 will only be used for strike-through.

 Is there any objection to this change?

 May be \ulem should be used for strike-through too!

Done.


Regards,

-- 
Nicolas Goaziou



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-11 Thread Nicolas Goaziou
Hello,

Feng Shu tuma...@gmail.com writes:

 When the article is writen with Chinese,  soul will output:

 #+begin_src
 soul Error: Reconstruction failed.
 #+end_src

 and underline word will dispear from  the output pdf file!

 A tmp solution is :


 \ul{\mbox{中文测试}}

 but,when it can't break lines properly too.

  1. Does \underline{中文测试} work properly (notwithstanding the line
 breaks)?
  2. Does \uline from ulem package handle it correctly, including the
 line breaks?


Regards,

-- 
Nicolas Goaziou



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-11 Thread Feng Shu
Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 Feng Shu tuma...@gmail.com writes:

 When the article is writen with Chinese,  soul will output:

 #+begin_src
 soul Error: Reconstruction failed.
 #+end_src

 and underline word will dispear from  the output pdf file!

 A tmp solution is :


 \ul{\mbox{中文测试}}

 but,when it can't break lines properly too.

   1. Does \underline{中文测试} work properly (notwithstanding the line
  breaks)?

\underline can show chinese, but the command can't resolve lines
breaking properly.

   2. Does \uline from ulem package handle it correctly, including the
  line breaks?

\uline seem to work properly.




 Regards,

-- 



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-11 Thread Nicolas Goaziou
Feng Shu tuma...@gmail.com writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:
   1. Does \underline{中文测试} work properly (notwithstanding the line
  breaks)?

 \underline can show chinese, but the command can't resolve lines
 breaking properly.

   2. Does \uline from ulem package handle it correctly, including the
  line breaks?

 \uline seem to work properly.

Then, the best solution seems to add ulem package to
`org-latex-default-packages-alist' and use \ulem for underline. soul
will only be used for strike-through.

Is there any objection to this change?


Regards,

-- 
Nicolas Goaziou



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-11 Thread Feng Shu
Nicolas Goaziou n.goaz...@gmail.com writes:

 Feng Shu tuma...@gmail.com writes:

 Nicolas Goaziou n.goaz...@gmail.com writes:
   1. Does \underline{中文测试} work properly (notwithstanding the line
  breaks)?

 \underline can show chinese, but the command can't resolve lines
 breaking properly.

   2. Does \uline from ulem package handle it correctly, including the
  line breaks?

 \uline seem to work properly.

 Then, the best solution seems to add ulem package to
 `org-latex-default-packages-alist' and use \ulem for underline. soul
 will only be used for strike-through.

 Is there any objection to this change?

May be \ulem should be used for strike-through too! 



 Regards,

-- 



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-09 Thread Nicolas Goaziou
Hello,

Nathaniel Cunningham nathaniel.cunning...@gmail.com writes:

 Suvayu Ali fatkasuvayu+linux at gmail.com writes:

 
 Org mode
 translates _underlined text_ to \underline{underlined text}, however if
 you read the TeX.sx question referenced below you will see that it
 doesn't support line breaks and the TeX community recommends \uline{..}
 from the ulem package.
 
   http://TeX.stackexchange.com/a/13382/4416

 The \ul{..} command from the soul package also supports underlining across
 line breaks.
 *And soul is included by default in org's list of loaded latex packages* -- 
 see
 org-latex-default-packages-alist.

 Therefore it would be painless for org users if \underline in
 org-latex-text-markup-alist were replaced with \ul -- and it would provide
 more complete support of underlining!  

Indeed. According to

  http://orgmode.org/worg/org-dependencies.html

introducing soul package in default packages list was meant to provide
underline and strike-through features. I fixed it in maint.

Thanks for the heads up.


Regards,

-- 
Nicolas Goaziou



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-09 Thread Feng Shu
Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 Nathaniel Cunningham nathaniel.cunning...@gmail.com writes:

 Suvayu Ali fatkasuvayu+linux at gmail.com writes:

 
 Org mode
 translates _underlined text_ to \underline{underlined text}, however if
 you read the TeX.sx question referenced below you will see that it
 doesn't support line breaks and the TeX community recommends \uline{..}
 from the ulem package.
 
   http://TeX.stackexchange.com/a/13382/4416
 The \ul{..} command from the soul package also supports underlining across
 line breaks.
 *And soul is included by default in org's list of loaded latex packages* -- 
 see
 org-latex-default-packages-alist.

 Therefore it would be painless for org users if \underline in
 org-latex-text-markup-alist were replaced with \ul -- and it would provide
 more complete support of underlining!  

 Indeed. According to

   http://orgmode.org/worg/org-dependencies.html

 introducing soul package in default packages list was meant to provide
 underline and strike-through features. I fixed it in maint.

 Thanks for the heads up.

When the article is writen with Chinese,  soul will output:

#+begin_src
soul Error: Reconstruction failed.
#+end_src

and underline word will dispear from  the output pdf file!

A tmp solution is :


\ul{\mbox{中文测试}}

but,when it can't break lines properly too.



 Regards,

-- 



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-06-06 Thread Nathaniel Cunningham
Suvayu Ali fatkasuvayu+linux at gmail.com writes:

 
 Org mode
 translates _underlined text_ to \underline{underlined text}, however if
 you read the TeX.sx question referenced below you will see that it
 doesn't support line breaks and the TeX community recommends \uline{..}
 from the ulem package.
 
   http://TeX.stackexchange.com/a/13382/4416

The \ul{..} command from the soul package also supports underlining across
line breaks.
*And soul is included by default in org's list of loaded latex packages* -- see
org-latex-default-packages-alist.

Therefore it would be painless for org users if \underline in
org-latex-text-markup-alist were replaced with \ul -- and it would provide
more complete support of underlining!  

Thanks,
Nathaniel




[O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-03-06 Thread Sanjib Sikder
Hi,

While PDF exporting a .org file, the underlined lines which are at the
right end of the page (in PDF) or underlined lines which are large and
spans to next line (in pdf) are not breaking properly.

How do I solve this problem ?

Thanks.
-
*Sanjib Sikder
**

*


Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-03-06 Thread Michael Strey
Hi Sanjib,

This is a known LaTeX issue that has nothing to do with Org.  Please
check the LaTeX packages ulem.sty and soul.sty or simply don't use
underlining -- it's anyway ugly.

Best regards
-- 
Michael Strey 
www.strey.biz



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-03-06 Thread Suvayu Ali
Hello Sanjib,

On Wed, Mar 06, 2013 at 06:55:36PM +0530, Sanjib Sikder wrote:
 
 If you feel that the problem is not related to org-mode, then ignore this
 email and thanks for your time and patience.

It is indeed a LaTeX issue!  And I have an answer too :).  Org mode
translates _underlined text_ to \underline{underlined text}, however if
you read the TeX.sx question referenced below you will see that it
doesn't support line breaks and the TeX community recommends \uline{..}
from the ulem package.

  http://TeX.stackexchange.com/a/13382/4416

For now you can write a filter to alter the LaTeX source[1]; for the
long haul you should start a separate thread asking to change the
defaults in Org mode.  However I'm not sure if that is desirable since
it introduces an extra LaTeX package dependency to handle corner cases.

Hope this helps,


Footnotes:

[1] A nice example can be found here:
http://orgmode.org/worg/exporters/beamer/ox-beamer.html#sec-2-3

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Org-mode latex pdf export issue: Underlined lines not breaking properly

2013-03-06 Thread Sanjib Sikder
Hi,

Thanks for the suggestions.

For an user like me, who depends heavily on org-mode for several purposes,
a basic feature like this (underline) is frequently used. Though it is ugly
or (may be) not used for serious published materials, but for personal
usage, this is very handy and very often I do pdf export my .org files.

I wish, org-mode provides an easier solution as not everybody is familiar
with lisp codes.

Again, thanks a lot.

-
*Sanjib Sikder
*


[O] Org-mode latex-export minted problem

2011-11-16 Thread Piotr Kaźmierczak
Hi, 

I'm having a hard time configuring org-mode LaTeX export to work with minted 
package for code listings. I put 

#+LaTeX_HEADER: \usepackage{minted}
#+LaTeX_HEADER: \usemintedstyle{emacs}

in the header of my org mode file, and then 

#+BEGIN_SRC haskell :exports code
some haskell code here
#+END_SRC

when I wanted to put the code listing. My .emacs has a proper minted 
configuration for org-mode set, too:

; minted latex export
(setq org-export-latex-listings 'minted)
(setq org-export-latex-minted-options
  '((frame lines)
(fontsize \\scriptsize)
(linenos )))
(setq org-latex-to-pdf-process
  '(pdflatex -shell-escape -interaction nonstopmode %s
pdflatex -shell-escape -interaction nonstopmode %s
pdflatex -shell-escape -interaction nonstopmode %s))

but whenever I export the org-mode buffer to LaTeX, I get my listings wrapped 
around \begin{lstlisting} and \end{lstlisting}. 

What am I missing here?

cheers;
Piotr
--
Dept. of Computer Engineering, Bergen University College
Postboks 7030, 5020 Bergen, Norway
(+47) 55 58 75 88
http://soundandcomplete.com




Re: [O] Org-mode latex-export minted problem

2011-11-16 Thread Niels Giesen
Piotr Kaźmierczak p.h.kazmierc...@gmail.com writes:

 Hi, 

 I'm having a hard time configuring org-mode LaTeX export to work with minted 
 package for code listings. I put 

 #+LaTeX_HEADER: \usepackage{minted}
 #+LaTeX_HEADER: \usemintedstyle{emacs}

 in the header of my org mode file, and then 

 #+BEGIN_SRC haskell :exports code
 some haskell code here
 #+END_SRC

 when I wanted to put the code listing. My .emacs has a proper minted 
 configuration for org-mode set, too:

 ; minted latex export
 (setq org-export-latex-listings 'minted)
 (setq org-export-latex-minted-options
   '((frame lines)
 (fontsize \\scriptsize)
 (linenos )))
 (setq org-latex-to-pdf-process
   '(pdflatex -shell-escape -interaction nonstopmode %s
 pdflatex -shell-escape -interaction nonstopmode %s
 pdflatex -shell-escape -interaction nonstopmode %s))

Hi Piotr,

Try and narrow down the problem:

1. Start Emacs with the -q option,
2. Open test.org, which is

* Test minted export

#+begin_src emacs-lisp
;; minted latex export
(setq org-export-latex-listings 'minted
  org-export-latex-minted-options
  '((frame lines)
(fontsize \\scriptsize)
(linenos )))
#+end_src


3. Evaluate the emacs-lisp block in test.org
4. Press C-c C-e L

With me, this outputs the src block correctly, namely as

\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{common-lisp}
; minted latex export
(setq org-export-latex-listings 'minted
  org-export-latex-minted-options
  '((frame lines)
(fontsize \\scriptsize)
(linenos )))
\end{minted}

If you get the same output, something else in your .emacs or custom.el
or so must play you parts, if not, you may have to check your org mode
version.

Regards, Niels.

-- 
http://pft.github.com/