-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
latex output: description lists and `lstinline' #645
Comments
I'm not keen on the idea of adding lots of complexity to the writer to specially handle lstinline in all of the various contexts in which it blows up. (And why not just use pandoc's own highlighting capabilities, which can be customized as you like by redefining the macros highlighting-kate uses?) It's probably better to handle the problem with solutions like this: http://tex.stackexchange.com/questions/93944/using-lstinline-inside-a-item |
Instead of opening another issue I will add a comment here. There are many reasons why one might not want to use Also, one sometimes needs the listings to be set in slightly smaller font. As it is now, doing this will cause the inline code strings to be awkwardly different from the rest of the text they are in line with. I am at a point right now where I can either have listings that look bad (are too large), or paragraphs that look bad (inline code strings will be too small). So, there are many reasons for an option to use |
Actually (responding to myself here) — this is a much more important issue than I previously thought. The problem with \lstinline is that is does not support UTF-8. The whole listings package is limited to 8-bit data. The (rather disastrous) result is that you get For non-english documents this is a significant problem. While it is workable within code listings, replacing |
I'm not sure if this issue is understood. I think it deserves more attention than it currently gets. To rephrase: currently Pandoc produces corrupted output if
|
@jwr If, as you say, the whole listings package is limited to 8-bit data, then I don't see how avoiding |
@jgm well, that's throwing out the baby with the bathwater. If you have UTF-8 in your text, you likely write in a language other than English, and yet most (if not all) code gets written in English. That is a pattern I see in all companies I know of. Hence, |
+++ Jan Rychter [May 19 15 09:55 ]:
So, then, your objection to |
@jgm My objection to I also point out a frequent use case (which happens to be my case, too): documentation with UTF-8 and code without UTF-8. My code listings only contain ASCII, as they are in English, but the rest of my document is in Polish. So I do want You seem to think that if one uses UTF-8 in documents, one also has code blocks with UTF-8, which is actually not necessarily the case. |
@jwr I'm familiar neither Polish nor LaTex, but just trying to understand the issue - so please pardon me if I'm completely off. I used your example, After seeing a similar issue here foo.txt \lstset{literate={ą}{{\k{a}}}1 {ł}{{\l{}}}1 {ń}{{\'n}}1 {ę}{{\k{e}}}1 {ś}{{\'s}}1 {ż}{{\.z}}1 {ó}{{\'o}}1 {ź}{{\'z}}1 {Ą}{{\k{A}}}1 {Ł}{{\L{}}}1 {Ń}{{\'N}}1 {Ę}{{\k{E}}}1 {Ś}{{\'S}}1 {Ż}{{\.Z}}1 {Ó}{{\'O}}1 {Ź}{{\'Z}}1 }
`--images-directory [ścieżka]` Output with Would something similar be a viable solution for you? |
I don't ever use |
I don't think this discussion ever occurred, and I'm not going to make the change without it, so closing for now. |
Reopening, not for the unicode issue, but for the disappearing stuff issue. |
I concur that this modification would be useful as can be seen here: # Temp.md
Edit Configuration: `sudo nano /etc/default/grub` pandoc Temp.md -s -o Temp.tex
pandoc Temp.md -o Temp.pdf
pandoc Temp.md --listings -s -o TempListing.tex
pandoc Temp.md --listings -o TempListing.pdf |
@jgm Please support |
Anish Mittal <notifications@github.com> writes:
@jgm Please support `\texttt{...}` instead of `\lstinline` as no one in the `pandoc-discuss` objected.
I'm not sure your message was clear enough for people
to know what the proposal was.
Also, I would like to hear more about your
motivations. Is it because you have non-ascii
characters in your inline code spans, but not
in code blocks? As I point out above, this seems
quite an unusual case to optimize for.
|
I don't have a strong motivation. But we can observe (in the following) that in the # Temp.md
Edit Configuration: `sudo nano /etc/default/grub` pandoc Temp.md -o Temp.pdf
pandoc Temp.md --listings -o TempListing.pdf |
LaTeX listings doesn't use monospace fonts generally,
unless you tell it to. Why are you using --listings
in the first place? Just don't use it, and you'll
get a monospaced font.
|
So I decided to use a smaller font for codeblocks via Now as soon as I use |
When I convert Markdown to Tex or PDF, I'd like it to use |
When writing description lists in markdown such as this:
...and you use the latex (or pdf) writer backends with the
--listings
option, you'll get\lstlinline
within\item[...]
which doesn't work without additional workarounds (i.e. the part within\item[...]
disappears or sometimes appears in an entirely different place).Hence, I'd propose to use
\texttt{...}
instead of\lstinline
within\item[...]
even if the--listings
option is used.To reproduce the issue, use the document body from above and call pandoc like this:
This is with pandoc 1.10 (actually a build from git, that is a week or two old) and pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian).
The text was updated successfully, but these errors were encountered: