Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
Suvayu Ali writes: > On Sat, Jun 06, 2015 at 09:28:12AM +0200, Nicolas Goaziou wrote: >> Titus von der Malsburg writes: >> >> > Thee can be handled by protectedtexttt. The obvious questions is of >> > course: Wouldn’t it be more consistent to handle all instances of ~code~ >> > using protectedtexttt? >> >> One option would be indeed to remove \verb altogether. Note that it is >> also used in inline source blocks. >> >> However, I assume \verb put less limitations than \texttt on its >> contents, so I'd rather keep \verb around. > > This TeX.SX post discourages the use of \verb. > > http://tex.stackexchange.com/a/83894/4416 > > It cites the following FAQ from UK TeX. > > http://www.TeX.ac.uk/cgi-bin/texfaq2html?label=verbwithin > > Maybe it is worth to consider dropping \verb entirely? Done in b8ade2e79e92dad10f2b045bc55fbeaf133e5598. Thanks to you both. Regards,
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
On Sat, Jun 06, 2015 at 09:28:12AM +0200, Nicolas Goaziou wrote: > Titus von der Malsburg writes: > > > Thee can be handled by protectedtexttt. The obvious questions is of > > course: Wouldn’t it be more consistent to handle all instances of ~code~ > > using protectedtexttt? > > One option would be indeed to remove \verb altogether. Note that it is > also used in inline source blocks. > > However, I assume \verb put less limitations than \texttt on its > contents, so I'd rather keep \verb around. This TeX.SX post discourages the use of \verb. http://tex.stackexchange.com/a/83894/4416 It cites the following FAQ from UK TeX. http://www.TeX.ac.uk/cgi-bin/texfaq2html?label=verbwithin Maybe it is worth to consider dropping \verb entirely? Hope this helps, -- Suvayu Open source is the future. It sets us free.
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
On 2015-06-06 Sat 00:28, Nicolas Goaziou wrote: > Titus von der Malsburg writes: > >> Thee can be handled by protectedtexttt. The obvious questions is of >> course: Wouldn’t it be more consistent to handle all instances of ~code~ >> using protectedtexttt? > > One option would be indeed to remove \verb altogether. Note that it is > also used in inline source blocks. > > However, I assume \verb put less limitations than \texttt on its > contents, so I'd rather keep \verb around. > >> And if you want to support the use of \verb at all, shouldn’t that be >> done via =verbatim= not ~code~? > > I fail to see how it would solve the problem at hand. It would simply > move it elsewhere. I didn’t say it would. I said that using protectedtexttt solves the issue in problematic environments. The issue that =verbatim= maps to \texttt and ~code~ to \verb is independent, but since it affects the same code, it might make sense to solve both at the same time. Titus > My question is how to handle \verb at the LaTeX level, not at the Org > one. > These two did not produce the intended results (sub and super script don’t work) but the LaTeX is not malformed: test^~test~ test_~test~ >> >> This really seems to be an independent issue (because test^*test* >> doesn’t work either) > > Actually, I just realized this is not valid syntax for sub/superscript > in Org anyway. It should be > > test^{~test~} > > Regards, signature.asc Description: PGP signature
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
Titus von der Malsburg writes: > Thee can be handled by protectedtexttt. The obvious questions is of > course: Wouldn’t it be more consistent to handle all instances of ~code~ > using protectedtexttt? One option would be indeed to remove \verb altogether. Note that it is also used in inline source blocks. However, I assume \verb put less limitations than \texttt on its contents, so I'd rather keep \verb around. > And if you want to support the use of \verb at all, shouldn’t that be > done via =verbatim= not ~code~? I fail to see how it would solve the problem at hand. It would simply move it elsewhere. My question is how to handle \verb at the LaTeX level, not at the Org one. >>> These two did not produce the intended results (sub and super script >>> don’t work) but the LaTeX is not malformed: >>> >>> test^~test~ >>> test_~test~ > > This really seems to be an independent issue (because test^*test* > doesn’t work either) Actually, I just realized this is not valid syntax for sub/superscript in Org anyway. It should be test^{~test~} Regards,
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
On 2015-06-05 Fri 14:27, Nicolas Goaziou wrote: > Titus von der Malsburg writes: > >> Below is a list of things that I tested. This list of test cases is >> probably not exhaustive. > > Thanks. > >> Things that don't work with \verb (produce malformed LaTeX): >> >> #+TITLE: ~test~ >> >> #+CAPTION: ~test~ >> [[/tmp/img.png]] >> >> * ~test~ >> ** ~test~ >> … Thee can be handled by protectedtexttt. The obvious questions is of course: Wouldn’t it be more consistent to handle all instances of ~code~ using protectedtexttt? And if you want to support the use of \verb at all, shouldn’t that be done via =verbatim= not ~code~? >> These two did not produce the intended results (sub and super script >> don’t work) but the LaTeX is not malformed: >> >> test^~test~ >> test_~test~ This really seems to be an independent issue (because test^*test* doesn’t work either) but I think it should produce this LaTeX: test\(^{\text{\texttt{test}}}\) test\(_{\text{\texttt{test}}}\) But this works, too: test\(^{\text{\verb~test~}}\) test\(_{\text{\verb~test~}}\) Titus signature.asc Description: PGP signature
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
Titus von der Malsburg writes: > Below is a list of things that I tested. This list of test cases is > probably not exhaustive. Thanks. > Things that don't work with \verb (produce malformed LaTeX): > > #+TITLE: ~test~ > > #+CAPTION: ~test~ > [[/tmp/img.png]] > > * ~test~ > ** ~test~ > … > > These two did not produce the intended results (sub and super script > don’t work) but the LaTeX is not malformed: > > test^~test~ > test_~test~ What should be produced by "ox-latex.el" in all the cases above? Regards,
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
On 2015-05-31 Sun 01:40, Nicolas Goaziou wrote: > Titus von der Malsburg writes: > >> Huh, ~code~ is translated to \verb and =verbatim= is translated to >> \texttt (plus escaping of some special characters)? > > Correct. > >> If \verb is used at all, shouldn’t it be generated by =verbatim= >> instead of by ~code~? > > Why is that? Because \verb reminds =verbatim=? Really, both "code" and > "verbatim" syntax produces verbatim contents. Therefore both are > eligible for "\verb". Well, \verb is short for verbatim. So, yeah, it is pretty unexpected that =verbatim= is translated to testtt and ~code~ to \verb. >>> Note that we could do better anyway and switch command depending on >>> context. >> >> Yes, I suppose anything is better than producing malformed LaTeX. > > Could you give the list of all contexts requiring such a switch, and > what the result should be in each case? Below is a list of things that I tested. This list of test cases is probably not exhaustive. Things that don't work with \verb (produce malformed LaTeX): #+TITLE: ~test~ #+CAPTION: ~test~ [[/tmp/img.png]] * ~test~ ** ~test~ … These two did not produce the intended results (sub and super script don’t work) but the LaTeX is not malformed: test^~test~ test_~test~ Things that did work as expected with \verb: ~test~ | ~test~ | [[http://www.fsf.org/][~test~]] - ~test~ :: this is a ~test~ [fn:1] [fn:1] ~test~ *~test~* =~test~= /~test~/ +~test~+ _~test~_ -- Dr Titus von der Malsburg Feodor Lynen Research Fellow Dept. Psychology & Dept. Linguistics University of California, San Diego http://pages.ucsd.edu/~tvondermalsburg/ signature.asc Description: PGP signature
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
Titus von der Malsburg writes: > Huh, ~code~ is translated to \verb and =verbatim= is translated to > \texttt (plus escaping of some special characters)? Correct. > If \verb is used at all, shouldn’t it be generated by =verbatim= > instead of by ~code~? Why is that? Because \verb reminds =verbatim=? Really, both "code" and "verbatim" syntax produces verbatim contents. Therefore both are eligible for "\verb". Anyway, you can customize `org-latex-text-markup-alist' to your liking. >> Note that we could do better anyway and switch command depending on >> context. > > Yes, I suppose anything is better than producing malformed LaTeX. Could you give the list of all contexts requiring such a switch, and what the result should be in each case? Thank you. Regards,
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
On 2015-05-30 Sat 01:09, Nicolas Goaziou wrote: > Hello, > > Titus von der Malsburg writes: > >> Yes, I saw this thread after sending the previous email. According to >> `org-latex-text-markup-alist', protectedtexttt should be used, which >> seems like a good-enough solution for this problem. But for some reason >> that doesn’t happen. > > It happens. However, verbatim is =...= whereas ~...~ is code. The former > uses protectedtexttt while the latter uses \verb. Huh, ~code~ is translated to \verb and =verbatim= is translated to \texttt (plus escaping of some special characters)? If \verb is used at all, shouldn’t it be generated by =verbatim= instead of by ~code~? > Note that we could do better anyway and switch command depending on > context. Yes, I suppose anything is better than producing malformed LaTeX. Titus signature.asc Description: PGP signature
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
Hello, Titus von der Malsburg writes: > Yes, I saw this thread after sending the previous email. According to > `org-latex-text-markup-alist', protectedtexttt should be used, which > seems like a good-enough solution for this problem. But for some reason > that doesn’t happen. It happens. However, verbatim is =...= whereas ~...~ is code. The former uses protectedtexttt while the latter uses \verb. Note that we could do better anyway and switch command depending on context. Regards, -- Nicolas Goaziou
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
On 2015-05-29 Fri 21:32, Nick Dokos wrote: > Titus von der Malsburg writes: > >> #+BEGIN_EXAMPLE >> * The variable ~JAVA_HOME~ >> & >> #+END_EXAMPLE >> >> Exporting this to LaTeX and then compiling to PDF, produces the >> following error: >> >> ! Missing $ inserted. >> >> $ >> l.35 \section{The variable \verb~JAVA_HOME~} >> >> Apparently, \verb is not allow in command arguments: >> >> http://www.tex.ac.uk/cgi-bin/texfaq2html?label=verbwithin >> >> One solution is uses \cprotect: >> >> \cprotect\section{The variable \verb~JAVA_HOME~} >> >> I don’t know how the exporter works but I wouldn’t be surprised if it >> wasn’t entirely trivial to implement this. >> >> The problem also exists in other situations where ~verbatim~ is used in >> embedded contexts, for example when used in link descriptions: >> >> [[https://encrypted.google.com/search?q=JAVA_HOME][Google >> ~JAVA_HOME~]] >> >> Is there anything that speaks against using \texttt for ~verbatim~? The >> HTML exporter uses the code tag for ~verbatim~ and =code=. >> >> Titus > > I don't know what \cprotect does but there was a discussion of this a > long time ago: > > http://thread.gmane.org/gmane.emacs.orgmode/14256/focus=14257 > > and back then, Carsten changed it so that verbatim in headlines used > \texttt - but that was the old latex exporter: I take it things are > different now? Yes, I saw this thread after sending the previous email. According to `org-latex-text-markup-alist', protectedtexttt should be used, which seems like a good-enough solution for this problem. But for some reason that doesn’t happen. BTW, I used the latest development versions of Emacs (-Q) and Org-mode to test this. Titus signature.asc Description: PGP signature
Re: [O] [Bug] ~Verbatim~ in headlines breaks LaTeX
Titus von der Malsburg writes: > #+BEGIN_EXAMPLE > * The variable ~JAVA_HOME~ > & > #+END_EXAMPLE > > Exporting this to LaTeX and then compiling to PDF, produces the > following error: > > ! Missing $ inserted. > > $ > l.35 \section{The variable \verb~JAVA_HOME~} > > Apparently, \verb is not allow in command arguments: > > http://www.tex.ac.uk/cgi-bin/texfaq2html?label=verbwithin > > One solution is uses \cprotect: > > \cprotect\section{The variable \verb~JAVA_HOME~} > > I don’t know how the exporter works but I wouldn’t be surprised if it > wasn’t entirely trivial to implement this. > > The problem also exists in other situations where ~verbatim~ is used in > embedded contexts, for example when used in link descriptions: > > [[https://encrypted.google.com/search?q=JAVA_HOME][Google > ~JAVA_HOME~]] > > Is there anything that speaks against using \texttt for ~verbatim~? The > HTML exporter uses the code tag for ~verbatim~ and =code=. > > Titus I don't know what \cprotect does but there was a discussion of this a long time ago: http://thread.gmane.org/gmane.emacs.orgmode/14256/focus=14257 and back then, Carsten changed it so that verbatim in headlines used \texttt - but that was the old latex exporter: I take it things are different now? Nick
[O] [Bug] ~Verbatim~ in headlines breaks LaTeX
#+BEGIN_EXAMPLE * The variable ~JAVA_HOME~ … #+END_EXAMPLE Exporting this to LaTeX and then compiling to PDF, produces the following error: ! Missing $ inserted. $ l.35 \section{The variable \verb~JAVA_HOME~} Apparently, \verb is not allow in command arguments: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=verbwithin One solution is uses \cprotect: \cprotect\section{The variable \verb~JAVA_HOME~} I don’t know how the exporter works but I wouldn’t be surprised if it wasn’t entirely trivial to implement this. The problem also exists in other situations where ~verbatim~ is used in embedded contexts, for example when used in link descriptions: [[https://encrypted.google.com/search?q=JAVA_HOME][Google ~JAVA_HOME~]] Is there anything that speaks against using \texttt for ~verbatim~? The HTML exporter uses the code tag for ~verbatim~ and =code=. Titus signature.asc Description: PGP signature