How to center a line in a verbatim LATEX? - latex

I have the following code:
\begin{verbatim}
{app_id:X[X]YY}
\end{verbatim}
This verbatim box only contains one line. I simply want to center that only line. How can I do it? \centerline doesn't work inside verbatim. Thank you so much for your help!

Sorted out thanks to this source:
\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\begin{center}
\begin{BVerbatim}
{app_id:X[X]YY}
\end{BVerbatim}
\end{center}
\end{document}
You need the package fancyvrb to implement this solution.

Related

How to create this variable in Latex?

How do I create this in Latex? I tried $r^e_{\_}$ or $r^e\_$ but none give the variable as shown in the added picture.
You can move the underscore up a bit with
\documentclass{article}
\begin{document}
$r^{e}_{\raisebox{0.21em}{\_}}$
\end{document}

Above point in latex

I would like to know how to make a point above a symbol (ie : αΊ‹)
I tried \overset{.}{x}, but the point is very small...
Can you help me ?
Thanks
Just to write down one answer, elaborating a bit the source cited in the comments, and to add the following minimal codes.
\documentclass{article}
\begin{document}
$\dot{x}$
$\ddot{x}$
\end{document}
One dot (\dot) and two dots (\ddot) work in math mode as above. Three dots (\dddot) and four dots (\ddddot) the same but they require the package amsmath:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\dddot{x}$
$\ddddot{x}$
\end{document}
Instead in text mode, the package called stackengine may help:
\documentclass{article}
\usepackage{stackengine}
\begin{document}
\stackon[1pt]{x}{.}
\end{document}

How to write the below in LaTeX?

I'm trying to write the big C in the picture below, Could anyone tell me how to write it?. And what is the name of this kind of letters?
With the amsfonts package, you can use the so-called blackboard bold font:
\documentclass{article}
\usepackage{amsfonts}
\begin{document}
\[
\mathbb{C}
\]
\end{document}

Fixing image position in latex, [h] doesn't work

Here's the usual code
\begin{figure} [H]
\centering
\includegraphics[scale=0.45]{ncurve.jpg}
\caption{tata}
\label{fig:ts}
\end{figure}
including the float package
But the result is the image at any other place, followed by [H]. What's happening?
i have the same problem so i have simply fix it by using flot package
\usepackage{float}
I had this issue, but I added the command [h] next to the {figure}
\begin{figure}[h]
\centering
\includegraphics[width=.70\textwidth]{image/image}
\caption{image example}
\label{fig-clean-architecture}
\end{figure}
and it worked for me!

Document doesn't display the list of figures (LaTeX)

I have the problem that LaTeX doesn't show the List of figures and List of Listings. I don't know where the problem is.
I'm working with TeXstudio and the code was defined as follows:
\begin{document}
\begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single]
//here is the code
\end{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{pic1.jpg}
\caption{That is a pic}
\label{fig: That is a pic}
\end{figure}
\listoffigures
\lstlistoflistings
\end{document}
Both lists remain empty. Can anyone tell me what the problem is??
I am able to generate the list of figures by doing these modifications on your file;
Adding these two lines to the very beginning of the file:
\documentclass{article}
\usepackage{listings}
and then, changing [H] into [h] (lower case).
#Winsoft There is nothing wrong with using [H] you just need to add the float-package (see https://tex.stackexchange.com/questions/132106/difference-between-h-and-h-in-float-position).
Adding the minimal set of needed packages compiled to the desired result. Please note that the list of figures and list of listings won't show up before compiling the document twice.
\documentclass{article}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
\begin{lstlisting}[caption={Testcode is here}\label{lst:Testcode is here},frame=single]
//here is the code
\end{lstlisting}
\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{pic1.jpg}
\caption{That is a pic}
\label{fig: That is a pic}
\end{figure}
\listoffigures
\lstlistoflistings
\end{document}

Resources