Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
I'm a super beginner with latex, so please be patient and don't assume I know anything, thanks!
Using Overleaf.com I'm trying to create a CV based on this template:
https://www.latextemplates.com/template/awesome-resume-cv
However, the "skills" section does not behave the way I expected it: if I write a long list of skills, the words go beyond the page limit on the right instead of starting a new line. How do I fix this?
I tried by using \\ to end the line, but that gives a syntax error.
Thank you!
I just tried to follow the problem you describe. In order to do that I created to sample lists of skills:
\cvskill
{Sample} % Category
{Sample A, Sample B, Sample C, Sample D, Sample E, Sample F, Sample G, Sample H, Sample I, Sample J, Sample K, Sample L, Sample M, Sample N, Sample O} % Skills
\cvskill
{Sample 2} % Category
{Averylongskillnamethatmayexceedthepage A, Averylongskillnamethatmayexceedthepage B, Averylongskillnamethatmayexceedthepage C, Averylongskillnamethatmayexceedthepage D, Averylongskillnamethatmayexceedthepage E, } % Skills
After compiling the skills section looks as follows:
So according to my view line breaks are added correctly. In case you are annoyed by slightly overarching text items like "Sample K" you can add a \newline before the corresponding item to force a manual line break.
The \ command is no 'line ending' symbol and even the command \\ which does exactly this should not work, as the cvskill command internally uses a tabular environment, which accepts the \newline command but not \\.
In case I missed to solve your problem please provide a more extensive problem description including a valid and recreateable example! Otherwise it's very complicated to narrow down the exact issue you have.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I use DIV=10 to set the type area, because the calculated type area would have too large margins for me.
I have read that you should use \recalctypearea after setting the font and line spacing.
So first: does this also make sense, when I have a defined DIV-value instead of DIV=calc?
If yes, here is my actual question: I use \spacing{1.2}, because \onehalfspacing seems to be a little bit too large for me.
I get the warning "Package typearea Warning: \typearea used at group level 2. Using \typearea inside any group, e.g. environments, math mode, boxes, etc. may result in many type setting problems. You should move the command \typearea outside all groups on input line 11."
If I use \usepackage[onehalfspacing]{setspace} instead of \usepackage{setspace} \spacing{1.2}, I don't get this warning.
Should I ignore the warning or what should I do?
MWE:
\documentclass[a4paper,12pt,headinclude=false, footinclude=false, BCOR=8mm,DIV=10]{scrreprt}
\usepackage[oldstyle]{libertine}
\setmainfont[Mapping=tex-text,Ligatures={Common},Numbers=OldStyle]{Linux Libertine O}
\setsansfont[Numbers=OldStyle]{Linux Biolinum O}
\setmonofont[Scale=MatchLowercase]{Linux Libertine Mono O}
\usepackage{setspace}
\spacing{1.2}
\recalctypearea
\begin{document}
Text
\end{document}
Package typearea
The command \recalctypearea ist just an abbreviation for \typearea[current]{last} which means, that the page layout is calculated again by the current binding correction (BCOR, first parameter) and the last DIV value (second parameter), see KOMA-script documentation p. 37
The BCOR and DIV value must be set beforehand. But, all (normal) ways to set these options already do a page layout calculation afterwards. So, if you want DIV=10, then use one of the following ways:
% Choosing a KOMA-script class
\documentclass[DIV=10]{scrreport}
% During loading the package, if another documentclass is used
\usepackage[DIV=10]{typearea}
% Or after loading the package with one of these
% a)
\KOMAoptions{DIV=10}
% b)
\typearea{10}
So, \recalctypearea should only be required if DIV=calc has been used and fonts or page sizes have been changed since this option has been set the last time.
Interaction with package spacing
Setting the DIV parameter affects the whole page. So, you can't change it within a group, e.g. the itemize environment \begin{itemize}...\end{itemize}.
Calling \spacing{1.2} opens a new group (environment) which is closed by \endspacing. The spacing will only be changed within this environment. Something which cannot be done (normally) for the page layout. Don't ignore the warning. To change the line spacing, use the macro \linespread instead, e.g.:
\linespread{1.25} % within preamble
should give a line spacing of 1.2*1.25 = 1.5. (1.2 is the normal base line skip). For more information see also here.
Further hints
Please note, that direct calls of \spacing macros is not recommended. Use
\begin{spacing}{1.2}
Your Text
\end{spacing}
instead because \end{spacing} will check if the right environment is closed (better error reporting).
For some details, here is the code of the spacing environment:
% quote from setspace.sty, line 524 ff, fetched from CTAN at 2015-11-17
\newenvironment{spacing}[1]{%
\par
\begingroup % moved from \endspacing by PGBR 29-1-91
\setstretch {#1}%
}{%
\restore#spacing
}
The first code block
{%
\par
\begingroup % moved from \endspacing by PGBR 29-1-91
\setstretch {#1}%
}
is called at \begin{spacing}{...} and starts a new paragraph (\par) and opens a new group (\begingroup). Within a group, changes to LaTeX variables/ macros (and so on) will only have a local effect. The second code block is called at \end{spacing} which calls an appropiate \endgroup.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
"Rubymonk Is Pretty Brilliant".match(/ ./, 9)
How is the answer "P" calculated from this regex?
use the match method on the string
passes two arguments, a regular expression and the position in the string to begin the search.
returns the character 'P'
The criteria you posted from the Rubymonk grader answer this succinctly:
passes two arguments, a regular expression and the position in the
string to begin the search
But let's examine that in more detail. match is being passed two arguments:
/ ./, a regular expression
9, the starting position in the string
The regular expression tells us that we're looking for a space () followed by any character (.).
The starting position tells us to start at position 9 (I). So instead of applying that regex against "Rubymonk Is Pretty Brilliant", we're applying it against "Is Pretty Brilliant".
In the string "Is Pretty Brilliant", where is the first place we encounter a space followed by another character? "Is[ P]retty Brilliant", right? Thus match finds a result of P (that's space-P, matching the regex, not just P.)
To see this more clearly and to experiment further with regexes, you can try it in an irb session or in your browser using Rubular.
(Just google for RegEx + ruby, You will find explanation of regex syntax)
/ANYTHING-HERE/
Will look for ANYTHING-HERE in the text.
In Your example its (/ ./,9):
/SPACE DOT/
So it will look for space followed by single character (Dot -> single character).
9 will be "I" from the string. And that is not space, so it will go on 2 characters right. Will find space, and then will find single character "P".
That is the result.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I want to write this simple equation in latex
2/|w|
In which |w| is the norm of w,,
I tried with
\frac{2}{\|w\|}
And get error "Missing $ inserted"
then I use this
\frac{2}{$\|w\|$}
And still get same error..
Does someone know how to solve this problem??
You are getting that error because LaTeX recognized this as being part of an equation and tried to correct it automagically. Unfortunately that rarely works well. You need to tell LaTeX that this is an equation.
To round out #nicoguaro's answer, use this form for equations that will be numbered and stand alone in the text:
\begin{equation}
\frac{2}{\left| w \right|}
\end{equation}
Or, use this form for equations that form part of a sentence:
blah blah $\frac{2}{\left| w \right|}$ blah blah.
Are this expression inside a mathematical environment like
\begin{equation}
...
\end{equation}
or $ $, \( \), \[ \] ?
The expression can be written as (using \[ \])
\[\frac{2}{\vert w \vert}\]
or just
\[\frac{2}{| w |}\]
You can see this book in Wikibooks. You need to specify that the whole expression is a mathematical expression enclosing it in its delimiters.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm learning Erlang and I'm trying to understand this code that was used as an example.
-module(tutorial5).
-export([format_temps/1]).
format_temps(List_of_cities) ->
convert_list_to_c(List_of_cities).
convert_list_to_c([{Name, {f, F}} | Rest]) ->
Converted_City = {Name, {c, (F -32)* 5 / 9}},
[Converted_City | convert_list_to_c(Rest)];
convert_list_to_c([City | Rest]) ->
[City | convert_list_to_c(Rest)];
convert_list_to_c([]) ->
[].
I am unsure of how to use these methods to get what I need. The most I know about this is that I'm supposed to be able to form a list of cities and their temperatures, and then be able to convert their temperatures from farenheit to celsius and vice versa. Any HELP would be appreciated.
The only callable function in the module tutorial5 is format_temps/1 (it takes one argument). It takes a list of city/temp where each city/temp is a tuple of the form {City,{f,Fahrenheit}} for example {berlin,{f,60}}. The function return a list of city/temp where the temp part is now {c,Celsius}. An example call from the shell with its return would be:
> tutorial5:format_temps([{berlin,{f,59}},{london,{f,50}},{stockholm,{f,50}}]).
[{berlin,{c,15.0}},{london,{c,10.0}},{stockholm,{c,10.0}}]
Some points to note are:
When calling a function in another module you MUST always include the module name
The words starting with lower case letters are atoms, literal constants with a name, while those starting with upper case letters (from my text) are variables. The look alike but are very different.
I wonder if there is any way to invert the way the LaTeX interprets linebreaks in equations? E.g., I dont want to insert them explicitly like,
\begin{gather}
x = y \\
a = c
\end{gather}
, but implicitly like,
\begin{gather}
x = y
a = c
\end{gather}
Thanks.
This is against the intention of TeX’s author, who believed that math must be typeset by hand. I tried obeylines, but to no avail. I guess it’s possible by making new line active, but you should ask the cracks over at Stack Exchange, a branch of Stack Overflow for TeX and LaTeX.
The breqn package will automatically insert linebreaks in equations when the line is full. I don't know of anything that will do break as you ask. If it is a big deal you could use perltex to define a macro that would do it for you. I will try to mock one up as an example.