Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [code-snippets]

The tag has no usage guidance.

0
votes
0answers
110 views

Repeatedly used snippets of code - how to shortcut? [duplicate]

I use LaTeX and TexStudio. I work with transripts and have so far found \longtable to be my best friend, e.g.: \begin{longtable}[H]{p{1.7cm}p{11.5cm}} Ignoramus & Richard, what are your ...
1
vote
1answer
91 views

Use special symbols in snippets [duplicate]

I want to write some LaTeX code and insert it in a snippet, so I used \lstset in my main code, like this: \documentclass[11pt]{article} \usepackage{listings} \usepackage{color} \lstset{ language=...
4
votes
2answers
615 views

Multiple code snippets in a page

I have 3 code snippets which I want to show in a horizontal way using Latex. So that the reader can compare all the three codes at the same time. I tried using minipage, paracolumn but the code gets ...
1
vote
2answers
1k views

Texpad OS X, how do you add a new shortcut to typeset?

I want to add another shortcut to compile a document in Texpad. The default one is cmd + T, while I'd like to create another one with cmd + enter (enter key). Here you can find a short guide about ...
1
vote
0answers
747 views

Tab autocomplete in latex using sublime text [closed]

I wrote a snippet for Sublime text that does the following: \begin{lemma} \end{lemma} and puts the cursor between them. Which works fine. However, if I want to use TAB inside the environment - lets ...
1
vote
0answers
13 views

Code snippets are not latin characters-using babel for greek [duplicate]

I am having an issue with code snippets. I am using babel as I am writing in Greek and when I want to use latin characters I type \textlatin{} . Now I need to insert code in my document and latex ...
0
votes
1answer
185 views

Latex Sublime Text Snippet doesn't working

i'm using Sublime snippet to create a state machine template. However, it does nothing. I don't understand why, as all my other snippet are working fine. If a remove some lines in the snippet, it ...
23
votes
3answers
1k views

Which TeX editors are able to compile just a snippet of a .tex file?

A friend of mine asked me whether TeXShop is able to compile just a snippet of a .tex file or not. More generally, one could ask which TeX editors are able to compile just a snippet of a .tex file? ...
1
vote
1answer
157 views

Can I copy the code snipptes created in Texmaker to another computer?

I'm trying to locate the folder where the code snippets I've created in Texmaker are stored. The reason is that I want to copy them to another computer(I don't want to create each single snippet again)...
0
votes
0answers
52 views

Greek characters in snippets [duplicate]

I have this document class in which I type both in English and Greek. \documentclass[12pt, a4]{article} \usepackage{microtype} \usepackage{fontspec} \usepackage{hyperref} \usepackage{xltxtra} \...
3
votes
1answer
347 views

define several languages for code snippets

After consulting this link: https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings in order to write some code, I concluded to this: \lstset{ language=C, backgroundcolor=\color{highlight}, blah, ...
0
votes
1answer
160 views

How to fix or change randomly marked json snippet?

So my problem is that my json snippets are marked red, but I don't want to mark them red. How my JSON looks like: [ {obj1} {obj2} {obj3} ] And my snippet looks like: [ {obj1} ... ] And that ... ...
1
vote
1answer
621 views

Kile: How can I insert repeated code snippet and make keyboard shortcut in kile for LaTeX?

To insert figures in LaTeX document I use this code repeatedly: %%%%%%%%%%%%%%%%%%%%%%%%%%% figure environment start %%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{figure}[hb!] \centering \includegraphics [scale=...
2
votes
1answer
163 views

Bash script between report lines - Line Breaking

I'm using the following commands to introduce bash script text in the middle of a report: \newcommand{\shellcmd}[1]{\\\indent\indent\texttt{\footnotesize\# #1}\\} \begin{document} \noindent ...
3
votes
1answer
187 views

Is it possible to define snippets in LyX?

While using LyX, I usually have to define some new theorem environments. For example, I define a new environment rst to state "Restriction". \newtheorem{rst}{Restriction} In LyX, I need to type \...
1
vote
0answers
546 views

why is the text green in my code listing? [closed]

I use \begin{lstlisting} Type readable_t, writable_t \end{lstlisting} I want the text color to be black, but instead I get green:
6
votes
3answers
1k views

How to show a filename above a code snippet just like on the arch wiki?

Context I'm writing a tutorial-like document in LaTeX on how to create a certain Linux based device. Part of the effort of recreating the device is writing small pieces of code, in either Bash or ...
2
votes
1answer
3k views

How to write code examples in LyX?

I'm using LyX for Hebrew documents. When I add a Verbatim environment with English language, sometimes after a little editing the language change automatically to LaTeX and the compiled Verbatim text ...
2
votes
2answers
833 views

TexStudio: Multiple Cursors in Macro

however looking up my questions using the usual suspects (Google, search function etc.) I could not find an answer/solution to the following task (potentially I don't know the proper name of the task ...