Skip to content
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

texinfo writer uses @textsuperscript instead of just @sup #4728

Closed
doronbehar opened this issue Jun 24, 2018 · 4 comments
Closed

texinfo writer uses @textsuperscript instead of just @sup #4728

doronbehar opened this issue Jun 24, 2018 · 4 comments

Comments

@doronbehar
Copy link

doronbehar commented Jun 24, 2018

Version:

pandoc 2.2.1
Compiled with pandoc-types 1.17.4.2, texmath 0.11, skylighting 0.7.0.2
Default user data directory: /home/doron/.pandoc
Copyright (C) 2006-2018 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

I've converted a mediawiki text from the Arch Linux WiKi into texinfo using pandoc inorder to run makeinfo on it. I recieved these errors from makeinfo:

2bwm.texinfo:20: unknown command `textsuperscript'
2bwm.texinfo:20: misplaced {
2bwm.texinfo:20: misplaced }
2bwm.texinfo:40: unknown command `textsuperscript'
2bwm.texinfo:40: misplaced {
2bwm.texinfo:40: misplaced }

While line 20 is:

@uref{https://aur.archlinux.org/packages/2bwm/,2bwm}@textsuperscript{AUR}

And line 40 is:

@uref{https://aur.archlinux.org/packages/9menu/,9menu}@textsuperscript{AUR}

I'm reporting this as a bug although it is compiled into pandoc like this by design. The official documentation for the texinfo format by GNU says that @sub and @sup are used supposed to be used: https://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Inserting-Subscripts-and-Superscripts

EDIT:

After reading a little bit about the texinfo format I understand that I should use the --standalone flag in order for the @textsuperscript macro to be defined. But still, an unwanted warning for the same line as above appears when running makeinfo:

out/2bwm.texinfo:55: warning: @iftex should only appear at the beginning of a line (possibly involving @textsuperscript)

I think we should just use @sup and @sub for this.

@link2xt
Copy link
Collaborator

link2xt commented Jun 24, 2018

Here is the macro, for reference:

@macro textsuperscript{text}
@iftex
@textsuperscript{\text\}
@end iftex
@ifnottex
^@{\text\@}
@end ifnottex
@end macro

I have not used texinfo before, can someone explain what this macro is doing? Why does it call itself recursively and what ^@ means? Also it does not work for me with texi2pdf, there is no superscript, the text is simply indented or something.

@link2xt link2xt self-assigned this Jun 24, 2018
@link2xt
Copy link
Collaborator

link2xt commented Jun 24, 2018

Guess it is not a recursive call but a LaTeX command. Anyway, going to change this to @sup and @sub.

@jgm
Copy link
Owner

jgm commented Jun 25, 2018

The texinfo writer and template are very old, and my memory doesn't help me here, but there must have been some reason that complex macro was used. Until we can reconstruct what that was, I'm a bit nervous about making this change.

Have you tested the new code with output to both tex and non-tex backends?

@jgm
Copy link
Owner

jgm commented Jun 25, 2018

OK, here's the answer -- I checked the texinfo changelog:

2014-12-02  Karl Berry  <karl@gnu.org>

	* doc/texinfo.tex (\sub, \sup, \mathopsup): new commands @sub and @sup.
	(\ptexsp, \ptexsup): save and restore in \tex.

The pandoc texinfo writer dates to 2008 or something. So that's why there were custom macros defined. I think this change is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants