Tag Info

Hot answers tagged

12

Markdown with pandoc extensions Advantages: Markdown is commonly used in many places, including all stackexchange sites and README files on github. Once you get the hang of it, Markdown is easy to use. Markdown has very little (almost none) configuration options. This means that when you are writing notes, you will not be distracted with presentation ...


12

You are on the right track with catcode changes. The key is to save the old definition of . with another name before applying the change. The standard approach would look something like \documentclass{article} \begingroup \catcode`\.=\active \gdef.{\normalperiod\formattingcommand}% \endgroup \newcommand{\formattingcommand}{DEMO} ...


8

You convert the em dash by using three dashes in a row in the LaTeX file: --- Actually, this depends on the font, but for all practical cases, this will work.


7

\textemdash - or, if you have a recent UTF-8 capable TeX engine, you can insert the UTF-8 character. See Wikipedia. Note that the command will gobble a trailing space unless you add a {} to it.


7

Here's a solution that doesn't use any extra package and doesn't abuse \marginpar: \documentclass{article} \newcommand{\impmark}{\strut\vadjust{\domark}} \newcommand{\domark}{% \vbox to 0pt{ \kern-\dp\strutbox \smash{\llap{*\kern1em}} \vss }% } \begin{document} This is a paragraph with something \impmark important bla bla bla bla bla bla ...


4

A simple answer to this would be: \documentclass{article} \usepackage{lipsum} \newcommand{\markme}{\marginpar[*]{}} \begin{document} \reversemarginpar \lipsum[1-3]\markme \lipsum[1-3]\markme \end{document} Which gives the desired result. By default \marginpar is creating a margin note on the right side, hence the need for \reversemarginpar. If you ...


3

I feel that as the point of all this is to have as human-friendly input as possible, it would make sense to use markdown or its derivatives (sidenote: I’ve pursued this idea previously). Out of that format I would like to raise tables as an example of kramdowns markdown extensions: | city | age_range | gender | marketing_target | ...


3

There are a few problems to be aware of when dealing with category codes and active characters in particular. When character tokens have already entered TeX, their category code is fixed (unless \scantokens is used, but this would open a can of worms). If an active character somehow sneaks into a list for \write, there must be a definition for it. babel ...


2

Did you try sed? cat test <b>Bold text</b>. Regular text, <i>italics</i>, <tt>teletype</tt>, regular. Nested: <b>Bold <i>bold italics</i> again bold</b> sed -e 's|<b>\(.*\)</b>|\\textbf{\1}|g' -e 's|<i>\(.*\)</i>|\\textit{\1}|g' -e ...


2

A bit of a description of my attempts so far to provide some answers and to expand a bit on the topic. Consider the structure of a table irrespective of how and where it is displayed or printed. A simple table would normally contain some form of a dataset. For example, DATA_LABELS = ['city', 'age_range', 'gender', 'marketing_target']; DATA_SET = [ ...


2

The answer to question 3 is yes. You can see this e.g. for @: its catcode in a document is other but \section has no problem to call the internal \@startsection. You can also easily test it: \documentclass{article} %normal catcodes: \newcommand\test{$a_b$} \begin{document} \catcode`\$=11 \catcode`_=11 %changed catcodes: $a_b$ \test \end{document}


2

As I pointed out in my comment, if there is worry about breaking things by making characters active, you can set them up with toggles to turn them on and off. Here, I demonstrate with the left bracket and the macros \newphoneON and \newphoneOFF. Use the latter when you need to employ the left bracket in its normal configuration (e.g., as an optional macro ...


1

Use the csquotes package! It also offers great possibilieties to cope with the different quoting styles of the various languages (babel and polyglossia are supported) \documentclass[parskip=half]{scrartcl} \usepackage{polyglossia} \setmainlanguage{english} \setotherlanguages{german} \usepackage{fontspec} \setmainfont{Deja Vu Sans} ...


1

The correct way for dealing with consecutive quotes is separating them with a thin space: ``He said it was `off the hook'\,'' Here's a sample, where various inputs are compared: \documentclass{article} \begin{document} \begin{tabular}{@{}ll@{}} Input & Rendering \\ \verb|``He said it was `off the hook'''| & ``He said it was `off the hook''' \\ ...



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