-
-
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
Babel's shorthand
option makes some characters to be skipped
#6817
Comments
Figure placement is done by LaTeX -- I'm not sure there's anything we can do about that in pandoc.
See the manual for information about how relative column widths are computed from the markdown source. (It depends which kind of markdown table you are using, but this is all documented. Looks like you have a pipe table, so you can adjust these widths by changing the widths of the lines under the headers.)
I don't know why this is happening, but it seems to be something LaTeX is doing. Pandoc is just passing through the math verbatim. I'd ask about this on a LaTeX forum, using a simple pure tex example. |
I see, the problem seems to be the default latex template. I'll try to modify that to suit my use. I found the comma problem. From the default latex template:
The decimal is not rending due to (Neither with Seems when dot
You had a typo on the comment btw! ;) |
For the figure float, I figure out the problem. In the default template the figure float has been defined as |
Thanks for this -- I'll reopen so we can consider possible changes to the default latex template.
I'm not sure that I understand yet the implications of either. What exactly is a "shorthand," anyway? And what would be the effect of |
Although I'm not a latex professional, as far as I understood, in short:
With more detail,
In case of the babel package, the shorthand seems to be used for localization in order to minimize the changes in the tex file. Spanish and Galician packages redefine (If there's no need to remove the shorthands defined by babel, I'll remove that part from the code.)
Anyway, the EDIT: In order to have |
I'm really confused about this. My understanding is that I like the idea of adding
and changing the |
According to this, even with It's considered to be a babel bug in the community: latex3/babel/issues/38. However, as the Galician babel had the same problem when I tested it before, my best guess is that it was done by purpose and not a bug. Although passing the
after the babel package would disable all the shorthands while the decimal separator is rendered correctly in both Spanish and Galician ( |
Another thing, related to the default template. The default template's page number in the title page is always centered. The page position only takes effect beyond the second page. Although for myself I disabled the page numbering for the title page, making it starts to display and count after the table of contents, considering that there are people who start the document immediately after the title, my style won't suit them. As result, it might be a good idea to add something like this before
So the page number position is always defined by the user in the header files. |
The post you linked to recommends simply using the As for the first page number, why don't you open a separate issue for that? |
Redefining command achieves the expected behavior for all languages.
On my way |
I'm hesitant to add this kind of low-level workaround to the default template, if it's really a bug in babel. Maybe it's the thing to do, though. Query: are you sure this is caused by babel and not by the additional content pandoc inserts in the template slot $ defField "babel-newcommands" (vcat $
map (\(poly, babel) -> literal $
-- \textspanish and \textgalician are already used by babel
-- save them as \oritext... and let babel use that
if poly `elem` ["spanish", "galician"]
then "\\let\\oritext" <> poly <> "\\text" <> poly <> "\n" <>
"\\AddBabelHook{" <> poly <> "}{beforeextras}" <>
"{\\renewcommand{\\text" <> poly <> "}{\\oritext"
<> poly <> "}}\n" <>
"\\AddBabelHook{" <> poly <> "}{afterextras}" <>
"{\\renewcommand{\\text" <> poly <> "}[2][]{\\foreignlanguage{"
<> poly <> "}{##2}}}"
else (if poly == "latin" -- see #4161
then "\\providecommand{\\textlatin}{}\n\\renewcommand"
else "\\newcommand") <> "{\\text" <> poly <>
"}[2][]{\\foreignlanguage{" <> babel <> "}{#2}}\n" <>
"\\newenvironment{" <> poly <>
"}[2][]{\\begin{otherlanguage}{" <>
babel <> "}}{\\end{otherlanguage}}" This affects precisely spanish and galician -- might it be interfering with babel's shorthands=off setting somehow? Looks like it was added by @mb21 in 9328f4c? |
Oddly, I don't see this code appearing in latex results, with either pdflatex or xelatex as the pdf-engine. [EDIT: it appears that's because the list to which this Reminder to self: as noted above, the |
It looks as if this code is designed to avoid a conflict between babel and polyglossia, but the conflict shouldn't arise, since we use one or the other, right? |
Pretty sure, I have tried with a blank tex file where only babel is included. |
@mb21 did you see the query above? I'm wondering if we should remove some of this code. |
Thanks for the ping, didn't see it before... so the reasoning/discussion for:
is #895 (comment) (and subsequent comments). Yes, the
|
I don't think so. |
Ah, I misread the comments I linked to. From #895 (comment)
And the 2017 version I've installed has it as well in:
And seems even the newest version has them:
So it seems we need to keep that hack for the moment... if we have a problem with those lines.. we could ask the the person who gave me that tip over at https://tex.stackexchange.com/questions/273512/renewcommand-textspanish ? |
shorthand
option makes some characters to be skipped
Apparently this bug has now been fixed in babel. After a suitable delay, I'd like to remove the hackish code we currently include in the template to disable shorthands. |
When setting
lang:es
in the header, the.
decimal separator is not rendered at all (it's supposed to be transformed to a comma). French still renders the decimal separator though.pandoc version:
pandoc.exe 2.11.1
Compiled with pandoc-types 1.22, texmath 0.12.0.3, skylighting 0.10.0.3,
citeproc 0.1.0.3, ipynb 0.1
The text was updated successfully, but these errors were encountered: