# Tag Info

2

It is because you can not split a square root. One way of resolve the problem is to use ()^{1/m} instead of \sqrt[m]{}: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{split} d_{m}^{\phi}\left(A,f\right) = \left( \mid A\left(pi\right) - f\left(pi\right)\mid^{4} + \sum_{i=1;i\neq pi}^{length\left(R\right)} \mid ...

11

Actually my first answer was a little unfair. The behaviour of the xetex whatsit in vertical mode is very strange. Put it in hmode and it is far more reasonable. \tracingall \line{% \vtop{\hsize=.6\hsize Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tempor lectus sit amet laoreet convallis. Quisque at est lacinia, porttitor justo ...

3

Using array package would enable you to simplify the markup a bit, nut you can do \begin{tabular}{|p{3cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|} \hline \centering {image} & \multicolumn{2}{c|}{ABC} & \multicolumn{2}{c|}{DEF} \tabularnewline \hline & \centering A&\centering B&\centering C&\centering D \tabularnewline \hline ...

5

Don't use the PlainTeX \centerline macro in a LaTeX document. If the contents of every single column should be typeset centered, it's better to define column types that do so automatically, without the user having to type lots and lots of \centering instructions. This idea is implemented in the example below. By the way, the user guide of the array package ...

2

If you are using \multicolumn, why not to use it for centering? And no \centerline's! They mean centered lines, so using them inside a tabular is strange. A version without additional packages: \documentclass{article} \begin{document} \begin{tabular}{|p{3cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|} \hline %\centerline {image} \centering {image} & ...

2

Here's an implementation with l3regex; the number is stored in \l_linuxss_code_int for later usage. One can extend the testing by acting on the search regular expression; this one catches the letter or the character. \documentclass{article} \usepackage{xparse,l3regex} \ExplSyntaxOn \NewDocumentCommand{\getlettercode}{m} { \linuxss_getlettercode:N #1 ...

4

\Char is not expanded because it is not an expandable token. Unlike \def\Char{a} which expands to a \let defines a token that essentially is a and like a it does not expand. The only way to get hold of this in classic TeX is to take \meaning\Char which will be the letter a split that up on spaces, and if the first two words are the letter take the ...

3

One could define a macro called, say, \supsub, that takes two arguments -- the repeated material that goes in the superscripts and subscripts, resp. One or the other argument or even both arguments may be empty. \documentclass{article} % exploit the fact that \null is defined as '{}' \newcommand{\supsub}[2]{ a \if#1\null\else^{#1}\fi ...

3

How's this? \documentclass[12pt]{article} \usepackage{ifthen} \newcommand{\exponent}[2] {% \ifthenelse{\equal{#1}{^}}% {a^{#2}b^{#2}c^{#2}}% {\ifthenelse{\equal{#1}{_}}% {a_{#2}b_{#2}c_{#2}}% {\message{## Warning: exponent command misused ##}#1#2}% }} \begin{document} Here is the exponent command: ...

10

As already mentioned in comments, the nag package does its best to pick up not only use of TeX rather than LaTeX syntax but also deprecated LaTeX stuff. That is the best you can do with LaTeX2e because of the way the kernel itself and packages are written: they use TeX constructs without 'LaTeX wrappers'. One of the aims of the LaTeX3 Project is to develop ...

-2

I will try to answer the question "is there a way to make the LaTeX compiler and TexStudio (Or another editor) not use the TeX commands in order to preserve proper typesetting?" To stop $from working, you can insert, just before \begin{document}: \catcode`\$=11 (I tested this on my current draft[1], which still compiles normally to its 14 pages). This ...

8

Where did you "learn" that using $as a switch to initiate and terminate inline math mode is incorrect for LaTeX users? I'd go even further than @egreg does in his comment and state that not only is using$ to start and end inline math mode not wrong, it has certain advantages over $$and$$. Consider the following MWE: \documentclass{article} ...

10

The respective TeX code is @<Compute the hash code |h|@>= h:=buffer[j]; for k:=j+1 to j+l-1 do begin h:=h+h+buffer[k]; while h>=hash_prime do h:=h-hash_prime; end So basically each digit gets mapped to some 2^k mod p. Prefixes and postfixes don't actually make the hashing worse, but the somewhat peculiar structure of the hash table means ...

16

\empty is defined in the LaTeX kernel by % latex.ltx, line 122: \def\@empty{} % latex.ltx, line 441: \let\empty\@empty Actually the kernel macro is \@empty, but \empty is equivalent and is in the kernel for backward compatibility, because Plain TeX uses \empty. When you expand \empty you get nothing at all, so \empty{word} is just equivalent to typing ...

12

\newline is not defined in Plain TeX. There are also other problems in your code: you set \leftskip and \rightskip but close the group before it can act. \input plipsum % for mock text \def\thm[#1]{% \par % get in vertical mode \begingroup % open a group \leftskip 1in \rightskip 1in % set the margins \noindent {\bf Theorem.} {\it #1}\par\nobreak % ...

4

You can also use \indent\llap{x}Hello

13

\llap is not a LaTeX box command and does not start a paragraph. \documentclass{article} \begin{document} \parindent=2cm \makebox[0pt][r]{x}Hello H\makebox[0pt][r]{x}ello \end{document}

2

Nailed it: \setupheadertexts[Page \currentpage\ of \lastpage] and/or \setupfootertexts[Page \currentpage\ of \lastpage] The simplicity of ConTeXt rocks again.

4

\show uses the same internal routines that TeX employs for error messages. Judging now this may seem a design error, but one always has to keep in mind that TeX was released in 1982, when computer memory was quite scarcer than it is today. A front-end like Texmaker could, in principle, distinguish between diagnostic messages given by \show (or \showthe) and ...

2

I don't exactly know what the longtable macros do. I am guessing what you want, and here is one alternative. \startsetups table:align \setupTABLE[column][1][width=3cm, align=flushright] \setupTABLE[column][2][width=broad, align=middle] \setupTABLE[column][3][width=2cm, align=flushleft] \stopsetups \starttext \startTABLE[setups={table:align}] \NC ...

6

The definition of \newcounter is \expandafter\@ifdefinable\csname c@#1\endcsname{\@definecounter{#1}} \@ifnextchar[{\@newctr{#1}}{} where \@definecounter is \expandafter\newcount\csname c@#1\endcsname \setcounter{#1}\z@ \global\expandafter\let\csname cl@#1\endcsname\@empty \addtoreset{#1}{@ckpt} \global\expandafter\let\csname p@#1\endcsname\@empty ...

13

Basically \noalign (which is a TeX primitive and not a supported LaTeX command) has to come as the first thing in a table row and its argument is evaluated as vertical mode material that is placed between rather than in the table rows. So \vspace just inserts vertical space. (If the table had vertical rules from | they would be broken by this additional ...

3

Indeed, it is not possible without changing something. I don't know if the following is practical in your case: \long\def\a #1\par\a {[#1]} \def\b #1\par{(#1)} \a\b five\par\par\a \bye The preceding way allows to pin-point the \par to be dealt with by \a. But, if you are always certain that \a will be followed by two \par's, then there is \def\a ...

4

The following should work for your example: \def\a{\expandafter\@a} \def\@a#1\par{[#1]} It should be clear that a lot of things can go wrong trying to generalise this. But to judge that we'd need to know what you're trying to achieve.

1

Your TeX system can be configured to always embed the standard 14 PDF fonts into PDFs by issuing updmap-sys --setoption pdftexDownloadBase14 true (for pdftex) and to always embed the standard 35 PostScript fonts by issuing updmap-sys --setoption dvipsDownloadBase35 true (for dvips).

Top 50 recent answers are included