academicpages / academicpages.github.io

Github Pages template for academic personal websites, forked from mmistakes/minimal-mistakes
https://academicpages.github.io
MIT License
11.41k stars 41.1k forks source link

Is it possible to justify the text in blog posts? #151

Closed SreenivasVRao closed 4 days ago

SreenivasVRao commented 5 years ago

It's aligned with the left margin, but not the right. Would be nice if it was justified.

jmloyola commented 5 years ago

In case you are still looking for the answer, you have to edit the file _sass/_page.scss. Add text-align: justify; to the .page__content block. It should look something like this:

.page__content {

  text-align: justify;

I've done it in this commit if you want to check it.

You can also justify only some tags of the html. For that, just add that line to the tag's block inside the page__content block.

@staeiou, I think this issue can be closed.

PhilippeGagnonPHD commented 5 years ago

In case you are still looking for the answer, you have to edit the file _sass/_page.scss. Add text-align: justify; to the .pagecontent block. It should look something like this: .pagecontent {

text-align: justify; I've done it in this commit if you want to check it. You can also justify only some tags of the html. For that, just add that line to the tag's block inside the page__content block. @staeiou, I think this issue can be closed.

I did that and it worked for the main page. But I don't see how to also justify the text in "Talks". Do someone have an idea please?

jmloyola commented 5 years ago

I peaked at your blog and I think your problem might be related to the change of name in the layout of Talks to News. Can you test going back to Talks and see if the text is justified?

PhilippeGagnonPHD commented 5 years ago

I peaked at your blog and I think your problem might be related to the change of name in the layout of Talks to News. Can you test going back to Talks and see if the text is justified?

Hi! Thanks for the suggestion. I tried, but it didn't work (I left it how you recommended if you wanna see). Maybe something could be done in "archive-single-talk.html"!? Sorry, I'm not familiar with that kind of coding...

jmloyola commented 5 years ago

Ohh I think this time I know what might be the problem. It seems that academicpages does not format the excerpt of the post the same way it does with the text in the post.

What you see in this page are the list of all the news you have with a little excerpt. If you click on the link you access the post that go in more detail about the subject. You can see that in this last one the text is justified.

If I were you, I'd define the excerpt manually. Note that (taken from here):

Post and page excerpts are auto-generated by Jekyll which grabs the first paragraph of text.

To override this text with something more specific, you can use somethink like this:

---
title: "I will present my work on nonreversible jump algorithms at Bayes Comp 2020"
collection: talks
type: # "Talk"
permalink: /talks/2019-08-08-Bayescomp
venue: "Reitz Union, University of Florida"
excerpt: 'A BRIEF SUMMARY OF THE NEWS'
date: 2020-01-07
location: "Gainesville, Florida, USA"
---
Abstract (for more information about the conference see this [website](http://users.stat.ufl.edu/~jhobert/BayesComp2020/Conf_Website/)): It is now well known that nonreversible Markov chain Monte Carlo methods often outperform their reversible counterparts. Lifting the state space (Chen et al. (1999)) has proved to be a successful technique for constructing such samplers relying on nonreversible Markov chains. The idea is to see the random variables that we wish to generate as position variables to which we associate velocity (or direction) variables, doubling the size of the state space. At each iteration of such samplers, the positions evolve deterministically as a function of the directions, and this is followed by a possible update of the latter. This direction assisted scheme may induce persistent movements that allow to traverse the state space more quickly, compared with the traditional methods producing chains with diffusive patterns. This explains the gain in efficiency. Directions playing a central role, the technique can only be employed to explore state spaces for which this concept is well defined. In this paper, we introduce samplers that we call nonreversible jump algorithms that can be applied to simultaneously achieve model selection and parameter estimation, in situations where the family of models considered forms a sequence of nested models; there thus exists a natural order among the models, and therefore, directions. These samplers are constructed by modifying reversible jump algorithms after having lifted the part of the state space associated with the model indicator. We demonstrate their correctness and show that they compare favourably to their reversible counterpart using both theoretical arguments as well as numerical experiments. We address implementation challenges, facilitating application by users.
P.S.: the preprint will soon be on ArXiv.

Tell me if if you are happy with the result.

PhilippeGagnonPHD commented 5 years ago

Ohh I think this time I know what might be the problem. It seems that academicpages does not format the excerpt of the post the same way it does with the text in the post. What you see in this page are the list of all the news you have with a little excerpt. If you click on the link you access the post that go in more detail about the subject. You can see that in this last one the text is justified. If I were you, I'd define the excerpt manually. Note that (taken from here):

Post and page excerpts are auto-generated by Jekyll which grabs the first paragraph of text.

To override this text with something more specific, you can use somethink like this:

title: "I will present my work on nonreversible jump algorithms at Bayes Comp 2020" collection: talks type: # "Talk" permalink: /talks/2019-08-08-Bayescomp venue: "Reitz Union, University of Florida" excerpt: 'A BRIEF SUMMARY OF THE NEWS' date: 2020-01-07 location: "Gainesville, Florida, USA"

Abstract (for more information about the conference see this website): It is now well known that nonreversible Markov chain Monte Carlo methods often outperform their reversible counterparts. Lifting the state space (Chen et al. (1999)) has proved to be a successful technique for constructing such samplers relying on nonreversible Markov chains. The idea is to see the random variables that we wish to generate as position variables to which we associate velocity (or direction) variables, doubling the size of the state space. At each iteration of such samplers, the positions evolve deterministically as a function of the directions, and this is followed by a possible update of the latter. This direction assisted scheme may induce persistent movements that allow to traverse the state space more quickly, compared with the traditional methods producing chains with diffusive patterns. This explains the gain in efficiency. Directions playing a central role, the technique can only be employed to explore state spaces for which this concept is well defined. In this paper, we introduce samplers that we call nonreversible jump algorithms that can be applied to simultaneously achieve model selection and parameter estimation, in situations where the family of models considered forms a sequence of nested models; there thus exists a natural order among the models, and therefore, directions. These samplers are constructed by modifying reversible jump algorithms after having lifted the part of the state space associated with the model indicator. We demonstrate their correctness and show that they compare favourably to their reversible counterpart using both theoretical arguments as well as numerical experiments. We address implementation challenges, facilitating application by users. P.S.: the preprint will soon be on ArXiv. Tell me if if you are happy with the result.

I understand now. Thank you very much. I modified it using your recommendation. Do you by any chance understand why the text in the Project section (which was the CV section) is not justified? Many thanks for your help!

jmloyola commented 5 years ago

I don't know why the CV section is not justified. Since it is the only page left with no justified text, I think you can fix it manually wrapping every paragraph with:

<p align="justify">
Your paragraph...
</p>
PhilippeGagnonPHD commented 5 years ago

I don't know why the CV section is not justified. Since it is the only page left with no justified text, I think you can fix it manually wrapping every paragraph with:

Your paragraph...

Thanks for the suggestion. The text is now justified, but the hyperlinks do not appear anymore. Do you see a way out?!

I tried going back to the last version and modifying "archive-single-cv.html" by adding "align="justify" where I saw "<p", but it didn't work.

Many thanks again for your help.

jmloyola commented 5 years ago

You can use the <a> tag for adding the hyperlinks. Something like this I think could work:

<p>
Using models relying on super heavy-tailed distributions has recently proved to be a successful technique to gain robustness against outliers. The demonstration started with a paper by <a href="https://projecteuclid.org/euclid.aos/1434546215">Desgagné (2015)</a> about the simple but ubiquitous location-scale model. The proof of effectiveness of the approach resides in the following: the posterior distribution converges to that based on the nonoutliers only (i.e. excluding the outliers) as the outliers move towards plus or minus infinity. As explained by Desgagné, that model has built-in robustness that resolves conflict in a sensitive way. It takes full consideration of nonoutliers and excludes observations that are undoubtedly outlying; in between these two extremes, it balances and bounds the impact of possible outliers, reflecting the uncertainty about the nature of those observations.
</p>
jmloyola commented 5 years ago

Digging a little bit more, I think the fact that the Project page didn't show the text justified was because of the layout defined. The CV page used as template employ layout: archive which doesn't seems to apply the same format as the other pages.

Thus, another easy fix that would not require you to write HTML code is change the layout of the project page to layout: single.

A more long lasting solution is creating a Projects collection. I don't have any experience doing this, but I think you should modify this file, add a directory for the collection (similar to the _teaching directory) and add a projects-archive (similar to this) to show every post in the collection.

You can read more about this in the minimal mistakes documentation, project in which academic pages is based on.

PhilippeGagnonPHD commented 5 years ago

Digging a little bit more, I think the fact that the Project page didn't show the text justified was because of the layout defined. The CV page used as template employ layout: archive which doesn't seems to apply the same format as the other pages.

Thus, another easy fix that would not require you to write HTML code is change the layout of the project page to layout: single.

A more long lasting solution is creating a Projects collection. I don't have any experience doing this, but I think you should modify this file, add a directory for the collection (similar to the _teaching directory) and add a projects-archive (similar to this) to show every post in the collection.

You can read more about this in the minimal mistakes documentation, project in which academic pages is based on.

Thank you very much for your help.

For now, I changed the "layout" to "single". But you're right, I should at some point work on more lasting solutions. Perhaps, when I'll be more comfortable with the platform and structure :-)