emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Klein <roklein@roklein.de>
To: emacs-orgmode@gnu.org
Subject: Re: issues with publishing to LaTeX using #INCLUDE
Date: Thu, 18 Jun 2015 08:58:13 +0200	[thread overview]
Message-ID: <20150618085813.1630b824@pckr150.mpip-mainz.mpg.de> (raw)
In-Reply-To: <20150617.200443.1764368968080794485.roklein@roklein.de>

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 <roklein@roklein.de> 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	other threads:[~2015-06-18  6:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 18:04 issues with publishing to LaTeX using #INCLUDE Robert Klein
2015-06-18  6:58 ` Robert Klein [this message]
2015-06-18  7:15   ` ECM for: " Robert Klein
2015-06-18  7:21     ` Robert Klein
2015-06-18  7:55       ` Nicolas Goaziou
2015-06-18 12:21         ` Robert Klein
2015-06-18 18:51           ` Robert Klein
2015-06-19  7:51             ` commit found, was: " Robert Klein
2015-06-19 18:28               ` tentative patch " Robert Klein
2015-06-20 22:15                 ` Nicolas Goaziou
2015-06-21 12:55                   ` Robert Klein
2015-06-22  8:37                     ` Nicolas Goaziou
2015-06-22 15:01                       ` Robert Klein
2015-06-23 21:44                         ` Nicolas Goaziou
2015-06-24  7:07                           ` Robert Klein
2015-06-25 13:16                             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150618085813.1630b824@pckr150.mpip-mainz.mpg.de \
    --to=roklein@roklein.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).