I want to parse markdown emphasis automatically in XeLaTeX. This basically means converting asterisks either side of a word into the \emph{word} that LaTeX uses. I know that more complex Markdown parsing is impossible, but this seems quite simple. Unfortunately, I don't know how to go about replacing something that is not a command.
38478
I understand that \bf and \it are now obsolete in LaTeX and that \textbf and \textit are proper, as they produce more sophisticated (in particular, cumulative and properly kerned) changes to font style. I have read the  and I understand the rules and their reasons, as well as the several other commands that are affected.  However, I find it convenient to use LaTeX for notetaking during lectures, and in that rushed environment, shortening a command by any number of keystrokes helps keep me from falling behind. \bf and its two-letter kin are still very useful to me for that reason, and once a presentation is finished I can go through and replace all appearances of \bf et al. with \textbf et al.  My question is this: is there a plan eventually to replace the short font style commands like \bf with the implementations of \textbf etc. some day, or should I expect \bf always to remain in existence but obsolete, for reasons of backward compatibility with original TeX? Original TeX has been greatly improved on in countless ways, but in the heat of transcription I sometimes miss its conciseness.
118769
I am looking for a LaTeX package that does syntax highlighting on code. For example, right now I use the verbatim block to write code:  \begin{verbatim}     &lt;html&gt;        &lt;head&gt;            &lt;title&gt;Hello&lt;/title&gt;        &lt;/head&gt;        &lt;body&gt;Hello&lt;/body&gt;     &lt;/html&gt; \end{verbatim}   And this works fine to display the code on my document. But, suppose I wanted to highlight the HTML markup the way an IDE would in the output document? Is there a package that could help?  I would like to do the same for various languages such as Java, C#, HTML, CSS and so on.
122070
I am a XeLaTeX user and I often have to typeset english-greek documents. Packages like xgreek or polyglossia are great but in order to apply the correct hyphenation rules you have to declare the text that belongs to the secondary language. On the long run, this can become cumbersome.  In XeLaTeX I am using the XeTeXinterchartoks mechanism  that allows me to change automatically the hyphenation rules and/or the font without explicitingly declaring them. The  involves grouping together the glyphs of a Unicode Block and then automatically applying tex commands when transitioning from a group to another one.  For those not familiar with the XeTeXinterchartoks, more info can be found at  pages 13-14.  Lately I got interested in Lua(La)Tex. I want to know if there is a way to achieve similar results in LuaTex. As was pointed in a previous question,  but it was suggested that there are other, more powerful ways to achieve the same goal.  So the questions are   How can I change the hyphenation rules/font automatically according to the glyphs used without declaring them?  Can someone provide a minimum working example or at least point me to some references? One of the drawbacks of XeTeXinterchartoks is that the settings are global. Is there a way in LuaTeX to set this feature (if it exists) on and off, thus providing more flexibility?
36992
Is it possible to automatically "add" \left and \right commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding \left and \right commands is time consuming and makes source code longer and less readable. I considered defining new commands such as \lb and \rb for \left( and \right), but it doesn't seem very elegant to me: what if I also want to add square brackets for example?  Any ideas? Thanks.
7611
I've used LaTeX a lot in the past, but now, when comparing with StackExchange's great , I find it tedious, for short documents (&lt; 2 pages), to have to use pure LaTeX. For a short document, instead of having 30 lines as introduction: \begin{document} \documentclass[11pt,a4paper]{article} \usepackage[frenchb]{babel} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts}  + &lt;lots of other things&gt; ...  I'd like to write my short document with MarkDown + Math, like on . Question: Is there an offline compiler such that compilemarkdown exercice.tex  would produce a PDF from this: #Title  Here is a *short document* including Markdown and Math, here is the equation:  $$f(x)=x^2$$  ___  Proof: ...   This is **bold**.
83428
Basically, how does the ^^^... notation work in LuaTeX and XeTeX, exactly?  In 8-bit TeX engines (recent TeX, eTeX, pdfTeX, at least), two consecutive identical catcode 7 characters (typically ^), followed by two lowercase hexadecimal digits, are converted before the tokenization step to the corresponding byte.  Namely, ^^6f is exactly equivalent to o: for instance, \sh^^6fw ^^6f will cause TeX to show the letter o.  There is also the notation with two ^ (identical catcode 7 characters), followed by any ascii character (but not two lowercase hexadecimal digits), which is replaced by the character obtained by either subtracting or adding 64 to the character code, remaining among ASCII characters (range 0 to 128).  Unicode-aware engines (I'm thinking of LuaTeX and XeTeX, there are perhaps other less known ones around) also provide ^^^^xxxx and ^^^^^xxxxx for characters whose hexadecimal representation has 4, or 5 digits.  But this does not seem to be done in the same way across engines.  For instance, both LuaTeX and XeTeX appear to accept the notation with 4, 5, or 6 carets followed by the same number of hexadecimal digits, but XeTeX also accepts it for 3, while LuaTeX doesn't. Compiling the following with pdfTeX, LuaTeX, and XeTeX gives different results.  \catcode0=12 \newlinechar=10 \def\loopshow#1{\message{\meaning #1^^J}\loopshow} \loopshow \/   ^^56   ^^^056   ^^^^0056   ^^^^^00056   ^^^^^^000056   ^^^^^^^0000056 {\end\iffalse} \fi} \bye   One weird fact about XeTeX (a bug?) is that  \show ^^^^^^010101   shows the character displaywidth.  My goal (there may be a better way to do this) is to provide a way to test whether passing a given list of tokens through \scantokens is safe.  For that, my plan is to go through the \detokenized token list one character at a time, applying TeX's rule for tokenizing (but no need to fully tokenize), and detecting begin-group and end-group tokens, as well as invalid characters.
47574
I often find myself adding a lot of \textsl{} around inside \emph{} or \textit{} blocks because I find italicized digits to look too "showoffy" and "baroque" and to hinder legibility (I'm using $$ when the number has a mathematical sense, but this situation occurs in less technical texts like CVs, and such.).  Could someone help me write a renewcommand to automate this, or better, a single low level command that makes \emph, \itshape, \textit and friends choose slanted over italic for numbers? I'm not too familiar with the low level latex font selection system nor with a way to detect digits from regular letters.  Edit: MWE of what I need and what I want to avoid  \documentclass{article} \begin{document} He thought: '\emph{Why 1234567890 apples?}' then he realized '\emph{ah yes, he has \textsl{1234567890} childs}' \end{document}   gives:   I find the italicized version (first one) of 2,3,4 and 7 to look especially bad.
67873
I wanted to know how is the \LaTeXe symbol () made, I mean, the command definition of superscripts and subscripts on the "L", "A"... letters.
37136
We've come to rename Markdown to Letdown in the  because it lets you down so often. I've now just found a pattern. It seems markdown . That is, this  Letdown can't cope with multi-line comments. Let's see code?  fails to display code marked as code, while this works  But code works.  Now, I think it would be Ok if you said chat messages shouldn't be multi-line. (Although I'd be a bit annoyed, because I like them.) But if so, please don't render them as multi-line (as is the case with comments), so we aren't tempted to use them.
16260
Is there an editor or IDE (or a script) for substituting the TeX-Commands $ and $$ for opening and closing math regions into the corresponding LaTeX-Commands \(,\) and \[,\]? I'm sure there is a tool - and I'm searching for. I think, this will result in better readable code. A simple search and replace wont do that - but with regular expressions, that should not be problem. I simply do not want to invent the wheel a second time.
14210
I'm trying to make latexmk works with XeLaTeX and biber for my thesis. The document will have many cross references. What settings do I need to ensure it works correctly? My current settings for latexmk are below.  -e  $pdflatex=q/pdflatex -synctex=1 %O %S/ -pdf $fullname
107874
After a recent update of MikTeX (and TeX Live!) on my computers (right after my vacation :)) I am not able to compile my book. The book is big and complex, uses many \if \else \fi constructions in the preamble, uses my own custom macros and environments some of which ceased to work properly. Here is one of the troubles identified so far.  The following minimal text is not compiled by XeTeX both in MkTeX and TeX Live.  \documentclass{article}  % Load fontspec and define a document font: \usepackage{fontspec} \setmainfont{TeX Gyre Pagella}  % Load unicode-math and define a math font: \usepackage{unicode-math} \setmathfont{texgyrepagella-math.otf}  \begin{document}    \providecommand{\tensor}[1]{\overleftrightarrow{{\mathbf{#1}}}}%    \begin{equation}   \tensor{\pi}   \end{equation}  \end{document}   Compilation aborts with 0 pages of output after issuing the message:  ! Internal error: fad native font flag in `map_char_to_glyph'   I am absolutely sure that 3 months ago the above example would be succesfully compiled.   What's wrong now? Should I change the above definition of the \tensor macro?   Here is complete defintion of the \tensor macro in my own package.   %\makeatletter \@ifpackageloraded{unicode-math}{%   \providecommand{\tensor}[1]{\overleftrightarrow{{\mathbf{#1}}}}%   \PackageInfo{handy}{\string\tensor\space has been declared using ^^J\space\space \string\overleftrightarrow\space from unicode-math package}% }{%   \@ifpackageloaded{accents}{%     \providecommand{\tensor}[1]{\accentset{\leftrightarrow}{{\mathbf{#1}}}}%     \PackageInfo{handy}{\string\tensor\space has been declared using ^^J\space\space \string\accentset\space from in accents package}%   }{%     \@ifpackageloaded{revsymb4-1}{%       \PackageWarningNoLine{handy2}{\string\tensor\space has been taken from revsymb4-1 package.^^J You are recommended to load `accents' package before me}%     }{     \@ifpackageloaded{revsymb}{%         \PackageWarningNoLine{handy2}{\string\tensor\space has been taken from revsymb package.^^J You are recommended to load `accents' package before me}%       }{%         \ifx\undefined\overset         \else           \providecommand{\tensor}[1]{\overset{\leftrightarrow}{\vec{#1}}}           \PackageWarningNoLine{handy2}{\string\tensor\space has been declared using ^^J\space\space \string\overset\space from amsmath package.^^J You are recommended to load `accents' package before me}%         \fi       }%     }%   }% }% %\makeatother   It uses 4 alternatives depending on what package is loaded. The most preferable alternative goes first and it assumes that unicode-math package is available.
40765
In LaTeX, if I use \verb, how can I escape |? For example, I want to display ab|bc: \verb|ab[]bc|. What should replace []?
102921
In the spirit of a free-form Friday on StackOverflow, I'd like to know if I should consider learning ConTeXt.  What got me into LaTeX way back in 1994 was having structural markup that made longer documents easier to write.  What got me into XeTeX was being able to use my Mac's fonts just like I could in a word processor.  What makes ConTeXt users passionate about it or at least willing to forsake LaTeX?  Edit: Thanks for all the answers and great discussion in the comments.  The whole page deserves a green check.  Success! I am now interested in ConTeXt.
1327
I can't find where I can remove any kind of hyphenation and just have LaTeX just do a line break.  edit: Honestly speaking I just don't like to read hyphenation anywhere and that's the only reason why I wanted to remove it. It is a matter of style, probably unexpected in LaTeX.  The document has only a summary in a different language and I used the language packages to hyphenate properly.
63754
It would be nice to be able to put emphasis on specific bits of a fragment or of a quote (bold can help for a quote but I find that it makes things less readable sometimes). What do you think? Update: On , you can highlight particular lines by prefixing each line with @@. See also:
32826
Are there compelling reasons to stick with \newcommand or should one always use \NewDocumentCommand instead, even when not using any of the additional features offered by xparse?  In addition and more specifically,   If I already require xparse to define one of the macros of my document/package/class, is it a good idea to use \NewDocumentCommand for all my other macro definitions? Will \newcommand eventually get deprecated/discouraged in favor of \NewDocumentCommand with LaTeX3?