* Why is text marked as ~verbatim~ exported in LaTeX as \texttt{}
@ 2011-01-28 23:25 Michael Broschinsky
2011-01-28 23:40 ` Nick Dokos
0 siblings, 1 reply; 5+ messages in thread
From: Michael Broschinsky @ 2011-01-28 23:25 UTC (permalink / raw)
To: emacs-orgmode
I have a small test document:
#+TITLE: Title
This is normal text.
=This is teletype text.=
~This is verbatim text.~
When I choose the LaTeX export option and inspect the LaTeX output, I
see that both the text marked as =code= and the text marked as
~verbatim~ are exported as \texttt{}.
I expected that =code= would be exported as \texttt{}, but I expected
~verbatim~ to be expected with the LaTeX \verb command.
Then when I explored org-export-latex-emphasis-alist, I see that the
documentation indicates that if the string to wrap the fontified text
is \verb, then "Org will automatically select a delimiter character
not in the string", which also leads me to believe that that
~verbatim~ will be exported as \verb.
What simple thing am I missing to export ~verbatim~ text as \verb?
Mike
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Why is text marked as ~verbatim~ exported in LaTeX as \texttt{}
2011-01-28 23:25 Why is text marked as ~verbatim~ exported in LaTeX as \texttt{} Michael Broschinsky
@ 2011-01-28 23:40 ` Nick Dokos
2011-01-29 0:14 ` Thomas S. Dye
0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2011-01-28 23:40 UTC (permalink / raw)
To: Michael Broschinsky; +Cc: nicholas.dokos, emacs-orgmode
Michael Broschinsky <mikebroschinsky@gmail.com> wrote:
> I have a small test document:
>
> #+TITLE: Title
>
> This is normal text.
>
> =This is teletype text.=
>
> ~This is verbatim text.~
>
> When I choose the LaTeX export option and inspect the LaTeX output, I
> see that both the text marked as =code= and the text marked as
> ~verbatim~ are exported as \texttt{}.
>
> I expected that =code= would be exported as \texttt{}, but I expected
> ~verbatim~ to be expected with the LaTeX \verb command.
>
> Then when I explored org-export-latex-emphasis-alist, I see that the
> documentation indicates that if the string to wrap the fontified text
> is \verb, then "Org will automatically select a delimiter character
> not in the string", which also leads me to believe that that
> ~verbatim~ will be exported as \verb.
>
> What simple thing am I missing to export ~verbatim~ text as \verb?
>
See http://thread.gmane.org/gmane.emacs.orgmode/14256/focus=14257 for
an explanation and some references.
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Why is text marked as ~verbatim~ exported in LaTeX as \texttt{}
2011-01-28 23:40 ` Nick Dokos
@ 2011-01-29 0:14 ` Thomas S. Dye
2011-01-29 17:42 ` Michael Broschinsky
0 siblings, 1 reply; 5+ messages in thread
From: Thomas S. Dye @ 2011-01-29 0:14 UTC (permalink / raw)
To: nicholas.dokos; +Cc: Michael Broschinsky, emacs-orgmode
On Jan 28, 2011, at 1:40 PM, Nick Dokos wrote:
> Michael Broschinsky <mikebroschinsky@gmail.com> wrote:
>
>> I have a small test document:
>>
>> #+TITLE: Title
>>
>> This is normal text.
>>
>> =This is teletype text.=
>>
>> ~This is verbatim text.~
>>
>> When I choose the LaTeX export option and inspect the LaTeX output, I
>> see that both the text marked as =code= and the text marked as
>> ~verbatim~ are exported as \texttt{}.
>>
>> I expected that =code= would be exported as \texttt{}, but I expected
>> ~verbatim~ to be expected with the LaTeX \verb command.
>>
>> Then when I explored org-export-latex-emphasis-alist, I see that the
>> documentation indicates that if the string to wrap the fontified text
>> is \verb, then "Org will automatically select a delimiter character
>> not in the string", which also leads me to believe that that
>> ~verbatim~ will be exported as \verb.
>>
>> What simple thing am I missing to export ~verbatim~ text as \verb?
>>
>
> See http://thread.gmane.org/gmane.emacs.orgmode/14256/focus=14257 for
> an explanation and some references.
>
> Nick
>
The problem appears to be the docstring of org-export-latex-emphasis-
alist, which refers to the behavior before Carsten's fix. Now it
seems that the second element, \\verb, yields \texttt{} instead of
\verb.
org-export-latex-emphasis-alist is a variable defined in `org-latex.el'.
Its value is
(("*" "\\textbf{%s}" nil)
("/" "\\emph{%s}" nil)
("_" "\\underline{%s}" nil)
("+" "\\st{%s}" nil)
("=" "\\verb" t)
("~" "\\verb" t))
Documentation:
Alist of LaTeX expressions to convert emphasis fontifiers.
Each element of the list is a list of three elements.
The first element is the character used as a marker for fontification.
The second element is a formatting string to wrap fontified text with.
If it is "\verb", Org will automatically select a delimiter
character that is not in the string.
The third element decides whether to protect converted text from other
conversions.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Why is text marked as ~verbatim~ exported in LaTeX as \texttt{}
2011-01-29 0:14 ` Thomas S. Dye
@ 2011-01-29 17:42 ` Michael Broschinsky
2011-01-29 18:08 ` Thomas S. Dye
0 siblings, 1 reply; 5+ messages in thread
From: Michael Broschinsky @ 2011-01-29 17:42 UTC (permalink / raw)
To: Thomas S. Dye; +Cc: nicholas.dokos, emacs-orgmode
On Fri, Jan 28, 2011 at 5:14 PM, Thomas S. Dye <tsd@tsdye.com> wrote:
>
> On Jan 28, 2011, at 1:40 PM, Nick Dokos wrote:
>
>> Michael Broschinsky <mikebroschinsky@gmail.com> wrote:
>>
>>> I have a small test document:
>>>
>>> #+TITLE: Title
>>>
>>> This is normal text.
>>>
>>> =This is teletype text.=
>>>
>>> ~This is verbatim text.~
>>>
>>> When I choose the LaTeX export option and inspect the LaTeX output, I
>>> see that both the text marked as =code= and the text marked as
>>> ~verbatim~ are exported as \texttt{}.
>>>
>>> I expected that =code= would be exported as \texttt{}, but I expected
>>> ~verbatim~ to be expected with the LaTeX \verb command.
>>>
>>> Then when I explored org-export-latex-emphasis-alist, I see that the
>>> documentation indicates that if the string to wrap the fontified text
>>> is \verb, then "Org will automatically select a delimiter character
>>> not in the string", which also leads me to believe that that
>>> ~verbatim~ will be exported as \verb.
>>>
>>> What simple thing am I missing to export ~verbatim~ text as \verb?
>>>
>>
>> See http://thread.gmane.org/gmane.emacs.orgmode/14256/focus=14257 for
>> an explanation and some references.
>>
>> Nick
>>
>
> The problem appears to be the docstring of org-export-latex-emphasis-alist,
> which refers to the behavior before Carsten's fix. Now it seems that the
> second element, \\verb, yields \texttt{} instead of \verb.
>
> org-export-latex-emphasis-alist is a variable defined in `org-latex.el'.
> Its value is
> (("*" "\\textbf{%s}" nil)
> ("/" "\\emph{%s}" nil)
> ("_" "\\underline{%s}" nil)
> ("+" "\\st{%s}" nil)
> ("=" "\\verb" t)
> ("~" "\\verb" t))
>
>
> Documentation:
> Alist of LaTeX expressions to convert emphasis fontifiers.
> Each element of the list is a list of three elements.
> The first element is the character used as a marker for fontification.
> The second element is a formatting string to wrap fontified text with.
> If it is "\verb", Org will automatically select a delimiter
> character that is not in the string.
> The third element decides whether to protect converted text from other
> conversions.
>
> Tom
>
>
So, if I understand correctly (and if I read line 1981 in org-latex.el
correctly, from Org 7.4), ~verbatim~ and =code= are exported
identically, using \texttt{}?
I stumbled upon this when I was writing a document with the following
character sequence: !--dar--
When I exported to LaTeX and then processed the file, the
\texttt{!--dar--} wound up collapsing the two hyphens into a single
hyphen (or an en-dash; hard to tell in the tt font). Of course, that
behavior *doesn't* happen when the string is preceded by the \verb
command in LaTeX.
Do I have other options for marking up verbatim inline content?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Why is text marked as ~verbatim~ exported in LaTeX as \texttt{}
2011-01-29 17:42 ` Michael Broschinsky
@ 2011-01-29 18:08 ` Thomas S. Dye
0 siblings, 0 replies; 5+ messages in thread
From: Thomas S. Dye @ 2011-01-29 18:08 UTC (permalink / raw)
To: Michael Broschinsky; +Cc: nicholas.dokos, emacs-orgmode
On Jan 29, 2011, at 7:42 AM, Michael Broschinsky wrote:
> On Fri, Jan 28, 2011 at 5:14 PM, Thomas S. Dye <tsd@tsdye.com> wrote:
>>
>> On Jan 28, 2011, at 1:40 PM, Nick Dokos wrote:
>>
>>> Michael Broschinsky <mikebroschinsky@gmail.com> wrote:
>>>
>>>> I have a small test document:
>>>>
>>>> #+TITLE: Title
>>>>
>>>> This is normal text.
>>>>
>>>> =This is teletype text.=
>>>>
>>>> ~This is verbatim text.~
>>>>
>>>> When I choose the LaTeX export option and inspect the LaTeX
>>>> output, I
>>>> see that both the text marked as =code= and the text marked as
>>>> ~verbatim~ are exported as \texttt{}.
>>>>
>>>> I expected that =code= would be exported as \texttt{}, but I
>>>> expected
>>>> ~verbatim~ to be expected with the LaTeX \verb command.
>>>>
>>>> Then when I explored org-export-latex-emphasis-alist, I see that
>>>> the
>>>> documentation indicates that if the string to wrap the fontified
>>>> text
>>>> is \verb, then "Org will automatically select a delimiter character
>>>> not in the string", which also leads me to believe that that
>>>> ~verbatim~ will be exported as \verb.
>>>>
>>>> What simple thing am I missing to export ~verbatim~ text as \verb?
>>>>
>>>
>>> See http://thread.gmane.org/gmane.emacs.orgmode/14256/focus=14257
>>> for
>>> an explanation and some references.
>>>
>>> Nick
>>>
>>
>> The problem appears to be the docstring of org-export-latex-
>> emphasis-alist,
>> which refers to the behavior before Carsten's fix. Now it seems
>> that the
>> second element, \\verb, yields \texttt{} instead of \verb.
>>
>> org-export-latex-emphasis-alist is a variable defined in `org-
>> latex.el'.
>> Its value is
>> (("*" "\\textbf{%s}" nil)
>> ("/" "\\emph{%s}" nil)
>> ("_" "\\underline{%s}" nil)
>> ("+" "\\st{%s}" nil)
>> ("=" "\\verb" t)
>> ("~" "\\verb" t))
>>
>>
>> Documentation:
>> Alist of LaTeX expressions to convert emphasis fontifiers.
>> Each element of the list is a list of three elements.
>> The first element is the character used as a marker for
>> fontification.
>> The second element is a formatting string to wrap fontified text
>> with.
>> If it is "\verb", Org will automatically select a delimiter
>> character that is not in the string.
>> The third element decides whether to protect converted text from
>> other
>> conversions.
>>
>> Tom
>>
>>
>
> So, if I understand correctly (and if I read line 1981 in org-latex.el
> correctly, from Org 7.4), ~verbatim~ and =code= are exported
> identically, using \texttt{}?
>
> I stumbled upon this when I was writing a document with the following
> character sequence: !--dar--
>
> When I exported to LaTeX and then processed the file, the
> \texttt{!--dar--} wound up collapsing the two hyphens into a single
> hyphen (or an en-dash; hard to tell in the tt font). Of course, that
> behavior *doesn't* happen when the string is preceded by the \verb
> command in LaTeX.
>
> Do I have other options for marking up verbatim inline content?
Hi Mike,
(setq org-export-latex-use-verb t)
appears to be the key here. It is not documented as a variable, but
when I set it to t in the *scratch* buffer and then run your test
case, I get
This is normal text.
\verb~This is teletype text.~
\verb~This is verbatim text.~
which compiles just fine with LaTeX.
HTH,
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-29 18:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28 23:25 Why is text marked as ~verbatim~ exported in LaTeX as \texttt{} Michael Broschinsky
2011-01-28 23:40 ` Nick Dokos
2011-01-29 0:14 ` Thomas S. Dye
2011-01-29 17:42 ` Michael Broschinsky
2011-01-29 18:08 ` Thomas S. Dye
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).