0

I am trying to set up my markdown editor to export pdf similar to the style used in American Mathematics Society, just to make day to day writings look more formal, not for serious journal work. I am using a css snippet to set the format close to latex. But could never get it to look quiet right.

In the styleguide for AMS, they indicate the spacing are done automatically by LaTex:

Be aware that spacing between words is created automatically by LATEX

Does anyone know what is the default letter spacing, word spacing, and line spacing used? And if similar format can be acchived by a css snippet?
This is the css snippet I'm currently using:

.markdown-preview-view,
.markdown-source-view {
    font-family: 'Latin Modern Roman', 'lmroman12-regular', serif;
    font-size: 10pt; /* This matches the common body text size used in AMS documents */
    line-height: 1;
    letter-spacing: -0.05em;
    word-spacing: -0.05em;
    max-width: 900px; /* Approximate width for AMS content blocks, adjust as needed */
    margin: auto;
    text-align: justify; /* AMS documents often have justified text */
}
Danny Wen
  • 13
  • 3
  • 2
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 15 '24 at 16:16
  • 5
    There is no simple answer. TeX stretches and shrinks spaces to make things look good. For example, with the default font for the article document class (cmr10), the interword spacing is 3.33pt plus 1.67pt minus 1.11pt (meaning it can be as large as 5pt or as small as 2.22pt). Changing the document class, options or packages loaded may affect this, and it becomes much more complicated if microtype is loaded. – Ian Thompson Feb 15 '24 at 16:34
  • 1
    The above comment by @IanThompson is correct. To put it another way, what the Journal is telling you, is that you have almost no control over the spacing, because TeX will automatically do things. It is what TeX does! Although there are methods for telling TeX what you want, they are not simple settings, they are more like program commands. – rallg Feb 15 '24 at 16:55
  • @IanThompson So if I'm understanding this correctly, the word spacing is not uniform even within the same document class? – Danny Wen Feb 15 '24 at 22:09
  • @DannyWen: Correct. TeX collects the letters and their associated kerning into a paragraph, which is then broken in lines, each possibly having different inter-word spacing to fill the line as best possible. Then there's consideration for other stretchable/shrinkable space on a page as paragraphs and sectional units are turned into a page. – Werner Feb 16 '24 at 00:13
  • If you are using a monospaced font (possible) and if you do not over-ride what TeX does in that case, then the word spacing is the size of the space in that font (which is the size of any letter). Now, in the case of non-monospace, you can control "how much" TeX is allowed to tweak spacing. But forcing a uniform, exact space (presumably the font space) defeats the purpose of TeX. This is related to monospace (but not identical). Bottom line: The "default" spacing is built into the font you use. But TeX will tweak that spacing as it sees fit. Default line spacing depends on page layout. – rallg Feb 16 '24 at 02:15
  • 1
    @DannyWen: For reference, see this post on how things can change because of stretch/shrink, and that this can be adjusted/set by a class/package: How to shorten/shrink spaces between words? – Werner Feb 16 '24 at 02:16

1 Answers1

0

Someone downvoted, I upvoted, because the question is reasonable for a new user.

Analogy: Think of HTML with CSS. Ultimately, the presentation of a web page is determined by the browser, and by the device on which it is viewed. You can code the HTML tags all you wish; you can use CSS to its maximum capability; you can specify web fonts instead of system fonts; you can use script to fork the code depending on browser. Even with all of that, presentation is ultimately controlled at the receiving end. The best you can do is create a page that "in most cases, will look just about the same" when the page is viewed.

It is the same with any markdown language. If the recipient does not have a program that reads that exact version of markdown, it will look wrong. Yes, there are different versions of markdown.

It is somewhat the same with TeX. When you write a document with TeX code, there are several ways it could be processed. Even if you control exactly which way it is processed (you can do that), TeX decides what goes where in final layout. So if you want particular line breaks in paragraphs, you must do a mighty amount of manual editing to get it. It you want things to appear on particular pages, you must do a mighty amount of manual editing to get it. Even then, you cannot prevent the end user from manipulating your code, to get a different result. And even a PDF may appear different in different PDF readers (especially with vector graphics) if there is something odd about the graphics.

Bottom line: Unless you have a substantial amount of TeX knowledge, let them do it, and don't worry about it. Many journals provide TeX templates for that purpose.

rallg
  • 2,379