Tag Info

Hot answers tagged

82

Although this question (and this answer) will stir up opinion, rather than fact, and so get teleported into Moderators' Oblivion, I'm going to have a crack, with a few ideas: TeX is very old. It was written when (a) there wasn't enough CPU power around, and (b) when all it basically had to do was produce something that was going to be printed. But now it ...


44

'complicated' - surely everyone can agree LaTeX deserves that adjective. No, I don't really agree. I think it is fairly simple to use and personally I have always found that a WYSIWYG style editing interface (on the few times I have tried to use one) is much harder to use and less intuitive. If you want to make a list in latex, you find a document ...


38

I think I can take a stab at this without being opinionated up to a point since I'm both a reasonably OKish TeX user (definitely not even close to TeXpertise) and I still think it is hard for anyone who is not actively participating in the development or answering with macro manipulations here or elsewhere. I might rephrase your question as, Why do we ...


34

pdfTeX is intended to offer complete compatibility with Knuth's TeX, and thus if the e-TeX extensions are not enabled should act in the same way. XeTeX is based on the e-TeX code and does not set out to break any compatibility with Knuth's TeX unless it is absolutely necessary (i.e. there is no reimplementation of algorithms unless this relates to adding ...


25

If conventional LaTeX -- more precisely, pdfLaTeX -- doesn't meet your needs, I have two suggestions for alternatives that may work better for you: If you're more of a user than a programmer and are mainly in need of a consistent interface to just about every package, consider using ConTeXt instead of pdfLaTeX. Its user interface is quite different from ...


25

You're looking at LaTeX from a programming point of view and claim, that compared to other programming languages it is hard to use. In this "answer" I'm going to formulate a general statement on the aforementioned claim, then I'm going to comment on the points you listed as an example. General First of all one has to accept that LaTeX was never intended ...


20

Here's my humble attempt to answering this question. Since David asked me in the chatroom whether my answer would include ducks, here's one for obvious reasons: :) Prologue I personally believe that complexity is in the eye of the beholder. I commented this somewhere in this site, but IMHO it's worth mentioning again: at the end of the day, complicated ...


17

To understand the design of the current LaTeX (LaTeX2e) and what might be regarded as design lessons for the future, we need to look at the components and history of La(TeX). Some of this is covered in either other answers here or other answers on the site, but it seems most natural to treat the relevant items in one place. I want to cover this background ...


13

In order to understand the complexities of programming TeX (I am using the word TeX to denote all its related engines and formats) we need to keep in mind that people have some thousand of years of accumulated tradition about how documents should be printed to satisfy esthetic and utilitarian criteria. With that much of history, there is a rich collection ...


12

I'm using TeX now for about two years, and I agree it's difficult. It is even more difficult to persuade others to start using it. On the other hand, I can't see any alternative giving me the same flexibility and possibility's as LaTeX. Being a very very experienced WORD and math type user for more then 20 years, after discovering LaTeX I never use those ...


12

It's important to distinguish between typesetting "engines", "formats", and "packages". The engine is the actual program. Nowadays, the most commonly used engines that are distributed with TeXlive and MiKTeX are pdfTeX, XeTeX, and LuaTeX. The "engines" make use of a number of so-called "primitive" instructions to accomplish the job of processing user ...


11

The macro \Section has an argument delimited by a space and a \par token, so it's supposed to be called like \Section Whatever title I want The text of the section following the title. Note the blank line after the end of the section title. The macro will store Whatever title I want (the actual title, of course) discarding the space produced by the end ...


11

This works, so long as the file has no empty line at the very end. \let\TeXend\end \def\blurb{} \everyeof{\blurb} \def\end{\futurelet\next\checkend} \def\checkend{% \ifx\next\blurb \csname TeXend\expandafter\endcsname \fi } This is the end \end This is the other end \end This is the last end \end But it's error prone and, in my opinion, useless. ...


11

TeX is designed to read input either from a file or from the command line: indeed, if you have a file that doesn't properly end a TeX run you'll get the prompt wait for more input. When you start TeX at the prompt without giving it a file name, you'll get something like This is TeX, Version 3.14159265 (TeX Live 2014/W32TeX) (preloaded format=tex) ** where ...


8

TeX is a typesetting engine which has a macro language available. This macro language is very different from other, more typical, languages. The TeX engine reads text, font metrics and does the typesetting. This means that it decides where the characters from the loaded font will be on the page. There are several extensions over classical TeX: pdfTeX, ...


8

^^5clet~^^5ccatcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdef PALLFPAXX71F7171P A33FilPA44Fe PA55Fg/PA667172F.7271PA99FaP A887172F7271P8hT4f348 si 9v939bl4fr8mo hXt8:pX /wXw6tc9n6 ro5pk5xXijbye


7

I can not judge whether TeX is difficult from a programmers point of view. I'm a user with a minor knowledge by far. But if you publish a software for typesetting scientific articles, there will be such users. My assumption why TeX is so hard to use for people like me: Because it has been designed without the faintest idea of such users. Which is quite ...


6

I will answer on the assumption that the input will be of the form \addintegers{1 + 2 + 3} i.e. consisting of a series of integers separated by + symbols and (potentially) whitespace. I'm also going to assume the solution does not need to be expandable, that we have only the TeX3 primitives available, and that we do not have to worry about 'big' values ...


4

You can be inspired by cyrchars.tex file from csplain package. \input cyrchars Normal text and текст на русском языке. {\it Normal text in italics and текст на русском языке}. {\bf Normal text in bold and текст на русском языке}. \end The cyrchars.tex macro uses encTeX for automatically font selection depending on the encoding. The pdfTeX is ...


4

While it is possible to define a macro looking for optional spaces, the primitive TeX syntax for finding a <number> carries out expansion and so it's not as easy as testing if the grabbed argument is a control sequence. Usually in these cases one uses a temporary register so that TeX is still parsing for a number (or dimen, skip, etc.) in the usual ...


3

You have to expand the row number as far as you can before adding it to the \tablines token list. Here's one way of achieving that: \documentclass{article} \newcounter{it} \newcounter{tot} \newtoks\tablines \newcommand{\addtomytablines}[1]{\tablines\expandafter{\the\tablines#1}} \setcounter{it}{2} \setcounter{tot}{7} \loop ...


3

Please give more complete examples, but using https://raw.githubusercontent.com/yihui/stat-sci-cranvas/master/imsart.cls https://raw.githubusercontent.com/yihui/stat-sci-cranvas/master/my_imsart.sty the following document \documentclass{imsart} \newcommand{\R}{\mathbb{R}} \begin{document} $\R $ \end{document} produces the error message ! Undefined ...


3

You shouldn't use \fontspec in the document body; it's better to have \newfontfamily. In order to avoid code duplication, it's also better to abstract the commands. \documentclass[a4paper,11pt]{article} \usepackage{fontspec} \newfontfamily\devfont[Script=Devanagari,Mapping=itrans-dvn]{Devanagari MT} ...


2

You can do this with two counters, one inside the \addtomytablines command, and one for the main loop. (I don't fully understand why.) I took the liberty of cleaning up your code and writing it in LaTeX. \documentclass{article} \newtoks\tablines \def\addtomytablines#1{\tablines\expandafter{\the\tablines#1}} \newcounter{row} \newcounter{loop} ...


1

Perhaps this can be tamed a bit. But the macro here checks its arguments to see whether they're control sequences and if they are branch one direction and if they aren't branch another. The key is the macro \@ifismacro provided by @egreg to a previous answer noted below: \documentclass{article} \makeatletter %% see: ...


1

Example example.tex: This \end is \end the \end Compile with: pdftex -jobname example "\let\TeXend\end\let\end\relax \input example \TeXend" But I don't really see why would you want that.


1

Thanks for the answers. I solved this with numeral conditions. \newcount\ends \newcount\lastends \ends=0 \lastends=3 \def\myend{\advance\ends by 1 \ifnum\ends=\lastends \end \else \fi} ABC \myend DEF \myend GHI \myend JKL \myend MNO \myend PQR \myend STU \myend \bye By giving a value to \lastends, the document is compiled at the point, \ends reaches the ...



Only top voted, non community-wiki answers of a minimum length are eligible