emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org mode latex export excude title
@ 2016-12-30 12:11 Fanpeng Kong
  2016-12-30 17:26 ` Charles C. Berry
  0 siblings, 1 reply; 4+ messages in thread
From: Fanpeng Kong @ 2016-12-30 12:11 UTC (permalink / raw)
  To: emacs-orgmode

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

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

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

\date{}
\title{}

\hypersetup{
}

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

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

Cheers
Fanpeng

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org mode latex export excude title
  2016-12-30 12:11 org mode latex export excude title Fanpeng Kong
@ 2016-12-30 17:26 ` Charles C. Berry
  2016-12-30 19:13   ` Ken Mankoff
  0 siblings, 1 reply; 4+ messages in thread
From: Charles C. Berry @ 2016-12-30 17:26 UTC (permalink / raw)
  To: Fanpeng Kong; +Cc: emacs-orgmode

On Fri, 30 Dec 2016, Fanpeng Kong wrote:

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

[example deleted]

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

Use a filter to comment it out:



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

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



* section 1

...

HTH,

Chuck

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org mode latex export excude title
  2016-12-30 17:26 ` Charles C. Berry
@ 2016-12-30 19:13   ` Ken Mankoff
  2016-12-30 19:55     ` Charles C. Berry
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Mankoff @ 2016-12-30 19:13 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: Fanpeng Kong, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]

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

Can be set as a buffer local variable.

  -k.

On Fri, Dec 30, 2016 at 12:26 PM, Charles C. Berry <ccberry@ucsd.edu> wrote:

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

[-- Attachment #2: Type: text/html, Size: 2137 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org mode latex export excude title
  2016-12-30 19:13   ` Ken Mankoff
@ 2016-12-30 19:55     ` Charles C. Berry
  0 siblings, 0 replies; 4+ messages in thread
From: Charles C. Berry @ 2016-12-30 19:55 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: Fanpeng Kong, Org-mode

On Fri, 30 Dec 2016, Ken Mankoff wrote:

> (setq-local org-latex-title-command "")
>
> Can be set as a buffer local variable.
>

True, but not relevant to the OPs query:

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

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

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

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

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

Chuck

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-30 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-30 12:11 org mode latex export excude title Fanpeng Kong
2016-12-30 17:26 ` Charles C. Berry
2016-12-30 19:13   ` Ken Mankoff
2016-12-30 19:55     ` Charles C. Berry

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