emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] issues with publishing to LaTeX using #INCLUDE


From: Robert Klein
Subject: Re: [O] issues with publishing to LaTeX using #INCLUDE
Date: Thu, 18 Jun 2015 08:58:13 +0200

Update: it happens only with org-mode master, not with maint.

When I delete the elisp (and its call) at the beginning of the
#INCLUDEd file everything works Ok.

In the failing export already the exported \documentclass is wrong; it
says `article' instead of `scrartcl' I use.

It seems the following code in the #INCLUDEd file causes this:

--- snip ---
#+name: docinfo
#+begin_src elisp :exports none
  (let ((props (org-export-get-environment)))
    (concat  "#+LaTeX_HEADER: \\newcommand{\\myTitle}{"
             (org-element-interpret-data
              (plist-get props :title))
             "}\n"
             "#+LaTeX_HEADER: \\newcommand{\\myAuthor}{"
             (org-element-interpret-data
              (plist-get props :author))
             "}\n"
             "#+LaTeX_HEADER: \\newcommand{\\myDate}{"
             (org-element-interpret-data
              (plist-get props :date))
             "}\n"
             "#+LaTeX_HEADER: \\newcommand{\\myCreator}{"
             (org-element-interpret-data
              (plist-get props :creator))
             "}\n"
             "#+LaTeX_HEADER: \\newcommand{\\myKeywords}{"
             (org-element-interpret-data
              (plist-get props :keywords))
             "}\n"
             "#+LaTeX_HEADER: \\newcommand{\\mySubject}{"
             (org-element-interpret-data
              (plist-get props :description))
             "}\n"))
#+end_src

#+CALL: docinfo() :exports results :results raw
--- snip ---


Any ideas?


Thanks a lot

Best regards
Robert



On Wed, 17 Jun 2015 20:04:43 +0200 (CEST)
Robert Klein <address@hidden> wrote:

> Hi,
> 
> when publishing a project (to LaTeX) where each file has a #INCLUDE:
> of the same file, some files get mixed up on export to LaTeX, but
> _only_ the stuff from the #INCLUDE gets mixed up.
> 
> Below is an excerpt of a correct export, one of a mixed up export and
> the corresponding part from the #INCLUDEd file.
> 
> Currently I don't have the slightest idea what to do about this.
> 
> Any advice is highly appreciated.
> 
> Thank you very much for your help.
> 
> Best regards
> Robert
> 
> 
> A correct export looks like:
> 
> #+begin_src latex
>   \newcommand{\mySubtitle}{}
>   \newcommand{\myProducer}{org-mode / pdflatex}
>   \newcommand{\myTitle}{Common Software}
>   \newcommand{\myAuthor}{Robert Klein}
>   \newcommand{\myDate}{}
>   \newcommand{\myCreator}{Emacs 24.5.1 (Org mode 8.3beta)}
>   \newcommand{\myKeywords}{}
>   \newcommand{\mySubject}{}
>   \usepackage{scrhack}
>   % standard font is Linux Libertine, but may want to have different
>   % tt font.  Scale is for 10pt, probably also Ok for others.
>   %\usepackage[ttscale=.875]{libertine} % scale by roklein
>   \usepackage[osf]{libertine}             % standardfont Linux
> Libertine \usepackage[libertine]{newtxmath}
>   \renewcommand*\oldstylenums[1]{{\fontfamily{fxlj}\selectfont #1}}
>   \usepackage[scaled=0.9,zerostyle=c]{newtxtt} % TX typewriter, scale
> ok by roklein % have to load ams packages before symbol packages, so
> some things aren't % already defined. (amsmath doesn't cope)
>   \usepackage{amstext}               % text in a math display
>   \usepackage[rgb,svgnames,table]{xcolor} % enable color, also for
> tables \usepackage[most]{tcolorbox}
>   \usepackage{overpic}               % put LaTeX or grid over graphics
>   \usepackage{colortbl}              % colored tables
>   \usepackage{tabu}                  % enhanced tables using above
> packages \usepackage{booktabs}              % beautiful table
> formatting \usepackage{tikz}
>   \usetikzlibrary{matrix,arrows,decorations.pathmorphing}
>   \usepackage{paralist}
>   \usepackage{xfrac}                 % nice fractions $\sfrac{1}{2}$
>   \usepackage{calc}                  % infix notation arithmetic
>   \usepackage{ifthen}                % if...then for LaTeX
>   \usepackage{alltt}                 % like verbatim but \, {, and }
> work \usepackage[a4paper]{geometry}
>   \usepackage{relsize}               % relative font sizing
> ("\smaller") \lstset{
>   basicstyle=\ttfamily,
>   frame=single,
>   % frame=leftline,
>   backgroundcolor=\color{Gainsboro},
>   % spacing normal, wie in verbatim:
>   columns=fullflexible,
>   keepspaces=true,
>   % Umlaute
>   inputencoding=utf8,
>   extendedchars=true,
>   literate={Ä}{{\"A}}1 {ä}{{\"a}}1 {Ö}{{\"O}}1 {ö}{{\"o}}1
> {Ü}{{\"U}}1 {ü}{{\"u}}1 {ß}{{\ss}}1, }
>   ...
> #+end_src
> 
> For some other files, however the export looks like:
> 
> #+begin_src latex
>   \newcommand{\mySubtitle}{}
>   \newcommand{\myProducer}{org-mode / pdflatex}
>   \newcommand{\myTitle}{Mathematical Software}
>   \newcommand{\myAuthor}{Robert Klein}
>   \newcommand{\myDate}{}
>   \newcommand{\myCreator}{Emacs 24.5.1 (Org mode 8.3beta)}
>   \usepackage{scrhack}
>   % standard font is Linux Libertine, but may want to have different
>   % tt font.  Scale is for 10pt, probably also Ok for others.
>   % tt font.  Scale is for 10pt, probably also Ok for others.
>   %\usepackage[ttscale=.875]{libertine} % scale by roklein
>   \usepackage[osf]{libertine}             % standardfont Linux
> Libertine \usepackage[libertine]{newtxmath}
>   \renewcommand*\oldstylenums[1]{{\fontfamily{fxlj}\selectfont #1}}
>   \usepackage[scaled=0.9,zerostyle=c]{newtxtt} % TX typewriter, scale
> ok by roklein % already defined. (amsmath doesn't cope)
>   % already defined. (amsmath doesn't cope)
>   \usepackage{amstext}               % text in a math display
>   \usepackage[rgb,svgnames,table]{xcolor} % enable color, also for
> tables \usepackage[rgb,svgnames,table]{xcolor} % enable color, also
> for tables \usepackage[most]{tcolorbox}
>   \usepackage[most]{tcolorbox}
>   \usepackage{overpic}               % put LaTeX or grid over graphics
>   \usepackage{colortbl}              % colored tables
>   \usepackage{tabu}                  % enhanced tables using above
> packages \usepackage{tabu}                  % enhanced tables using
> above packages \usepackage{booktabs}              % beautiful table
> formatting \usetikzlibrary{matrix,arrows,decorations.pathmorphing}
>   \usetikzlibrary{matrix,arrows,decorations.pathmorphing}
>   \usepackage{paralist}
>   \usepackage{xfrac}                 % nice fractions $\sfrac{1}{2}$
>   \usepackage{xfrac}                 % nice fractions $\sfrac{1}{2}$
>   \usepackage{calc}                  % infix notation arithmetic
>   \usepackage{ifthen}                % if...then for LaTeX
>   \usepackage{ifthen}                % if...then for LaTeX
>   \usepackage{alltt}                 % like verbatim but \, {, and }
> work \usepackage{alltt}                 % like verbatim but \, {,
> and } work \usepackage[a4paper]{geometry}
>   \usepackage{relsize}               % relative font sizing
> ("\smaller") \usepackage{relsize}               % relative font
> sizing ("\smaller") \lstset{
>   frame=single,
>   % frame=leftline,
>   % frame=leftline,
>   backgroundcolor=\color{Gainsboro},
>   % spacing normal, wie in verbatim:
>   columns=fullflexible,
>   keepspaces=true,
>   inputencoding=utf8,
>   extendedchars=true,
>   literate={Ä}{{\"A}}1 {ä}{{\"a}}1 {Ö}{{\"O}}1 {ö}{{\"o}}1
> {Ü}{{\"U}}1 {ü}{{\"u}}1 {ß}{{\ss}}1, literate={Ä}{{\"A}}1 {ä}{{\"a}}1
> {Ö}{{\"O}}1 {ö}{{\"o}}1 {Ü}{{\"U}}1 {ü}{{\"u}}1 {ß}{{\ss}}1,
> literate={Ä}{{\"A}}1 {ä}{{\"a}}1 {Ö}{{\"O}}1 {ö}{{\"o}}1 {Ü}{{\"U}}1
> {ü}{{\"u}}1 {ß}{{\ss}}1, literate={Ä}{{\"A}}1 {ä}{{\"a}}1 {Ö}{{\"O}}1
> {ö}{{\"o}}1 {Ü}{{\"U}}1 {ü}{{\"u}}1 {ß}{{\ss}}1, ... #+end_src 
> 
> 
> The corresponding part of the #INCLUDEd file is:
> 
> #+begin_src org
>   ,#+name: docinfo
>   ,#+begin_src elisp :exports none
>     (let ((props (org-export-get-environment)))
>       (concat  "#+LaTeX_HEADER: \\newcommand{\\myTitle}{"
>                (org-element-interpret-data
>                 (plist-get props :title))
>                "}\n"
>                "#+LaTeX_HEADER: \\newcommand{\\myAuthor}{"
>                (org-element-interpret-data
>                 (plist-get props :author))
>                "}\n"
>                "#+LaTeX_HEADER: \\newcommand{\\myDate}{"
>                (org-element-interpret-data
>                 (plist-get props :date))
>                "}\n"
>                "#+LaTeX_HEADER: \\newcommand{\\myCreator}{"
>                (org-element-interpret-data
>                 (plist-get props :creator))
>                "}\n"
>                "#+LaTeX_HEADER: \\newcommand{\\myKeywords}{"
>                (org-element-interpret-data
>                 (plist-get props :keywords))
>                "}\n"
>                "#+LaTeX_HEADER: \\newcommand{\\mySubject}{"
>                (org-element-interpret-data
>                 (plist-get props :description))
>                "}\n"))
>   ,#+end_src
> 
>   ,#+CALL: docinfo() :exports results :results raw
> 
>   ,#+LaTeX_CLASS: scrartcl
>   ,#+LaTeX_CLASS_OPTIONS: [11pt, a4paper, twoside, notitlepage,
> headsepline, headings=normal, DIV=12, BCOR=12mm] # +LaTeX_HEADER:
> \usepackage[utf8]{inputenc} # +LaTeX_HEADER:
> \usepackage[TS1,T1]{fontenc} ,#+LaTeX_HEADER: \usepackage{scrhack}
>   ,#+LaTeX_HEADER: 
>   ,#+LaTeX_HEADER: % standard font is Linux Libertine, but may want
> to have different ,#+LaTeX_HEADER: % tt font.  Scale is for 10pt,
> probably also Ok for others. ,#+LaTeX_HEADER:
> %\usepackage[ttscale=.875]{libertine} % scale by
> roklein ,#+LaTeX_HEADER: \usepackage[osf]{libertine}             %
> standardfont Linux Libertine ,#+LaTeX_HEADER:
> \usepackage[libertine]{newtxmath} ,#+LaTeX_HEADER:
> \renewcommand*\oldstylenums[1]{{\fontfamily{fxlj}\selectfont
> #1}} ,#+LaTeX_HEADER: \usepackage[scaled=0.9,zerostyle=c]{newtxtt} %
> TX typewriter, scale ok by roklein ,#+LaTeX_HEADER: ,#+LaTeX_HEADER:
> % have to load ams packages before symbol packages, so some things
> aren't ,#+LaTeX_HEADER: % already defined. (amsmath doesn't cope) #
> +LaTeX_HEADER: \usepackage{amsmath}               % enhanced
> math ,#+LaTeX_HEADER: \usepackage{amstext}               % text in a
> math display ,#+LaTeX_HEADER: # +LaTeX_HEADER:
> \usepackage{fixltx2e}              % fix some things wrong with
> LaTeX2e # +LaTeX_HEADER: \usepackage{textcomp}              % text
> symbols via text companion fonts # +LaTeX_HEADER:
> \usepackage{marvosym}              % Martin Vogel's Symbol Font #
> +LaTeX_HEADER: \usepackage{wasysym}               % Waldi Symbol
> Fonts # +LaTeX_HEADER: \usepackage{amssymb}               % AMS
> Symbols (mainly for math) ,#+LaTeX_HEADER: ,#+LaTeX_HEADER:
> \usepackage[rgb,svgnames,table]{xcolor} % enable color, also for
> tables ,#+LaTeX_HEADER: \usepackage[most]{tcolorbox} ,#+LaTeX_HEADER:
> # +LaTeX_HEADER: \usepackage{graphicx}              % enhanced
> Graphics support ,#+LaTeX_HEADER: \usepackage{overpic}
> % put LaTeX or grid over graphics ,#+LaTeX_HEADER: # +LaTeX_HEADER:
> \usepackage{longtable}             % multi-page
> tables ,#+LaTeX_HEADER: \usepackage{colortbl}              % colored
> tables ,#+LaTeX_HEADER: \usepackage{tabu}                  % enhanced
> tables using above packages
> 
>   ,#+LaTeX_HEADER: \usepackage{booktabs}              % beautiful
> table formatting
> 
>   ,#+LaTeX_HEADER: 
>   # +LaTeX_HEADER: \usepackage{float}                 % improved
> environment for floats # +LaTeX_HEADER:
> \usepackage{wrapfig}               % wrap text around floats #
> +LaTeX_HEADER: \usepackage{rotating}              % rotate
> floats ,#+LaTeX_HEADER: ,#+LaTeX_HEADER: \usepackage{tikz}
>   ,#+LaTeX_HEADER:
> \usetikzlibrary{matrix,arrows,decorations.pathmorphing} # org uses
> ulem # +LaTeX_HEADER: \usepackage{soul}                  % space-out,
> underline, strike-out... # +LaTeX_HEADER:
> \usepackage{soulutf8}              % also for utf-8
> characters ,#+LaTeX_HEADER: # +LaTeX_HEADER: \usepackage{hyperref}
>   # +LaTeX_HEADER: \usepackage{listings}
>   ,#+LaTeX_HEADER: \usepackage{paralist}
>   ,#+LaTeX_HEADER: \usepackage{xfrac}                 % nice
> fractions $\sfrac{1}{2}$ ,#+LaTeX_HEADER: 
>   ,#+LaTeX_HEADER: \usepackage{calc}                  % infix
> notation arithmetic ,#+LaTeX_HEADER: 
>   ,#+LaTeX_HEADER: \usepackage{ifthen}                % if...then for
> LaTeX ,#+LaTeX_HEADER: \usepackage{alltt}                 % like
> verbatim but \, {, and } work ,#+LaTeX_HEADER: 
>   ,#+LaTeX_HEADER: \usepackage[a4paper]{geometry}
>   ,#+LaTeX_HEADER: \usepackage{relsize}               % relative font
> sizing ("\smaller") ,#+LaTeX_HEADER: 
>   ,#+LaTeX_HEADER: \lstset{
>   ,#+LaTeX_HEADER:     basicstyle=\ttfamily,
>   ,#+LaTeX_HEADER:     frame=single,
>   ,#+LaTeX_HEADER:     % frame=leftline,
>   ,#+LaTeX_HEADER:     backgroundcolor=\color{Gainsboro},
>   ,#+LaTeX_HEADER:     % spacing normal, wie in verbatim:
>   ,#+LaTeX_HEADER:     columns=fullflexible,
>   ,#+LaTeX_HEADER:     keepspaces=true,
>   ,#+LaTeX_HEADER:     % Umlaute
>   ,#+LaTeX_HEADER:     inputencoding=utf8,
>   ,#+LaTeX_HEADER:     extendedchars=true,
>   ,#+LaTeX_HEADER:     literate={Ä}{{\"A}}1 {ä}{{\"a}}1 {Ö}{{\"O}}1
> {ö}{{\"o}}1 {Ü}{{\"U}}1 {ü}{{\"u}}1 {ß}{{\ss}}1, ,#+LaTeX_HEADER: }
>   ...
> #+end_src
> 




reply via email to

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