Document Classesachemso math environment problem

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
lbrogan
Posts: 4
Joined: Thu Jan 21, 2010 11:20 pm

achemso math environment problem

Post by lbrogan »

I am trying to format a paper using achemso.cls and found a fairly bizarre error. The compiled .dvi does not display numerals or the "-" sign while in the math environment, both in line using $..$ and using /equation and the like. These are the only characters I've tried that are affected - letters, +, =, and commands display fine. I can get numerals and "-" to display using \textrf, but I would rather not have to put in that command every time I need to write negative signs in an equation. Since I just learned LaTeX yesterday, I have a very fresh install of both the Ubuntu Tex Live package and the achemso files, but not the deepest understanding of how to use them. I think it's some kind of install or package issue, but LaTeX throws no errors when compiling, and inclusion of other math related packages doesn't seem to help. When I compile the same code with article.cls there are a few errors due to unrecognized commands (/acknowledgements and such) but the numerals and - signs display properly in the math environment. Has anyone else seen this problem or know how I might go about fixing it?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: achemso math environment problem

Post by josephwright »

Post an example here of what you are doing. As shown in the demo file for the achemso class, standard math(s) does work just fine. Also consider posting your log, so we can see what is going on.
Joseph Wright
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

achemso math environment problem

Post by localghost »

Sounds to me not like a specific problem of the achemso class. Build a minimal working example (MWE) and attach the source code, log file and final output to your next post. You can put all the files into a RAR or ZIP archive.


Best regards and welcome to the board
Thorsten¹
lbrogan
Posts: 4
Joined: Thu Jan 21, 2010 11:20 pm

Re: achemso math environment problem

Post by lbrogan »

Thanks for the interest, everyone!

Here's an example. Example1 is compiled using achemso.cls, example2 is using article.cls.

Incidentally, when I compile the demo file it has the same problem, which is why I believe this is a problem with my install - I just don't know what to do about it.
Attachments
Latex.zip
I included all output files and both input .tex
(7.04 KiB) Downloaded 132 times
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

achemso math environment problem

Post by josephwright »

There is nothing wrong with the output in either of your examples, and there are also no unexpected warning in the log. I looks to me as if you expect the wrong outcome. Traditional typography uses different symbols for a hyphen and a minus sign: the later is longer and thinner. TeX knows that, so in mathematical content uses a proper minus symbol where you type a hyphen (keyboards tend not to have immediate access to the appropriate symbol). I'd also point out that your superscript 2 is the wrong size when you do

Code: Select all

\begin{equation}
a^{\textrm{2}} + b \textrm{ - 18 = 0}
\end{equation}
Again, TeX is resizing in:

Code: Select all

\begin{equation}
a^2 + b - 18 = 0
\end{equation}
as super- and subscripts are normally smaller than text on the line. Take a look at a published journal article and pay real attention to the appearance of the equations.

I think you are looking at what people type into a word processor and expecting TeX to do the same. It does not, and those in the know also make the same changes when using a word processor (I certainly do). The tools have different aims: TeX is a typesetting engine, and is intended for getting it right.
Joseph Wright
lbrogan
Posts: 4
Joined: Thu Jan 21, 2010 11:20 pm

Re: achemso math environment problem

Post by lbrogan »

It sounds as though you might not be seeing the problem I'm having - it is not the one you just described.

In the example.div I posted, when I view the first line of the file, it reads

a +b =c

There are no numerals displayed at all, regardless of size or typesetting. The only way I could get them to display was by exiting the math environment using \textrm. Could this be a problem with my install of evince, perhaps? Do you happen to know what font is used for numerals in the math environment for achemso or where I could find out? It might not be installed on my machine.
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

achemso math environment problem

Post by josephwright »

Okay, I think the issue is your font installation. Can you try a simple file such as

Code: Select all

\documentclass{article}
\usepackage{mathptmx}
\begin{document}
$a^2 - b = c$
\end{document}
achemso uses the Times font via the mathptmx package. I wonder if your system has bad font maps, which would not show up for me as the DVI viewer on my system will find the fonts when requested. Can you try converting the DVI to PDF and posting the log files for that process?
Joseph Wright
lbrogan
Posts: 4
Joined: Thu Jan 21, 2010 11:20 pm

Re: achemso math environment problem

Post by lbrogan »

Thanks for the help - it's definitely a font issue. Your suggested file displays the same problem that achemso does. Using pdflatex produces the correct output. The log file from running pdflatex on my example.tex shows some font shape replacement for unavailable shapes, but that's as much as I can get out of it. Open Office also does not have Times available, though I don't know if that's indicative of anything. I tried reinstalling the texlive recommended fonts package and refreshing the font cache, but that didn't help. Do you happen to know how I can figure out where my LaTeX install is looking for its fonts?
Attachments
example.log
(15.17 KiB) Downloaded 253 times
Post Reply