tex

To escape many _ in LaTeX efficiently

扶醉桌前 提交于 2019-12-04 22:40:40
How can you escape _ without the use of \_ ? This is the example of the question word_a_a_a_a_a_b_c_dd There is one function which you can use for this. However, I cannot remember its name. Are you thinking of the underscore package, which redefines the underscore symbol so that you don't have to escape it in text mode? See here . Other than verbatim I wouldn't know. Verbatim environment: \begin{verbatim} word_a_a_a_a_a_b_c_dd \end{verbatim} Inline: \verb|word_a_a_a_a_a_b_c_dd| I couldn't get the underscore package to work, so I used the url package: \usepackage{url} \urlstyle{sf} % or rm,

Latex - extract substring/ignore characters

那年仲夏 提交于 2019-12-04 22:18:59
问题 I have the following problem. I have defined a macro, \func as follows \newcommand{\func}[1]{% do something with #1 X #1 Y } I now want to define another macro \newcommand{\MyFunc}[1]{ % parse #1 and if it contains "\func{....}", ignore all except this part % otherwise ignore #1 } Can someone tell me how to implement \MyFunc ? Here is what should happen: \MyFunc{123abcdefg} % should print nothing \MyFunc{123\func{abcd}efg} % should print X abcd Y I can only change the code of \MyFunc . \func

How can I combine cells in a row in a latex-table?

…衆ロ難τιáo~ 提交于 2019-12-04 16:06:55
问题 In a table I want to combine some of the columns, but not in all rows. How can I realize this with LaTeX? 回答1: \multicolumn{<number>}{<formatting>}{<contents>} Where the arguments are Number of columns to merge the justification and formating string (just like you use in the table header, i.e. " |c| " or the like) The contents to put in the merged columns This command simply replaces the <number> columns and is used inline. Addition: This is also how you change the formatting of a single

How to insert an image into Anki notes in latex format?

你说的曾经没有我的故事 提交于 2019-12-04 15:28:57
I am trying to create an Anki deck with, for example, a word on the front. Then I add the word with definitions on the back with a picture as well. But I am having trouble including graphics when there are already two fields (front text and back text). Here is an example note: \begin{note} \begin{field} \textbf{\large ruminate} \end{field} \begin{field} \textbf{\large ruminate} \begin{description} \item[verb] \hfill \\ chew the cuds \item[verb] \hfill \\ reflect deeply on a subject \end{description} \end{field} \end{note} This note works just dandy, but when I try to include a graphic (as

how to create parser for TEX?

前提是你 提交于 2019-12-04 10:58:21
I am looking to develop a TEX parser, now problem is there is no Context Free Grammar and there can not be one, because its not context free language, I heard that it is some sort of macro language and that builds on its own. So now I need direction of what kind of grammar this macro language has and how to build anything upon in c#. I will write the tokenizer and parser, but I need some rules of macro in TEX which are quite hard to find, everywhere else there is documentation about how to use TEX macros. TeX as a programming language is perhaps the most complex (non-esoteric) language ever

Tex markup, how to render it in Html with Python?

主宰稳场 提交于 2019-12-04 10:22:25
The Tex markup support has been recently added to the following Stack Exchange sites: Mathematics Statistical Analysis Theoretical Computer Science These sites are using the client side Mathjax library to correctly format the submitted formulas to the user. Since this new feature was added, the StackExchange API returns the JSON question/answers text with formulas delimited by the $ char Tex Markup ( here an example). StackPrinter , built on this API, merely prints the returned text full of $ with an orrible result . I'm searching for a server side Python library that can parse and trasform

How to underline section-headings in LaTeX?

南楼画角 提交于 2019-12-04 03:05:17
EDIT : As I see in the first answer, underline is the wrong word. I want a line under the section heading, separating the heading from the following text. I want to separate section headings from the following text with a horizontal line. At the moment I use the following: \newcommand{\tmpsection}[1]{} \let\tmpsection=\section \renewcommand{\section}[1]{\tmpsection{#1}\hrule\nobreak} But that produces a line, that is too far away from the section-heading and to near to the following text. Has anyone a better idea? You can do this with the \sectionrule command in the sectsty package . Rewriting

Use Agda's input method in other emacs mode?

纵饮孤独 提交于 2019-12-04 01:57:09
How do I use Agda's input method to enter unicode characters in non-Agda mode? I don't see its name showing up when I try set-input-method . The reason I want to use Agda's input method instead of TeX is because there are characters I want that can't enter in TeX . Or, maybe an alternate question would be "How do I add more shortcuts to enter unicode characters in the existing TeX input method?" Thank you very much Add the following commands in your .emacs file: ;; Using the input method of Agda in LaTeX files. (require 'agda-input) (add-hook 'LaTeX-mode-hook (lambda () (set-input-method "Agda

Redefining commands in a new environment

99封情书 提交于 2019-12-04 00:27:58
Two questions: Does LaTeX allow one to (re)define commands within a \newenvironment ? I've tried using \renewcommand , \newcommand and \def in the before declaration but to no avail. How would one redefine \item when creating a new list environment? I've created a new type of list environment from scratch using \newenvironment while using another token instead of \item for each but I'd really like to keep things consistent by using \list and redefining \item . Sure; it's hard to know what went wrong without seeing your code. As an answer to your two questions, see if this helps: \documentclass