Re: [O] ox-latex: Export ignores org-latex-classes from 4th level on

2016-11-06 Thread Nicolas Goaziou
Hello,

Christian Heinrich  writes:

> the ox-latex file uses org-latex-classes to help, among other things,
> with exporting headlines to the right commands, such as \section,
> \subsection etc.
>
> Unfortunately, not all headlines get exported correctly; the default
> "article" class, as defined in ox-latex.el (see org-latex-classes
> there), does for instance not use  "\paragraph" or "\subparagraph".

See `org-export-headline-levels'.

> PS: I couldn't find any news about the renaming (?) of org-export-
> latex-classes to org-latex-classes.

This probably happened with Org 8.0 release.

> There is still quite a bit of documentation out there, such as
> http://orgmode.org/tmp/worg/org-tutorials/org-latex-export.html that
> refers to the former but doesn't work. Is this intended?

Some documentation is outdated on Worg. You can help, if you want to.
See  for details.

Regards,

-- 
Nicolas Goaziou



[O] ox-latex: Export ignores org-latex-classes from 4th level on

2016-11-06 Thread Christian Heinrich
Hello,

the ox-latex file uses org-latex-classes to help, among other things,
with exporting headlines to the right commands, such as \section,
\subsection etc.

Unfortunately, not all headlines get exported correctly; the default
"article" class, as defined in ox-latex.el (see org-latex-classes
there), does for instance not use  "\paragraph" or "\subparagraph".

Here is an example file:


#+LATEX_CLASS: article

* First
** Second
*** Third
 Fourth
* Fifth
** Sixth
*** Seventh
This is the final text.


When I export, I get something like this:

[...]
\subsubsection{Third}
\label{sec:orgafa785d}
\begin{enumerate}
\item Fourth
[...]

However, it should use "\paragraph{Fourth}" instead, and not a list
with \item.

It seems there is something going on with the deep subtrees, starting
at line 1929 in ox-latex.el; (for the first 3 levels, line 1893 gets
called, too).

Can anyone see whats going on here? I'm currently on master. I tried
older versions, but this bug must have been there since 7.8 (I couldn't
compile many older versions any more or I couldn't export).

Thanks
Christian

PS: I couldn't find any news about the renaming (?) of org-export-
latex-classes to org-latex-classes. There is still quite a bit of
documentation out there, such as http://orgmode.org/tmp/worg/org-tutori
als/org-latex-export.html that refers to the former but doesn't work.
Is this intended?

signature.asc
Description: This is a digitally signed message part


Re: [O] ox-latex doesn't handle doi: links right

2016-03-19 Thread Eric S Fraga
On Thursday, 17 Mar 2016 at 07:47, Vladimir Alexiev wrote:
> A link like doi:10.1109/ICMEW.2015.7169818 is resolved in org to 
> http://dx.doi.org/10.1109/ICMEW.2015.7169818.
> (I mean that if I click to the link, I go to that URL)
>
> However, ox-latex makes merely this:
>\url{10.1109/ICMEW.2015.7169818} 
> which Acrobat tries to resolve as a local file.
> Instead, ox-latex should make this:
>\href{http://dx.doi.org/10.1109/ICMEW.2015.7169818}
> {doi:10.1109/ICMEW.2015.7169818}

On my system, the default handling for doi: links is

--8<---cut here---start->8---
 ("doi" nil
  (lambda
(path desc format)
(cond
 ((eq format 'latex)
  (format "\\doi{%s}" path)
--8<---cut here---end--->8---

It is then a case of defining the LaTeX \doi function to do what you
want?  Probably simply add

#+latex_header: \usepackage{doi}

to your org file to get what you want.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa



[O] ox-latex doesn't handle doi: links right

2016-03-18 Thread Vladimir Alexiev
A link like doi:10.1109/ICMEW.2015.7169818 is resolved in org to 
http://dx.doi.org/10.1109/ICMEW.2015.7169818.
(I mean that if I click to the link, I go to that URL)

However, ox-latex makes merely this:
   \url{10.1109/ICMEW.2015.7169818} 
which Acrobat tries to resolve as a local file.
Instead, ox-latex should make this:
   \href{http://dx.doi.org/10.1109/ICMEW.2015.7169818}
{doi:10.1109/ICMEW.2015.7169818}





Re: [O] ox-latex

2015-12-04 Thread John Hendy
On Thu, Dec 3, 2015 at 10:36 AM, Thomas S. Dye  wrote:
> Aloha Raimund,
>
> Raimund  writes:
>
>> Hi,
>>
>> I'm a bloody beginner on org-mode so I still am searching my way through
>> the oceans of informations about getting along with org-mode.
>>
>> At the moment I am struggling with using latex-export and setting up (a)
>> latex-class(es).
>>
>> I found some great instructions on worg: Latex Export vor org-mode < 8.0
>> 
>>   and it says to make some changes in .emacs like:
>
> These instructions are for the old exporter.  The new exporter made many
> of the old instructions obsolete.
>
> I presume you're using Org mode 8?

The instructions are for Org < 8... but why would those instructions
mention ox-latex? I thought all the ox-* stuff came through only with
8.0? Or was the ox-* convention earlier than I realize?


>>
>>> (require  'ox-latex)
>>
>> If I do that and eval-buffer emacs it reads:
>>
>>
>>> eval-buffer: Cannot open load file: ox-latex
>>
>> Now I don't know if it means ox-latex doesn't exist at all ... however,
>> I thought to look out for ox-latex in the web to download and push it in
>> my .emacs.d ... hmmm ... even though there are bunches of
>> ox-whatsoever-files I failed to find ox-latex ... so I think I'm
>> thinking wrong ... :-(
>>
>> Can anyone help me out here?
>
> The manual is a good starting place.
>
> There are a couple of LaTeX export templates here:
> http://orgmode.org/worg/exporters/index.html
>
> There is one for annotated bibliographies and another for the Journal
> PLOS One.  They should give examples of how the LaTeX exporter can be
> customized.
>
> hth,
> Tom
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>



Re: [O] ox-latex

2015-12-03 Thread Rasmus
Raimund  writes:

> Hi,
>
> I'm a bloody beginner on org-mode so I still am searching my way
> through the oceans of informations about getting along with org-mode.
>
> At the moment I am struggling with using latex-export and setting up
> (a) latex-class(es).
>
> I found some great instructions on worg: Latex Export vor org-mode <
> 8.0 
>  and it says to make some changes in .emacs like:
>
>> (require  'ox-latex)
>
> If I do that and eval-buffer emacs it reads:
>
>
>> eval-buffer: Cannot open load file: ox-latex
>
> Now I don't know if it means ox-latex doesn't exist at all
> ... however, I thought to look out for ox-latex in the web to download
> and push it in my .emacs.d ... hmmm ... even though there are bunches
> of ox-whatsoever-files I failed to find ox-latex ... so I think I'm
> thinking wrong ... :-(
>
> Can anyone help me out here?

It sounds like you don't have a recent version of Org.   Please see the
installation instructions in the manual,

 http://orgmode.org/org.html

Hope it helps,
Rasmus

-- 
To err is human. To screw up 10⁶ times per second, you need a computer




[O] ox-latex

2015-12-03 Thread Raimund

Hi,

I'm a bloody beginner on org-mode so I still am searching my way through 
the oceans of informations about getting along with org-mode.


At the moment I am struggling with using latex-export and setting up (a) 
latex-class(es).


I found some great instructions on worg: Latex Export vor org-mode < 8.0 


 and it says to make some changes in .emacs like:


(require  'ox-latex)


If I do that and eval-buffer emacs it reads:



eval-buffer: Cannot open load file: ox-latex


Now I don't know if it means ox-latex doesn't exist at all ... however, 
I thought to look out for ox-latex in the web to download and push it in 
my .emacs.d ... hmmm ... even though there are bunches of 
ox-whatsoever-files I failed to find ox-latex ... so I think I'm 
thinking wrong ... :-(


Can anyone help me out here?




Re: [O] ox-latex

2015-12-03 Thread Thomas S . Dye
Aloha Raimund,

Raimund  writes:

> Hi,
>
> I'm a bloody beginner on org-mode so I still am searching my way through 
> the oceans of informations about getting along with org-mode.
>
> At the moment I am struggling with using latex-export and setting up (a) 
> latex-class(es).
>
> I found some great instructions on worg: Latex Export vor org-mode < 8.0 
> 
>   and it says to make some changes in .emacs like:

These instructions are for the old exporter.  The new exporter made many
of the old instructions obsolete.

I presume you're using Org mode 8?
>
>> (require  'ox-latex)
>
> If I do that and eval-buffer emacs it reads:
>
>
>> eval-buffer: Cannot open load file: ox-latex
>
> Now I don't know if it means ox-latex doesn't exist at all ... however, 
> I thought to look out for ox-latex in the web to download and push it in 
> my .emacs.d ... hmmm ... even though there are bunches of 
> ox-whatsoever-files I failed to find ox-latex ... so I think I'm 
> thinking wrong ... :-(
>
> Can anyone help me out here?

The manual is a good starting place.

There are a couple of LaTeX export templates here:
http://orgmode.org/worg/exporters/index.html

There is one for annotated bibliographies and another for the Journal
PLOS One.  They should give examples of how the LaTeX exporter can be
customized.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



[O] ox-latex doesn't export with `\newminted`.

2015-08-07 Thread Zack Piper
Apparently ox-latex doesn't add `\newminted` to languages that I wish
to use.

This is required to use:

\begin{common-lispcode}
(format t test)
\end{common-lispcode}

That being the `${LANG}code` environment, which Org-mode uses for my
entire document.

https://github.com/gpoore/minted/issues/83

The author responded with:

╭
│ Environments ${LANG}code are not created by default. You can create
│ whichever ones you need using the \newminted command. In this case,
│ \newminted{python}{}. Note the trailing, empty {}. If you wanted to
│ specify default options for the new environment, that's where you
│ would put them. Also, if you didn't want to call the new environment
│ pythoncode, you could give \newminted an optional argument. More
│ details are in the docs.
│ 
│ If Org-mode is exporting LaTeX using the ${LANG}code form, then it
│ should really be creating the corresponding environments automatically
│ by default. But I would think it would really be simpler for it to
│ export standard minted environments. I haven't used it, so I can't
│ make any suggestions about configuration.
╰

Thanks!

-- 
Zack Piper z...@apertron.net http://apertron.net



Re: [O] ox-latex doesn't export with `\newminted`.

2015-08-07 Thread Rasmus
Zack Piper z...@apertron.net writes:

 Apparently ox-latex doesn't add `\newminted` to languages that I wish
 to use.

 This is required to use:

 \begin{common-lispcode}
 (format t test)
 \end{common-lispcode}

 That being the `${LANG}code` environment, which Org-mode uses for my
 entire document.

What is the org code you use to produce this?

From a clean Emacs, I get

 #+BEGIN_SRC emacs-lisp
 x
 #+END_SRC

Translated to

 \begin{minted}[]{common-lisp}
 x
 \end{minted}

When (setq org-latex-listings 'minted).

Rasmus

-- 
It was you, Jezebel, it was you




Re: [O] ox-latex doesn't export with `\newminted`.

2015-08-07 Thread Nicolas Goaziou
Hello,

Zack Piper z...@apertron.net writes:

 Apparently ox-latex doesn't add `\newminted` to languages that I wish
 to use.

 This is required to use:

 \begin{common-lispcode}
 (format t test)
 \end{common-lispcode}

 That being the `${LANG}code` environment, which Org-mode uses for my
 entire document.

This is not very clear to me. Org doesn't generate LANGcode by default,
unless you configured `org-latex-custom-lang-environments'.

What Org document are you using? What LaTeX code do you want to generate
from it?


Regards,

-- 
Nicolas Goaziou



Re: [O] ox-latex doesn't export with `\newminted`.

2015-08-07 Thread Zack Piper
On Fri, Aug 07, 2015 at 03:22:32PM +0200, Rasmus wrote:
 Zack Piper z...@apertron.net writes:
 
  Apparently ox-latex doesn't add `\newminted` to languages that I wish
  to use.
 
  This is required to use:
 
  \begin{common-lispcode}
  (format t test)
  \end{common-lispcode}
 
  That being the `${LANG}code` environment, which Org-mode uses for my
  entire document.
 
 What is the org code you use to produce this?
 
 From a clean Emacs, I get
 
  #+BEGIN_SRC emacs-lisp
  x
  #+END_SRC
 

Same as that.

 Translated to
 
  \begin{minted}[]{common-lisp}
  x
  \end{minted}
 
 When (setq org-latex-listings 'minted).
 

I solved the problem I was using the wrong setting
(org-latex-custom-lang-environments) when i should be using
(org-latex-minted-langs).

Thanks! Sorry for the noise.

-- 
Zack Piper z...@apertron.net http://apertron.net



Re: [O] ox-latex: default packages cleaning

2015-07-29 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

  +(defun org-latex-guess-polyglossia-language (header info)
  +  Set the Polyglossia language according to the LANGUAGE keyword.
 
  I'm in two-minds about this.  On the one had it is a nice thing, but on
  the other hand, it prevents the more fine grained control offered by
  polyglossia.  For example, I used this in my setup before:
 
\setdefaultlanguage[variant=british]{english}
 
 The attached supports Polyglossia better.  Note, the last loaded language
 is the main one (as babel).  Perhaps org-latex-variant-file-string should
 be less annoying (not a file-variable).

 The polyglossia bits work well.

Pushed.

Rasmus

-- 
I feel emotional landscapes they puzzle me




Re: [O] ox-latex: default packages cleaning

2015-07-27 Thread Rasmus
Sebastien Vauban sva-n...@mygooglest.com
writes:

 FWIW, it seems that people who played with different LaTeX engines used
 the LATEX_CMD property, as adviced on Worg [1].  Doesn't matter if we
 change that, but just a reminder of some already common usage.

I didn't know that worg page.  Just to understand, you are advising to use
LATEX_CMD as the keyword name?  FWIW, that's fine with me, though
presently it's not really accurate as only {pdf,xe,lua}latex is allowed
(I'm hesitant to allow arbitrary scripts).

Rasmus

-- 
Not everything that goes around comes back around, you know




Re: [O] ox-latex: default packages cleaning

2015-07-27 Thread Sebastien Vauban
Hello,

Rasmus ras...@gmx.us writes:
 I have a few other questions:
 - how does one change the variant when doing a subtree export?  By
   setting EXPORT_LATEX_VARIANT?

 It seems to work at least to the point that the right engine is written to
 the file:

 #+LATEX_VARIANT: xelatex
 * pdflatex
 :PROPERTIES:
 :export_latex_variant: pdflatex
 :END:

 * lualatex
 :PROPERTIES:
 :export_latex_variant: lualatex
 :END:


 - Is it possible to set a default variant?

 org-latex-variant = pdflatex

FWIW, it seems that people who played with different LaTeX engines used
the LATEX_CMD property, as adviced on Worg [1].  Doesn't matter if we
change that, but just a reminder of some already common usage.

Best regards,
  Seb

[1] http://orgmode.org/worg/org-faq.html#using-xelatex-for-pdf-export 

-- 
Sebastien Vauban




Re: [O] ox-latex: default packages cleaning

2015-07-27 Thread Rasmus
Hi,

Sebastien Vauban sva-n...@mygooglest.com
writes:

 (I'm hesitant to allow arbitrary scripts).

 I agree. Just stick to the basic need, which is to be able to easily
 change of LaTeX engine.

I'd however also like to allow some flags, e.g. -shell-escape/write18 for
minted.  I cannot think of other useful flags.

Thanks,
Rasmus

-- 
When in doubt, do it!




Re: [O] ox-latex: default packages cleaning

2015-07-27 Thread Sebastien Vauban
Rasmus ras...@gmx.us writes:
 Sebastien Vauban sva-n...@mygooglest.com writes:

 FWIW, it seems that people who played with different LaTeX engines used
 the LATEX_CMD property, as adviced on Worg [1].  Doesn't matter if we
 change that, but just a reminder of some already common usage.

 I didn't know that worg page.  Just to understand, you are advising to
 use LATEX_CMD as the keyword name?

Yes.

 FWIW, that's fine with me, though presently it's not really accurate
 as only {pdf,xe,lua}latex is allowed

AFAIK, it's not intended to do more than just indicating which flavor of
the LaTeX engine to use (and, then, correctly update the real commands
which will be run), that is {pdf,xe,lua}latex.

 (I'm hesitant to allow arbitrary scripts).

I agree. Just stick to the basic need, which is to be able to easily
change of LaTeX engine.

Best regards,
  Seb

-- 
Sebastien Vauban




[O] [ox-latex] setting `org-latex-classes'

2015-07-21 Thread Seb
Hello,

Does one have to `require' ox-latex in ~/.emacs just to set
`org-latex-classes'?  I can't seem to find the proper hook where I can
add to this alist without loading ox-latex.

Cheers,

-- 
Seb




Re: [O] [ox-latex] setting `org-latex-classes'

2015-07-21 Thread Nick Dokos
Seb splu...@gmail.com writes:

 Does one have to `require' ox-latex in ~/.emacs just to set
 `org-latex-classes'?  I can't seem to find the proper hook where I can
 add to this alist without loading ox-latex.


Use eval-after-load:

(eval-after-load ox-latex
   (add-to-list 'org-latex-classes ))

Nick




Re: [O] [ox-latex] setting `org-latex-classes'

2015-07-21 Thread Seb
On Tue, 21 Jul 2015 13:37:39 -0400,
Nick Dokos ndo...@gmail.com wrote:

[...]

 Use eval-after-load:

 (eval-after-load ox-latex (add-to-list 'org-latex-classes ))

Thanks, I tried that but I get a Symbol's value as variable is void:
org-latex-classes when starting Emacs.

-- 
Seb




Re: [O] [ox-latex] setting `org-latex-classes'

2015-07-21 Thread Rasmus
Seb splu...@gmail.com writes:

 On Tue, 21 Jul 2015 13:37:39 -0400,
 Nick Dokos ndo...@gmail.com wrote:

 [...]

 Use eval-after-load:

 (eval-after-load ox-latex (add-to-list 'org-latex-classes ))

 Thanks, I tried that but I get a Symbol's value as variable is void:
 org-latex-classes when starting Emacs.

(eval-after-load ox-latex '(add-to-list 'org-latex-classes ))

Or

(with-eval-after-load 'ox-latex (add-to-list 'org-latex-classes ))

(untested)

-- 
Bang bang




Re: [O] ox-latex: default packages cleaning

2015-07-16 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 The polyglossia bits work well.

 The file local variable prompt for every export is quite annoying
 though.  Same goes for the exported file, opening it brings up the same
 prompt again.  I guess it is a one time thing to mark that variable as
 safe, then it should be good.

It's probably too annoying to default org-latex-variant-file-string to a
file variable.  I find it neat to automatically have AUCTeX pick the right
engine, though.

I worry more about how to allow flags to be transmitted without making it
insecure.  E.g. -shell-escape is one that we'd want to allow for minted.
Perhaps whitelisted flags  Or just allow arbitrary flags after a latex
command.

 I have a few other questions:
 - how does one change the variant when doing a subtree export?  By
   setting EXPORT_LATEX_VARIANT?

It seems to work at least to the point that the right engine is written to
the file:

#+LATEX_VARIANT: xelatex
* pdflatex
:PROPERTIES:
:export_latex_variant: pdflatex
:END:

* lualatex
:PROPERTIES:
:export_latex_variant: lualatex
:END:


 - Is it possible to set a default variant?

org-latex-variant = pdflatex

 - How does one insert a line in the package list which is not
   usepackage.  I guess the normal case is still valid:
   \\somedirective, but inserting a similar variant specific directive
   isn't possible.

Not possible ATM.  You could use iftex on the latex level or we could
allow something like '(\\mymacro (pdflatex)) and enforce the second
argument to be a list to differentiate it from (PKG OPTIONS PKG)

 I'm starting to wonder, all these complications, is it really worth it?
 What do you think?

Most of my longer documents declare the compiler via bind of file
variables.  So I'd use it.  It would also allow me to get rid of some
filters.

Rasmus

-- 
Warning: Everything saved will be lost




Re: [O] ox-latex: default packages cleaning

2015-07-16 Thread Suvayu Ali
On Wed, Jul 08, 2015 at 08:35:28PM +0200, Rasmus wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  +(defun org-latex-guess-polyglossia-language (header info)
  +  Set the Polyglossia language according to the LANGUAGE keyword.
 
  I'm in two-minds about this.  On the one had it is a nice thing, but on
  the other hand, it prevents the more fine grained control offered by
  polyglossia.  For example, I used this in my setup before:
 
\setdefaultlanguage[variant=british]{english}
 
 The attached supports Polyglossia better.  Note, the last loaded language
 is the main one (as babel).  Perhaps org-latex-variant-file-string should
 be less annoying (not a file-variable).

The polyglossia bits work well.  The file local variable prompt for
every export is quite annoying though.  Same goes for the exported file,
opening it brings up the same prompt again.  I guess it is a one time
thing to mark that variable as safe, then it should be good.  

I have a few other questions:
- how does one change the variant when doing a subtree export?  By
  setting EXPORT_LATEX_VARIANT?
- Is it possible to set a default variant?
- How does one insert a line in the package list which is not
  usepackage.  I guess the normal case is still valid:
  \\somedirective, but inserting a similar variant specific directive
  isn't possible.

I'm starting to wonder, all these complications, is it really worth it?
What do you think?

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] ox-latex: default packages cleaning

2015-07-15 Thread Rasmus
Marcin Borkowski mb...@mbork.pl writes:

 I would also suggest removing inputenc.  At the moment, it is loaded
 with the AUTO option.  AFAIK, this is redundant since most recent
 (meaning for quite a few years) TeX engines already use the encoding of
 the file if nothing is specified.

 Can you elaborate on that?  AFAIK, XeTeX and LuaTeX use UTF-8 by
 default, but pdfetex (which is the default LaTeX engine) does not.  And
 quite a lot of people ose pdfetex (me included;-)).  I haven't heard
 about any heuristic determination of encoding by TeX (and I hope nothing
 like that happens, since it could be disastrous).

At least on Windows/Miktex this isn't working.  And while I don't like
miktex enough people do.

 The next one would be fontenc, now it is loaded with T1.  I'm not sure
 if this is needed.  Maybe LaTeX experts like Marcin or Fabrice could
 comment.

 Thanks for calling me an expert, though I'm not one regarding fonts and
 their encodings;-).

 With fontenc, the thing is tricky.  I do not know much about other
 languages, but you actually can't use LaTeX to typeset texts in Polish
 without changing the default LaTeX's font encoding (which is OT1, and it
 doesn't support some Polish letters).  (Usually, I do not use fontenc
 for that, since there is a specialized package for Polish typesetting.)

 I guess that removing fontenc for non-English texts might lead to
 erroneous results – at least in case of presence of certain Polish words
 (e.g., some names in bibliographies).  I guess we don’t want that.

 OTOH, one thing we /might/ want to add is \usepackage{lmodern}.  The
 Latin Modern family of fonts is a drop-in replacement for the default
 Computer Modern, but with all sorts of accented characters.  Using this
 font family has the advantage that accented characters are not build
 from letters and accents, but are single glyphs in the font.  AFAIR,
 this makes words containing accented letters hyphenatable.  Not a huge
 gain, but sometimes may be important (especially in some languages, and
 with narrow columns).

If people have the need for additional fonts they can add it.  In a patch
further down the thread I add support to set backends for packages (so
fontenc is only loaded if using pdflatex).

If you'd replaced lmodern with libertine I would have been more inclined
to agree (though it might not have as wide support as LM).  BTW: I guess
any of the GUST fonts would have pretty great glyph support.

An easy mechanism for changing font package is nice.  E.g. I use libertine
by default, but in some cases I'd might want to use another package in
which case I'd want to have libertine replaced.

 We could also take this opportunity to provide users an easy way to
 switch between TeX engines.

 I second that!

Feel free to test the patch in another post.  If's difficult because: (i)
we want to be able to change engines with some liberty, but not to much
(e.g. you can run xelatex but you can't run myrandomscript.sh); (ii) the
info plist is not available at compile time so we have to write the info
to file, in the patch I use the AUCTeX latex-command var; (iii) it would
be nice to support flags (-shell-escape), but see (i).

Rasmus

-- 
I hear there's rumors on the, uh, Internets. . .




Re: [O] ox-latex: default packages cleaning

2015-07-14 Thread Marcin Borkowski

On 2015-07-07, at 16:53, Rasmus ras...@gmx.us wrote:

 Hi,

Hi,

and sorry for my delay – I have a huge email backlog...

 We could do some cleaning of org-default-package-alist before Org 8.3.

Yes, yes, yes!

 * tolerance

 Why is \\tolerance=1000 part of org-default-package-alist?  Is this
 value good for all languages?  If we keep it, it should be configurable.
 But people who explicitly wants this behavior can probably add it
 themselves.

 If it's a means to archive high-quality paragraphs, maybe microtype is
 probably the 'proper' fix...

My suggestion: forget about \tolerance.  It’s low-level TeX stuff,
hardly anybody knows what it does, really (it is one of the dozen or two
parameters governing the line-breaking algorithm), and most people would
not see any difference anyway.  I wouldn’t add microtype, OTOH.  One
reason: it issues a lot of warnings when you use a font it does not
know.  It doesn’t hurt, but some people don’t like warnings.  Also, some
people might not really /want/ microtype – it messes around with font
widths, and even with the default settings (which are rather
conservative), it can look a bit strange.

 * Fixltx2e

 This packages is depreciated with TL2015 cf. LaTeX News 22.  We can use
 \RequirePackage[current]{latexrelease} but there's no point in that
 AFAIK latexrelease only useful for backwards compatibility.

Didn’t even know that.

 * marvosym¹ 
 * Wasysym² 

My opinion: remove both.

 Rasmus

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



Re: [O] ox-latex: default packages cleaning

2015-07-14 Thread Marcin Borkowski

On 2015-07-07, at 21:35, Suvayu Ali fatkasuvayu+li...@gmail.com wrote:

 I would like to second microtype.  In fact as far as I know, now a days
 it is recommended to load that for almost all documents with significant
 text on TeX.SX.

As I wrote a minute ago, I would rather not add microtype, though it's
a minor thing, really.

 I would also suggest removing inputenc.  At the moment, it is loaded
 with the AUTO option.  AFAIK, this is redundant since most recent
 (meaning for quite a few years) TeX engines already use the encoding of
 the file if nothing is specified.

Can you elaborate on that?  AFAIK, XeTeX and LuaTeX use UTF-8 by
default, but pdfetex (which is the default LaTeX engine) does not.  And
quite a lot of people ose pdfetex (me included;-)).  I haven't heard
about any heuristic determination of encoding by TeX (and I hope nothing
like that happens, since it could be disastrous).

 The next one would be fontenc, now it is loaded with T1.  I'm not sure
 if this is needed.  Maybe LaTeX experts like Marcin or Fabrice could
 comment.

Thanks for calling me an expert, though I'm not one regarding fonts and
their encodings;-).

With fontenc, the thing is tricky.  I do not know much about other
languages, but you actually can't use LaTeX to typeset texts in Polish
without changing the default LaTeX's font encoding (which is OT1, and it
doesn't support some Polish letters).  (Usually, I do not use fontenc
for that, since there is a specialized package for Polish typesetting.)

I guess that removing fontenc for non-English texts might lead to
erroneous results – at least in case of presence of certain Polish words
(e.g., some names in bibliographies).  I guess we don’t want that.

OTOH, one thing we /might/ want to add is \usepackage{lmodern}.  The
Latin Modern family of fonts is a drop-in replacement for the default
Computer Modern, but with all sorts of accented characters.  Using this
font family has the advantage that accented characters are not build
from letters and accents, but are single glyphs in the font.  AFAIR,
this makes words containing accented letters hyphenatable.  Not a huge
gain, but sometimes may be important (especially in some languages, and
with narrow columns).

 We could also take this opportunity to provide users an easy way to
 switch between TeX engines.

I second that!

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



Re: [O] ox-latex: default packages cleaning

2015-07-13 Thread Rasmus
Hi,

Rasmus ras...@gmx.us writes:

 * tolerance
 * marvosym¹ 
 * Wasysym² 

Pushed.

 * Fixltx2e

Will push after 8.3 is released.

Rasmus

-- 
Dobbelt-A




Re: [O] ox-latex: default packages cleaning

2015-07-11 Thread Rasmus
Hi Robert,

Robert Klein rokl...@roklein.de writes:

 * Fixltx2e
 
 This packages is depreciated with TL2015 cf. LaTeX News 22.  We can
 use \RequirePackage[current]{latexrelease} but there's no point in
 that AFAIK latexrelease only useful for backwards compatibility.

 Leaving this out probably doesn't break texing with older
 texlive versions.

 Please try to keep export compatible to older versions.  I have a
 couple of computers where I can use new versions of org-mode (and an
 appropriate version of emacs), where it is not feasible to install a
 newer version of texlive.

The target of Org 8.3 is 24.3.  I don't know if there's a policy wrt
targeting older versions of auxiliary software.

In the case of fixltx2 it's reasonable to only remove it from the default
packages after the release of Org 8.3.  Extrapolating, users of org-stable
will only see that change 1-2 years from now.

Rasmus

-- 
History is what should never happen again




Re: [O] ox-latex: default packages cleaning

2015-07-11 Thread Robert Klein
Hi Rasmus,

On Sat, 11 Jul 2015 12:48:06 +0200
Rasmus ras...@gmx.us wrote:

 Hi Robert,
 
 Robert Klein rokl...@roklein.de writes:
 
  * Fixltx2e
  
  This packages is depreciated with TL2015 cf. LaTeX News 22.  We can
  use \RequirePackage[current]{latexrelease} but there's no point in
  that AFAIK latexrelease only useful for backwards
  compatibility.
 
  Leaving this out probably doesn't break texing with older
  texlive versions.
 
  Please try to keep export compatible to older versions.  I have a
  couple of computers where I can use new versions of org-mode (and an
  appropriate version of emacs), where it is not feasible to install a
  newer version of texlive.
 
 The target of Org 8.3 is 24.3.  I don't know if there's a policy wrt
 targeting older versions of auxiliary software.
 
 In the case of fixltx2 it's reasonable to only remove it from the
 default packages after the release of Org 8.3.  Extrapolating, users
 of org-stable will only see that change 1-2 years from now.

Forget what I said.  You are right.

LaTeX will also work without fixltx2e and org latex export probably
doesn't need it anyway.

Sorry about that.

Best regards
Robert



Re: [O] ox-latex: default packages cleaning

2015-07-10 Thread Robert Klein
Hello

 * Fixltx2e
 
 This packages is depreciated with TL2015 cf. LaTeX News 22.  We can
 use \RequirePackage[current]{latexrelease} but there's no point in
 that AFAIK latexrelease only useful for backwards compatibility.

Leaving this out probably doesn't break texing with older
texlive versions.

Please try to keep export compatible to older versions.  I have a
couple of computers where I can use new versions of org-mode (and an
appropriate version of emacs), where it is not feasible to install a
newer version of texlive.

Best regards
Robert



Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Suvayu Ali
On Wed, Jul 08, 2015 at 03:53:32PM +0200, Rasmus wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  From 54bcf8f1ae26c91fa856b64071dca65d3f31e1f2 Mon Sep 17 00:00:00 2001
  From: Rasmus ras...@gmx.us
  Date: Wed, 8 Jul 2015 14:44:56 +0200
  Subject: [PATCH 9/9] ox-latex: Support TeX variants
 
  This one fails to apply for me.  I'm on 
 
 You probably need the other patches posted in OP due to changes in
 org-latex-default-packages-alist.

Indeed, and it works very nicely!

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 We could also take this opportunity to provide users an easy way to
 switch between TeX engines.

These two patches goes some of the way towards what you want.
org-latex-pdf-process would also have to patched as well, though.

Test document:

 #+title: test xetex
 #+language: en
 #+options: tex-variant:xetex
 * header
 #+BEGIN_SRC emacs-lisp
   (add-to-list 'org-latex-packages-alist
'(AUTO, french polyglossia nil (luatex xetex)))
 #+END_SRC


Result (node the missing inputenc and fontenc):

 \documentclass[11pt]{article}
 \usepackage{graphicx}
 \usepackage{grffile}
 \usepackage{longtable}
 \usepackage{wrapfig}
 \usepackage{rotating}
 \usepackage[normalem]{ulem}
 \usepackage{amsmath}
 \usepackage{textcomp}
 \usepackage{amssymb}
 \usepackage{capt-of}
 \usepackage{hyperref}
 \usepackage{polyglossia}
 \setmainlanguage{english}
 \setotherlanguage{french}

 \author{Rasmus}
 \date{\textit{2015-07-07 mar}}
 \title{test xetex}
 \hypersetup{
  pdfauthor={Rasmus},
  pdftitle={test xetex},
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 25.0.50.1 (Org mode 8.3beta)}, 
  pdflang={English}}
 \begin{document}

 \maketitle
 \tableofcontents

 \section{add polyglossia}
 \label{sec:orgheadline1}
 \begin{verbatim}
 (add-to-list 'org-latex-packages-alist
  '(AUTO, french polyglossia nil (luatex xetex)))
 \end{verbatim}
 \end{document}

Rasmus

-- 
However beautiful the theory, you should occasionally look at the evidence
From df91d417df3223c0698e56be219f8f1a303ce566 Mon Sep 17 00:00:00 2001
From: Rasmus ras...@gmx.us
Date: Wed, 8 Jul 2015 14:12:21 +0200
Subject: [PATCH 8/9] ox-latex: Add polyglossia support

* ox-latex.el (org-latex-guess-polyglossia-language): New function.
  (org-latex-template): Apply new function.
---
 lisp/ox-latex.el | 61 ++--
 1 file changed, 51 insertions(+), 10 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index ff42843..058d7f8 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1195,6 +1195,45 @@ Return the new header.
 		, )
 	 t nil header 1)
 
+(defun org-latex-guess-polyglossia-language (header info)
+  Set the Polyglossia language according to the LANGUAGE keyword.
+
+HEADER is the LaTeX header string.  INFO is the plist used as
+a communication channel.
+
+Insertion of guessed language only happens when the Polyglossia
+package has been explicitly loaded.
+
+The argument to Polyglossia may be \AUTO\ which is then
+replaced with the language of the document or
+`org-export-default-language'.  Note, the language is really set
+using \setdefaultlanguage and not as an option to the package.
+
+Return the new header.
+  (let ((language-code (plist-get info :language)))
+;; If no language is set or Polyglossia is not loaded, return
+;; HEADER as-is.
+(if (or (not (stringp language-code))
+	(not (string-match usepackage\\[?\\(.*?\\)?\\]?{polyglossia} header)))
+	header
+  (let* ((language (cdr (assoc language-code
+   org-latex-babel-language-alist)))
+	 (options (or (org-string-nw-p (match-string 1 header)) AUTO))
+	 (languages (save-match-data
+			  (org-split-string
+			   (replace-regexp-in-string
+			AUTO (if (string-match-p language options)  language)
+			options t)
+			   ,[ \t]*)))
+	 (main-language-set (string-match-p setmainlanguage{.*?} header)))
+	(replace-match
+	 (concat \\usepackage{polyglossia}\n
+		 (when (and languages (not main-language-set))
+		   (format \\setmainlanguage{%s} (pop languages)))
+		 (when languages
+		   (format \n\\setotherlanguage{%s}\n (mapconcat 'identity languages , 
+	 t t header 0)
+
 (defun org-latex--find-verb-separator (s)
   Return a character not used in string S.
 This is used to choose a separator for constructs like \\verb.
@@ -1349,16 +1388,18 @@ holding export options.
 		 class-options header t nil 1)
(if (not document-class-string)
 	   (user-error Unknown LaTeX class `%s' class)
-	 (org-latex-guess-babel-language
-	  (org-latex-guess-inputenc
-	   (org-element-normalize-string
-	(org-splice-latex-header
-	 document-class-string
-	 org-latex-default-packages-alist
-	 org-latex-packages-alist nil
-	 (concat (org-element-normalize-string
-		  (plist-get info :latex-header))
-		 (plist-get info :latex-header-extra)
+	 (org-latex-guess-polyglossia-language
+	  (org-latex-guess-babel-language
+	   (org-latex-guess-inputenc
+	(org-element-normalize-string
+	 (org-splice-latex-header
+	  document-class-string
+	  org-latex-default-packages-alist
+	  org-latex-packages-alist nil
+	  (concat (org-element-normalize-string
+		   (plist-get info :latex-header))
+		  (plist-get info 

Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 I would also suggest removing inputenc.  At the moment, it is loaded
 with the AUTO option.  AFAIK, this is redundant since most recent
 (meaning for quite a few years) TeX engines already use the encoding of
 the file if nothing is specified.

A colleague of mine were missing her umlaut today cause she hadn't loaded
inputenc with utf8.  So I guess removing inputenc is premature.

Rasmus

-- 
. . . The proofs are technical in nature and provides no real understanding




Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Suvayu Ali
On Wed, Jul 08, 2015 at 02:54:41PM +0200, Rasmus wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  I would also suggest removing inputenc.  At the moment, it is loaded
  with the AUTO option.  AFAIK, this is redundant since most recent
  (meaning for quite a few years) TeX engines already use the encoding of
  the file if nothing is specified.
 
 A colleague of mine were missing her umlaut today cause she hadn't loaded
 inputenc with utf8.  So I guess removing inputenc is premature.

Interesting, I'll keep this in mind.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Suvayu Ali
On Wed, Jul 08, 2015 at 02:53:46PM +0200, Rasmus wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
  We could also take this opportunity to provide users an easy way to
  switch between TeX engines.
 
 These two patches goes some of the way towards what you want.
 org-latex-pdf-process would also have to patched as well, though.

 [...chomp...chomp...chomp...]

 From 54bcf8f1ae26c91fa856b64071dca65d3f31e1f2 Mon Sep 17 00:00:00 2001
 From: Rasmus ras...@gmx.us
 Date: Wed, 8 Jul 2015 14:44:56 +0200
 Subject: [PATCH 9/9] ox-latex: Support TeX variants

This one fails to apply for me.  I'm on 

  c76fef6 org-clock: Add `untilnow' time block

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 From 54bcf8f1ae26c91fa856b64071dca65d3f31e1f2 Mon Sep 17 00:00:00 2001
 From: Rasmus ras...@gmx.us
 Date: Wed, 8 Jul 2015 14:44:56 +0200
 Subject: [PATCH 9/9] ox-latex: Support TeX variants

 This one fails to apply for me.  I'm on 

You probably need the other patches posted in OP due to changes in
org-latex-default-packages-alist.

-- 
Tack, ni svenska vakttorn. Med plutonium tvingar vi dansken på knä!




Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 Indeed, and it works very nicely!

Let me know when you find bugs.

I'm trying to think of an elegant way to map from a tex-variant to a
command.  Perhaps change the variant names to the latex variants and input
that.  E.g. if using plain commands, pdflatex is changed to replaced
with xelatex.  texi2dvi uses LATEX=xelatex texi2dvi.  With latexmk you
can use -pdflatex=xelatex.  Rubber: no clue and it's not part of TL...

Rasmus

-- 
And when I’m finished thinking, I have to die a lot




Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Suvayu Ali
On Wed, Jul 08, 2015 at 04:26:56PM +0200, Rasmus wrote:
 
 I'm trying to think of an elegant way to map from a tex-variant to a
 command.  Perhaps change the variant names to the latex variants and input
 that.

I think that would be a good way to go.

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Rasmus
Hi,

Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 +(defun org-latex-guess-polyglossia-language (header info)
 +  Set the Polyglossia language according to the LANGUAGE keyword.

 I'm in two-minds about this.  On the one had it is a nice thing, but on
 the other hand, it prevents the more fine grained control offered by
 polyglossia.  For example, I used this in my setup before:

   \setdefaultlanguage[variant=british]{english}

It's a shame that Polyglossia is so much different from babel  For
babel we translate en-gb to british which is a valid babel language.
But your example shows that org-latex-babel-language-alist does not work
for polyglossia.  Which means that somebody has to come up with a mapping
from language codes (en-gb) to (language . variant) pairs (your example).

Also, some mechanism needs to be in place to convey random options like
spelling={new, old} for German...  Unless polyglossia options can be set
afterwards via latex_headers.

 I don't see an easy way of passing the optional argument.  But on the
 other hand

   \setmainlanguage{english}

 is plain, simple, and works in most (almost all) cases.

The only limitation here is whether somebody wants to contribute
org-latex-polyglossia-language-alist (≡ go through the manual and map all
pairs).  Conveying language-specific options in Org is what I worry about.

Rasmus

-- 
ツ




Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Suvayu Ali
Hi Rasmus,

On Wed, Jul 08, 2015 at 02:53:46PM +0200, Rasmus wrote:

 +(defun org-latex-guess-polyglossia-language (header info)
 +  Set the Polyglossia language according to the LANGUAGE keyword.

I'm in two-minds about this.  On the one had it is a nice thing, but on
the other hand, it prevents the more fine grained control offered by
polyglossia.  For example, I used this in my setup before:

  \setdefaultlanguage[variant=british]{english}

I don't see an easy way of passing the optional argument.  But on the
other hand

  \setmainlanguage{english}

is plain, simple, and works in most (almost all) cases.  I'm thinking
whether to leave the babel/polyglossia features entirely up to the user.
That said, I like the feature very much.  For people who write in
multiple languages, if they load polyglossia, it should just work for
all their documents.  Which is great!

WDYT?  What do others think?

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] ox-latex: default packages cleaning

2015-07-08 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 +(defun org-latex-guess-polyglossia-language (header info)
 +  Set the Polyglossia language according to the LANGUAGE keyword.

 I'm in two-minds about this.  On the one had it is a nice thing, but on
 the other hand, it prevents the more fine grained control offered by
 polyglossia.  For example, I used this in my setup before:

   \setdefaultlanguage[variant=british]{english}

The attached supports Polyglossia better.  Note, the last loaded language
is the main one (as babel).  Perhaps org-latex-variant-file-string should
be less annoying (not a file-variable).

Test file:

 #+title: test xetex
 #+language: en-gb
 #+latex_variant: xelatex

 * header
   add polyglossia

 #+BEGIN_SRC emacs-lisp
 (add-to-list 'org-latex-packages-alist
   '(AUTO, french polyglossia nil (lualatex xelatex)))
 #+END_SRC

Output:

% -*- LaTeX-command: xelatex -*-
% Created 2015-07-08 mié 20:32
\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{polyglossia}
\setmainlanguage{french}
\setotherlanguage[variant=uk]{english}
\author{Rasmus}
\date{\today}
\title{test xetex}
\hypersetup{
 pdfauthor={Rasmus},
 pdftitle={test xetex},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 25.0.50.1 (Org mode 8.3beta)}, 
 pdflang={British}}
\begin{document}

\maketitle
\tableofcontents


\section{add polyglossia}
\label{sec:orgheadline1}
\begin{verbatim}
(add-to-list 'org-latex-packages-alist
  '(AUTO, french polyglossia nil (lualatex xelatex)))
\end{verbatim}
\end{document}


-- 
Dung makes an excellent fertilizer
From 96dcb2ab15ddfce1f95560f49076187508b2ef43 Mon Sep 17 00:00:00 2001
From: Rasmus ras...@gmx.us
Date: Wed, 8 Jul 2015 14:44:56 +0200
Subject: [PATCH 09/10] ox-latex: Support TeX variants

* org.el (org-latex-default-packages-alist): Only use inputenc
and fontenc in pdftex.
* ox-latex.el (latex): Add :latex-tex-variant.
(org-latex-variant): New defcustom.
(org-latex-variants): New defconst.
(org-latex--remove-packages): New function.
(org-latex-template): Use new function.
(org-latex-pdf-process): Update to use %latex shorthand.
(org-latex-compile): Check and use intended compiler.

Suggested-by: Suvayu Ali fatkasuvayu+li...@gmail.com
http://permalink.gmane.org/gmane.emacs.orgmode/98921
---
 lisp/org.el  |   4 +-
 lisp/ox-latex.el | 133 ---
 2 files changed, 89 insertions(+), 48 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index f10ccf9..2721646 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4069,8 +4069,8 @@ header, or they will be appended.
 	  (default-value var)))
 
 (defcustom org-latex-default-packages-alist
-  '((AUTO inputenc  t)
-(T1   fontenc   t)
+  '((AUTO inputenc  t (pdflatex))
+(T1   fontenc   t (pdflatex))
 ( graphicx  t)
 ( grffile   t)
 ( longtable nil)
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 0851066..8c1cd9f 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -144,6 +144,7 @@
 (:latex-text-markup-alist nil nil org-latex-text-markup-alist)
 (:latex-title-command nil nil org-latex-title-command)
 (:latex-toc-command nil nil org-latex-toc-command)
+(:latex-variant LATEX_VARIANT nil org-latex-variant)
 ;; Redefine regular options.
 (:date DATE nil \\today parse)))
 
@@ -395,6 +396,28 @@ references.
   :version 25.1
   :package-version '(Org . 8.3))
 
+(defcustom org-latex-variant pdflatex
+  Tex variant to use.
+  :group 'org-export-latex
+  :type '(choice
+	  (cons :tag pdfLaTeX pdflatex)
+	  (cons :tag XeLaTeX  xelatex)
+	  (cons :tag luaLaTeX lualatex))
+  :version 25.1
+  :package-version '(Org . 8.3))
+
+(defcustom org-latex-variant-file-string %% -*- LaTeX-command: %s -*-\n
+  Variant format-string written to file.
+Default value is a local variable for AUCTeX.
+  :group 'org-export-latex
+  :type 'string
+  :version 25.1
+  :package-version '(Org . 8.3)
+  )
+
+(defconst org-latex-variants '(pdflatex xelatex lualatex)
+  Known LaTeX variants.)
+
  Preamble
 
 (defcustom org-latex-default-class article
@@ -1032,14 +1055,15 @@ during latex export it will output
  Compilation
 
 (defcustom org-latex-pdf-process
-  '(pdflatex -interaction nonstopmode -output-directory %o %f
-pdflatex -interaction nonstopmode -output-directory %o %f
-pdflatex -interaction nonstopmode -output-directory %o %f)
+  '(%latex -interaction nonstopmode -output-directory %o %f
+%latex -interaction nonstopmode -output-directory %o %f
+%latex -interaction nonstopmode -output-directory %o %f)
   

Re: [O] ox-latex: default packages cleaning

2015-07-07 Thread Eric S Fraga
On Tuesday,  7 Jul 2015 at 16:53, Rasmus wrote:
 Hi,

 We could do some cleaning of org-default-package-alist before Org 8.3.

Rasmus,

I'm happy with all of your suggested removals.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1260-gcedef7



Re: [O] ox-latex: default packages cleaning

2015-07-07 Thread Suvayu Ali
Hi Rasmus,

On Tue, Jul 07, 2015 at 04:53:35PM +0200, Rasmus wrote:
 
 If it's a means to archive high-quality paragraphs, maybe microtype is
 probably the 'proper' fix...

I would like to second microtype.  In fact as far as I know, now a days
it is recommended to load that for almost all documents with significant
text on TeX.SX.

I would also suggest removing inputenc.  At the moment, it is loaded
with the AUTO option.  AFAIK, this is redundant since most recent
(meaning for quite a few years) TeX engines already use the encoding of
the file if nothing is specified.

The next one would be fontenc, now it is loaded with T1.  I'm not sure
if this is needed.  Maybe LaTeX experts like Marcin or Fabrice could
comment.

 * Fixltx2e
 
 This packages is depreciated with TL2015 cf. LaTeX News 22.  We can use
 \RequirePackage[current]{latexrelease} but there's no point in that
 AFAIK latexrelease only useful for backwards compatibility.

Didn't know about this.  Thank you.  I would vote for dropping it.

 * marvosym¹ 
 * Wasysym² 

Agreed.  On top of this, wasysym also interferes with integral symbols
from amsmath[1].

We could also take this opportunity to provide users an easy way to
switch between TeX engines.  I have been using XeLaTeX with Org and
outside for quite a few years now.  Originally what used to be very
hacky, is now simply replacing a couple of packages in the header and
calling xelatex instead of pdflatex.  And the list of packages is pretty
much identical for LuaLaTeX.  This is what I would use:

  \usepackage{fontspec}
  \usepackage{microtype}
  \usepackage{polyglossia}  % instead of babel
  % of course this should be something appropriate for the buffer
  \setdefaultlanguage[variant=british]{english}

So an option like tex-engine:xelatex or tex-engine:lualatex adds the
above to the default packages and the right binaries.  Just an idea.

Cheers,


Footnotes:

[1] At least that's what comments in my setup tell me :-p:
https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L136


-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] ox-latex: default packages cleaning

2015-07-07 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 I would like to second microtype.  In fact as far as I know, now a days
 it is recommended to load that for almost all documents with significant
 text on TeX.SX.

It's easy enough to add and we should keep the default minimal.  Though
microtype is certainly a package I would not mind imposing on people.

 I would also suggest removing inputenc.  At the moment, it is loaded
 with the AUTO option.  AFAIK, this is redundant since most recent
 (meaning for quite a few years) TeX engines already use the encoding of
 the file if nothing is specified.

I think you might be right, but I haven't looked into it.

 The next one would be fontenc, now it is loaded with T1.  I'm not sure
 if this is needed.  Maybe LaTeX experts like Marcin or Fabrice could
 comment.

I thought it was needed for some symbols, but it seems it might not be.


 * marvosym¹ 
 * Wasysym² 

 Agreed.  On top of this, wasysym also interferes with integral symbols
 from amsmath[1].

No, the manual notes it has comparability with amsmath build it.  It
installs them under \varint and friends.

 We could also take this opportunity to provide users an easy way to
 switch between TeX engines.

It's already pretty easy.  I bind org-latex-pdf-process to the desired
engine via latexmk in my file.  I also wrap fontenc and inputenc in
\ifpdftex\else\fi or whatever.  In any case, betterᵀᴹ support for xelatex
would be nice.

   \usepackage{polyglossia}  % instead of babel

You can use babel with xelatex.

Rasmus

-- 
A clever person solves a problem. A wise person avoids it




Re: [O] ox-latex: default packages cleaning

2015-07-07 Thread Rasmus
Suvayu Ali fatkasuvayu+li...@gmail.com writes:

 Yes, but polyglossia is recommended.  In the interest of minimal work on
 the part of Org, this could just be ignored.  I don't think we add babel
 anyway, or do we?

I thought we did, but we don't.  Anyway, babel works across different tex
backends which is nice feature.  That was the point.

-- 
Dung makes an excellent fertilizer




Re: [O] ox-latex: default packages cleaning

2015-07-07 Thread Suvayu Ali
On Tue, Jul 07, 2015 at 10:05:06PM +0200, Rasmus wrote:
 Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 
\usepackage{polyglossia}  % instead of babel
 
 You can use babel with xelatex.

Yes, but polyglossia is recommended.  In the interest of minimal work on
the part of Org, this could just be ignored.  I don't think we add babel
anyway, or do we?

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



[O] ox-latex: default packages cleaning

2015-07-07 Thread Rasmus
Hi,

We could do some cleaning of org-default-package-alist before Org 8.3.

* tolerance

Why is \\tolerance=1000 part of org-default-package-alist?  Is this
value good for all languages?  If we keep it, it should be configurable.
But people who explicitly wants this behavior can probably add it
themselves.

If it's a means to archive high-quality paragraphs, maybe microtype is
probably the 'proper' fix...

* Fixltx2e

This packages is depreciated with TL2015 cf. LaTeX News 22.  We can use
\RequirePackage[current]{latexrelease} but there's no point in that
AFAIK latexrelease only useful for backwards compatibility.

* marvosym¹ 

This is used for

 (EUR \\EUR{} nil euro; EUR EUR €)
 (EURdig \\EURdig{} nil euro; EUR EUR €)
 (EURhv \\EURhv{} nil euro; EUR EUR €)
 (EURcr \\EURcr{} nil euro; EUR EUR €)
 (EURtm \\EURtm{} nil euro; EUR EUR €)

We could either call \\texteuro{} or use eurosym.  IMO, if people wants
something more sophisticated than \texteuro (which depends on the current
font) can load marvosym or eurosym.

* Wasysym² 

Wasysym is used for a couple of smileys.

 (smiley \\smiley{} nil #9786; :-) :-) ☺)
 (blacksmile \\blacksmiley{} nil #9787; :-) :-) ☻)
 (sad \\frownie{} nil #9785; :-( :-( ☹)

I don't know why these smileys are blessed when '' and '' are not.
Ideally, you'd just use unicode smileys, but this requires {xe,lua}tex.
So for now we can could use \(\ddot\smile\) and \(\ddot\frown\) and shave
off the extra dependency.  Put perhaps it's better to just let people
choose themselves which smiley command they will want to use in which case
we could also just remove wasysym.

Rasmus

Footnotes: 
¹ (defun rasmus-next-marvosym ()
  find marvosym symbols
  (interactive)
  (let (case-fold-search)
(search-forward-regexp 
 (format %s\\ (regexp-opt (mapcar 'symbol-name '(Pickup Letter 
Mobilefone Telefon fax FAX Faxmachine Email Lightning EmailCT Beam Bearing 
LooseBearing FixedBearing LeftTorque RightTorque Lineload MVArrowDown OktoSteel 
HexaSteel SquareSteel RectSteel CircSteel SquarePipe RectPipe CircPipe LSteel 
RoundedLSteel TSteel RoundedTSteel TTsteel RoundedTTSteel FlatSteel Valve 
Industry Coffeecup LeftScissors CuttingLine RightScissors Football Bicycle Info 
ClockLogo CutRight CutLineine CutLeft Wheelchair Gentsroom Ladiesroom 
Checkedbox CrossedBox HollowBox PointingHand WritingHand MineSign Recycling 
PackingWaste WashCotton WashSynthetics WashWool HandWash NoWash Tumbler 
NoTumbler NoChemicalCleaning Bleech NoBleech CleaningA CleaningP CleaningPP 
CleaningF CleaningFF IroningI IroningII IroningIII NoIroning AtNinetyFive 
ShortNinetyFive AtSixty ShortSixty ShortFifty AtForty ShortForty SpecialForty 
ShortThirty EUR EURdig EURhv EURcr EURtm Ecommerce Shilling Denarius Pfund 
EyesDollar Florin EurDig EurHv EurCr EurTm EstimatedSign Deleatur Ecommerce 
Denarius EUR EURdig Stopsign CESign Estatically Explosionsafe Laserbeam 
Biohazard Radioactivity BSEFree RewindToIndex RewindToStart Rewind Forward 
ForwardToEnd ForwardToIndex MoveUp MoveDown ToTop ToBottom ComputerMouse 
SerialInterface Keyboard SerialPort ParallelPort Printer MVZero MVOne MVTwo 
MVThree MVFour MVFive MVSix MVSeven MVEight MVNine MVLeftBracket MVRightBracket 
MVComma MVPeriod MVMinus MVPlus MVDivision MVMultiplication Conclusion 
Equivalence barOver BarOver arrowOver ArrowOver StrikingThrough 
MultiplicationDot LessOrEqual LargerOrEqual AngleSign Corresponds Congruent 
NotCongruent Divides DividesNot Female Male Hermaphrodite Neutral FEMALE MALE 
HERMAPHRODITE FemaleFemale MaleMale FemaleMale Sun Moon Mercury Venus Mars 
Jupiter Saturn Uranus Neptune Pluto Earth Aries Taurus Gemini Cancer Leo Virgo 
Libra Scorpio Sagittarius Capricorn Aquarius Pisces YinYang MVRightArrow MVAt 
BOLogo BOLogoL BALogoP Mundus Cross CeltCross Ankh Heart CircledA Bouquet 
Frowny Smiley PeaceDove Bat WomanFace ManFace
 nil t)))



²   (defun rasmus-next-wasy ()
  next wasysym symbol
  (interactive)
  (let (case-fold-search)
(search-forward-regexp
 (format %s\\
 (regexp-opt
  (mapcar 'symbol-name
  '(male female currency phone recorder clock lightning 
pointer RIGHTarrow LEFTarrow UParrow DOWNarrow diameter invdiameter varangle 
wasylozenge kreuz smiley frownie blacksmiley sun checked bell ataribox cent 
permil brokenvert wasytherefore Bowtie agemO AC HF VHF photon gluon Square XBox 
CheckedBox hexagon varhexagon pentagon octagon hexstar varhexstar davidsstar 
eighthnote quarternote u2669 halfnote fullnote twonotes CIRCLE Leftcircle 
LEFTCIRCLE Rightcircle RIGHTCIRCLE LEFTcircle RIGHTcircle leftturn rightturn dh 
DH thorn Thorn openo inve vernal ascnode descnode fullmoon newmoon leftmoon 
rightmoon astrosun mercury venus earth mars jupiter saturn uranus neptune pluto 
aries taurus gemini cancer leo virgo libra scorpio sagittarius capricornus 
aquarius pisces conjunction opposition APLstar APLlog APLbox APLup
 nil t)))



Re: [O] ox-latex: includegraphics should quote filenames

2015-05-29 Thread Vaidheeswaran C
On Tuesday 26 May 2015 02:32 PM, Andreas Leha wrote:
 Hi Vaidheeswaran,
 
 Vaidheeswaran C vaidheeswaran.chinnar...@gmail.com writes:
  In:
  [[./emacs-24.5.1-startup-screen-annotated.png]]
 
  Buggy Out:
 
  \includegraphics[width=.9\linewidth]{./emacs-24.5.1-startup-screen-annotated.png}
 
  Desired: Out:
 
  \includegraphics[width=.9\linewidth]{{./emacs-24.5.1-startup-screen-annotated}.png}
 
  Source:
 
  http://tex.stackexchange.com/questions/10574/includegraphics-dots-in-filename
 I agree.  Although I do not actually experience this, as my custom LaTeX
 classes all \use[ the ]package{grffile} (also in your Reference) by now.
 
 I have not experienced any problem with that package and it appears to
 handle more cases (especially spaces) than 'quoting'.  So, it might be
 an alternative to use grffile by default?

ox-latex export must work out of the box (when it can)!  Currently
inline images (that have dots in their names) are not exporting
correctly.

If someone fixes this bug (one way or the other), I will be most
grateful!




Re: [O] ox-latex: includegraphics should quote filenames

2015-05-29 Thread Rasmus
Vaidheeswaran C vaidheeswaran.chinnar...@gmail.com writes:

 ox-latex export must work out of the box (when it can)!  Currently
 inline images (that have dots in their names) are not exporting
 correctly.

No it musen't.  There's explicit cases where you have to add
configuration.  The most horrendous example is a local toc.

 If someone fixes this bug (one way or the other), I will be most
 grateful!

Unless this is SUPER urgent for you, I will fix it on Monday.  Let me know
if this is not early enough.

Rasmus

-- 
m-mm-mmm- bacon!




Re: [O] ox-latex: includegraphics should quote filenames

2015-05-29 Thread Vaidheeswaran C
On Friday 29 May 2015 03:39 PM, Rasmus wrote:

 Okay, I'm adding grffile as it also support spaces in filenames.  Now this
 example works:

Thanks. Works for me.





Re: [O] ox-latex: includegraphics should quote filenames

2015-05-29 Thread Rasmus
Rasmus ras...@gmx.us writes:

 Vaidheeswaran C vaidheeswaran.chinnar...@gmail.com writes:

 ox-latex export must work out of the box (when it can)!  Currently
 inline images (that have dots in their names) are not exporting
 correctly.

 If someone fixes this bug (one way or the other), I will be most
 grateful!

 Actually, does it work if you add grffile to your latex package alist?  It
 should.  Since it's part of latex-base I'm tempted to add this package to
 the default packages.

Okay, I'm adding grffile as it also support spaces in filenames.  Now this
example works:

* test
[[file:nasty dir/Screenshot. from 2015-03-05 19:05:00.png]]

Rasmus

-- 
Hooray!




Re: [O] ox-latex: includegraphics should quote filenames

2015-05-29 Thread Rasmus
Vaidheeswaran C vaidheeswaran.chinnar...@gmail.com writes:

 ox-latex export must work out of the box (when it can)!  Currently
 inline images (that have dots in their names) are not exporting
 correctly.

 If someone fixes this bug (one way or the other), I will be most
 grateful!

Actually, does it work if you add grffile to your latex package alist?  It
should.  Since it's part of latex-base I'm tempted to add this package to
the default packages.

Rasmus

-- 
⠠⠵




Re: [O] ox-latex: includegraphics should quote filenames

2015-05-26 Thread Rasmus
Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 I have not experienced any problem with that package and it appears to
 handle more cases (especially spaces) than 'quoting'.  So, it might be
 an alternative to use grffile by default?  Even with the downside of
 more dependencies.  But maybe more experienced LaTeX users might have a
 different opinion.

Since tlmgr info --list collection-latex |grep oberdiek is non-nil and
since the manual of grffile mentions no conflicts there's not really any
cost of including grffile.  OTOH, it's pretty trivial to add.  [I'd never
heard of this problem before this thread].

From the link it seems that an extra pair of braces is always enough when
the filename in included (and there's no spaces).  It's also trivial to
add this.

IOW: I think either solution is fine.

Rasmus

-- 
This message is brought to you by the department of redundant departments




Re: [O] ox-latex: includegraphics should quote filenames

2015-05-26 Thread Andreas Leha
Hi Vaidheeswaran,

Vaidheeswaran C vaidheeswaran.chinnar...@gmail.com writes:
 In:
 [[./emacs-24.5.1-startup-screen-annotated.png]]

 Buggy Out:

 \includegraphics[width=.9\linewidth]{./emacs-24.5.1-startup-screen-annotated.png}

 Desired: Out:

 \includegraphics[width=.9\linewidth]{{./emacs-24.5.1-startup-screen-annotated}.png}

 Source:

 http://tex.stackexchange.com/questions/10574/includegraphics-dots-in-filename

I agree.  Although I do not actually experience this, as my custom LaTeX
classes all \use[ the ]package{grffile} (also in your Reference) by now.

I have not experienced any problem with that package and it appears to
handle more cases (especially spaces) than 'quoting'.  So, it might be
an alternative to use grffile by default?  Even with the downside of
more dependencies.  But maybe more experienced LaTeX users might have a
different opinion.

Regards,
Andreas




[O] ox-latex: includegraphics should quote filenames

2015-05-25 Thread Vaidheeswaran C

In:
[[./emacs-24.5.1-startup-screen-annotated.png]]

Buggy Out:

\includegraphics[width=.9\linewidth]{./emacs-24.5.1-startup-screen-annotated.png}

Desired: Out:

\includegraphics[width=.9\linewidth]{{./emacs-24.5.1-startup-screen-annotated}.png}

Source:

http://tex.stackexchange.com/questions/10574/includegraphics-dots-in-filename




[O] ox-latex does not recognize :align setting

2015-05-02 Thread Vicente
I can't get ox-beamer to recognize the settings from the :align, while 
exporting a table to latex. In the tex file it shows as: \begin{tabular}{l}
Using Emacs 24.4.1 (Org mode 8.2.10) on Fedora 21
 my script follows, including headers
#+TITLE: export latex embedded table 
#+AUTHOR: VE
#+EMAIL: desdefu...@yahoo.com
#+OPTIONS: H:1 toc:nil
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation smaller]
#+BEAMER_THEME: Madrid
#+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) 
%8BEAMER_OPT(Opt)
* table test
#+ATTR_LATEX: :mode table :align |p{3cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}| 
#+LATEX: {\tiny
|-+---+---+---+---|
| 15    | 5   | 5   | 5   | 5   |
| | Nunca lo hizo | Lo hizo una vez o algunas veces | Lo ha 
hecho frecuentemente | NS/NR |
|-+---+---+---+---|
| a. ¿Ha trabajado en un proyecto comunitario? |   |   |   |   |
|-+---+---+---+---|
| b. ¿Ha participado en actividades de voluntariado? |   |   |   |  
 |
|-+---+---+---+---|
| c. ¿Ha llevado botellas, cajas, papel o material para reciclar a lugares 
designados? |   |   |   |   |
|-+---+---+---+---|
#+LATEX: }



Re: [O] ox-latex does not recognize :align setting

2015-05-02 Thread Nicolas Goaziou
Hello,

Vicente desdefu...@yahoo.com writes:

 #+ATTR_LATEX: :mode table :align |p{3cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|

This line has to appear just before the table.  Therefore, the line
below prevents the attributes from being associated to the table.

 #+LATEX: {\tiny

Note that there is a :font parameter:

  #+ATTR_LATEX: :font \footnotesize

 |-+---+---+---+---|
 | 15    | 5   | 5   | 5   | 5   |
 | | Nunca lo hizo | Lo hizo una vez o algunas veces | Lo ha 
 hecho frecuentemente | NS/NR |
 |-+---+---+---+---|
 | a. ¿Ha trabajado en un proyecto comunitario? |   |   |   |  
  |
 |-+---+---+---+---|
 | b. ¿Ha participado en actividades de voluntariado? |   |   |   
 |   |
 |-+---+---+---+---|
 | c. ¿Ha llevado botellas, cajas, papel o material para reciclar a lugares 
 designados? |   |   |   |   |
 |-+---+---+---+---|
 #+LATEX: }


Regards,

-- 
Nicolas Goaziou


Re: [O] ox-latex export code block results without \texttt

2015-05-01 Thread Joon Ro
I'm sorry, :results latex solved my problem. :)From: joon...@outlook.com
To: emacs-orgmode@gnu.org
Date: Fri, 1 May 2015 17:34:34 -0500
Subject: [O] ox-latex export code block results without \texttt




Hi,
When I export a org file with an inline code like Two plus two equals 
src_python{return(2+2)} to latex, it is exported as Two plus two equals 
\texttt{4}. Is there any way to suppress \texttt and have it exported as a 
common text? Usually I would want the verbatim font, but in this particular 
case I want to combine some texts with a result of a calculation automatically.
Best,Joon

  

[O] ox-latex export code block results without \texttt

2015-05-01 Thread Joon Ro
Hi,
When I export a org file with an inline code like Two plus two equals 
src_python{return(2+2)} to latex, it is exported as Two plus two equals 
\texttt{4}. Is there any way to suppress \texttt and have it exported as a 
common text? Usually I would want the verbatim font, but in this particular 
case I want to combine some texts with a result of a calculation automatically.
Best,Joon
  

Re: [O] ox-latex and small caps links

2015-04-22 Thread Rasmus
Hi,

David Dynerman da...@block-party.net writes:

 I've been using links to render text in small caps when exporting to
 LaTeX and HTML, e.g.

 [[latex:textsc][this is in small caps]]

 This worked fine in 8.2.10, but causes an error in latest. When I try to
 export the file to LaTeX, the export fails with:

 Unable to resolve link latex:textsc

Perhaps you did not add the latex link type.  You could also use a macro.

I use the following hack, which (tries to) captures words like ThIs, THIS,
or thIS and export is as \textsc{t}h\textsc{i}s, \textsc{this}, or
th\textsc{is}.  It won't manage e.g. (i).

For html you need to add support for a small-caps class.

  (defun rasmus/org-guess-textsc (content backend info)
Automatically downcase and wrap all-caps words in textsc.
The function is a bit slow...

TODO: Make the function work with headlines, but without doing it
on subsequent text.

TODO: Add ODT support.
(if (org-export-derived-backend-p backend 'latex 'html)
(let* (case-fold-search
   (latexp (org-export-derived-backend-p backend 'latex))
   (wrap (if latexp \\textsc{%s}
 span class=\small-caps\%s/span)))
  (replace-regexp-in-string
   \\w+
   (lambda (str)
 (if (or (string-equal str (downcase str))
 (string-equal str (capitalize str)))
 str
   (replace-regexp-in-string
[[:upper:]]+
(lambda (x) (format wrap (downcase x)))
str t t)))
   content t t))
  content))

  (add-to-list 'org-export-filter-plain-text-functions
   'rasmus/org-guess-textsc)

I have also found the slantsc latex package useful for emphases with small
caps.

Here's what I have used for small caps in css.

   body {
   font-family: Linux Libertine;
   -moz-font-feature-settings:onum 1, kern 1, liga 1;
   -moz-font-feature-settings:onum=1, kern=1, liga=1;
   -ms-font-feature-settings:onum 1, kern 1, liga 1;
   -o-font-feature-settings:onum 1, kern 1, liga 1;
   -webkit-font-feature-settings:onum 1, kern 1, liga 1;
   font-feature-settings:onum 1, kern 1, liga 1;}

   .small-caps {
   -ms-font-feature-settings: smcp;
   -moz-font-feature-settings: smcp;
   -webkit-font-feature-settings: smcp;
   font-feature-settings: smcp;
   letter-spacing:.02em;
   font-variant-caps: small-caps;
   text-transform: lowercase;}

Hope it helps,
Rasmus

-- 
I hear there's rumors on the, uh, Internets. . .




Re: [O] ox-latex and small caps links

2015-04-21 Thread Thomas S. Dye
Aloha David,

David Dynerman da...@block-party.net writes:

 This
 latex: trick in a link was the standard way to bracket text with any
 latex command, right?

The latex: link trick was invented for pre Org mode 8.  AFAIK, it
should still work, but I haven't been paying full attention.

However, in the meantime a syntax for inline latex code has been
developed:

,-
| Code within @@latex:some code@@ a paragraph.
`-

This new syntax might prove to be more robust in the long run.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] ox-latex and small caps links

2015-04-21 Thread David Dynerman
 ,-
 | Code within @@latex:some code@@ a paragraph.
 `-

This works great! Thanks Tom!

It might be nice to document this somehwere, to make the transition a
little easier when 8.3 rolls out and the old [[latex:textsc][Hello]]
links cause export errors.

I'd be happy to write something. Where would a good place be? The NEWS
file? The wiki?

David


signature.asc
Description: PGP signature


Re: [O] ox-latex and small caps links

2015-04-21 Thread Thomas S. Dye
Aloha David,

David Dynerman da...@block-party.net writes:

 ,-
 | Code within @@latex:some code@@ a paragraph.
 `-

 This works great! Thanks Tom!

Good news.

 It might be nice to document this somehwere, to make the transition a
 little easier when 8.3 rolls out and the old [[latex:textsc][Hello]]
 links cause export errors.

I just tested the latex link type and it seems to work fine here with a
recent Org mode from master.

I executed the source code block and then exported the following buffer
to LaTeX.

,--
| #+LATEX_CLASS: article   
| #+DATE: \today   
|  
| * Test link type 
| This is [[latex:textsc][small caps]].
|  
| * Link type:noexport:
| #+begin_src emacs-lisp   
| (org-add-link-type   
|  latex nil 
|  (lambda (path desc format)  
|(cond 
| ((eq format 'html)   
|  (format span class=\%s\%s/span path desc))  
| ((eq format 'latex)  
|  (format \\%s{%s} path desc)   
| #+end_src
`--

The LaTeX output looks fine:

,-
| \begin{document}
| 
| \tableofcontents
| 
| \section{Test link type}
| \label{sec-1}   
| This is \textsc{small caps}.
| \end{document}  
`-

Did your recent Org mode upgrade lose the latex link type somehow?

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



[O] ox-latex and small caps links

2015-04-21 Thread David Dynerman
Hi there,

I've been using links to render text in small caps when exporting to
LaTeX and HTML, e.g.

[[latex:textsc][this is in small caps]]

This worked fine in 8.2.10, but causes an error in latest. When I try to
export the file to LaTeX, the export fails with:

Unable to resolve link latex:textsc

Is this a bug? Is there a better way to render text in small caps? This
latex: trick in a link was the standard way to bracket text with any
latex command, right?

Thanks,
David


signature.asc
Description: PGP signature


Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-24 Thread Nicolas Goaziou
Rasmus ras...@gmx.us writes:

 AFAIK, we use float actively at one place, namely ;; Case 1.  No source
 fontification.  Of org-latex-src-block.  In that particular case I guess
 we could also use capt-of, actually.

It's worth trying. Do you want to provide a patch?

 At some point I wanted to get rid of float, until I became aware that
 capt-of doesn't ensure that floats/non-floats appear in the right
 order.

Since we wouldn't use floats anymore, this isn't a problem, is it?

Regards,



Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-24 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Rasmus ras...@gmx.us writes:

 AFAIK, we use float actively at one place, namely ;; Case 1.  No source
 fontification.  Of org-latex-src-block.  In that particular case I guess
 we could also use capt-of, actually.

 It's worth trying. Do you want to provide a patch?

Yeah, I started already, but so far only tables works, but I'm really busy
ATM with funding applications.

[BTW: For one I need to send a .doc.  I'm getting random crashes with
 ox-odt as well (as Eric), but I haven't been able to track it down...]

 At some point I wanted to get rid of float, until I became aware that
 capt-of doesn't ensure that floats/non-floats appear in the right
 order.

 Since we wouldn't use floats anymore, this isn't a problem, is it?

Well the problem is that you can get unorder.  E.g. the following where I
don't know if the syntax is valid.  Table 1 can be printed midway on the
page, and table 2 can be printed on top of the page, but table 2 would
actually be called Table 2.  I haven't tested this thoroughly though.

Text 

#+Attr_latex:  :float nil
| 1 | 

Text

#+Attr_latex:  :float t :options [t]
| 2  | 

—Rasmus

-- 
El Rey ha muerto. ¡Larga vida al Rey!



Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-19 Thread Nicolas Goaziou
Rasmus ras...@gmx.us writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 This is a feature. A caption implies, at least, a table environment.

 Except when it doesn't¹ ...

That's your problem since Org didn't request the minipage in the first
place. You don't want a caption but still provide one.

 And in this case I told Org that it doesn't by specifying :environment
 nil. :environment should be stronger than :caption.

This is really a matter of taste. I don't mind either way.

 There no explicit interface for \captonof, and reading the manual of
 capt-of, I don't want to, as the author says care should be taken in
 documents where floats are also used.

Again, this is the user's problem. But it could be reasonable to use
captionof when no environment is explicitly required. IOW ox-latex
could fall-back to caption of when a caption is specified and there's no
environment to hold it.


Regards,



Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-19 Thread Nicolas Goaziou
Hello,

Rasmus ras...@gmx.us writes:


 Consider this example:

 #+ATTR_LATEX: :environment nil :center nil :caption cap
 | t |

 Exporting to latex, it produces:

 \begin{table}[htb]
 cap
 \begin{tabular}{l}
 \toprule
 t\\
 \bottomrule
 \end{tabular}
 \end{table}

 I'd expect:

 cap
 \begin{tabular}{l}
 \toprule
 t\\
 \bottomrule
 \end{tabular}

This is a feature. A caption implies, at least, a table environment.

 The real usecase is that I want to use \captionof{table}{my caption}.

This feature existed before support for captionof. Of course, it is
now possible to make use of this macro and alter `org-latex--org-table'
accordingly.


Regards,

-- 
Nicolas Goaziou



Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-19 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 This is a feature. A caption implies, at least, a table environment.

Except when it doesn't¹ ...  And in this case I told Org that it doesn't by
specifying :environment nil.  :environment should be stronger
than :caption.

 The real usecase is that I want to use \captionof{table}{my caption}.

 This feature existed before support for captionof. Of course, it is
 now possible to make use of this macro and alter `org-latex--org-table'
 accordingly.

There no explicit interface for \captonof, and reading the manual of
capt-of, I don't want to, as the author says care should be taken in
documents where floats are also used.

—Rasmus


Footnotes: 
¹   I need to put the table inside an minipage, and they don't hold floats.

-- 
. . . The proofs are technical in nature and provides no real
understanding



Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-19 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Again, this is the user's problem. But it could be reasonable to use
 captionof when no environment is explicitly required.

Do you consider it explicit when no environment is specified?  I would
/only/ use capt-of when :environment is nil.

  IOW ox-latex could fall-back to caption of when a caption is
 specified and there's no environment to hold it.

That would be nice, I guess.  Then I could also use #+CAPTION which is
arguably nicer than #+attr_latex :caption.

—Rasmus

-- 
⠠⠵




Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-19 Thread Nicolas Goaziou
Rasmus ras...@gmx.us writes:

 Do you consider it explicit when no environment is specified?  I would
 /only/ use capt-of when :environment is nil.

I think you are confusing :environment and :float. :environment cannot
be nil.

  ‘:environment’
   Environment used for the table.  It can be set to any LaTeX table
   environment, like ‘tabularx’(1), ‘longtable’, ‘array’, ‘tabu’(2),
   ‘bmatrix’...  It defaults to ‘org-latex-default-table-environment’
   value.


  ‘:placement’
   The ‘:float’ specifies the float environment for the table.
   Possible values are ‘sideways’(3), ‘multicolumn’, ‘t’ and ‘nil’.
   When unspecified, a table with a caption will have a ‘table’
   environment.  Moreover, the ‘:placement’ attribute can specify the
   positioning of the float.  Note: ‘:placement’ is ignored for
   ‘:float sideways’ tables.

We could use captof with a caption and :float nil.

 That would be nice, I guess.  Then I could also use #+CAPTION which is
 arguably nicer than #+attr_latex :caption.

Indeed.

Regards,



Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-19 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Do you consider it explicit when no environment is specified?  I would
 /only/ use capt-of when :environment is nil.

 I think you are confusing :environment and :float. :environment cannot
 be nil.

I think you are right.

 We could use captof with a caption and :float nil.

Yeah, that makes perfect sense.

—Rasmus

-- 
Need more coffee. . .



[O] [ox-latex, bug?] :caption forces environment

2015-02-19 Thread Rasmus
Hi,

Consider this example:

#+ATTR_LATEX: :environment nil :center nil :caption cap
| t |

Exporting to latex, it produces:

\begin{table}[htb]
cap
\begin{tabular}{l}
\toprule
t\\
\bottomrule
\end{tabular}
\end{table}

I'd expect:

cap
\begin{tabular}{l}
\toprule
t\\
\bottomrule
\end{tabular}

The real usecase is that I want to use \captionof{table}{my caption}.

I can try to fix it myself later if that's better.

—Rasmus

-- 
. . . The proofs are technical in nature and provides no real understanding





Re: [O] [ox-latex, bug?] :caption forces environment

2015-02-19 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 We could use captof with a caption and :float nil.

You would also be able to do this with the awful float-package using the
H :placement, though I guess it's still a float (so I don't know if it
would work in e.g. minipage). 

AFAIK, we use float actively at one place, namely ;; Case 1.  No source
fontification.  Of org-latex-src-block.  In that particular case I guess
we could also use capt-of, actually.

At some point I wanted to get rid of float, until I became aware that
capt-of doesn't ensure that floats/non-floats appear in the right order.

-- 
Summon the Mothership!



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-24 Thread Eric S Fraga
On Thursday, 23 Oct 2014 at 23:08, Nicolas Goaziou wrote:
 Hello,

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 I don't actually understand you.

 `org-latex-table-caption-above' is now an alias for
 `org-latex-caption-above', so the default values ought to be the same.

Ah, I see.

 IIUC, the old behaviour wasn't consistent (some captions above, some
 below). This is the original motivation for this change.

The old behaviour was not consistent in the sense of captions for
different objects being placed differently but the behaviour was
consistent with what is recognised as best practice in typesetting:
captions below figures and captions above tables.  However, I agree with
the desire for complete control.

 I would be happy to make the transition smoother. However, I don't know
 how to achieve complete backward compatibility, considering the remark
 above.

Okay.  No worries!

thanks,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-475-g25d50e



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-24 Thread Nicolas Goaziou
Eric S Fraga e.fr...@ucl.ac.uk writes:

 The old behaviour was not consistent in the sense of captions for
 different objects being placed differently but the behaviour was
 consistent with what is recognised as best practice in typesetting:
 captions below figures and captions above tables.  However, I agree with
 the desire for complete control.

If this is really considered as best practice (would you have
a reference about it?), we really should consider making it the default.
Reading the thread, it seemed to me that it wasn't as universal.

However, `org-latex-table-caption-above' would then be dropped
altogether. I don't mind either.


Regards,



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-24 Thread Rasmus
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 The old behaviour was not consistent in the sense of captions for
 different objects being placed differently but the behaviour was
 consistent with what is recognised as best practice in typesetting:
 captions below figures and captions above tables.  However, I agree with
 the desire for complete control.

 If this is really considered as best practice (would you have
 a reference about it?), we really should consider making it the default.
 Reading the thread, it seemed to me that it wasn't as universal.

It's discussed here with some references:

https://tex.stackexchange.com/questions/3243/why-should-a-table-caption-be-placed-above-the-table

I took a quick looks as some different journals for which I have
articles with both tables and figures on my computer.  7 had the
configuration table captions above and figure caption below.  One had
both captions above.  One had mixed figure captions (some years above
some years below).  So for sure table captions should be above.
Probably figure captions should be below.  It makes sense.

—Rasmus
 
-- 
I almost cut my hair, it happened just the other day




Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-24 Thread Eric S Fraga
On Friday, 24 Oct 2014 at 11:28, Nicolas Goaziou wrote:
 Eric S Fraga e.fr...@ucl.ac.uk writes:

 The old behaviour was not consistent in the sense of captions for
 different objects being placed differently but the behaviour was
 consistent with what is recognised as best practice in typesetting:
 captions below figures and captions above tables.  However, I agree with
 the desire for complete control.

 If this is really considered as best practice (would you have
 a reference about it?), we really should consider making it the default.
 Reading the thread, it seemed to me that it wasn't as universal.

Not sure whether any reference will be definitive as there will always
be those that argue when it comes to style.  However, a web search for
typesetting captions for tables and figures gives quite a few results,
the first of which is interesting:

https://www.e-education.psu.edu/styleforstudents/c4_p12.html

which is headed Captions for figures and tables.  I quote:

 The caption for a figure appears below the graphic; for a table,
 above.

The fact that LaTeX encourages the above is also a good sign.

However, I should add that I could be somewhat anglo-centric in this: I
really have no idea what technical writing in other languages might look
like.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-475-g25d50e



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-24 Thread Nicolas Goaziou
Eric S Fraga e.fr...@ucl.ac.uk writes:

 Not sure whether any reference will be definitive as there will always
 be those that argue when it comes to style.  However, a web search for
 typesetting captions for tables and figures gives quite a few results,
 the first of which is interesting:

 https://www.e-education.psu.edu/styleforstudents/c4_p12.html

 which is headed Captions for figures and tables.  I quote:

  The caption for a figure appears below the graphic; for a table,
  above.

 The fact that LaTeX encourages the above is also a good sign.

 However, I should add that I could be somewhat anglo-centric in this: I
 really have no idea what technical writing in other languages might look
 like.

Thanks for the feedback. Default value is now '(table).


Regards,



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-23 Thread Nicolas Goaziou
Hello,

Eric S Fraga e.fr...@ucl.ac.uk writes:

 I don't actually understand you.

`org-latex-table-caption-above' is now an alias for
`org-latex-caption-above', so the default values ought to be the same.

 All I know is that I had nothing set explicitly anywhere to do with
 captions and, all of a sudden, the behaviour has changed. This seems
 wrong. If I understand things correctly, a new variable has been
 introduced to control behaviour that previously was implicit. By
 introducing this variable, the default (previously implicit but now
 explicit) behaviour has changed.

IIUC, the old behaviour wasn't consistent (some captions above, some
below). This is the original motivation for this change.

I would be happy to make the transition smoother. However, I don't know
how to achieve complete backward compatibility, considering the remark
above.


Regards,

-- 
Nicolas Goaziou



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-22 Thread Eric S Fraga
On Tuesday, 21 Oct 2014 at 18:47, Nicolas Goaziou wrote:
 Hello,

 Eric S Fraga e.fr...@ucl.ac.uk writes:

 However, I think it would make sense to make '(table) (at least) the
 default for captions above to have some form of backward compatibility?
 The change caught me by surprise...

 If we change `org-latex-caption-above', then it will no longer match
 `org-latex-table-caption-above', which will introduce another class of
 backward compatibility problems.

Hi Nicolas,

I don't actually understand you.  All I know is that I had nothing set
explicitly anywhere to do with captions and, all of a sudden, the
behaviour has changed.  This seems wrong.  If I understand things
correctly, a new variable has been introduced to control behaviour that
previously was implicit.  By introducing this variable, the default
(previously implicit but now explicit) behaviour has changed.  

But it's a not a big deal (to me) as I have now set the variable and I'm
back to where I was.  So I'm happy to have things as they are now if
that's deemed to be better overall.

Thanks,
eric
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-475-g25d50e



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-21 Thread Eric S Fraga
On Friday, 17 Oct 2014 at 22:08, Nicolas Goaziou wrote:
 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 If we want to preserve backward-compatibility, t, nil and a list of
 types (e.g. '(table src-block)) should suffice. No need for an alist.

 Still on my ToDo list but I'm not there yet. Feel free to beat me to it
 if you want.

 Done. Feedback welcome.

Nicolas,

the changes seem to work just fine.  Thanks.

However, I think it would make sense to make '(table) (at least) the
default for captions above to have some form of backward compatibility?
The change caught me by surprise...

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-472-gc27d86



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-21 Thread Nicolas Goaziou
Hello,

Eric S Fraga e.fr...@ucl.ac.uk writes:

 However, I think it would make sense to make '(table) (at least) the
 default for captions above to have some form of backward compatibility?
 The change caught me by surprise...

If we change `org-latex-caption-above', then it will no longer match
`org-latex-table-caption-above', which will introduce another class of
backward compatibility problems.


Regards,

-- 
Nicolas Goaziou



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-17 Thread Nicolas Goaziou
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 If we want to preserve backward-compatibility, t, nil and a list of
 types (e.g. '(table src-block)) should suffice. No need for an alist.

 Still on my ToDo list but I'm not there yet. Feel free to beat me to it
 if you want.

Done. Feedback welcome.



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-13 Thread Nicolas Goaziou
Hello,

Aaron Ecay aarone...@gmail.com writes:

 There’s at least some notion in the Latex community that captions atop
 tables but below figures is sensible style:
 https://tex.stackexchange.com/questions/3243/why-should-a-table-caption-be-placed-above-the-table.

 In that light, does it make sense to instead implement this setting as an 
 alist
 with separate settings for tables, images, src blocks, etc.?  (Of
 course, there could be separate variables
 org-latex-{table,figure,src-block}-caption-above, but a single alist
 seems simpler)

If we want to preserve backward-compatibility, t, nil and a list of
types (e.g. '(table src-block)) should suffice. No need for an alist.

Still on my ToDo list but I'm not there yet. Feel free to beat me to it
if you want.


Regards,

-- 
Nicolas Goaziou



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-12 Thread Aaron Ecay
Hi Nicolas,

2014ko urriak 5an, Nicolas Goaziou-ek idatzi zuen:
 
 Hello,
 
 James Harkins jamshar...@qq.com writes:
 
 Something like that would do it, I think. I hesitate about breaking
 backward compatibility, but at the same time, I'm hard-pressed to
 imagine why one would want captions to be differently placed in the
 same document.
 
 This wouldn't break compatibility. We would just mark
 `org-latex-table-caption-above' as an obsolete alias for
 `org-latex-caption-above'.
 
 I suppose, if somebody needs to move a caption to the top or bottom
 overriding the default, it could be an attribute, hypothetically:
 
 #+name: blah
 #+caption: blah blah
 #+attr_latex: :captionpos t
 #+begin_figure
 ...
 #+end_figure
 
 t would put it at the top, :captionpos b at the bottom and
 :captionpos nil (or not specified) would use the default from the
 configuration variable.
 
 Reasonable?
 
 I don't think we need to go that far at the moment. Implementing
 `org-latex-caption-above' is a reasonable start.
 
 I add it to my ToDo list.

There’s at least some notion in the Latex community that captions atop
tables but below figures is sensible style:
https://tex.stackexchange.com/questions/3243/why-should-a-table-caption-be-placed-above-the-table.

In that light, does it make sense to instead implement this setting as an alist
with separate settings for tables, images, src blocks, etc.?  (Of
course, there could be separate variables
org-latex-{table,figure,src-block}-caption-above, but a single alist
seems simpler)

Thanks,

-- 
Aaron Ecay



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-05 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@qq.com writes:

 Something like that would do it, I think. I hesitate about breaking
 backward compatibility, but at the same time, I'm hard-pressed to
 imagine why one would want captions to be differently placed in the
 same document.

This wouldn't break compatibility. We would just mark
`org-latex-table-caption-above' as an obsolete alias for
`org-latex-caption-above'.

 I suppose, if somebody needs to move a caption to the top or bottom
 overriding the default, it could be an attribute, hypothetically:

 #+name: blah
 #+caption: blah blah
 #+attr_latex: :captionpos t
 #+begin_figure
 ...
 #+end_figure

 t would put it at the top, :captionpos b at the bottom and
 :captionpos nil (or not specified) would use the default from the
 configuration variable.

 Reasonable?

I don't think we need to go that far at the moment. Implementing
`org-latex-caption-above' is a reasonable start.

I add it to my ToDo list.


Regards,

-- 
Nicolas Goaziou



Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-03 Thread James Harkins
On Thu, 02 Oct 2014 18:54:20 +0200
Nicolas Goaziou m...@nicolasgoaziou.fr wrote:

 You mean moving `org-latex-table-caption-above' to
 `org-latex-caption-above' and making sure every block complies to the
 variable?

Sorry for the late reply. I wasn't feeling quite well yesterday.

Something like that would do it, I think. I hesitate about breaking
backward compatibility, but at the same time, I'm hard-pressed to
imagine why one would want captions to be differently placed in the
same document.

I suppose, if somebody needs to move a caption to the top or bottom
overriding the default, it could be an attribute, hypothetically:

#+name: blah
#+caption: blah blah
#+attr_latex: :captionpos t
#+begin_figure
...
#+end_figure

t would put it at the top, :captionpos b at the bottom and
:captionpos nil (or not specified) would use the default from the
configuration variable.

Reasonable?
hjh




[O] [ox-latex] How to force ALL captions below their referents?

2014-10-02 Thread James Harkins
I'm struggling a bit with caption placement in LaTeX export.

In the document I'm working on now, I have:

- Image links, exported as floating figures (by inclusion of a
  caption). ox-latex places the caption at the end of the figure
  environment, so the caption appears below the image.

#+name: fig1
#+caption: blah blah
#+attr_latex: :width 0.75\textwidth
[[./img/blahblah.png]]

\begin{figure}[htb]
\centering
\includegraphics[width=0.75\textwidth]{./img/blahblah.png}
\caption{\label{fig1}blah blah}
\end{figure}

- A figure block containing some figures. The entire block should be
  captioned. ox-latex places a caption first in the figure environment,
  so the caption is on top.

#+name: product1
#+caption: blah blah
#+begin_figure
#+begin_latex
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{./img/blah1.png}
\end{subfigure} \hfill \begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{./img/blah2.png}
\end{subfigure}
#+end_latex
#+end_figure

\begin{figure}
\caption{\label{product1}blah blah}
\begin{subfigure}.. (omitted)
\end{figure}

I don't like the typographical inconsistency. It would be much better,
I think, if I could specify in one place that I want *all* captions
below or above the entity being captioned.

It seems somebody recognized a while ago that this was a problem, and
introduced org-latex-table-caption-above. But this applies only to
tables, not to figure special blocks, nor to source code blocks, and
probably some other cases that I can't think of. Well,  I can customize
org-latex-listings-options to include (captionpos b), but I think
this is not quite ideal because:

a/ image captions always go at the bottom;
b/ table captions can be configured;
c/ listings captions can be configured in a different variable;
d/ many types of captions always go at the top, conflicting with a/.

Is there a plan to deal with this, other than my hacking ox-latex
locally?

hjh






Re: [O] [ox-latex] How to force ALL captions below their referents?

2014-10-02 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@qq.com writes:

 It seems somebody recognized a while ago that this was a problem, and
 introduced org-latex-table-caption-above. But this applies only to
 tables, not to figure special blocks, nor to source code blocks, and
 probably some other cases that I can't think of. Well,  I can customize
 org-latex-listings-options to include (captionpos b), but I think
 this is not quite ideal because:

 a/ image captions always go at the bottom;
 b/ table captions can be configured;
 c/ listings captions can be configured in a different variable;
 d/ many types of captions always go at the top, conflicting with a/.

 Is there a plan to deal with this, other than my hacking ox-latex
 locally?

You mean moving `org-latex-table-caption-above' to
`org-latex-caption-above' and making sure every block complies to the
variable?


Regards,

-- 
Nicolas Goaziou



[O] ox-latex and synctex

2014-02-24 Thread Ken Mankoff


I'm writing about a recent thread combining syntex with ox-latex. 
Four posts on this are here: 
https://lists.gnu.org/archive/html/emacs-orgmode/2013-10/msg00905.html 
including an ox-synctex.el that implements PDF - Org syncing.


I have bi-directional synctex working with LaTeX source, and would 
like to get one direction PDF - Org Source links working with Org 
mode if possible as the above claims. Right now if I click on the 
PDF the LaTeX exported version opens to the correct line, not the 
Org source.


I'm using the latest version of Org (from ELPA, OS X) and I'm 
wondering if anyone else has this setup working?


I'm using this test code:

#+BEGIN_SRC emacs-lisp
(load ~/.emacs.d/ox-synctex.el)
(setq org-latex-pdf-process
  '(pdflatex -synctex=1 -interaction nonstopmode -output-directory %o %f))
(ox-synctex-activate)
(org-latex-export-to-pdf)
#+END_SRC

And after exporting my *Messages* buffer contains:

ox-synctex: patching org-export-as return
ox-synctex: active during latex compile
ox-synctex: no concordance, not patching.
ox-synctex: done, hoorah!

However, when I look at the synctex.gz and compare it with that same 
file produced from compiling the LaTeX source directly in emacs the 
two are identical, which is why my pdf viewer/synctex is sending me 
to the .tex exported file and not the original .org source file.


  -k.



[O] ox-latex: need win-cygwin path translation

2014-02-21 Thread mirko
Hi,

This is on Windows 7 and Cygwin64 with TeXLive

When exporting to latex and pdf, the compilation fails because the path
passed to pdflatex is the Windows one.

I installed and activated cygwin-mount and setup-cygwin packages, but that
did not help.

Before I dig in (I did find the pdf export code in ox-latex), I am wondering
if there is something else I can do.  If I activate some path translator, is
there some hook I can attach it to so that the ox-latex exporter will see it?

Thanks,

Mirko




[O] ox-latex: Is \uline really right for underlining?

2013-12-11 Thread James Harkins

org-latex-text-markup-alist is a variable defined in `ox-latex.el'.
Its value is ((bold . \\textbf{%s})
(code . verb)
(italic . \\emph{%s})
(strike-through . \\sout{%s})
(underline . \\uline{%s})
(verbatim . protectedtexttt))

underline . \\uline{%s} -- According to [1],

~~
\uline 
   Underlines text. Requires ulem package. See Formatting.

~~

Is ulem one of the LaTeX export default packages? I don't see that it is. 
If not, should org's default underlining command depend on a package that 
is not activated by default?


(There is no reference to -markup- anything in my .emacs, so I'm quite sure 
I haven't customized this variable.)


hjh

[1] http://en.wikibooks.org/wiki/LaTeX/Command_Glossary#U



Re: [O] ox-latex: Is \uline really right for underlining?

2013-12-11 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@gmail.com writes:

 Is ulem one of the LaTeX export default packages?

Yes, it is. See `org-latex-default-packages-alist'.


Regards,

-- 
Nicolas Goaziou



Re: [O] ox-latex: Is \uline really right for underlining?

2013-12-11 Thread James Harkins

On Wednesday, December 11, 2013 10:47:42 PM HKT, Nicolas Goaziou wrote:

Is ulem one of the LaTeX export default packages?


Yes, it is. See `org-latex-default-packages-alist'.


Ah... I must have customized that at some point.

Drifting off the topic slightly, to a related question. I have a feeling 
that something is a bit off in my installation. If I do M-x customize-group 
ret org-export ret, I have two links to Org Export LaTeX:


Org Export LaTeX : Options for exporting Org-mode files to LaTeX.

Org Export LaTeX : Options for exporting Org-mode files to PDF, via LaTeX.

I think this is the source of some of my confusion about these export 
options.


Which one is current? Then I can figure out where the other one is coming 
from and make sure it doesn't get loaded.


Thanks,
hjh



Re: [O] ox-latex: Is \uline really right for underlining?

2013-12-11 Thread James Harkins
On Thu, Dec 12, 2013 at 10:40 AM, James Harkins
jamshar...@dewdrop-world.net wrote:
 On Wednesday, December 11, 2013 10:47:42 PM HKT, Nicolas Goaziou wrote:

 Is ulem one of the LaTeX export default packages?

 Yes, it is. See `org-latex-default-packages-alist'.

 Ah... I must have customized that at some point.

And... I just found why I had customized it. It was because of
hyperref's (idiotic) default behavior of drawing red boxes around
links.

I'm not sure how ulem didn't make it into my customized setting.
Maybe ulem was added to the default packages list after I made the
customization.

What's the best way to handle that? I really want the hidelinks
option for hyperref to be used globally. But, customizing
org-latex-default-packages-alist means that I will miss updates to
that variable in future org versions.

Should I leave org-latex-default-packages-alist alone, and add my own
entry for hyperref into org-latex-packages-alist? (Would there be any
ill effect from having two \usepackage{hyperref} lines in the
preamble, with different options?)

hjh



Re: [O] ox-latex: Is \uline really right for underlining?

2013-12-11 Thread Aaron Ecay
Hi James,

2013ko abenudak 12an, James Harkins-ek idatzi zuen:

 What's the best way to handle that? I really want the hidelinks
 option for hyperref to be used globally. But, customizing
 org-latex-default-packages-alist means that I will miss updates to
 that variable in future org versions.

 Should I leave org-latex-default-packages-alist alone, and add my own
 entry for hyperref into org-latex-packages-alist? (Would there be any
 ill effect from having two \usepackage{hyperref} lines in the
 preamble, with different options?)

I don’t know for certain if having two \usepackages would have bad
effects, but my vague feeling is that you will be fussed at by the
LaTeX compiler and/or the options specified in the two instances will
not compose in the desired way.

You probably want the \hypersetup command (q.v. in the hyperref manual).
You can add it to the ‘org-latex-classes’.  You probably want something
like the following, slightly modified from the default:

((article
  \\documentclass[11pt]{article}
\[DEFAULT-PACKAGES]
\[PACKAGES]
\hypersetup{hidelinks=true} % --- the important bit
\[EXTRA]
(\\section{%s} . \\section*{%s})
  (\\subsection{%s} . \\subsection*{%s})
  (\\subsubsection{%s} . \\subsubsection*{%s})
  (\\paragraph{%s} . \\paragraph*{%s})
  (\\subparagraph{%s} . \\subparagraph*{%s})))

HTH,

--
Aaron Ecay



Re: [O] [ox-latex] Bad default value for image width?

2013-04-11 Thread Bastien
Hi,

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

 Rasmus ras...@gmx.us writes:

 Perhaps.  I'm not convinced.

 Since I didn't introduce this feature in new exporter (it was already in
 the previous one), it may be interesting to know the motivation of the
 person who originally introduced it. I think it was Bastien (Cc'ed).

The same than the one you expressed: make sure images fit the page.
I don't there was a way to set the width attribute per image at the
time.

 For people who use it it might also be reasonable to introduce
 a org-latex-wrap-image-default-width or making
 org-latex-image-default-width a list ordered by type of element/float
 type.

 E.g. '((float . .9\\textwidth) (wrap . .5\\textwidth)). . . 

 I'm not sure we need to go that far.

Not sure either, a bit too much for sure.

-- 
 Bastien



Re: [O] [ox-latex] Bad default value for image width?

2013-04-10 Thread Rasmus
Nicolas,

 I don't like that tikz figures are wrapped in a resize box.  

 Set `org-latex-image-default-width' to .

But as my second email shows this still doesn't work with
captions. . .

This exmample:

#+BEGIN_SRC org
#+BEGIN_SRC emacs-lisp
(make-local-variable 'org-latex-image-default-width)
(setq org-latex-image-default-width )
#+END_SRC

#+NAME:firm-ts-fig
#+CAPTION: test
[[file:figs/test.tikz]]

no caption
[[file:figs/test.tikz]]
#+END_SRC

 That's not correct. It is always true because (:width ) means width
 becomes \\, not . IOW, `org-export-read-attribute' is unable to
 parse a real empty string.

I see. 

 This wouldn't help to solve the general problem. Though, you can change
 it in your config to something else, as suggested above.

I have.  But I don't think it's a sensible default.  It's against what
your usual stand of Org not trying to be too clever.  You would also
not put tables in resize boxes to make them fit on the page.


Here's another example where the default causes a non-sensible
behavior.

#+BEGIN_SRC org
#+BEGIN_SRC emacs-lisp :exports none
(url-copy-file http://orgmode.org/img/org-mode-unicorn-logo.png; logo.png)
#+END_SRC

* My raster picture

This is a low res. picture with the right size^{TM}

[[file:logo.png]]
#+END_SRC


   2. allow for a non-width (:width nil)
   3. make a better test for the resize box.

 Let me know and I might be able to look into it.



 I think the correct solution would be to fix `org-export-read-attribute'
 so it can read empty strings.

I think this is the solution to a general problem.  But I still find
the default width to be wrong.  It only works as intended when I have
a slightly too large picture.  And then, if anything, I'd want full
page width.  

It's a bad default for
  - Picture smaller than textwidth
  - Picture crafted to the document which shouldn't have a width.

It's a decent solution for 
  - pictures which are unintentionally larger than textwidth.  But IMO
it's my responsibility, and not Org's, to fix these
images/situations.


In usually exhibit good judgment of these matters, so I'll take your
word for it.  But I fail to see its usefulness as a default.

 If  is really read as ,  will still be read as , and
 it will not be possible to obtain \\.

Fine with me. 

 Another possibility is to read the empty string as the empty string
 instead of nil, that is

   #+attr_latex: :prop1 :prop2 1

I like the  better.  It works better with my intuitive logic.


–Rasmus


-- 
Hvor meget poesi tror De kommer ud af et glas isvand?




Re: [O] [ox-latex] Bad default value for image width?

2013-04-10 Thread Nicolas Goaziou
Hello,

Rasmus ras...@gmx.us writes:

 Set `org-latex-image-default-width' to .

 But as my second email shows this still doesn't work with
 captions. . .

 This exmample:

 #+BEGIN_SRC org
 #+BEGIN_SRC emacs-lisp
 (make-local-variable 'org-latex-image-default-width)
 (setq org-latex-image-default-width )
 #+END_SRC

 #+NAME:firm-ts-fig
 #+CAPTION: test
 [[file:figs/test.tikz]]

 no caption
 [[file:figs/test.tikz]]
 #+END_SRC

The problem is different here. More on this below.

 This wouldn't help to solve the general problem. Though, you can change
 it in your config to something else, as suggested above.

 I have.  But I don't think it's a sensible default.  It's against what
 your usual stand of Org not trying to be too clever.  You would also
 not put tables in resize boxes to make them fit on the page.

This is different. You always build tables from LaTeX so they are, in
a way, normalized. On the other hand, images can be imported from
various sources, with different sizes and resolutions.

 I think this is the solution to a general problem.  But I still find
 the default width to be wrong.  It only works as intended when I have
 a slightly too large picture.  And then, if anything, I'd want full
 page width.  

 It's a bad default for
   - Picture smaller than textwidth
   - Picture crafted to the document which shouldn't have a width.

 It's a decent solution for 
   - pictures which are unintentionally larger than textwidth.  But IMO
 it's my responsibility, and not Org's, to fix these
 images/situations.

Exactly.

I'm not selling you the default value as the perfect solution: it isn't,
obviously. I even agree that in most situations, no default value is
better.

However, in my experience, the worst situation is the image (much)
larger than textwidth, which makes it difficult to even read the
produced document. It isn't as bad for enlarged small pictures.

So, the current default is good to control the worst case. And since
there is no decent solution in all situations, it makes sense here.
I think the same applies to default wrap width (.48\textwidth), which
ensures that the display will be coherent.

Now, the .7\textwidth for floats is harder to explain. I don't feel
very strong about it, and I don't mind removing it (meaning
`org-latex-image-default-width' would also apply
 to floats).

 If  is really read as ,  will still be read as , and
 it will not be possible to obtain \\.

 Fine with me. 

 Another possibility is to read the empty string as the empty string
 instead of nil, that is

   #+attr_latex: :prop1 :prop2 1

 I like the  better.  It works better with my intuitive logic.

I have pushed a patch which should fix your initial problem about :width
 not being taken into account.  Could you confirm the new behaviour
works as expected?


Regards,

-- 
Nicolas Goaziou



  1   2   >