emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX export: list with non-optional argument
@ 2014-01-24  7:35 Andreas Leha
  2014-01-24  8:45 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Leha @ 2014-01-24  7:35 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

How can a pass a non-optional argument to a special list in LaTeX
export?

The 'currvita' LaTeX package comes with the environment 'cvlist'.  This
cvlist is to be used like this:

--8<---------------cut here---------------start------------->8---
\begin{cvlist}{Personal Information}
  \item[Date of Birth] 01.01.2014
  \item[Place of Birth] Berlin
  \item[Nationality] German
\end{cvlist}
--8<---------------cut here---------------end--------------->8---

So, it has the title of the list as argument.  How would I create such
list from Org mode?

For that case it seems to be a little inconvenient that Org does
surround any given :options with '[ ... ]' automatically, because the
closest I get with a pure Org mode solution is

--8<---------------cut here---------------start------------->8---
\begin{cvlist}[{Personal Information}]
\item [Date of Birth]  01.01.2014
\item [Place of Birth] Berlin
\item [Nationality]    German
\end{cvlist}
--8<---------------cut here---------------end--------------->8---

produced by this Org snippet:

--8<---------------cut here---------------start------------->8---
#+ATTR_LATEX: :environment cvlist :options {Personal Information}
- [Date of Birth]  01.01.2014
- [Place of Birth] Berlin
- [Nationality]    German
--8<---------------cut here---------------end--------------->8---


Well, I am aware of two obvious solutions:
1. just include the LaTeX code (inside #+begin_latex ... #+end_latex)
2. define my own environment 'mycvlist' that translates between Org and
   'cvlist' and that takes the title as optional argument:
   \newenvironment{mycvlist}[1][]{\begin{cvlist}{#1}}{\end{cvlist}}



And I will happily go with the second solution.  Just wanted to ask,
whether that definition of mycvlist is necessary or whether I miss
something here.

Regards,
Andreas

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

* Re: LaTeX export: list with non-optional argument
  2014-01-24  7:35 LaTeX export: list with non-optional argument Andreas Leha
@ 2014-01-24  8:45 ` Nicolas Goaziou
  2014-01-24  9:00   ` Andreas Leha
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2014-01-24  8:45 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

Hello,

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> How can a pass a non-optional argument to a special list in LaTeX
> export?

You can't. See below.

> The 'currvita' LaTeX package comes with the environment 'cvlist'.  This
> cvlist is to be used like this:
>
> \begin{cvlist}{Personal Information}
>   \item[Date of Birth] 01.01.2014
>   \item[Place of Birth] Berlin
>   \item[Nationality] German
> \end{cvlist}
>
> So, it has the title of the list as argument.  How would I create such
> list from Org mode?
>
> For that case it seems to be a little inconvenient that Org does
> surround any given :options with '[ ... ]' automatically, because the
> closest I get with a pure Org mode solution is

I introduced :environment property thinking about "paralist" package,
which uses only optional arguments. Therefore :options tries to be smart
and enclose its value within square brackets when necessary.

The problem is that this differs from :options property in special
blocks, which will append its value verbatim after the environment name.

I guess the best move would be to avoid being too smart and do the same
for :options in plain lists. The manual would need to be updated
accordingly.

Opinions?

> \begin{cvlist}[{Personal Information}]
> \item [Date of Birth]  01.01.2014
> \item [Place of Birth] Berlin
> \item [Nationality]    German
> \end{cvlist}
>
> produced by this Org snippet:
>
> #+ATTR_LATEX: :environment cvlist :options {Personal Information}
> - [Date of Birth]  01.01.2014
> - [Place of Birth] Berlin
> - [Nationality]    German

This syntax is not possible anymore in latest Org release. You cannot
start an item with a square bracket and expect it will become an option
to \item anymore. This should be:

  #+ATTR_LATEX: :environment cvlist :options {Personal Information}
  - @@latex:[Date of Birth]@@ ...
  - @@latex:[Place of Birth]@@ ...
  - @@latex:[Nationality]@@ ...

or, in this particular case, simply:

  #+ATTR_LATEX: :environment cvlist :options {Personal Information}
  - Date of Birth :: ...
  - Place of Birth :: ...
  - Nationality :: ...

But it won't solve the problem discussed above.


Regards,

-- 
Nicolas Goaziou

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

* Re: LaTeX export: list with non-optional argument
  2014-01-24  8:45 ` Nicolas Goaziou
@ 2014-01-24  9:00   ` Andreas Leha
  2014-01-25 14:02     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Leha @ 2014-01-24  9:00 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> How can a pass a non-optional argument to a special list in LaTeX
>> export?
>
> You can't. See below.
>
>> The 'currvita' LaTeX package comes with the environment 'cvlist'.  This
>> cvlist is to be used like this:
>>
>> \begin{cvlist}{Personal Information}
>>   \item[Date of Birth] 01.01.2014
>>   \item[Place of Birth] Berlin
>>   \item[Nationality] German
>> \end{cvlist}
>>
>> So, it has the title of the list as argument.  How would I create such
>> list from Org mode?
>>
>> For that case it seems to be a little inconvenient that Org does
>> surround any given :options with '[ ... ]' automatically, because the
>> closest I get with a pure Org mode solution is
>
> I introduced :environment property thinking about "paralist" package,
> which uses only optional arguments. Therefore :options tries to be smart
> and enclose its value within square brackets when necessary.
>
> The problem is that this differs from :options property in special
> blocks, which will append its value verbatim after the environment name.
>
> I guess the best move would be to avoid being too smart and do the same
> for :options in plain lists. The manual would need to be updated
> accordingly.
>
> Opinions?

I would (obviously?) vote in favour of such a change.
- It does not hurt too much for the other use cases to include the
  square brackets manually.
- It provides more flexibility in general.
- It solves my special use case.

>
>> \begin{cvlist}[{Personal Information}]
>> \item [Date of Birth]  01.01.2014
>> \item [Place of Birth] Berlin
>> \item [Nationality]    German
>> \end{cvlist}
>>
>> produced by this Org snippet:
>>
>> #+ATTR_LATEX: :environment cvlist :options {Personal Information}
>> - [Date of Birth]  01.01.2014
>> - [Place of Birth] Berlin
>> - [Nationality]    German
>
> This syntax is not possible anymore in latest Org release. You cannot
> start an item with a square bracket and expect it will become an option
> to \item anymore.

Thanks for pointing that out.  I remember having seen the thread, but I
did not follow it.  (For the same reason, that I have not been updating
Org lately: time constraints)

> This should be:
>
>   #+ATTR_LATEX: :environment cvlist :options {Personal Information}
>   - @@latex:[Date of Birth]@@ ...
>   - @@latex:[Place of Birth]@@ ...
>   - @@latex:[Nationality]@@ ...
>

That seems to be a regression...


> or, in this particular case, simply:
>
>   #+ATTR_LATEX: :environment cvlist :options {Personal Information}
>   - Date of Birth :: ...
>   - Place of Birth :: ...
>   - Nationality :: ...

... or not.  That is even better than my original syntax.

Regards,
Andreas

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

* Re: LaTeX export: list with non-optional argument
  2014-01-24  9:00   ` Andreas Leha
@ 2014-01-25 14:02     ` Nicolas Goaziou
  2014-01-25 14:21       ` Andreas Leha
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2014-01-25 14:02 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

Hello,

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> I would (obviously?) vote in favour of such a change.
> - It does not hurt too much for the other use cases to include the
>   square brackets manually.
> - It provides more flexibility in general.
> - It solves my special use case.

Done in maint. Thank you for reporting the problem.


Regards,

-- 
Nicolas Goaziou

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

* Re: LaTeX export: list with non-optional argument
  2014-01-25 14:02     ` Nicolas Goaziou
@ 2014-01-25 14:21       ` Andreas Leha
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Leha @ 2014-01-25 14:21 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> I would (obviously?) vote in favour of such a change.
>> - It does not hurt too much for the other use cases to include the
>>   square brackets manually.
>> - It provides more flexibility in general.
>> - It solves my special use case.
>
> Done in maint. Thank you for reporting the problem.
>

Thank you!

- Andreas

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

end of thread, other threads:[~2014-01-25 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-24  7:35 LaTeX export: list with non-optional argument Andreas Leha
2014-01-24  8:45 ` Nicolas Goaziou
2014-01-24  9:00   ` Andreas Leha
2014-01-25 14:02     ` Nicolas Goaziou
2014-01-25 14:21       ` Andreas Leha

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