Invalid LaTeX format for arcsec2
See original GitHub issueastropy version 3.1.2
print (astropy.units.Unit("arcsec2").to_string("latex"))
$\mathrm{{}^{\prime\prime}^{2}}$
This is invalid LaTeX because the same base string carries two exponents. The problem arises because the LaTeX string for arcsec uses an exponent to raise the primes above the baseline.
A quick fix would be to always enclose the LaTeX string for arcsec in curly braces, but the resulting layout is not so nice (the primes and the exponent are on the same level). The better fix would be to include the LaTeX string for arcsec in regular parentheses if and only if it carries an exponent.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
siunitx arcsecond invalid arcformat - LaTeX Stack Exchange
I found a solution... I guess the \arc{}. command needs a final placeholder to know where it is in the sequence of degrees,...
Read more >Errors - Overleaf, Online LaTeX Editor
An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.
Read more >pandoc - exams2pandoc error message - invalid template
The default template is a LaTeX file plain.tex : ... And then you can call exams2pandoc(..., template = "myplain.tex") .
Read more >Latex Instructions - Elsevier
You can download a set of files containing a template LaTeX manuscript, using the elsarticle class, plus associated BibTeX style files here. Although...
Read more >TAPS Workflow - Association for Computing Machinery
incorrect template used - You need to use the proper Word templates. The "interim" template is not compatible with TAPS. document not validated...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, I think with an exponent we should indeed not use the primes at all, but rather just
$\mathrm{arcsec}^{2}$
. Arguably this should happen in composite units as well (say,pix/arcsec
). A change is not entirely trivial - the actual formatting is done inLatex.to_string
inunits/format/latex.py
.Note that there is already a special treatment for
arcsec
insi.py
, in that only the un-prefixed unit is shown using primes. The same should also be done forarcmin
anddeg
. Right now:(And the same for unicode output)
Possibly the simplest would be for the format dict to
def_unit
to include an extralatex_simple
(or so) entry with the value that gets used when the unit is shown on its own.fixed by #9218